# Responses

## Cancel a response

`client.beta.responses.cancel(stringresponseID, ResponseCancelParamsparams?, RequestOptionsoptions?): BetaResponse`

**post** `/responses/{response_id}/cancel?beta=true`

Cancels a model response with the given ID. Only responses created with
the `background` parameter set to `true` can be cancelled.
[Learn more](https://platform.openai.com/docs/guides/background).

### Parameters

- `responseID: string`

- `params: ResponseCancelParams`

  - `betas?: Array<"responses_multi_agent=v1">`

    Optional beta features to enable for this request.

    - `"responses_multi_agent=v1"`

### Returns

- `BetaResponse`

  - `id: string`

    Unique identifier for this Response.

  - `created_at: number`

    Unix timestamp (in seconds) of when this Response was created.

  - `error: BetaResponseError | null`

    An error object returned when the model fails to generate a Response.

    - `code: "server_error" | "rate_limit_exceeded" | "invalid_prompt" | 17 more`

      The error code for the response.

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

    - `message: string`

      A human-readable description of the error.

  - `incomplete_details: IncompleteDetails | null`

    Details about why the response is incomplete.

    - `reason?: "max_output_tokens" | "content_filter"`

      The reason why the response is incomplete.

      - `"max_output_tokens"`

      - `"content_filter"`

  - `instructions: string | Array<BetaResponseInputItem> | null`

    A system (or developer) message inserted into the model's context.

    When using along with `previous_response_id`, the instructions from a previous
    response will not be carried over to the next response. This makes it simple
    to swap out system (or developer) messages in new responses.

    - `string`

    - `Array<BetaResponseInputItem>`

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

        - `content: string | BetaResponseInputMessageContentList`

          Text, image, or audio input to the model, used to generate a response.
          Can also contain previous assistant responses.

          - `string`

          - `BetaResponseInputMessageContentList = Array<BetaResponseInputContent>`

            A list of one or many input items to the model, containing different content
            types.

            - `BetaResponseInputText`

              A text input to the model.

              - `text: string`

                The text input to the model.

              - `type: "input_text"`

                The type of the input item. Always `input_text`.

                - `"input_text"`

              - `prompt_cache_breakpoint?: PromptCacheBreakpoint`

                Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.

                - `mode: "explicit"`

                  The breakpoint mode. Always `explicit`.

                  - `"explicit"`

            - `BetaResponseInputImage`

              An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision).

              - `detail: BetaImageDetail`

                The detail level of the image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`.

                - `"low"`

                - `"high"`

                - `"auto"`

                - `"original"`

              - `type: "input_image"`

                The type of the input item. Always `input_image`.

                - `"input_image"`

              - `file_id?: string | null`

                The ID of the file to be sent to the model.

              - `image_url?: string | null`

                The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.

              - `prompt_cache_breakpoint?: PromptCacheBreakpoint`

                Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.

                - `mode: "explicit"`

                  The breakpoint mode. Always `explicit`.

                  - `"explicit"`

            - `BetaResponseInputFile`

              A file input to the model.

              - `type: "input_file"`

                The type of the input item. Always `input_file`.

                - `"input_file"`

              - `detail?: "auto" | "low" | "high"`

                The detail level of the file to be sent to the model. Use `auto` to let the system select the detail level; for GPT-5.6 and later models, `auto` uses high-quality rendering, which may increase input token usage. Use `low` for lower-cost rendering, or `high` to render the file at higher quality. Defaults to `auto`.

                - `"auto"`

                - `"low"`

                - `"high"`

              - `file_data?: string`

                The content of the file to be sent to the model.

              - `file_id?: string | null`

                The ID of the file to be sent to the model.

              - `file_url?: string`

                The URL of the file to be sent to the model.

              - `filename?: string`

                The name of the file to be sent to the model.

              - `prompt_cache_breakpoint?: PromptCacheBreakpoint`

                Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.

                - `mode: "explicit"`

                  The breakpoint mode. Always `explicit`.

                  - `"explicit"`

        - `role: "user" | "assistant" | "system" | "developer"`

          The role of the message input. One of `user`, `assistant`, `system`, or
          `developer`.

          - `"user"`

          - `"assistant"`

          - `"system"`

          - `"developer"`

        - `phase?: "commentary" | "final_answer" | null`

          Labels an `assistant` message as intermediate commentary (`commentary`) or the final answer (`final_answer`).
          For models like `gpt-5.3-codex` and beyond, when sending follow-up requests, preserve and resend
          phase on all assistant messages — dropping it can degrade performance. Not used for user messages.

          - `"commentary"`

          - `"final_answer"`

        - `type?: "message"`

          The type of the message input. Always `message`.

          - `"message"`

      - `Message`

        A message input to the model with a role indicating instruction following
        hierarchy. Instructions given with the `developer` or `system` role take
        precedence over instructions given with the `user` role.

        - `content: BetaResponseInputMessageContentList`

          A list of one or many input items to the model, containing different content
          types.

        - `role: "user" | "system" | "developer"`

          The role of the message input. One of `user`, `system`, or `developer`.

          - `"user"`

          - `"system"`

          - `"developer"`

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `status?: "in_progress" | "completed" | "incomplete"`

          The status of item. One of `in_progress`, `completed`, or
          `incomplete`. Populated when items are returned via API.

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

        - `type?: "message"`

          The type of the message input. Always set to `message`.

          - `"message"`

      - `BetaResponseOutputMessage`

        An output message from the model.

        - `id: string`

          The unique ID of the output message.

        - `content: Array<BetaResponseOutputText | BetaResponseOutputRefusal>`

          The content of the output message.

          - `BetaResponseOutputText`

            A text output from the model.

            - `annotations: Array<FileCitation | URLCitation | ContainerFileCitation | FilePath>`

              The annotations of the text output.

              - `FileCitation`

                A citation to a file.

                - `file_id: string`

                  The ID of the file.

                - `filename: string`

                  The filename of the file cited.

                - `index: number`

                  The index of the file in the list of files.

                - `type: "file_citation"`

                  The type of the file citation. Always `file_citation`.

                  - `"file_citation"`

              - `URLCitation`

                A citation for a web resource used to generate a model response.

                - `end_index: number`

                  The index of the last character of the URL citation in the message.

                - `start_index: number`

                  The index of the first character of the URL citation in the message.

                - `title: string`

                  The title of the web resource.

                - `type: "url_citation"`

                  The type of the URL citation. Always `url_citation`.

                  - `"url_citation"`

                - `url: string`

                  The URL of the web resource.

              - `ContainerFileCitation`

                A citation for a container file used to generate a model response.

                - `container_id: string`

                  The ID of the container file.

                - `end_index: number`

                  The index of the last character of the container file citation in the message.

                - `file_id: string`

                  The ID of the file.

                - `filename: string`

                  The filename of the container file cited.

                - `start_index: number`

                  The index of the first character of the container file citation in the message.

                - `type: "container_file_citation"`

                  The type of the container file citation. Always `container_file_citation`.

                  - `"container_file_citation"`

              - `FilePath`

                A path to a file.

                - `file_id: string`

                  The ID of the file.

                - `index: number`

                  The index of the file in the list of files.

                - `type: "file_path"`

                  The type of the file path. Always `file_path`.

                  - `"file_path"`

            - `text: string`

              The text output from the model.

            - `type: "output_text"`

              The type of the output text. Always `output_text`.

              - `"output_text"`

            - `logprobs?: Array<Logprob>`

              - `token: string`

              - `bytes: Array<number>`

              - `logprob: number`

              - `top_logprobs: Array<TopLogprob>`

                - `token: string`

                - `bytes: Array<number>`

                - `logprob: number`

          - `BetaResponseOutputRefusal`

            A refusal from the model.

            - `refusal: string`

              The refusal explanation from the model.

            - `type: "refusal"`

              The type of the refusal. Always `refusal`.

              - `"refusal"`

        - `role: "assistant"`

          The role of the output message. Always `assistant`.

          - `"assistant"`

        - `status: "in_progress" | "completed" | "incomplete"`

          The status of the message input. One of `in_progress`, `completed`, or
          `incomplete`. Populated when input items are returned via API.

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

        - `type: "message"`

          The type of the output message. Always `message`.

          - `"message"`

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `phase?: "commentary" | "final_answer" | null`

          Labels an `assistant` message as intermediate commentary (`commentary`) or the final answer (`final_answer`).
          For models like `gpt-5.3-codex` and beyond, when sending follow-up requests, preserve and resend
          phase on all assistant messages — dropping it can degrade performance. Not used for user messages.

          - `"commentary"`

          - `"final_answer"`

      - `BetaResponseFileSearchToolCall`

        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.

        - `id: string`

          The unique ID of the file search tool call.

        - `queries: Array<string>`

          The queries used to search for files.

        - `status: "in_progress" | "searching" | "completed" | 2 more`

          The status of the file search tool call. One of `in_progress`,
          `searching`, `incomplete` or `failed`,

          - `"in_progress"`

          - `"searching"`

          - `"completed"`

          - `"incomplete"`

          - `"failed"`

        - `type: "file_search_call"`

          The type of the file search tool call. Always `file_search_call`.

          - `"file_search_call"`

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `results?: Array<Result> | null`

          The results of the file search tool call.

          - `attributes?: Record<string, string | number | boolean> | null`

            Set of 16 key-value pairs that can be attached to an object. This can be
            useful for storing additional information about the object in a structured
            format, and querying for objects via API or the dashboard. Keys are strings
            with a maximum length of 64 characters. Values are strings with a maximum
            length of 512 characters, booleans, or numbers.

            - `string`

            - `number`

            - `boolean`

          - `file_id?: string`

            The unique ID of the file.

          - `filename?: string`

            The name of the file.

          - `score?: number`

            The relevance score of the file - a value between 0 and 1.

          - `text?: string`

            The text that was retrieved from the file.

      - `BetaResponseComputerToolCall`

        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.

        - `id: string`

          The unique ID of the computer call.

        - `call_id: string`

          An identifier used when responding to the tool call with output.

        - `pending_safety_checks: Array<PendingSafetyCheck>`

          The pending safety checks for the computer call.

          - `id: string`

            The ID of the pending safety check.

          - `code?: string | null`

            The type of the pending safety check.

          - `message?: string | null`

            Details about the pending safety check.

        - `status: "in_progress" | "completed" | "incomplete"`

          The status of the item. One of `in_progress`, `completed`, or
          `incomplete`. Populated when items are returned via API.

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

        - `type: "computer_call"`

          The type of the computer call. Always `computer_call`.

          - `"computer_call"`

        - `action?: BetaComputerAction`

          A click action.

          - `Click`

            A click action.

            - `button: "left" | "right" | "wheel" | 2 more`

              Indicates which mouse button was pressed during the click. One of `left`, `right`, `wheel`, `back`, or `forward`.

              - `"left"`

              - `"right"`

              - `"wheel"`

              - `"back"`

              - `"forward"`

            - `type: "click"`

              Specifies the event type. For a click action, this property is always `click`.

              - `"click"`

            - `x: number`

              The x-coordinate where the click occurred.

            - `y: number`

              The y-coordinate where the click occurred.

            - `keys?: Array<string> | null`

              The keys being held while clicking.

          - `DoubleClick`

            A double click action.

            - `keys: Array<string> | null`

              The keys being held while double-clicking.

            - `type: "double_click"`

              Specifies the event type. For a double click action, this property is always set to `double_click`.

              - `"double_click"`

            - `x: number`

              The x-coordinate where the double click occurred.

            - `y: number`

              The y-coordinate where the double click occurred.

          - `Drag`

            A drag action.

            - `path: Array<Path>`

              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 }
              ]
              ```

              - `x: number`

                The x-coordinate.

              - `y: number`

                The y-coordinate.

            - `type: "drag"`

              Specifies the event type. For a drag action, this property is always set to `drag`.

              - `"drag"`

            - `keys?: Array<string> | null`

              The keys being held while dragging the mouse.

          - `Keypress`

            A collection of keypresses the model would like to perform.

            - `keys: Array<string>`

              The combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key.

            - `type: "keypress"`

              Specifies the event type. For a keypress action, this property is always set to `keypress`.

              - `"keypress"`

          - `Move`

            A mouse move action.

            - `type: "move"`

              Specifies the event type. For a move action, this property is always set to `move`.

              - `"move"`

            - `x: number`

              The x-coordinate to move to.

            - `y: number`

              The y-coordinate to move to.

            - `keys?: Array<string> | null`

              The keys being held while moving the mouse.

          - `Screenshot`

            A screenshot action.

            - `type: "screenshot"`

              Specifies the event type. For a screenshot action, this property is always set to `screenshot`.

              - `"screenshot"`

          - `Scroll`

            A scroll action.

            - `scroll_x: number`

              The horizontal scroll distance.

            - `scroll_y: number`

              The vertical scroll distance.

            - `type: "scroll"`

              Specifies the event type. For a scroll action, this property is always set to `scroll`.

              - `"scroll"`

            - `x: number`

              The x-coordinate where the scroll occurred.

            - `y: number`

              The y-coordinate where the scroll occurred.

            - `keys?: Array<string> | null`

              The keys being held while scrolling.

          - `Type`

            An action to type in text.

            - `text: string`

              The text to type.

            - `type: "type"`

              Specifies the event type. For a type action, this property is always set to `type`.

              - `"type"`

          - `Wait`

            A wait action.

            - `type: "wait"`

              Specifies the event type. For a wait action, this property is always set to `wait`.

              - `"wait"`

        - `actions?: BetaComputerActionList`

          Flattened batched actions for `computer_use`. Each action includes an
          `type` discriminator and action-specific fields.

          - `Click`

            A click action.

          - `DoubleClick`

            A double click action.

          - `Drag`

            A drag action.

          - `Keypress`

            A collection of keypresses the model would like to perform.

          - `Move`

            A mouse move action.

          - `Screenshot`

            A screenshot action.

          - `Scroll`

            A scroll action.

          - `Type`

            An action to type in text.

          - `Wait`

            A wait action.

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

      - `ComputerCallOutput`

        The output of a computer tool call.

        - `call_id: string`

          The ID of the computer tool call that produced the output.

        - `output: BetaResponseComputerToolCallOutputScreenshot`

          A computer screenshot image used with the computer use tool.

          - `type: "computer_screenshot"`

            Specifies the event type. For a computer screenshot, this property is
            always set to `computer_screenshot`.

            - `"computer_screenshot"`

          - `file_id?: string`

            The identifier of an uploaded file that contains the screenshot.

          - `image_url?: string`

            The URL of the screenshot image.

        - `type: "computer_call_output"`

          The type of the computer tool call output. Always `computer_call_output`.

          - `"computer_call_output"`

        - `id?: string | null`

          The ID of the computer tool call output.

        - `acknowledged_safety_checks?: Array<AcknowledgedSafetyCheck> | null`

          The safety checks reported by the API that have been acknowledged by the developer.

          - `id: string`

            The ID of the pending safety check.

          - `code?: string | null`

            The type of the pending safety check.

          - `message?: string | null`

            Details about the pending safety check.

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

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

          The status of the message input. One of `in_progress`, `completed`, or `incomplete`. Populated when input items are returned via API.

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

      - `BetaResponseFunctionWebSearch`

        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.

        - `id: string`

          The unique ID of the web search tool call.

        - `action: Search | OpenPage | FindInPage`

          An object describing the specific action taken in this web search call.
          Includes details on how the model used the web (search, open_page, find_in_page).

          - `Search`

            Action type "search" - Performs a web search query.

            - `type: "search"`

              The action type.

              - `"search"`

            - `queries?: Array<string>`

              The search queries.

            - `query?: string`

              The search query.

            - `sources?: Array<Source>`

              The sources used in the search.

              - `type: "url"`

                The type of source. Always `url`.

                - `"url"`

              - `url: string`

                The URL of the source.

          - `OpenPage`

            Action type "open_page" - Opens a specific URL from search results.

            - `type: "open_page"`

              The action type.

              - `"open_page"`

            - `url?: string | null`

              The URL opened by the model.

          - `FindInPage`

            Action type "find_in_page": Searches for a pattern within a loaded page.

            - `pattern: string`

              The pattern or text to search for within the page.

            - `type: "find_in_page"`

              The action type.

              - `"find_in_page"`

            - `url: string`

              The URL of the page searched for the pattern.

        - `status: "in_progress" | "searching" | "completed" | "failed"`

          The status of the web search tool call.

          - `"in_progress"`

          - `"searching"`

          - `"completed"`

          - `"failed"`

        - `type: "web_search_call"`

          The type of the web search tool call. Always `web_search_call`.

          - `"web_search_call"`

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

      - `BetaResponseFunctionToolCall`

        A tool call to run a function. See the
        [function calling guide](https://platform.openai.com/docs/guides/function-calling) for more information.

        - `arguments: string`

          A JSON string of the arguments to pass to the function.

        - `call_id: string`

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

        - `name: string`

          The name of the function to run.

        - `type: "function_call"`

          The type of the function tool call. Always `function_call`.

          - `"function_call"`

        - `id?: string`

          The unique ID of the function tool call.

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `caller?: Direct | Program | null`

          The execution context that produced this tool call.

          - `Direct`

            - `type: "direct"`

              - `"direct"`

          - `Program`

            - `caller_id: string`

              The call ID of the program item that produced this tool call.

            - `type: "program"`

              - `"program"`

        - `namespace?: string`

          The namespace of the function to run.

        - `status?: "in_progress" | "completed" | "incomplete"`

          The status of the item. One of `in_progress`, `completed`, or
          `incomplete`. Populated when items are returned via API.

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

      - `FunctionCallOutput`

        The output of a function tool call.

        - `call_id: string`

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

        - `output: string | BetaResponseFunctionCallOutputItemList`

          Text, image, or file output of the function tool call.

          - `string`

          - `BetaResponseFunctionCallOutputItemList = Array<BetaResponseFunctionCallOutputItem>`

            An array of content outputs (text, image, file) for the function tool call.

            - `BetaResponseInputTextContent`

              A text input to the model.

              - `text: string`

                The text input to the model.

              - `type: "input_text"`

                The type of the input item. Always `input_text`.

                - `"input_text"`

              - `prompt_cache_breakpoint?: PromptCacheBreakpoint | null`

                Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.

                - `mode: "explicit"`

                  The breakpoint mode. Always `explicit`.

                  - `"explicit"`

            - `BetaResponseInputImageContent`

              An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision)

              - `type: "input_image"`

                The type of the input item. Always `input_image`.

                - `"input_image"`

              - `detail?: BetaImageDetail | null`

                The detail level of the image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`.

              - `file_id?: string | null`

                The ID of the file to be sent to the model.

              - `image_url?: string | null`

                The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.

              - `prompt_cache_breakpoint?: PromptCacheBreakpoint | null`

                Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.

                - `mode: "explicit"`

                  The breakpoint mode. Always `explicit`.

                  - `"explicit"`

            - `BetaResponseInputFileContent`

              A file input to the model.

              - `type: "input_file"`

                The type of the input item. Always `input_file`.

                - `"input_file"`

              - `detail?: "auto" | "low" | "high"`

                The detail level of the file to be sent to the model. Use `auto` to let the system select the detail level; for GPT-5.6 and later models, `auto` uses high-quality rendering, which may increase input token usage. Use `low` for lower-cost rendering, or `high` to render the file at higher quality. Defaults to `auto`.

                - `"auto"`

                - `"low"`

                - `"high"`

              - `file_data?: string | null`

                The base64-encoded data of the file to be sent to the model.

              - `file_id?: string | null`

                The ID of the file to be sent to the model.

              - `file_url?: string | null`

                The URL of the file to be sent to the model.

              - `filename?: string | null`

                The name of the file to be sent to the model.

              - `prompt_cache_breakpoint?: PromptCacheBreakpoint | null`

                Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.

                - `mode: "explicit"`

                  The breakpoint mode. Always `explicit`.

                  - `"explicit"`

        - `type: "function_call_output"`

          The type of the function tool call output. Always `function_call_output`.

          - `"function_call_output"`

        - `id?: string | null`

          The unique ID of the function tool call output. Populated when this item is returned via API.

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `caller?: Direct | Program | null`

          The execution context that produced this tool call.

          - `Direct`

            - `type: "direct"`

              The caller type. Always `direct`.

              - `"direct"`

          - `Program`

            - `caller_id: string`

              The call ID of the program item that produced this tool call.

            - `type: "program"`

              The caller type. Always `program`.

              - `"program"`

        - `name?: string | null`

          The name of the tool that produced the output.

        - `namespace?: string | null`

          The namespace of the tool that produced the output.

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

          The status of the item. One of `in_progress`, `completed`, or `incomplete`. Populated when items are returned via API.

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

      - `AgentMessage`

        A message routed between agents.

        - `author: string`

          The sending agent identity.

        - `content: Array<BetaResponseInputTextContent | BetaResponseInputImageContent | EncryptedContent>`

          Plaintext, image, or encrypted content sent between agents.

          - `BetaResponseInputTextContent`

            A text input to the model.

          - `BetaResponseInputImageContent`

            An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision)

          - `EncryptedContent`

            Opaque encrypted content that Responses API decrypts inside trusted model execution.

            - `encrypted_content: string`

              Opaque encrypted content.

            - `type: "encrypted_content"`

              The type of the input item. Always `encrypted_content`.

              - `"encrypted_content"`

        - `recipient: string`

          The destination agent identity.

        - `type: "agent_message"`

          The item type. Always `agent_message`.

          - `"agent_message"`

        - `id?: string | null`

          The unique ID of this agent message item.

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

      - `MultiAgentCall`

        - `action: "spawn_agent" | "interrupt_agent" | "list_agents" | 3 more`

          The multi-agent action that was executed.

          - `"spawn_agent"`

          - `"interrupt_agent"`

          - `"list_agents"`

          - `"send_message"`

          - `"followup_task"`

          - `"wait_agent"`

        - `arguments: string`

          The action arguments as a JSON string.

        - `call_id: string`

          The unique ID linking this call to its output.

        - `type: "multi_agent_call"`

          The item type. Always `multi_agent_call`.

          - `"multi_agent_call"`

        - `id?: string | null`

          The unique ID of this multi-agent call.

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

      - `MultiAgentCallOutput`

        - `action: "spawn_agent" | "interrupt_agent" | "list_agents" | 3 more`

          The multi-agent action that produced this result.

          - `"spawn_agent"`

          - `"interrupt_agent"`

          - `"list_agents"`

          - `"send_message"`

          - `"followup_task"`

          - `"wait_agent"`

        - `call_id: string`

          The unique ID of the multi-agent call.

        - `output: Array<Output>`

          Text output returned by the multi-agent action.

          - `text: string`

            The text content.

          - `type: "output_text"`

            The content type. Always `output_text`.

            - `"output_text"`

          - `annotations?: Array<FileCitation | URLCitation | ContainerFileCitation>`

            Citations associated with the text content.

            - `FileCitation`

              - `file_id: string`

                The ID of the file.

              - `filename: string`

                The filename of the file cited.

              - `index: number`

                The index of the file in the list of files.

              - `type: "file_citation"`

                The citation type. Always `file_citation`.

                - `"file_citation"`

            - `URLCitation`

              - `end_index: number`

                The index of the last character of the citation in the message.

              - `start_index: number`

                The index of the first character of the citation in the message.

              - `title: string`

                The title of the cited resource.

              - `type: "url_citation"`

                The citation type. Always `url_citation`.

                - `"url_citation"`

              - `url: string`

                The URL of the cited resource.

            - `ContainerFileCitation`

              - `container_id: string`

                The ID of the container.

              - `end_index: number`

                The index of the last character of the citation in the message.

              - `file_id: string`

                The ID of the container file.

              - `filename: string`

                The filename of the container file cited.

              - `start_index: number`

                The index of the first character of the citation in the message.

              - `type: "container_file_citation"`

                The citation type. Always `container_file_citation`.

                - `"container_file_citation"`

        - `type: "multi_agent_call_output"`

          The item type. Always `multi_agent_call_output`.

          - `"multi_agent_call_output"`

        - `id?: string | null`

          The unique ID of this multi-agent call output.

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

      - `ToolSearchCall`

        - `arguments: unknown`

          The arguments supplied to the tool search call.

        - `type: "tool_search_call"`

          The item type. Always `tool_search_call`.

          - `"tool_search_call"`

        - `id?: string | null`

          The unique ID of this tool search call.

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `call_id?: string | null`

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

        - `execution?: "server" | "client"`

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

          - `"server"`

          - `"client"`

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

          The status of the tool search call.

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

      - `BetaResponseToolSearchOutputItemParam`

        - `tools: Array<BetaTool>`

          The loaded tool definitions returned by the tool search output.

          - `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).

            - `name: string`

              The name of the function to call.

            - `parameters: Record<string, unknown> | null`

              A JSON schema object describing the parameters of the function.

            - `strict: boolean | null`

              Whether strict parameter validation is enforced for this function tool.

            - `type: "function"`

              The type of the function tool. Always `function`.

              - `"function"`

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

              The tool invocation context(s).

              - `"direct"`

              - `"programmatic"`

            - `defer_loading?: boolean`

              Whether this function is deferred and loaded via tool search.

            - `description?: string | null`

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

            - `output_schema?: Record<string, unknown> | null`

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

          - `BetaFileSearchTool`

            A tool that searches for relevant content from uploaded files. Learn more about the [file search tool](https://platform.openai.com/docs/guides/tools-file-search).

            - `type: "file_search"`

              The type of the file search tool. Always `file_search`.

              - `"file_search"`

            - `vector_store_ids: Array<string>`

              The IDs of the vector stores to search.

            - `filters?: ComparisonFilter | CompoundFilter | null`

              A filter to apply.

              - `ComparisonFilter`

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

                - `key: string`

                  The key to compare against the value.

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

                  Specifies the comparison operator: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`, `in`, `nin`.

                  - `eq`: equals
                  - `ne`: not equal
                  - `gt`: greater than
                  - `gte`: greater than or equal
                  - `lt`: less than
                  - `lte`: less than or equal
                  - `in`: in
                  - `nin`: not in

                  - `"eq"`

                  - `"ne"`

                  - `"gt"`

                  - `"gte"`

                  - `"lt"`

                  - `"lte"`

                  - `"in"`

                  - `"nin"`

                - `value: string | number | boolean | Array<string | number>`

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

                  - `string`

                  - `number`

                  - `boolean`

                  - `Array<string | number>`

                    - `string`

                    - `number`

              - `CompoundFilter`

                Combine multiple filters using `and` or `or`.

                - `filters: Array<ComparisonFilter | unknown>`

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

                  - `ComparisonFilter`

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

                    - `key: string`

                      The key to compare against the value.

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

                      Specifies the comparison operator: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`, `in`, `nin`.

                      - `eq`: equals
                      - `ne`: not equal
                      - `gt`: greater than
                      - `gte`: greater than or equal
                      - `lt`: less than
                      - `lte`: less than or equal
                      - `in`: in
                      - `nin`: not in

                      - `"eq"`

                      - `"ne"`

                      - `"gt"`

                      - `"gte"`

                      - `"lt"`

                      - `"lte"`

                      - `"in"`

                      - `"nin"`

                    - `value: string | number | boolean | Array<string | number>`

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

                      - `string`

                      - `number`

                      - `boolean`

                      - `Array<string | number>`

                        - `string`

                        - `number`

                  - `unknown`

                - `type: "and" | "or"`

                  Type of operation: `and` or `or`.

                  - `"and"`

                  - `"or"`

            - `max_num_results?: number`

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

            - `ranking_options?: RankingOptions`

              Ranking options for search.

              - `hybrid_search?: HybridSearch`

                Weights that control how reciprocal rank fusion balances semantic embedding matches versus sparse keyword matches when hybrid search is enabled.

                - `embedding_weight: number`

                  The weight of the embedding in the reciprocal ranking fusion.

                - `text_weight: number`

                  The weight of the text in the reciprocal ranking fusion.

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

                The ranker to use for the file search.

                - `"auto"`

                - `"default-2024-11-15"`

              - `score_threshold?: number`

                The score threshold for the file search, a number between 0 and 1. Numbers closer to 1 will attempt to return only the most relevant results, but may return fewer results.

          - `BetaComputerTool`

            A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use).

            - `type: "computer"`

              The type of the computer tool. Always `computer`.

              - `"computer"`

          - `BetaComputerUsePreviewTool`

            A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use).

            - `display_height: number`

              The height of the computer display.

            - `display_width: number`

              The width of the computer display.

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

              The type of computer environment to control.

              - `"windows"`

              - `"mac"`

              - `"linux"`

              - `"ubuntu"`

              - `"browser"`

            - `type: "computer_use_preview"`

              The type of the computer use tool. Always `computer_use_preview`.

              - `"computer_use_preview"`

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

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

              - `"web_search"`

              - `"web_search_2025_08_26"`

            - `external_web_access?: boolean`

              Allow live internet access for web search. Defaults to true when omitted. When false, the web search tool runs in offline/cache-only mode and will not fetch new external content.

            - `filters?: Filters | null`

              Filters for the search.

              - `allowed_domains?: Array<string> | null`

                Allowed domains for the search. If not provided, all domains are allowed.
                Subdomains of the provided domains are allowed as well.

                Example: `["pubmed.ncbi.nlm.nih.gov"]`

            - `search_context_size?: "low" | "medium" | "high"`

              High level guidance for the amount of context window space to use for the search. One of `low`, `medium`, or `high`. `medium` is the default.

              - `"low"`

              - `"medium"`

              - `"high"`

            - `user_location?: UserLocation | null`

              The approximate location of the user.

              - `city?: string | null`

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

              - `country?: string | null`

                The two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of the user, e.g. `US`.

              - `region?: string | null`

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

              - `timezone?: string | null`

                The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of the user, e.g. `America/Los_Angeles`.

              - `type?: "approximate"`

                The type of location approximation. Always `approximate`.

                - `"approximate"`

          - `Mcp`

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

            - `server_label: string`

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

            - `type: "mcp"`

              The type of the MCP tool. Always `mcp`.

              - `"mcp"`

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

              The tool invocation context(s).

              - `"direct"`

              - `"programmatic"`

            - `allowed_tools?: Array<string> | McpToolFilter | null`

              List of allowed tool names or a filter object.

              - `Array<string>`

              - `McpToolFilter`

                A filter object to specify which tools are allowed.

                - `read_only?: boolean`

                  Indicates whether or not a tool modifies data or is read-only. If an
                  MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint),
                  it will match this filter.

                - `tool_names?: Array<string>`

                  List of allowed tool names.

            - `authorization?: string`

              An OAuth access token that can be used with a remote MCP server, either
              with a custom MCP server URL or a service connector. Your application
              must handle the OAuth authorization flow and provide the token here.

            - `connector_id?: "connector_dropbox" | "connector_gmail" | "connector_googlecalendar" | 5 more`

              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`

              - `"connector_dropbox"`

              - `"connector_gmail"`

              - `"connector_googlecalendar"`

              - `"connector_googledrive"`

              - `"connector_microsoftteams"`

              - `"connector_outlookcalendar"`

              - `"connector_outlookemail"`

              - `"connector_sharepoint"`

            - `defer_loading?: boolean`

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

            - `headers?: Record<string, string> | null`

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

            - `require_approval?: McpToolApprovalFilter | "always" | "never" | null`

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

              - `McpToolApprovalFilter`

                Specify which of the MCP server's tools require approval. Can be
                `always`, `never`, or a filter object associated with tools
                that require approval.

                - `always?: Always`

                  A filter object to specify which tools are allowed.

                  - `read_only?: boolean`

                    Indicates whether or not a tool modifies data or is read-only. If an
                    MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint),
                    it will match this filter.

                  - `tool_names?: Array<string>`

                    List of allowed tool names.

                - `never?: Never`

                  A filter object to specify which tools are allowed.

                  - `read_only?: boolean`

                    Indicates whether or not a tool modifies data or is read-only. If an
                    MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint),
                    it will match this filter.

                  - `tool_names?: Array<string>`

                    List of allowed tool names.

              - `"always" | "never"`

                - `"always"`

                - `"never"`

            - `server_description?: string`

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

            - `server_url?: string`

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

            - `tunnel_id?: string`

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

          - `CodeInterpreter`

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

            - `container: string | CodeInterpreterToolAuto`

              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`

              - `CodeInterpreterToolAuto`

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

                - `type: "auto"`

                  Always `auto`.

                  - `"auto"`

                - `file_ids?: Array<string>`

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

                - `memory_limit?: "1g" | "4g" | "16g" | "64g" | null`

                  The memory limit for the code interpreter container.

                  - `"1g"`

                  - `"4g"`

                  - `"16g"`

                  - `"64g"`

                - `network_policy?: BetaContainerNetworkPolicyDisabled | BetaContainerNetworkPolicyAllowlist`

                  Network access policy for the container.

                  - `BetaContainerNetworkPolicyDisabled`

                    - `type: "disabled"`

                      Disable outbound network access. Always `disabled`.

                      - `"disabled"`

                  - `BetaContainerNetworkPolicyAllowlist`

                    - `allowed_domains: Array<string>`

                      A list of allowed domains when type is `allowlist`.

                    - `type: "allowlist"`

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

                      - `"allowlist"`

                    - `domain_secrets?: Array<BetaContainerNetworkPolicyDomainSecret>`

                      Optional domain-scoped secrets for allowlisted domains.

                      - `domain: string`

                        The domain associated with the secret.

                      - `name: string`

                        The name of the secret to inject for the domain.

                      - `value: string`

                        The secret value to inject for the domain.

            - `type: "code_interpreter"`

              The type of the code interpreter tool. Always `code_interpreter`.

              - `"code_interpreter"`

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

              The tool invocation context(s).

              - `"direct"`

              - `"programmatic"`

          - `ProgrammaticToolCalling`

            - `type: "programmatic_tool_calling"`

              The type of the tool. Always `programmatic_tool_calling`.

              - `"programmatic_tool_calling"`

          - `ImageGeneration`

            A tool that generates images using the GPT image models.

            - `type: "image_generation"`

              The type of the image generation tool. Always `image_generation`.

              - `"image_generation"`

            - `action?: "generate" | "edit" | "auto"`

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

              - `"generate"`

              - `"edit"`

              - `"auto"`

            - `background?: "transparent" | "opaque" | "auto"`

              Allows to set transparency for the background of the generated image(s).
              Must be one of `transparent`, `opaque`, or `auto` (default value). When
              `auto` is used, the model will automatically determine the best
              background for the image.

              Transparent backgrounds are available for supported GPT Image models.
              For `gpt-image-2` and `gpt-image-2-2026-04-21`, this support is in
              preview. When using `transparent`, set the output format to `png` or
              `webp`.

              - `"transparent"`

              - `"opaque"`

              - `"auto"`

            - `input_fidelity?: "high" | "low" | null`

              Control how much effort the model will exert to match the style and features, especially facial features, of input images. This parameter is only supported for `gpt-image-1` and `gpt-image-1.5` and later models, unsupported for `gpt-image-1-mini`. Supports `high` and `low`. Defaults to `low`.

              - `"high"`

              - `"low"`

            - `input_image_mask?: InputImageMask`

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

              - `file_id?: string`

                File ID for the mask image.

              - `image_url?: string`

                Base64-encoded mask image.

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

              The image generation model to use. One of `gpt-image-1`,
              `gpt-image-1-mini`, `gpt-image-1.5`, `gpt-image-2`,
              `gpt-image-2-2026-04-21`, or `chatgpt-image-latest`. Default:
              `gpt-image-1`.

              - `(string & {})`

              - `"gpt-image-1" | "gpt-image-1-mini" | "gpt-image-2" | 3 more`

                - `"gpt-image-1"`

                - `"gpt-image-1-mini"`

                - `"gpt-image-2"`

                - `"gpt-image-2-2026-04-21"`

                - `"gpt-image-1.5"`

                - `"chatgpt-image-latest"`

            - `moderation?: "auto" | "low"`

              Moderation level for the generated image. Default: `auto`.

              - `"auto"`

              - `"low"`

            - `output_compression?: number`

              Compression level for the output image. Default: 100.

            - `output_format?: "png" | "webp" | "jpeg"`

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

              - `"png"`

              - `"webp"`

              - `"jpeg"`

            - `partial_images?: number`

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

            - `quality?: "low" | "medium" | "high" | "auto"`

              The quality of the generated image. One of `low`, `medium`, `high`,
              or `auto`. Default: `auto`.

              - `"low"`

              - `"medium"`

              - `"high"`

              - `"auto"`

            - `size?: (string & {}) | "1024x1024" | "1024x1536" | "1536x1024" | "auto"`

              The size of the generated images. For `gpt-image-2` and `gpt-image-2-2026-04-21`, arbitrary resolutions are supported as `WIDTHxHEIGHT` strings, for example `1536x864`. Width and height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above `2560x1440` are experimental, and the maximum supported resolution is `3840x2160`. The requested size must also satisfy the model's current pixel and edge limits. The standard sizes `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models; `auto` is supported for models that allow automatic sizing. For `dall-e-2`, use one of `256x256`, `512x512`, or `1024x1024`. For `dall-e-3`, use one of `1024x1024`, `1792x1024`, or `1024x1792`.

              - `(string & {})`

              - `"1024x1024" | "1024x1536" | "1536x1024" | "auto"`

                - `"1024x1024"`

                - `"1024x1536"`

                - `"1536x1024"`

                - `"auto"`

          - `LocalShell`

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

            - `type: "local_shell"`

              The type of the local shell tool. Always `local_shell`.

              - `"local_shell"`

          - `BetaFunctionShellTool`

            A tool that allows the model to execute shell commands.

            - `type: "shell"`

              The type of the shell tool. Always `shell`.

              - `"shell"`

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

              The tool invocation context(s).

              - `"direct"`

              - `"programmatic"`

            - `environment?: BetaContainerAuto | BetaLocalEnvironment | BetaContainerReference | null`

              - `BetaContainerAuto`

                - `type: "container_auto"`

                  Automatically creates a container for this request

                  - `"container_auto"`

                - `file_ids?: Array<string>`

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

                - `memory_limit?: "1g" | "4g" | "16g" | "64g" | null`

                  The memory limit for the container.

                  - `"1g"`

                  - `"4g"`

                  - `"16g"`

                  - `"64g"`

                - `network_policy?: BetaContainerNetworkPolicyDisabled | BetaContainerNetworkPolicyAllowlist`

                  Network access policy for the container.

                  - `BetaContainerNetworkPolicyDisabled`

                  - `BetaContainerNetworkPolicyAllowlist`

                - `skills?: Array<BetaSkillReference | BetaInlineSkill>`

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

                  - `BetaSkillReference`

                    - `skill_id: string`

                      The ID of the referenced skill.

                    - `type: "skill_reference"`

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

                      - `"skill_reference"`

                    - `version?: string`

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

                  - `BetaInlineSkill`

                    - `description: string`

                      The description of the skill.

                    - `name: string`

                      The name of the skill.

                    - `source: BetaInlineSkillSource`

                      Inline skill payload

                      - `data: string`

                        Base64-encoded skill zip bundle.

                      - `media_type: "application/zip"`

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

                        - `"application/zip"`

                      - `type: "base64"`

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

                        - `"base64"`

                    - `type: "inline"`

                      Defines an inline skill for this request.

                      - `"inline"`

              - `BetaLocalEnvironment`

                - `type: "local"`

                  Use a local computer environment.

                  - `"local"`

                - `skills?: Array<BetaLocalSkill>`

                  An optional list of skills.

                  - `description: string`

                    The description of the skill.

                  - `name: string`

                    The name of the skill.

                  - `path: string`

                    The path to the directory containing the skill.

              - `BetaContainerReference`

                - `container_id: string`

                  The ID of the referenced container.

                - `type: "container_reference"`

                  References a container created with the /v1/containers endpoint

                  - `"container_reference"`

          - `BetaCustomTool`

            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)

            - `name: string`

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

            - `type: "custom"`

              The type of the custom tool. Always `custom`.

              - `"custom"`

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

              The tool invocation context(s).

              - `"direct"`

              - `"programmatic"`

            - `defer_loading?: boolean`

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

            - `description?: string`

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

            - `format?: Text | Grammar`

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

              - `Text`

                Unconstrained free-form text.

                - `type: "text"`

                  Unconstrained text format. Always `text`.

                  - `"text"`

              - `Grammar`

                A grammar defined by the user.

                - `definition: string`

                  The grammar definition.

                - `syntax: "lark" | "regex"`

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

                  - `"lark"`

                  - `"regex"`

                - `type: "grammar"`

                  Grammar format. Always `grammar`.

                  - `"grammar"`

          - `BetaNamespaceTool`

            Groups function/custom tools under a shared namespace.

            - `description: string`

              A description of the namespace shown to the model.

            - `name: string`

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

            - `tools: Array<Function | BetaCustomTool>`

              The function/custom tools available inside this namespace.

              - `Function`

                - `name: string`

                - `type: "function"`

                  - `"function"`

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

                  The tool invocation context(s).

                  - `"direct"`

                  - `"programmatic"`

                - `defer_loading?: boolean`

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

                - `description?: string | null`

                - `output_schema?: Record<string, unknown> | null`

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

                - `parameters?: unknown`

                - `strict?: boolean | null`

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

              - `BetaCustomTool`

                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: "namespace"`

              The type of the tool. Always `namespace`.

              - `"namespace"`

          - `BetaToolSearchTool`

            Hosted or BYOT tool search configuration for deferred tools.

            - `type: "tool_search"`

              The type of the tool. Always `tool_search`.

              - `"tool_search"`

            - `description?: string | null`

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

            - `execution?: "server" | "client"`

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

              - `"server"`

              - `"client"`

            - `parameters?: unknown`

              Parameter schema for a client-executed tool search tool.

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

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

              - `"web_search_preview"`

              - `"web_search_preview_2025_03_11"`

            - `search_content_types?: Array<"text" | "image">`

              - `"text"`

              - `"image"`

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

              - `"low"`

              - `"medium"`

              - `"high"`

            - `user_location?: UserLocation | null`

              The user's location.

              - `type: "approximate"`

                The type of location approximation. Always `approximate`.

                - `"approximate"`

              - `city?: string | null`

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

              - `country?: string | null`

                The two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of the user, e.g. `US`.

              - `region?: string | null`

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

              - `timezone?: string | null`

                The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of the user, e.g. `America/Los_Angeles`.

          - `BetaApplyPatchTool`

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

            - `type: "apply_patch"`

              The type of the tool. Always `apply_patch`.

              - `"apply_patch"`

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

              The tool invocation context(s).

              - `"direct"`

              - `"programmatic"`

        - `type: "tool_search_output"`

          The item type. Always `tool_search_output`.

          - `"tool_search_output"`

        - `id?: string | null`

          The unique ID of this tool search output.

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `call_id?: string | null`

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

        - `execution?: "server" | "client"`

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

          - `"server"`

          - `"client"`

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

          The status of the tool search output.

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

      - `AdditionalTools`

        - `role: "developer"`

          The role that provided the additional tools. Only `developer` is supported.

          - `"developer"`

        - `tools: Array<BetaTool>`

          A list of additional tools made available at this item.

          - `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).

          - `Mcp`

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

          - `CodeInterpreter`

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

          - `ProgrammaticToolCalling`

          - `ImageGeneration`

            A tool that generates images using the GPT image models.

          - `LocalShell`

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

          - `BetaFunctionShellTool`

            A tool that allows the model to execute shell commands.

          - `BetaCustomTool`

            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)

          - `BetaNamespaceTool`

            Groups function/custom tools under a shared namespace.

          - `BetaToolSearchTool`

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

          - `BetaApplyPatchTool`

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

        - `type: "additional_tools"`

          The item type. Always `additional_tools`.

          - `"additional_tools"`

        - `id?: string | null`

          The unique ID of this additional tools item.

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

      - `BetaResponseReasoningItem`

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

        - `id: string`

          The unique identifier of the reasoning content.

        - `summary: Array<Summary>`

          Reasoning summary content.

          - `text: string`

            A summary of the reasoning output from the model so far.

          - `type: "summary_text"`

            The type of the object. Always `summary_text`.

            - `"summary_text"`

        - `type: "reasoning"`

          The type of the object. Always `reasoning`.

          - `"reasoning"`

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `content?: Array<Content>`

          Reasoning text content.

          - `text: string`

            The reasoning text from the model.

          - `type: "reasoning_text"`

            The type of the reasoning text. Always `reasoning_text`.

            - `"reasoning_text"`

        - `encrypted_content?: string | null`

          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.

          When streaming, use the completed reasoning item and its
          `encrypted_content` from the `response.output_item.done` event in
          subsequent requests. The `encrypted_content` in
          `response.output_item.added` may be incomplete. This is especially
          important when `store` is `false` or when using Zero Data Retention.

        - `status?: "in_progress" | "completed" | "incomplete"`

          The status of the item. One of `in_progress`, `completed`, or
          `incomplete`. Populated when items are returned via API.

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

      - `BetaResponseCompactionItemParam`

        A compaction item generated by the [`v1/responses/compact` API](https://platform.openai.com/docs/api-reference/responses/compact).

        - `encrypted_content: string`

          The encrypted content of the compaction summary.

        - `type: "compaction"`

          The type of the item. Always `compaction`.

          - `"compaction"`

        - `id?: string | null`

          The ID of the compaction item.

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

      - `ImageGenerationCall`

        An image generation request made by the model.

        - `id: string`

          The unique ID of the image generation call.

        - `result: string | null`

          The generated image encoded in base64.

        - `status: "in_progress" | "completed" | "generating" | "failed"`

          The status of the image generation call.

          - `"in_progress"`

          - `"completed"`

          - `"generating"`

          - `"failed"`

        - `type: "image_generation_call"`

          The type of the image generation call. Always `image_generation_call`.

          - `"image_generation_call"`

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

      - `BetaResponseCodeInterpreterToolCall`

        A tool call to run code.

        - `id: string`

          The unique ID of the code interpreter tool call.

        - `code: string | null`

          The code to run, or null if not available.

        - `container_id: string`

          The ID of the container used to run the code.

        - `outputs: Array<Logs | Image> | null`

          The outputs generated by the code interpreter, such as logs or images.
          Can be null if no outputs are available.

          - `Logs`

            The logs output from the code interpreter.

            - `logs: string`

              The logs output from the code interpreter.

            - `type: "logs"`

              The type of the output. Always `logs`.

              - `"logs"`

          - `Image`

            The image output from the code interpreter.

            - `type: "image"`

              The type of the output. Always `image`.

              - `"image"`

            - `url: string`

              The URL of the image output from the code interpreter.

        - `status: "in_progress" | "completed" | "incomplete" | 2 more`

          The status of the code interpreter tool call. Valid values are `in_progress`, `completed`, `incomplete`, `interpreting`, and `failed`.

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

          - `"interpreting"`

          - `"failed"`

        - `type: "code_interpreter_call"`

          The type of the code interpreter tool call. Always `code_interpreter_call`.

          - `"code_interpreter_call"`

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

      - `LocalShellCall`

        A tool call to run a command on the local shell.

        - `id: string`

          The unique ID of the local shell call.

        - `action: Action`

          Execute a shell command on the server.

          - `command: Array<string>`

            The command to run.

          - `env: Record<string, string>`

            Environment variables to set for the command.

          - `type: "exec"`

            The type of the local shell action. Always `exec`.

            - `"exec"`

          - `timeout_ms?: number | null`

            Optional timeout in milliseconds for the command.

          - `user?: string | null`

            Optional user to run the command as.

          - `working_directory?: string | null`

            Optional working directory to run the command in.

        - `call_id: string`

          The unique ID of the local shell tool call generated by the model.

        - `status: "in_progress" | "completed" | "incomplete"`

          The status of the local shell call.

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

        - `type: "local_shell_call"`

          The type of the local shell call. Always `local_shell_call`.

          - `"local_shell_call"`

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

      - `LocalShellCallOutput`

        The output of a local shell tool call.

        - `id: string`

          The unique ID of the local shell tool call generated by the model.

        - `output: string`

          A JSON string of the output of the local shell tool call.

        - `type: "local_shell_call_output"`

          The type of the local shell tool call output. Always `local_shell_call_output`.

          - `"local_shell_call_output"`

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

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

          The status of the item. One of `in_progress`, `completed`, or `incomplete`.

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

      - `ShellCall`

        A tool representing a request to execute one or more shell commands.

        - `action: Action`

          The shell commands and limits that describe how to run the tool call.

          - `commands: Array<string>`

            Ordered shell commands for the execution environment to run.

          - `max_output_length?: number | null`

            Maximum number of UTF-8 characters to capture from combined stdout and stderr output.

          - `timeout_ms?: number | null`

            Maximum wall-clock time in milliseconds to allow the shell commands to run.

        - `call_id: string`

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

        - `type: "shell_call"`

          The type of the item. Always `shell_call`.

          - `"shell_call"`

        - `id?: string | null`

          The unique ID of the shell tool call. Populated when this item is returned via API.

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `caller?: Direct | Program | null`

          The execution context that produced this tool call.

          - `Direct`

            - `type: "direct"`

              The caller type. Always `direct`.

              - `"direct"`

          - `Program`

            - `caller_id: string`

              The call ID of the program item that produced this tool call.

            - `type: "program"`

              The caller type. Always `program`.

              - `"program"`

        - `environment?: BetaLocalEnvironment | BetaContainerReference | null`

          The environment to execute the shell commands in.

          - `BetaLocalEnvironment`

          - `BetaContainerReference`

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

          The status of the shell call. One of `in_progress`, `completed`, or `incomplete`.

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

      - `ShellCallOutput`

        The streamed output items emitted by a shell tool call.

        - `call_id: string`

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

        - `output: Array<BetaResponseFunctionShellCallOutputContent>`

          Captured chunks of stdout and stderr output, along with their associated outcomes.

          - `outcome: Timeout | Exit`

            The exit or timeout outcome associated with this shell call.

            - `Timeout`

              Indicates that the shell call exceeded its configured time limit.

              - `type: "timeout"`

                The outcome type. Always `timeout`.

                - `"timeout"`

            - `Exit`

              Indicates that the shell commands finished and returned an exit code.

              - `exit_code: number`

                The exit code returned by the shell process.

              - `type: "exit"`

                The outcome type. Always `exit`.

                - `"exit"`

          - `stderr: string`

            Captured stderr output for the shell call.

          - `stdout: string`

            Captured stdout output for the shell call.

        - `type: "shell_call_output"`

          The type of the item. Always `shell_call_output`.

          - `"shell_call_output"`

        - `id?: string | null`

          The unique ID of the shell tool call output. Populated when this item is returned via API.

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `caller?: Direct | Program | null`

          The execution context that produced this tool call.

          - `Direct`

            - `type: "direct"`

              The caller type. Always `direct`.

              - `"direct"`

          - `Program`

            - `caller_id: string`

              The call ID of the program item that produced this tool call.

            - `type: "program"`

              The caller type. Always `program`.

              - `"program"`

        - `max_output_length?: number | null`

          The maximum number of UTF-8 characters captured for this shell call's combined output.

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

          The status of the shell call output.

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

      - `ApplyPatchCall`

        A tool call representing a request to create, delete, or update files using diff patches.

        - `call_id: string`

          The unique ID of the apply patch tool call generated by the model.

        - `operation: CreateFile | DeleteFile | UpdateFile`

          The specific create, delete, or update instruction for the apply_patch tool call.

          - `CreateFile`

            Instruction for creating a new file via the apply_patch tool.

            - `diff: string`

              Unified diff content to apply when creating the file.

            - `path: string`

              Path of the file to create relative to the workspace root.

            - `type: "create_file"`

              The operation type. Always `create_file`.

              - `"create_file"`

          - `DeleteFile`

            Instruction for deleting an existing file via the apply_patch tool.

            - `path: string`

              Path of the file to delete relative to the workspace root.

            - `type: "delete_file"`

              The operation type. Always `delete_file`.

              - `"delete_file"`

          - `UpdateFile`

            Instruction for updating an existing file via the apply_patch tool.

            - `diff: string`

              Unified diff content to apply to the existing file.

            - `path: string`

              Path of the file to update relative to the workspace root.

            - `type: "update_file"`

              The operation type. Always `update_file`.

              - `"update_file"`

        - `status: "in_progress" | "completed"`

          The status of the apply patch tool call. One of `in_progress` or `completed`.

          - `"in_progress"`

          - `"completed"`

        - `type: "apply_patch_call"`

          The type of the item. Always `apply_patch_call`.

          - `"apply_patch_call"`

        - `id?: string | null`

          The unique ID of the apply patch tool call. Populated when this item is returned via API.

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `caller?: Direct | Program | null`

          The execution context that produced this tool call.

          - `Direct`

            - `type: "direct"`

              The caller type. Always `direct`.

              - `"direct"`

          - `Program`

            - `caller_id: string`

              The call ID of the program item that produced this tool call.

            - `type: "program"`

              The caller type. Always `program`.

              - `"program"`

      - `ApplyPatchCallOutput`

        The streamed output emitted by an apply patch tool call.

        - `call_id: string`

          The unique ID of the apply patch tool call generated by the model.

        - `status: "completed" | "failed"`

          The status of the apply patch tool call output. One of `completed` or `failed`.

          - `"completed"`

          - `"failed"`

        - `type: "apply_patch_call_output"`

          The type of the item. Always `apply_patch_call_output`.

          - `"apply_patch_call_output"`

        - `id?: string | null`

          The unique ID of the apply patch tool call output. Populated when this item is returned via API.

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `caller?: Direct | Program | null`

          The execution context that produced this tool call.

          - `Direct`

            - `type: "direct"`

              The caller type. Always `direct`.

              - `"direct"`

          - `Program`

            - `caller_id: string`

              The call ID of the program item that produced this tool call.

            - `type: "program"`

              The caller type. Always `program`.

              - `"program"`

        - `output?: string | null`

          Optional human-readable log text from the apply patch tool (e.g., patch results or errors).

      - `McpListTools`

        A list of tools available on an MCP server.

        - `id: string`

          The unique ID of the list.

        - `server_label: string`

          The label of the MCP server.

        - `tools: Array<Tool>`

          The tools available on the server.

          - `input_schema: unknown`

            The JSON schema describing the tool's input.

          - `name: string`

            The name of the tool.

          - `annotations?: unknown`

            Additional annotations about the tool.

          - `description?: string | null`

            The description of the tool.

        - `type: "mcp_list_tools"`

          The type of the item. Always `mcp_list_tools`.

          - `"mcp_list_tools"`

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `error?: string | null`

          Error message if the server could not list tools.

      - `McpApprovalRequest`

        A request for human approval of a tool invocation.

        - `id: string`

          The unique ID of the approval request.

        - `arguments: string`

          A JSON string of arguments for the tool.

        - `name: string`

          The name of the tool to run.

        - `server_label: string`

          The label of the MCP server making the request.

        - `type: "mcp_approval_request"`

          The type of the item. Always `mcp_approval_request`.

          - `"mcp_approval_request"`

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

      - `McpApprovalResponse`

        A response to an MCP approval request.

        - `approval_request_id: string`

          The ID of the approval request being answered.

        - `approve: boolean`

          Whether the request was approved.

        - `type: "mcp_approval_response"`

          The type of the item. Always `mcp_approval_response`.

          - `"mcp_approval_response"`

        - `id?: string | null`

          The unique ID of the approval response

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `reason?: string | null`

          Optional reason for the decision.

      - `McpCall`

        An invocation of a tool on an MCP server.

        - `id: string`

          The unique ID of the tool call.

        - `arguments: string`

          A JSON string of the arguments passed to the tool.

        - `name: string`

          The name of the tool that was run.

        - `server_label: string`

          The label of the MCP server running the tool.

        - `type: "mcp_call"`

          The type of the item. Always `mcp_call`.

          - `"mcp_call"`

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `approval_request_id?: string | null`

          Unique identifier for the MCP tool call approval request.
          Include this value in a subsequent `mcp_approval_response` input to approve or reject the corresponding tool call.

        - `error?: BetaMcpToolCallError | null`

          The error from the tool call, if any.

          - `McpProtocolError`

            - `code: number`

            - `message: string`

            - `type: "mcp_protocol_error"`

              - `"mcp_protocol_error"`

          - `McpToolExecutionError`

            - `content: unknown`

            - `type: "mcp_tool_execution_error"`

              - `"mcp_tool_execution_error"`

          - `HTTPError`

            - `code: number`

            - `message: string`

            - `type: "http_error"`

              - `"http_error"`

        - `output?: string | null`

          The output from the tool call.

        - `status?: "in_progress" | "completed" | "incomplete" | 2 more`

          The status of the tool call. One of `in_progress`, `completed`, `incomplete`, `calling`, or `failed`.

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

          - `"calling"`

          - `"failed"`

      - `BetaResponseCustomToolCallOutput`

        The output of a custom tool call from your code, being sent back to the model.

        - `call_id: string`

          The call ID, used to map this custom tool call output to a custom tool call.

        - `output: string | Array<BetaResponseInputText | BetaResponseInputImage | BetaResponseInputFile>`

          The output from the custom tool call generated by your code.
          Can be a string or an list of output content.

          - `string`

          - `Array<BetaResponseInputText | BetaResponseInputImage | BetaResponseInputFile>`

            - `BetaResponseInputText`

              A text input to the model.

            - `BetaResponseInputImage`

              An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision).

            - `BetaResponseInputFile`

              A file input to the model.

        - `type: "custom_tool_call_output"`

          The type of the custom tool call output. Always `custom_tool_call_output`.

          - `"custom_tool_call_output"`

        - `id?: string`

          The unique ID of the custom tool call output in the OpenAI platform.

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `caller?: Direct | Program | null`

          The execution context that produced this tool call.

          - `Direct`

            - `type: "direct"`

              The caller type. Always `direct`.

              - `"direct"`

          - `Program`

            - `caller_id: string`

              The call ID of the program item that produced this tool call.

            - `type: "program"`

              The caller type. Always `program`.

              - `"program"`

      - `BetaResponseCustomToolCall`

        A call to a custom tool created by the model.

        - `call_id: string`

          An identifier used to map this custom tool call to a tool call output.

        - `input: string`

          The input for the custom tool call generated by the model.

        - `name: string`

          The name of the custom tool being called.

        - `type: "custom_tool_call"`

          The type of the custom tool call. Always `custom_tool_call`.

          - `"custom_tool_call"`

        - `id?: string`

          The unique ID of the custom tool call in the OpenAI platform.

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `caller?: Direct | Program | null`

          The execution context that produced this tool call.

          - `Direct`

            - `type: "direct"`

              - `"direct"`

          - `Program`

            - `caller_id: string`

              The call ID of the program item that produced this tool call.

            - `type: "program"`

              - `"program"`

        - `namespace?: string`

          The namespace of the custom tool being called.

      - `CompactionTrigger`

        Compacts the current context. Must be the final input item.

        - `type: "compaction_trigger"`

          The type of the item. Always `compaction_trigger`.

          - `"compaction_trigger"`

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

      - `ItemReference`

        An internal identifier for an item to reference.

        - `id: string`

          The ID of the item to reference.

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `type?: "item_reference" | null`

          The type of item to reference. Always `item_reference`.

          - `"item_reference"`

      - `Program`

        - `id: string`

          The unique ID of this program item.

        - `call_id: string`

          The stable call ID of the program item.

        - `code: string`

          The JavaScript source executed by programmatic tool calling.

        - `fingerprint: string`

          Opaque program replay fingerprint that must be round-tripped.

        - `type: "program"`

          The item type. Always `program`.

          - `"program"`

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

      - `ProgramOutput`

        - `id: string`

          The unique ID of this program output item.

        - `call_id: string`

          The call ID of the program item.

        - `result: string`

          The result produced by the program item.

        - `status: "completed" | "incomplete"`

          The terminal status of the program output.

          - `"completed"`

          - `"incomplete"`

        - `type: "program_output"`

          The item type. Always `program_output`.

          - `"program_output"`

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

  - `metadata: Record<string, string> | null`

    Set of 16 key-value pairs that can be attached to an object. This can be
    useful for storing additional information about the object in a structured
    format, and querying for objects via API or the dashboard.

    Keys are strings with a maximum length of 64 characters. Values are strings
    with a maximum length of 512 characters.

  - `model: "gpt-5.6-sol" | "gpt-5.6-terra" | "gpt-5.6-luna" | 99 more | (string & {})`

    Model ID used to generate the response, like `gpt-4o` or `o3`. OpenAI
    offers a wide range of models with different capabilities, performance
    characteristics, and price points. Refer to the [model guide](https://platform.openai.com/docs/models)
    to browse and compare available models.

    - `"gpt-5.6-sol" | "gpt-5.6-terra" | "gpt-5.6-luna" | 99 more`

      - `"gpt-5.6-sol"`

      - `"gpt-5.6-terra"`

      - `"gpt-5.6-luna"`

      - `"gpt-5.5"`

      - `"gpt-5.5-2026-04-23"`

      - `"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.5-pro"`

      - `"gpt-5.5-pro-2026-04-23"`

      - `"gpt-5-codex"`

      - `"gpt-5-pro"`

      - `"gpt-5-pro-2025-10-06"`

      - `"gpt-5.1-codex-max"`

      - `"gpt-daybreak-blue-latest"`

      - `"gpt-daybreak-red-latest"`

      - `"gpt-5.6-cyber"`

    - `(string & {})`

  - `object: "response"`

    The object type of this resource - always set to `response`.

    - `"response"`

  - `output: Array<BetaResponseOutputItem>`

    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.

    - `BetaResponseOutputMessage`

      An output message from the model.

    - `BetaResponseFileSearchToolCall`

      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.

    - `BetaResponseFunctionToolCall`

      A tool call to run a function. See the
      [function calling guide](https://platform.openai.com/docs/guides/function-calling) for more information.

    - `BetaResponseFunctionToolCallOutputItem`

      - `id: string`

        The unique ID of the function call tool output.

      - `call_id: string`

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

      - `output: string | Array<BetaResponseInputText | BetaResponseInputImage | BetaResponseInputFile>`

        The output from the function call generated by your code.
        Can be a string or an list of output content.

        - `string`

        - `Array<BetaResponseInputText | BetaResponseInputImage | BetaResponseInputFile>`

          - `BetaResponseInputText`

            A text input to the model.

          - `BetaResponseInputImage`

            An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision).

          - `BetaResponseInputFile`

            A file input to 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.

        - `"in_progress"`

        - `"completed"`

        - `"incomplete"`

      - `type: "function_call_output"`

        The type of the function tool call output. Always `function_call_output`.

        - `"function_call_output"`

      - `agent?: Agent | null`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

      - `caller?: Direct | Program | null`

        The execution context that produced this tool call.

        - `Direct`

          - `type: "direct"`

            The caller type. Always `direct`.

            - `"direct"`

        - `Program`

          - `caller_id: string`

            The call ID of the program item that produced this tool call.

          - `type: "program"`

            The caller type. Always `program`.

            - `"program"`

      - `created_by?: string`

        The identifier of the actor that created the item.

      - `name?: string`

        The name of the tool that produced the output.

      - `namespace?: string`

        The namespace of the tool that produced the output.

    - `AgentMessage`

      - `id: string`

        The unique ID of the agent message.

      - `author: string`

        The sending agent identity.

      - `content: Array<BetaResponseInputText | BetaResponseOutputText | Text | 7 more>`

        Encrypted content sent between agents.

        - `BetaResponseInputText`

          A text input to the model.

        - `BetaResponseOutputText`

          A text output from the model.

        - `Text`

          A text content.

          - `text: string`

          - `type: "text"`

            - `"text"`

        - `SummaryText`

          A summary text from the model.

          - `text: string`

            A summary of the reasoning output from the model so far.

          - `type: "summary_text"`

            The type of the object. Always `summary_text`.

            - `"summary_text"`

        - `ReasoningText`

          Reasoning text from the model.

          - `text: string`

            The reasoning text from the model.

          - `type: "reasoning_text"`

            The type of the reasoning text. Always `reasoning_text`.

            - `"reasoning_text"`

        - `BetaResponseOutputRefusal`

          A refusal from the model.

        - `BetaResponseInputImage`

          An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision).

        - `ComputerScreenshot`

          A screenshot of a computer.

          - `detail: BetaImageDetail`

            The detail level of the screenshot image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`.

          - `file_id: string | null`

            The identifier of an uploaded file that contains the screenshot.

          - `image_url: string | null`

            The URL of the screenshot image.

          - `type: "computer_screenshot"`

            Specifies the event type. For a computer screenshot, this property is always set to `computer_screenshot`.

            - `"computer_screenshot"`

          - `prompt_cache_breakpoint?: PromptCacheBreakpoint`

            Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.

            - `mode: "explicit"`

              The breakpoint mode. Always `explicit`.

              - `"explicit"`

        - `BetaResponseInputFile`

          A file input to the model.

        - `EncryptedContent`

          Opaque encrypted content that Responses API decrypts inside trusted model execution.

          - `encrypted_content: string`

            Opaque encrypted content.

          - `type: "encrypted_content"`

            The type of the input item. Always `encrypted_content`.

            - `"encrypted_content"`

      - `recipient: string`

        The destination agent identity.

      - `type: "agent_message"`

        The type of the item. Always `agent_message`.

        - `"agent_message"`

      - `agent?: Agent`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

    - `MultiAgentCall`

      - `id: string`

        The unique ID of the multi-agent call item.

      - `action: "spawn_agent" | "interrupt_agent" | "list_agents" | 3 more`

        The multi-agent action to execute.

        - `"spawn_agent"`

        - `"interrupt_agent"`

        - `"list_agents"`

        - `"send_message"`

        - `"followup_task"`

        - `"wait_agent"`

      - `arguments: string`

        The JSON string of arguments generated for the action.

      - `call_id: string`

        The unique ID linking this call to its output.

      - `type: "multi_agent_call"`

        The type of the multi-agent call. Always `multi_agent_call`.

        - `"multi_agent_call"`

      - `agent?: Agent`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

    - `MultiAgentCallOutput`

      - `id: string`

        The unique ID of the multi-agent call output item.

      - `action: "spawn_agent" | "interrupt_agent" | "list_agents" | 3 more`

        The multi-agent action that produced this result.

        - `"spawn_agent"`

        - `"interrupt_agent"`

        - `"list_agents"`

        - `"send_message"`

        - `"followup_task"`

        - `"wait_agent"`

      - `call_id: string`

        The unique ID of the multi-agent call.

      - `output: Array<BetaResponseOutputText>`

        Text output returned by the multi-agent action.

        - `annotations: Array<FileCitation | URLCitation | ContainerFileCitation | FilePath>`

          The annotations of the text output.

        - `text: string`

          The text output from the model.

        - `type: "output_text"`

          The type of the output text. Always `output_text`.

        - `logprobs?: Array<Logprob>`

      - `type: "multi_agent_call_output"`

        The type of the multi-agent result. Always `multi_agent_call_output`.

        - `"multi_agent_call_output"`

      - `agent?: Agent`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

    - `BetaResponseFunctionWebSearch`

      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.

    - `BetaResponseComputerToolCall`

      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.

    - `BetaResponseComputerToolCallOutputItem`

      - `id: string`

        The unique ID of the computer call tool output.

      - `call_id: string`

        The ID of the computer tool call that produced the output.

      - `output: BetaResponseComputerToolCallOutputScreenshot`

        A computer screenshot image used with the computer use tool.

      - `status: "completed" | "incomplete" | "failed" | "in_progress"`

        The status of the message input. One of `in_progress`, `completed`, or
        `incomplete`. Populated when input items are returned via API.

        - `"completed"`

        - `"incomplete"`

        - `"failed"`

        - `"in_progress"`

      - `type: "computer_call_output"`

        The type of the computer tool call output. Always `computer_call_output`.

        - `"computer_call_output"`

      - `acknowledged_safety_checks?: Array<AcknowledgedSafetyCheck>`

        The safety checks reported by the API that have been acknowledged by the
        developer.

        - `id: string`

          The ID of the pending safety check.

        - `code?: string | null`

          The type of the pending safety check.

        - `message?: string | null`

          Details about the pending safety check.

      - `agent?: Agent | null`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

      - `created_by?: string`

        The identifier of the actor that created the item.

    - `BetaResponseReasoningItem`

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

    - `Program`

      - `id: string`

        The unique ID of the program item.

      - `call_id: string`

        The stable call ID of the program item.

      - `code: string`

        The JavaScript source executed by programmatic tool calling.

      - `fingerprint: string`

        Opaque program replay fingerprint that must be round-tripped.

      - `type: "program"`

        The type of the item. Always `program`.

        - `"program"`

      - `agent?: Agent`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

    - `ProgramOutput`

      - `id: string`

        The unique ID of the program output item.

      - `call_id: string`

        The call ID of the program item.

      - `result: string`

        The result produced by the program item.

      - `status: "completed" | "incomplete"`

        The terminal status of the program output item.

        - `"completed"`

        - `"incomplete"`

      - `type: "program_output"`

        The type of the item. Always `program_output`.

        - `"program_output"`

      - `agent?: Agent`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

    - `BetaResponseToolSearchCall`

      - `id: string`

        The unique ID of the tool search call item.

      - `arguments: unknown`

        Arguments used for the tool search call.

      - `call_id: string | null`

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

      - `execution: "server" | "client"`

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

        - `"server"`

        - `"client"`

      - `status: "in_progress" | "completed" | "incomplete"`

        The status of the tool search call item that was recorded.

        - `"in_progress"`

        - `"completed"`

        - `"incomplete"`

      - `type: "tool_search_call"`

        The type of the item. Always `tool_search_call`.

        - `"tool_search_call"`

      - `agent?: Agent`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

      - `created_by?: string`

        The identifier of the actor that created the item.

    - `BetaResponseToolSearchOutputItem`

      - `id: string`

        The unique ID of the tool search output item.

      - `call_id: string | null`

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

      - `execution: "server" | "client"`

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

        - `"server"`

        - `"client"`

      - `status: "in_progress" | "completed" | "incomplete"`

        The status of the tool search output item that was recorded.

        - `"in_progress"`

        - `"completed"`

        - `"incomplete"`

      - `tools: Array<BetaTool>`

        The loaded tool definitions returned by tool search.

        - `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).

        - `Mcp`

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

        - `CodeInterpreter`

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

        - `ProgrammaticToolCalling`

        - `ImageGeneration`

          A tool that generates images using the GPT image models.

        - `LocalShell`

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

        - `BetaFunctionShellTool`

          A tool that allows the model to execute shell commands.

        - `BetaCustomTool`

          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)

        - `BetaNamespaceTool`

          Groups function/custom tools under a shared namespace.

        - `BetaToolSearchTool`

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

        - `BetaApplyPatchTool`

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

      - `type: "tool_search_output"`

        The type of the item. Always `tool_search_output`.

        - `"tool_search_output"`

      - `agent?: Agent`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

      - `created_by?: string`

        The identifier of the actor that created the item.

    - `AdditionalTools`

      - `id: string`

        The unique ID of the additional tools item.

      - `role: "unknown" | "user" | "assistant" | 5 more`

        The role that provided the additional tools.

        - `"unknown"`

        - `"user"`

        - `"assistant"`

        - `"system"`

        - `"critic"`

        - `"discriminator"`

        - `"developer"`

        - `"tool"`

      - `tools: Array<BetaTool>`

        The additional tool definitions made available at this item.

        - `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).

        - `Mcp`

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

        - `CodeInterpreter`

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

        - `ProgrammaticToolCalling`

        - `ImageGeneration`

          A tool that generates images using the GPT image models.

        - `LocalShell`

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

        - `BetaFunctionShellTool`

          A tool that allows the model to execute shell commands.

        - `BetaCustomTool`

          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)

        - `BetaNamespaceTool`

          Groups function/custom tools under a shared namespace.

        - `BetaToolSearchTool`

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

        - `BetaApplyPatchTool`

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

      - `type: "additional_tools"`

        The type of the item. Always `additional_tools`.

        - `"additional_tools"`

      - `agent?: Agent`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

    - `BetaResponseCompactionItem`

      A compaction item generated by the [`v1/responses/compact` API](https://platform.openai.com/docs/api-reference/responses/compact).

      - `id: string`

        The unique ID of the compaction item.

      - `encrypted_content: string`

        The encrypted content that was produced by compaction.

      - `type: "compaction"`

        The type of the item. Always `compaction`.

        - `"compaction"`

      - `agent?: Agent`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

      - `created_by?: string`

        The identifier of the actor that created the item.

    - `ImageGenerationCall`

      An image generation request made by the model.

      - `id: string`

        The unique ID of the image generation call.

      - `result: string | null`

        The generated image encoded in base64.

      - `status: "in_progress" | "completed" | "generating" | "failed"`

        The status of the image generation call.

        - `"in_progress"`

        - `"completed"`

        - `"generating"`

        - `"failed"`

      - `type: "image_generation_call"`

        The type of the image generation call. Always `image_generation_call`.

        - `"image_generation_call"`

      - `agent?: Agent | null`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

    - `BetaResponseCodeInterpreterToolCall`

      A tool call to run code.

    - `LocalShellCall`

      A tool call to run a command on the local shell.

      - `id: string`

        The unique ID of the local shell call.

      - `action: Action`

        Execute a shell command on the server.

        - `command: Array<string>`

          The command to run.

        - `env: Record<string, string>`

          Environment variables to set for the command.

        - `type: "exec"`

          The type of the local shell action. Always `exec`.

          - `"exec"`

        - `timeout_ms?: number | null`

          Optional timeout in milliseconds for the command.

        - `user?: string | null`

          Optional user to run the command as.

        - `working_directory?: string | null`

          Optional working directory to run the command in.

      - `call_id: string`

        The unique ID of the local shell tool call generated by the model.

      - `status: "in_progress" | "completed" | "incomplete"`

        The status of the local shell call.

        - `"in_progress"`

        - `"completed"`

        - `"incomplete"`

      - `type: "local_shell_call"`

        The type of the local shell call. Always `local_shell_call`.

        - `"local_shell_call"`

      - `agent?: Agent | null`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

    - `LocalShellCallOutput`

      The output of a local shell tool call.

      - `id: string`

        The unique ID of the local shell tool call generated by the model.

      - `output: string`

        A JSON string of the output of the local shell tool call.

      - `type: "local_shell_call_output"`

        The type of the local shell tool call output. Always `local_shell_call_output`.

        - `"local_shell_call_output"`

      - `agent?: Agent | null`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

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

        The status of the item. One of `in_progress`, `completed`, or `incomplete`.

        - `"in_progress"`

        - `"completed"`

        - `"incomplete"`

    - `BetaResponseFunctionShellToolCall`

      A tool call that executes one or more shell commands in a managed environment.

      - `id: string`

        The unique ID of the shell tool call. Populated when this item is returned via API.

      - `action: Action`

        The shell commands and limits that describe how to run the tool call.

        - `commands: Array<string>`

        - `max_output_length: number | null`

          Optional maximum number of characters to return from each command.

        - `timeout_ms: number | null`

          Optional timeout in milliseconds for the commands.

      - `call_id: string`

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

      - `environment: BetaResponseLocalEnvironment | BetaResponseContainerReference | null`

        Represents the use of a local environment to perform shell actions.

        - `BetaResponseLocalEnvironment`

          Represents the use of a local environment to perform shell actions.

          - `type: "local"`

            The environment type. Always `local`.

            - `"local"`

        - `BetaResponseContainerReference`

          Represents a container created with /v1/containers.

          - `container_id: string`

          - `type: "container_reference"`

            The environment type. Always `container_reference`.

            - `"container_reference"`

      - `status: "in_progress" | "completed" | "incomplete"`

        The status of the shell call. One of `in_progress`, `completed`, or `incomplete`.

        - `"in_progress"`

        - `"completed"`

        - `"incomplete"`

      - `type: "shell_call"`

        The type of the item. Always `shell_call`.

        - `"shell_call"`

      - `agent?: Agent`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

      - `caller?: Direct | Program | null`

        The execution context that produced this tool call.

        - `Direct`

          - `type: "direct"`

            - `"direct"`

        - `Program`

          - `caller_id: string`

            The call ID of the program item that produced this tool call.

          - `type: "program"`

            - `"program"`

      - `created_by?: string`

        The ID of the entity that created this tool call.

    - `BetaResponseFunctionShellToolCallOutput`

      The output of a shell tool call that was emitted.

      - `id: string`

        The unique ID of the shell call output. Populated when this item is returned via API.

      - `call_id: string`

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

      - `max_output_length: number | null`

        The maximum length of the shell command output. This is generated by the model and should be passed back with the raw output.

      - `output: Array<Output>`

        An array of shell call output contents

        - `outcome: Timeout | Exit`

          Represents either an exit outcome (with an exit code) or a timeout outcome for a shell call output chunk.

          - `Timeout`

            Indicates that the shell call exceeded its configured time limit.

            - `type: "timeout"`

              The outcome type. Always `timeout`.

              - `"timeout"`

          - `Exit`

            Indicates that the shell commands finished and returned an exit code.

            - `exit_code: number`

              Exit code from the shell process.

            - `type: "exit"`

              The outcome type. Always `exit`.

              - `"exit"`

        - `stderr: string`

          The standard error output that was captured.

        - `stdout: string`

          The standard output that was captured.

        - `created_by?: string`

          The identifier of the actor that created the item.

      - `status: "in_progress" | "completed" | "incomplete"`

        The status of the shell call output. One of `in_progress`, `completed`, or `incomplete`.

        - `"in_progress"`

        - `"completed"`

        - `"incomplete"`

      - `type: "shell_call_output"`

        The type of the shell call output. Always `shell_call_output`.

        - `"shell_call_output"`

      - `agent?: Agent`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

      - `caller?: Direct | Program | null`

        The execution context that produced this tool call.

        - `Direct`

          - `type: "direct"`

            - `"direct"`

        - `Program`

          - `caller_id: string`

            The call ID of the program item that produced this tool call.

          - `type: "program"`

            - `"program"`

      - `created_by?: string`

        The identifier of the actor that created the item.

    - `BetaResponseApplyPatchToolCall`

      A tool call that applies file diffs by creating, deleting, or updating files.

      - `id: string`

        The unique ID of the apply patch tool call. Populated when this item is returned via API.

      - `call_id: string`

        The unique ID of the apply patch tool call generated by the model.

      - `operation: CreateFile | DeleteFile | UpdateFile`

        One of the create_file, delete_file, or update_file operations applied via apply_patch.

        - `CreateFile`

          Instruction describing how to create a file via the apply_patch tool.

          - `diff: string`

            Diff to apply.

          - `path: string`

            Path of the file to create.

          - `type: "create_file"`

            Create a new file with the provided diff.

            - `"create_file"`

        - `DeleteFile`

          Instruction describing how to delete a file via the apply_patch tool.

          - `path: string`

            Path of the file to delete.

          - `type: "delete_file"`

            Delete the specified file.

            - `"delete_file"`

        - `UpdateFile`

          Instruction describing how to update a file via the apply_patch tool.

          - `diff: string`

            Diff to apply.

          - `path: string`

            Path of the file to update.

          - `type: "update_file"`

            Update an existing file with the provided diff.

            - `"update_file"`

      - `status: "in_progress" | "completed"`

        The status of the apply patch tool call. One of `in_progress` or `completed`.

        - `"in_progress"`

        - `"completed"`

      - `type: "apply_patch_call"`

        The type of the item. Always `apply_patch_call`.

        - `"apply_patch_call"`

      - `agent?: Agent`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

      - `caller?: Direct | Program | null`

        The execution context that produced this tool call.

        - `Direct`

          - `type: "direct"`

            - `"direct"`

        - `Program`

          - `caller_id: string`

            The call ID of the program item that produced this tool call.

          - `type: "program"`

            - `"program"`

      - `created_by?: string`

        The ID of the entity that created this tool call.

    - `BetaResponseApplyPatchToolCallOutput`

      The output emitted by an apply patch tool call.

      - `id: string`

        The unique ID of the apply patch tool call output. Populated when this item is returned via API.

      - `call_id: string`

        The unique ID of the apply patch tool call generated by the model.

      - `status: "completed" | "failed"`

        The status of the apply patch tool call output. One of `completed` or `failed`.

        - `"completed"`

        - `"failed"`

      - `type: "apply_patch_call_output"`

        The type of the item. Always `apply_patch_call_output`.

        - `"apply_patch_call_output"`

      - `agent?: Agent`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

      - `caller?: Direct | Program | null`

        The execution context that produced this tool call.

        - `Direct`

          - `type: "direct"`

            - `"direct"`

        - `Program`

          - `caller_id: string`

            The call ID of the program item that produced this tool call.

          - `type: "program"`

            - `"program"`

      - `created_by?: string`

        The ID of the entity that created this tool call output.

      - `output?: string | null`

        Optional textual output returned by the apply patch tool.

    - `McpCall`

      An invocation of a tool on an MCP server.

      - `id: string`

        The unique ID of the tool call.

      - `arguments: string`

        A JSON string of the arguments passed to the tool.

      - `name: string`

        The name of the tool that was run.

      - `server_label: string`

        The label of the MCP server running the tool.

      - `type: "mcp_call"`

        The type of the item. Always `mcp_call`.

        - `"mcp_call"`

      - `agent?: Agent | null`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

      - `approval_request_id?: string | null`

        Unique identifier for the MCP tool call approval request.
        Include this value in a subsequent `mcp_approval_response` input to approve or reject the corresponding tool call.

      - `error?: BetaMcpToolCallError | null`

        The error from the tool call, if any.

      - `output?: string | null`

        The output from the tool call.

      - `status?: "in_progress" | "completed" | "incomplete" | 2 more`

        The status of the tool call. One of `in_progress`, `completed`, `incomplete`, `calling`, or `failed`.

        - `"in_progress"`

        - `"completed"`

        - `"incomplete"`

        - `"calling"`

        - `"failed"`

    - `McpListTools`

      A list of tools available on an MCP server.

      - `id: string`

        The unique ID of the list.

      - `server_label: string`

        The label of the MCP server.

      - `tools: Array<Tool>`

        The tools available on the server.

        - `input_schema: unknown`

          The JSON schema describing the tool's input.

        - `name: string`

          The name of the tool.

        - `annotations?: unknown`

          Additional annotations about the tool.

        - `description?: string | null`

          The description of the tool.

      - `type: "mcp_list_tools"`

        The type of the item. Always `mcp_list_tools`.

        - `"mcp_list_tools"`

      - `agent?: Agent | null`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

      - `error?: string | null`

        Error message if the server could not list tools.

    - `McpApprovalRequest`

      A request for human approval of a tool invocation.

      - `id: string`

        The unique ID of the approval request.

      - `arguments: string`

        A JSON string of arguments for the tool.

      - `name: string`

        The name of the tool to run.

      - `server_label: string`

        The label of the MCP server making the request.

      - `type: "mcp_approval_request"`

        The type of the item. Always `mcp_approval_request`.

        - `"mcp_approval_request"`

      - `agent?: Agent | null`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

    - `McpApprovalResponse`

      A response to an MCP approval request.

      - `id: string`

        The unique ID of the approval response

      - `approval_request_id: string`

        The ID of the approval request being answered.

      - `approve: boolean`

        Whether the request was approved.

      - `type: "mcp_approval_response"`

        The type of the item. Always `mcp_approval_response`.

        - `"mcp_approval_response"`

      - `agent?: Agent | null`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

      - `reason?: string | null`

        Optional reason for the decision.

    - `BetaResponseCustomToolCall`

      A call to a custom tool created by the model.

    - `BetaResponseCustomToolCallOutputItem extends BetaResponseCustomToolCallOutput`

      The output of a custom tool call from your code, being sent back to the model.

      - `id: string`

        The unique ID of the custom tool call output item.

      - `status: "in_progress" | "completed" | "incomplete"`

        The status of the item. One of `in_progress`, `completed`, or
        `incomplete`. Populated when items are returned via API.

        - `"in_progress"`

        - `"completed"`

        - `"incomplete"`

      - `created_by?: string`

        The identifier of the actor that created the item.

  - `parallel_tool_calls: boolean`

    Whether to allow the model to run tool calls in parallel.

  - `temperature: number | null`

    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.

  - `tool_choice: BetaToolChoiceOptions | BetaToolChoiceAllowed | BetaToolChoiceTypes | 6 more`

    How the model should select which tool (or tools) to use when generating
    a response. See the `tools` parameter to see how to specify which tools
    the model can call.

    - `BetaToolChoiceOptions = "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.

      - `"none"`

      - `"auto"`

      - `"required"`

    - `BetaToolChoiceAllowed`

      Constrains the tools available to the model to a pre-defined set.

      - `mode: "auto" | "required"`

        Constrains the tools available to the model to a pre-defined set.

        `auto` allows the model to pick from among the allowed tools and generate a
        message.

        `required` requires the model to call one or more of the allowed tools.

        - `"auto"`

        - `"required"`

      - `tools: Array<Record<string, unknown>>`

        A list of tool definitions that the model should be allowed to call.

        For the Responses API, the list of tool definitions might look like:

        ```json
        [
          { "type": "function", "name": "get_weather" },
          { "type": "mcp", "server_label": "deepwiki" },
          { "type": "image_generation" }
        ]
        ```

      - `type: "allowed_tools"`

        Allowed tool configuration type. Always `allowed_tools`.

        - `"allowed_tools"`

    - `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" | 5 more`

        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`

        - `"file_search"`

        - `"web_search_preview"`

        - `"computer"`

        - `"computer_use_preview"`

        - `"computer_use"`

        - `"web_search_preview_2025_03_11"`

        - `"image_generation"`

        - `"code_interpreter"`

    - `BetaToolChoiceFunction`

      Use this option to force the model to call a specific function.

      - `name: string`

        The name of the function to call.

      - `type: "function"`

        For function calling, the type is always `function`.

        - `"function"`

    - `BetaToolChoiceMcp`

      Use this option to force the model to call a specific tool on a remote MCP server.

      - `server_label: string`

        The label of the MCP server to use.

      - `type: "mcp"`

        For MCP tools, the type is always `mcp`.

        - `"mcp"`

      - `name?: string | null`

        The name of the tool to call on the server.

    - `BetaToolChoiceCustom`

      Use this option to force the model to call a specific custom tool.

      - `name: string`

        The name of the custom tool to call.

      - `type: "custom"`

        For custom tool calling, the type is always `custom`.

        - `"custom"`

    - `BetaSpecificProgrammaticToolCallingParam`

      - `type: "programmatic_tool_calling"`

        The tool to call. Always `programmatic_tool_calling`.

        - `"programmatic_tool_calling"`

    - `BetaToolChoiceApplyPatch`

      Forces the model to call the apply_patch tool when executing a tool call.

      - `type: "apply_patch"`

        The tool to call. Always `apply_patch`.

        - `"apply_patch"`

    - `BetaToolChoiceShell`

      Forces the model to call the shell tool when a tool call is required.

      - `type: "shell"`

        The tool to call. Always `shell`.

        - `"shell"`

  - `tools: Array<BetaTool>`

    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.

    - `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).

    - `Mcp`

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

    - `CodeInterpreter`

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

    - `ProgrammaticToolCalling`

    - `ImageGeneration`

      A tool that generates images using the GPT image models.

    - `LocalShell`

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

    - `BetaFunctionShellTool`

      A tool that allows the model to execute shell commands.

    - `BetaCustomTool`

      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)

    - `BetaNamespaceTool`

      Groups function/custom tools under a shared namespace.

    - `BetaToolSearchTool`

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

    - `BetaApplyPatchTool`

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

  - `top_p: number | null`

    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.

  - `background?: boolean | null`

    Whether to run the model response in the background.
    [Learn more](https://platform.openai.com/docs/guides/background).

  - `completed_at?: number | null`

    Unix timestamp (in seconds) of when this Response was completed.
    Only present when the status is `completed`.

  - `conversation?: Conversation | null`

    The conversation that this response belonged to. Input items and output items from this response were automatically added to this conversation.

    - `id: string`

      The unique ID of the conversation that this response was associated with.

  - `max_output_tokens?: number | null`

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

  - `max_tool_calls?: number | null`

    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.

  - `moderation?: Moderation | null`

    Moderation results for the response input and output, if moderated completions were requested.

    - `input: ModerationResult | Error`

      Moderation for the response input.

      - `ModerationResult`

        A moderation result produced for the response input or output.

        - `categories: Record<string, boolean>`

          A dictionary of moderation categories to booleans, True if the input is flagged under this category.

        - `category_applied_input_types: Record<string, Array<"text" | "image">>`

          Which modalities of input are reflected by the score for each category.

          - `"text"`

          - `"image"`

        - `category_scores: Record<string, number>`

          A dictionary of moderation categories to scores.

        - `flagged: boolean`

          A boolean indicating whether the content was flagged by any category.

        - `model: string`

          The moderation model that produced this result.

        - `type: "moderation_result"`

          The object type, which was always `moderation_result` for successful moderation results.

          - `"moderation_result"`

      - `Error`

        An error produced while attempting moderation for the response input or output.

        - `code: string`

          The error code.

        - `message: string`

          The error message.

        - `type: "error"`

          The object type, which was always `error` for moderation failures.

          - `"error"`

    - `output: ModerationResult | Error`

      Moderation for the response output.

      - `ModerationResult`

        A moderation result produced for the response input or output.

        - `categories: Record<string, boolean>`

          A dictionary of moderation categories to booleans, True if the input is flagged under this category.

        - `category_applied_input_types: Record<string, Array<"text" | "image">>`

          Which modalities of input are reflected by the score for each category.

          - `"text"`

          - `"image"`

        - `category_scores: Record<string, number>`

          A dictionary of moderation categories to scores.

        - `flagged: boolean`

          A boolean indicating whether the content was flagged by any category.

        - `model: string`

          The moderation model that produced this result.

        - `type: "moderation_result"`

          The object type, which was always `moderation_result` for successful moderation results.

          - `"moderation_result"`

      - `Error`

        An error produced while attempting moderation for the response input or output.

        - `code: string`

          The error code.

        - `message: string`

          The error message.

        - `type: "error"`

          The object type, which was always `error` for moderation failures.

          - `"error"`

  - `previous_response_id?: string | null`

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

  - `prompt?: BetaResponsePrompt | null`

    Reference to a prompt template and its variables.
    [Learn more](https://platform.openai.com/docs/guides/text?api-mode=responses#reusable-prompts).

    - `id: string`

      The unique identifier of the prompt template to use.

    - `variables?: Record<string, string | BetaResponseInputText | BetaResponseInputImage | BetaResponseInputFile> | null`

      Optional map of values to substitute in for variables in your
      prompt. The substitution values can either be strings, or other
      Response input types like images or files.

      - `string`

      - `BetaResponseInputText`

        A text input to the model.

      - `BetaResponseInputImage`

        An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision).

      - `BetaResponseInputFile`

        A file input to the model.

    - `version?: string | null`

      Optional version of the prompt template.

  - `prompt_cache_key?: string | null`

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

  - `prompt_cache_options?: PromptCacheOptions`

    The prompt-caching options that were applied to the response. Supported for `gpt-5.6` and later models.

    - `mode: "implicit" | "explicit"`

      Whether implicit prompt-cache breakpoints were enabled.

      - `"implicit"`

      - `"explicit"`

    - `ttl: "30m"`

      The minimum lifetime applied to each cache breakpoint.

      - `"30m"`

  - `prompt_cache_retention?: "in_memory" | "24h" | null`

    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.

    - `"in_memory"`

    - `"24h"`

  - `reasoning?: Reasoning | null`

    **gpt-5 and o-series models only**

    Configuration options for
    [reasoning models](https://platform.openai.com/docs/guides/reasoning).

    - `context?: "auto" | "current_turn" | "all_turns" | null`

      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.

      - `"auto"`

      - `"current_turn"`

      - `"all_turns"`

    - `effort?: "none" | "minimal" | "low" | 4 more | null`

      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.

      - `"none"`

      - `"minimal"`

      - `"low"`

      - `"medium"`

      - `"high"`

      - `"xhigh"`

      - `"max"`

    - `generate_summary?: "auto" | "concise" | "detailed" | null`

      **Deprecated:** use `summary` instead.

      A summary of the reasoning performed by the model. This can be
      useful for debugging and understanding the model's reasoning process.
      One of `auto`, `concise`, or `detailed`.

      - `"auto"`

      - `"concise"`

      - `"detailed"`

    - `mode?: (string & {}) | "standard" | "pro"`

      Controls the reasoning execution mode for the request.

      When returned on a response, this is the effective execution mode.

      - `(string & {})`

      - `"standard" | "pro"`

        - `"standard"`

        - `"pro"`

    - `summary?: "auto" | "concise" | "detailed" | null`

      A summary of the reasoning performed by the model. This can be
      useful for debugging and understanding the model's reasoning process.
      One of `auto`, `concise`, or `detailed`.

      `concise` is supported for `computer-use-preview` models and all reasoning models after `gpt-5`.

      - `"auto"`

      - `"concise"`

      - `"detailed"`

  - `safety_identifier?: string | null`

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

  - `service_tier?: BetaServiceTier | null`

    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.
    - If set to 'ultrafast', then the request will be processed with the access-controlled Ultrafast Processing service tier. This tier is currently available for `gpt-5.6-sol`; a response served through it will show `service_tier=ultrafast`.
    - When not set, the default behavior is 'auto'.

    When the `service_tier` parameter is set, the response body will include the `service_tier` value based on the processing mode actually used to serve the request. This response value may be different from the value set in the parameter.

    - `"auto"`

    - `"default"`

    - `"flex"`

    - `"scale"`

    - `"priority"`

    - `"fast"`

    - `"ultrafast"`

  - `status?: BetaResponseStatus`

    The status of the response generation. One of `completed`, `failed`,
    `in_progress`, `cancelled`, `queued`, or `incomplete`.

    - `"completed"`

    - `"failed"`

    - `"in_progress"`

    - `"cancelled"`

    - `"queued"`

    - `"incomplete"`

  - `text?: BetaResponseTextConfig`

    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?: BetaResponseFormatTextConfig`

      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.

      - `Text`

        Default response format. Used to generate text responses.

        - `type: "text"`

          The type of response format being defined. Always `text`.

          - `"text"`

      - `BetaResponseFormatTextJSONSchemaConfig`

        JSON Schema response format. Used to generate structured JSON responses.
        Learn more about [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs).

        - `name: string`

          The name of the response format. Must be a-z, A-Z, 0-9, or contain
          underscores and dashes, with a maximum length of 64.

        - `schema: Record<string, unknown>`

          The schema for the response format, described as a JSON Schema object.
          Learn how to build JSON schemas [here](https://json-schema.org/).

        - `type: "json_schema"`

          The type of response format being defined. Always `json_schema`.

          - `"json_schema"`

        - `description?: string`

          A description of what the response format is for, used by the model to
          determine how to respond in the format.

        - `strict?: boolean | null`

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

      - `JSONObject`

        JSON object response format. An older method of generating JSON responses.
        Using `json_schema` is recommended for models that support it. Note that the
        model will not generate JSON without a system or user message instructing it
        to do so.

        - `type: "json_object"`

          The type of response format being defined. Always `json_object`.

          - `"json_object"`

    - `verbosity?: "low" | "medium" | "high" | null`

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

      - `"low"`

      - `"medium"`

      - `"high"`

  - `top_logprobs?: number | null`

    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.

  - `truncation?: "auto" | "disabled" | null`

    The truncation strategy to use for the model response.

    - `auto`: If the input to this Response exceeds
      the model's context window size, the model will truncate the
      response to fit the context window by dropping items from the beginning of the conversation.
    - `disabled` (default): If the input size will exceed the context window
      size for a model, the request will fail with a 400 error.

    - `"auto"`

    - `"disabled"`

  - `usage?: BetaResponseUsage`

    Represents token usage details including input tokens, output tokens,
    a breakdown of output tokens, and the total tokens used.

    - `input_tokens: number`

      The number of input tokens.

    - `input_tokens_details: InputTokensDetails`

      A detailed breakdown of the input tokens.

      - `cache_write_tokens: number`

        The number of input tokens that were written to the cache.

      - `cached_tokens: number`

        The number of tokens that were retrieved from the cache.
        [More on prompt caching](https://platform.openai.com/docs/guides/prompt-caching).

    - `output_tokens: number`

      The number of output tokens.

    - `output_tokens_details: OutputTokensDetails`

      A detailed breakdown of the output tokens.

      - `reasoning_tokens: number`

        The number of reasoning tokens.

    - `total_tokens: number`

      The total number of tokens used.

  - `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).

### Example

```typescript
import OpenAI from 'openai';

const client = new OpenAI({
  apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
});

const betaResponse = await client.beta.responses.cancel('resp_677efb5139a88190b512bc3fef8e535d');

console.log(betaResponse.id);
```

#### Response

```json
{
  "id": "id",
  "created_at": 0,
  "error": {
    "code": "server_error",
    "message": "message"
  },
  "incomplete_details": {
    "reason": "max_output_tokens"
  },
  "instructions": "string",
  "metadata": {
    "foo": "string"
  },
  "model": "gpt-5.1",
  "object": "response",
  "output": [
    {
      "id": "id",
      "content": [
        {
          "annotations": [
            {
              "file_id": "file_id",
              "filename": "filename",
              "index": 0,
              "type": "file_citation"
            }
          ],
          "text": "text",
          "type": "output_text",
          "logprobs": [
            {
              "token": "token",
              "bytes": [
                0
              ],
              "logprob": 0,
              "top_logprobs": [
                {
                  "token": "token",
                  "bytes": [
                    0
                  ],
                  "logprob": 0
                }
              ]
            }
          ]
        }
      ],
      "role": "assistant",
      "status": "in_progress",
      "type": "message",
      "agent": {
        "agent_name": "agent_name"
      },
      "phase": "commentary"
    }
  ],
  "parallel_tool_calls": true,
  "temperature": 1,
  "tool_choice": "none",
  "tools": [
    {
      "name": "name",
      "parameters": {
        "foo": "bar"
      },
      "strict": true,
      "type": "function",
      "allowed_callers": [
        "direct"
      ],
      "defer_loading": true,
      "description": "description",
      "output_schema": {
        "foo": "bar"
      }
    }
  ],
  "top_p": 1,
  "background": true,
  "completed_at": 0,
  "conversation": {
    "id": "id"
  },
  "max_output_tokens": 0,
  "max_tool_calls": 0,
  "moderation": {
    "input": {
      "categories": {
        "foo": true
      },
      "category_applied_input_types": {
        "foo": [
          "text"
        ]
      },
      "category_scores": {
        "foo": 0
      },
      "flagged": true,
      "model": "model",
      "type": "moderation_result"
    },
    "output": {
      "categories": {
        "foo": true
      },
      "category_applied_input_types": {
        "foo": [
          "text"
        ]
      },
      "category_scores": {
        "foo": 0
      },
      "flagged": true,
      "model": "model",
      "type": "moderation_result"
    }
  },
  "output_text": "output_text",
  "previous_response_id": "previous_response_id",
  "prompt": {
    "id": "id",
    "variables": {
      "foo": "string"
    },
    "version": "version"
  },
  "prompt_cache_key": "prompt-cache-key-1234",
  "prompt_cache_options": {
    "mode": "implicit",
    "ttl": "30m"
  },
  "prompt_cache_retention": "in_memory",
  "reasoning": {
    "context": "auto",
    "effort": "none",
    "generate_summary": "auto",
    "mode": "standard",
    "summary": "auto"
  },
  "safety_identifier": "safety-identifier-1234",
  "service_tier": "auto",
  "status": "completed",
  "text": {
    "format": {
      "type": "text"
    },
    "verbosity": "low"
  },
  "top_logprobs": 0,
  "truncation": "auto",
  "usage": {
    "input_tokens": 0,
    "input_tokens_details": {
      "cache_write_tokens": 0,
      "cached_tokens": 0
    },
    "output_tokens": 0,
    "output_tokens_details": {
      "reasoning_tokens": 0
    },
    "total_tokens": 0
  },
  "user": "user-1234"
}
```

### Example

```typescript
import OpenAI from "openai";
const client = new OpenAI();

const response = await client.responses.cancel("resp_123");
console.log(response);
```

#### Response

```json
{
  "id": "resp_67cb71b351908190a308f3859487620d06981a8637e6bc44",
  "object": "response",
  "created_at": 1741386163,
  "status": "cancelled",
  "background": true,
  "completed_at": null,
  "error": null,
  "incomplete_details": null,
  "instructions": null,
  "max_output_tokens": null,
  "model": "gpt-4o-2024-08-06",
  "output": [
    {
      "type": "message",
      "id": "msg_67cb71b3c2b0819084d481baaaf148f206981a8637e6bc44",
      "status": "in_progress",
      "role": "assistant",
      "content": [
        {
          "type": "output_text",
          "text": "Silent circuits hum,  \nThoughts emerge in data streams—  \nDigital dawn breaks.",
          "annotations": []
        }
      ]
    }
  ],
  "parallel_tool_calls": true,
  "previous_response_id": null,
  "reasoning": {
    "effort": null,
    "summary": null
  },
  "store": true,
  "temperature": 1.0,
  "text": {
    "format": {
      "type": "text"
    }
  },
  "tool_choice": "auto",
  "tools": [],
  "top_p": 1.0,
  "truncation": "disabled",
  "usage": null,
  "user": null,
  "metadata": {}
}
```

## Compact a response

`client.beta.responses.compact(ResponseCompactParamsparams, RequestOptionsoptions?): BetaCompactedResponse`

**post** `/responses/compact?beta=true`

Compact a conversation. Returns a compacted response object.

Learn when and how to compact long-running conversations in the [conversation state guide](https://platform.openai.com/docs/guides/conversation-state#managing-the-context-window). For ZDR-compatible compaction details, see [Compaction (advanced)](https://platform.openai.com/docs/guides/conversation-state#compaction-advanced).

### Parameters

- `params: ResponseCompactParams`

  - `model: "gpt-5.6-sol" | "gpt-5.6-terra" | "gpt-5.6-luna" | 99 more | (string & {}) | null`

    Body param: Model ID used to generate the response, like `gpt-5` or `o3`. OpenAI offers a wide range of models with different capabilities, performance characteristics, and price points. Refer to the [model guide](https://platform.openai.com/docs/models) to browse and compare available models.

    - `"gpt-5.6-sol" | "gpt-5.6-terra" | "gpt-5.6-luna" | 99 more`

      - `"gpt-5.6-sol"`

      - `"gpt-5.6-terra"`

      - `"gpt-5.6-luna"`

      - `"gpt-5.5"`

      - `"gpt-5.5-2026-04-23"`

      - `"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.5-pro"`

      - `"gpt-5.5-pro-2026-04-23"`

      - `"gpt-5-codex"`

      - `"gpt-5-pro"`

      - `"gpt-5-pro-2025-10-06"`

      - `"gpt-5.1-codex-max"`

      - `"gpt-daybreak-blue-latest"`

      - `"gpt-daybreak-red-latest"`

      - `"gpt-5.6-cyber"`

    - `(string & {})`

  - `input?: string | Array<BetaResponseInputItem> | null`

    Body param: Text, image, or file inputs to the model, used to generate a response

    - `string`

    - `Array<BetaResponseInputItem>`

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

        - `content: string | BetaResponseInputMessageContentList`

          Text, image, or audio input to the model, used to generate a response.
          Can also contain previous assistant responses.

          - `string`

          - `BetaResponseInputMessageContentList = Array<BetaResponseInputContent>`

            A list of one or many input items to the model, containing different content
            types.

            - `BetaResponseInputText`

              A text input to the model.

              - `text: string`

                The text input to the model.

              - `type: "input_text"`

                The type of the input item. Always `input_text`.

                - `"input_text"`

              - `prompt_cache_breakpoint?: PromptCacheBreakpoint`

                Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.

                - `mode: "explicit"`

                  The breakpoint mode. Always `explicit`.

                  - `"explicit"`

            - `BetaResponseInputImage`

              An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision).

              - `detail: BetaImageDetail`

                The detail level of the image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`.

                - `"low"`

                - `"high"`

                - `"auto"`

                - `"original"`

              - `type: "input_image"`

                The type of the input item. Always `input_image`.

                - `"input_image"`

              - `file_id?: string | null`

                The ID of the file to be sent to the model.

              - `image_url?: string | null`

                The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.

              - `prompt_cache_breakpoint?: PromptCacheBreakpoint`

                Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.

                - `mode: "explicit"`

                  The breakpoint mode. Always `explicit`.

                  - `"explicit"`

            - `BetaResponseInputFile`

              A file input to the model.

              - `type: "input_file"`

                The type of the input item. Always `input_file`.

                - `"input_file"`

              - `detail?: "auto" | "low" | "high"`

                The detail level of the file to be sent to the model. Use `auto` to let the system select the detail level; for GPT-5.6 and later models, `auto` uses high-quality rendering, which may increase input token usage. Use `low` for lower-cost rendering, or `high` to render the file at higher quality. Defaults to `auto`.

                - `"auto"`

                - `"low"`

                - `"high"`

              - `file_data?: string`

                The content of the file to be sent to the model.

              - `file_id?: string | null`

                The ID of the file to be sent to the model.

              - `file_url?: string`

                The URL of the file to be sent to the model.

              - `filename?: string`

                The name of the file to be sent to the model.

              - `prompt_cache_breakpoint?: PromptCacheBreakpoint`

                Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.

                - `mode: "explicit"`

                  The breakpoint mode. Always `explicit`.

                  - `"explicit"`

        - `role: "user" | "assistant" | "system" | "developer"`

          The role of the message input. One of `user`, `assistant`, `system`, or
          `developer`.

          - `"user"`

          - `"assistant"`

          - `"system"`

          - `"developer"`

        - `phase?: "commentary" | "final_answer" | null`

          Labels an `assistant` message as intermediate commentary (`commentary`) or the final answer (`final_answer`).
          For models like `gpt-5.3-codex` and beyond, when sending follow-up requests, preserve and resend
          phase on all assistant messages — dropping it can degrade performance. Not used for user messages.

          - `"commentary"`

          - `"final_answer"`

        - `type?: "message"`

          The type of the message input. Always `message`.

          - `"message"`

      - `Message`

        A message input to the model with a role indicating instruction following
        hierarchy. Instructions given with the `developer` or `system` role take
        precedence over instructions given with the `user` role.

        - `content: BetaResponseInputMessageContentList`

          A list of one or many input items to the model, containing different content
          types.

        - `role: "user" | "system" | "developer"`

          The role of the message input. One of `user`, `system`, or `developer`.

          - `"user"`

          - `"system"`

          - `"developer"`

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `status?: "in_progress" | "completed" | "incomplete"`

          The status of item. One of `in_progress`, `completed`, or
          `incomplete`. Populated when items are returned via API.

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

        - `type?: "message"`

          The type of the message input. Always set to `message`.

          - `"message"`

      - `BetaResponseOutputMessage`

        An output message from the model.

        - `id: string`

          The unique ID of the output message.

        - `content: Array<BetaResponseOutputText | BetaResponseOutputRefusal>`

          The content of the output message.

          - `BetaResponseOutputText`

            A text output from the model.

            - `annotations: Array<FileCitation | URLCitation | ContainerFileCitation | FilePath>`

              The annotations of the text output.

              - `FileCitation`

                A citation to a file.

                - `file_id: string`

                  The ID of the file.

                - `filename: string`

                  The filename of the file cited.

                - `index: number`

                  The index of the file in the list of files.

                - `type: "file_citation"`

                  The type of the file citation. Always `file_citation`.

                  - `"file_citation"`

              - `URLCitation`

                A citation for a web resource used to generate a model response.

                - `end_index: number`

                  The index of the last character of the URL citation in the message.

                - `start_index: number`

                  The index of the first character of the URL citation in the message.

                - `title: string`

                  The title of the web resource.

                - `type: "url_citation"`

                  The type of the URL citation. Always `url_citation`.

                  - `"url_citation"`

                - `url: string`

                  The URL of the web resource.

              - `ContainerFileCitation`

                A citation for a container file used to generate a model response.

                - `container_id: string`

                  The ID of the container file.

                - `end_index: number`

                  The index of the last character of the container file citation in the message.

                - `file_id: string`

                  The ID of the file.

                - `filename: string`

                  The filename of the container file cited.

                - `start_index: number`

                  The index of the first character of the container file citation in the message.

                - `type: "container_file_citation"`

                  The type of the container file citation. Always `container_file_citation`.

                  - `"container_file_citation"`

              - `FilePath`

                A path to a file.

                - `file_id: string`

                  The ID of the file.

                - `index: number`

                  The index of the file in the list of files.

                - `type: "file_path"`

                  The type of the file path. Always `file_path`.

                  - `"file_path"`

            - `text: string`

              The text output from the model.

            - `type: "output_text"`

              The type of the output text. Always `output_text`.

              - `"output_text"`

            - `logprobs?: Array<Logprob>`

              - `token: string`

              - `bytes: Array<number>`

              - `logprob: number`

              - `top_logprobs: Array<TopLogprob>`

                - `token: string`

                - `bytes: Array<number>`

                - `logprob: number`

          - `BetaResponseOutputRefusal`

            A refusal from the model.

            - `refusal: string`

              The refusal explanation from the model.

            - `type: "refusal"`

              The type of the refusal. Always `refusal`.

              - `"refusal"`

        - `role: "assistant"`

          The role of the output message. Always `assistant`.

          - `"assistant"`

        - `status: "in_progress" | "completed" | "incomplete"`

          The status of the message input. One of `in_progress`, `completed`, or
          `incomplete`. Populated when input items are returned via API.

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

        - `type: "message"`

          The type of the output message. Always `message`.

          - `"message"`

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `phase?: "commentary" | "final_answer" | null`

          Labels an `assistant` message as intermediate commentary (`commentary`) or the final answer (`final_answer`).
          For models like `gpt-5.3-codex` and beyond, when sending follow-up requests, preserve and resend
          phase on all assistant messages — dropping it can degrade performance. Not used for user messages.

          - `"commentary"`

          - `"final_answer"`

      - `BetaResponseFileSearchToolCall`

        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.

        - `id: string`

          The unique ID of the file search tool call.

        - `queries: Array<string>`

          The queries used to search for files.

        - `status: "in_progress" | "searching" | "completed" | 2 more`

          The status of the file search tool call. One of `in_progress`,
          `searching`, `incomplete` or `failed`,

          - `"in_progress"`

          - `"searching"`

          - `"completed"`

          - `"incomplete"`

          - `"failed"`

        - `type: "file_search_call"`

          The type of the file search tool call. Always `file_search_call`.

          - `"file_search_call"`

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `results?: Array<Result> | null`

          The results of the file search tool call.

          - `attributes?: Record<string, string | number | boolean> | null`

            Set of 16 key-value pairs that can be attached to an object. This can be
            useful for storing additional information about the object in a structured
            format, and querying for objects via API or the dashboard. Keys are strings
            with a maximum length of 64 characters. Values are strings with a maximum
            length of 512 characters, booleans, or numbers.

            - `string`

            - `number`

            - `boolean`

          - `file_id?: string`

            The unique ID of the file.

          - `filename?: string`

            The name of the file.

          - `score?: number`

            The relevance score of the file - a value between 0 and 1.

          - `text?: string`

            The text that was retrieved from the file.

      - `BetaResponseComputerToolCall`

        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.

        - `id: string`

          The unique ID of the computer call.

        - `call_id: string`

          An identifier used when responding to the tool call with output.

        - `pending_safety_checks: Array<PendingSafetyCheck>`

          The pending safety checks for the computer call.

          - `id: string`

            The ID of the pending safety check.

          - `code?: string | null`

            The type of the pending safety check.

          - `message?: string | null`

            Details about the pending safety check.

        - `status: "in_progress" | "completed" | "incomplete"`

          The status of the item. One of `in_progress`, `completed`, or
          `incomplete`. Populated when items are returned via API.

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

        - `type: "computer_call"`

          The type of the computer call. Always `computer_call`.

          - `"computer_call"`

        - `action?: BetaComputerAction`

          A click action.

          - `Click`

            A click action.

            - `button: "left" | "right" | "wheel" | 2 more`

              Indicates which mouse button was pressed during the click. One of `left`, `right`, `wheel`, `back`, or `forward`.

              - `"left"`

              - `"right"`

              - `"wheel"`

              - `"back"`

              - `"forward"`

            - `type: "click"`

              Specifies the event type. For a click action, this property is always `click`.

              - `"click"`

            - `x: number`

              The x-coordinate where the click occurred.

            - `y: number`

              The y-coordinate where the click occurred.

            - `keys?: Array<string> | null`

              The keys being held while clicking.

          - `DoubleClick`

            A double click action.

            - `keys: Array<string> | null`

              The keys being held while double-clicking.

            - `type: "double_click"`

              Specifies the event type. For a double click action, this property is always set to `double_click`.

              - `"double_click"`

            - `x: number`

              The x-coordinate where the double click occurred.

            - `y: number`

              The y-coordinate where the double click occurred.

          - `Drag`

            A drag action.

            - `path: Array<Path>`

              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 }
              ]
              ```

              - `x: number`

                The x-coordinate.

              - `y: number`

                The y-coordinate.

            - `type: "drag"`

              Specifies the event type. For a drag action, this property is always set to `drag`.

              - `"drag"`

            - `keys?: Array<string> | null`

              The keys being held while dragging the mouse.

          - `Keypress`

            A collection of keypresses the model would like to perform.

            - `keys: Array<string>`

              The combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key.

            - `type: "keypress"`

              Specifies the event type. For a keypress action, this property is always set to `keypress`.

              - `"keypress"`

          - `Move`

            A mouse move action.

            - `type: "move"`

              Specifies the event type. For a move action, this property is always set to `move`.

              - `"move"`

            - `x: number`

              The x-coordinate to move to.

            - `y: number`

              The y-coordinate to move to.

            - `keys?: Array<string> | null`

              The keys being held while moving the mouse.

          - `Screenshot`

            A screenshot action.

            - `type: "screenshot"`

              Specifies the event type. For a screenshot action, this property is always set to `screenshot`.

              - `"screenshot"`

          - `Scroll`

            A scroll action.

            - `scroll_x: number`

              The horizontal scroll distance.

            - `scroll_y: number`

              The vertical scroll distance.

            - `type: "scroll"`

              Specifies the event type. For a scroll action, this property is always set to `scroll`.

              - `"scroll"`

            - `x: number`

              The x-coordinate where the scroll occurred.

            - `y: number`

              The y-coordinate where the scroll occurred.

            - `keys?: Array<string> | null`

              The keys being held while scrolling.

          - `Type`

            An action to type in text.

            - `text: string`

              The text to type.

            - `type: "type"`

              Specifies the event type. For a type action, this property is always set to `type`.

              - `"type"`

          - `Wait`

            A wait action.

            - `type: "wait"`

              Specifies the event type. For a wait action, this property is always set to `wait`.

              - `"wait"`

        - `actions?: BetaComputerActionList`

          Flattened batched actions for `computer_use`. Each action includes an
          `type` discriminator and action-specific fields.

          - `Click`

            A click action.

          - `DoubleClick`

            A double click action.

          - `Drag`

            A drag action.

          - `Keypress`

            A collection of keypresses the model would like to perform.

          - `Move`

            A mouse move action.

          - `Screenshot`

            A screenshot action.

          - `Scroll`

            A scroll action.

          - `Type`

            An action to type in text.

          - `Wait`

            A wait action.

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

      - `ComputerCallOutput`

        The output of a computer tool call.

        - `call_id: string`

          The ID of the computer tool call that produced the output.

        - `output: BetaResponseComputerToolCallOutputScreenshot`

          A computer screenshot image used with the computer use tool.

          - `type: "computer_screenshot"`

            Specifies the event type. For a computer screenshot, this property is
            always set to `computer_screenshot`.

            - `"computer_screenshot"`

          - `file_id?: string`

            The identifier of an uploaded file that contains the screenshot.

          - `image_url?: string`

            The URL of the screenshot image.

        - `type: "computer_call_output"`

          The type of the computer tool call output. Always `computer_call_output`.

          - `"computer_call_output"`

        - `id?: string | null`

          The ID of the computer tool call output.

        - `acknowledged_safety_checks?: Array<AcknowledgedSafetyCheck> | null`

          The safety checks reported by the API that have been acknowledged by the developer.

          - `id: string`

            The ID of the pending safety check.

          - `code?: string | null`

            The type of the pending safety check.

          - `message?: string | null`

            Details about the pending safety check.

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

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

          The status of the message input. One of `in_progress`, `completed`, or `incomplete`. Populated when input items are returned via API.

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

      - `BetaResponseFunctionWebSearch`

        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.

        - `id: string`

          The unique ID of the web search tool call.

        - `action: Search | OpenPage | FindInPage`

          An object describing the specific action taken in this web search call.
          Includes details on how the model used the web (search, open_page, find_in_page).

          - `Search`

            Action type "search" - Performs a web search query.

            - `type: "search"`

              The action type.

              - `"search"`

            - `queries?: Array<string>`

              The search queries.

            - `query?: string`

              The search query.

            - `sources?: Array<Source>`

              The sources used in the search.

              - `type: "url"`

                The type of source. Always `url`.

                - `"url"`

              - `url: string`

                The URL of the source.

          - `OpenPage`

            Action type "open_page" - Opens a specific URL from search results.

            - `type: "open_page"`

              The action type.

              - `"open_page"`

            - `url?: string | null`

              The URL opened by the model.

          - `FindInPage`

            Action type "find_in_page": Searches for a pattern within a loaded page.

            - `pattern: string`

              The pattern or text to search for within the page.

            - `type: "find_in_page"`

              The action type.

              - `"find_in_page"`

            - `url: string`

              The URL of the page searched for the pattern.

        - `status: "in_progress" | "searching" | "completed" | "failed"`

          The status of the web search tool call.

          - `"in_progress"`

          - `"searching"`

          - `"completed"`

          - `"failed"`

        - `type: "web_search_call"`

          The type of the web search tool call. Always `web_search_call`.

          - `"web_search_call"`

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

      - `BetaResponseFunctionToolCall`

        A tool call to run a function. See the
        [function calling guide](https://platform.openai.com/docs/guides/function-calling) for more information.

        - `arguments: string`

          A JSON string of the arguments to pass to the function.

        - `call_id: string`

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

        - `name: string`

          The name of the function to run.

        - `type: "function_call"`

          The type of the function tool call. Always `function_call`.

          - `"function_call"`

        - `id?: string`

          The unique ID of the function tool call.

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `caller?: Direct | Program | null`

          The execution context that produced this tool call.

          - `Direct`

            - `type: "direct"`

              - `"direct"`

          - `Program`

            - `caller_id: string`

              The call ID of the program item that produced this tool call.

            - `type: "program"`

              - `"program"`

        - `namespace?: string`

          The namespace of the function to run.

        - `status?: "in_progress" | "completed" | "incomplete"`

          The status of the item. One of `in_progress`, `completed`, or
          `incomplete`. Populated when items are returned via API.

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

      - `FunctionCallOutput`

        The output of a function tool call.

        - `call_id: string`

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

        - `output: string | BetaResponseFunctionCallOutputItemList`

          Text, image, or file output of the function tool call.

          - `string`

          - `BetaResponseFunctionCallOutputItemList = Array<BetaResponseFunctionCallOutputItem>`

            An array of content outputs (text, image, file) for the function tool call.

            - `BetaResponseInputTextContent`

              A text input to the model.

              - `text: string`

                The text input to the model.

              - `type: "input_text"`

                The type of the input item. Always `input_text`.

                - `"input_text"`

              - `prompt_cache_breakpoint?: PromptCacheBreakpoint | null`

                Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.

                - `mode: "explicit"`

                  The breakpoint mode. Always `explicit`.

                  - `"explicit"`

            - `BetaResponseInputImageContent`

              An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision)

              - `type: "input_image"`

                The type of the input item. Always `input_image`.

                - `"input_image"`

              - `detail?: BetaImageDetail | null`

                The detail level of the image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`.

              - `file_id?: string | null`

                The ID of the file to be sent to the model.

              - `image_url?: string | null`

                The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.

              - `prompt_cache_breakpoint?: PromptCacheBreakpoint | null`

                Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.

                - `mode: "explicit"`

                  The breakpoint mode. Always `explicit`.

                  - `"explicit"`

            - `BetaResponseInputFileContent`

              A file input to the model.

              - `type: "input_file"`

                The type of the input item. Always `input_file`.

                - `"input_file"`

              - `detail?: "auto" | "low" | "high"`

                The detail level of the file to be sent to the model. Use `auto` to let the system select the detail level; for GPT-5.6 and later models, `auto` uses high-quality rendering, which may increase input token usage. Use `low` for lower-cost rendering, or `high` to render the file at higher quality. Defaults to `auto`.

                - `"auto"`

                - `"low"`

                - `"high"`

              - `file_data?: string | null`

                The base64-encoded data of the file to be sent to the model.

              - `file_id?: string | null`

                The ID of the file to be sent to the model.

              - `file_url?: string | null`

                The URL of the file to be sent to the model.

              - `filename?: string | null`

                The name of the file to be sent to the model.

              - `prompt_cache_breakpoint?: PromptCacheBreakpoint | null`

                Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.

                - `mode: "explicit"`

                  The breakpoint mode. Always `explicit`.

                  - `"explicit"`

        - `type: "function_call_output"`

          The type of the function tool call output. Always `function_call_output`.

          - `"function_call_output"`

        - `id?: string | null`

          The unique ID of the function tool call output. Populated when this item is returned via API.

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `caller?: Direct | Program | null`

          The execution context that produced this tool call.

          - `Direct`

            - `type: "direct"`

              The caller type. Always `direct`.

              - `"direct"`

          - `Program`

            - `caller_id: string`

              The call ID of the program item that produced this tool call.

            - `type: "program"`

              The caller type. Always `program`.

              - `"program"`

        - `name?: string | null`

          The name of the tool that produced the output.

        - `namespace?: string | null`

          The namespace of the tool that produced the output.

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

          The status of the item. One of `in_progress`, `completed`, or `incomplete`. Populated when items are returned via API.

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

      - `AgentMessage`

        A message routed between agents.

        - `author: string`

          The sending agent identity.

        - `content: Array<BetaResponseInputTextContent | BetaResponseInputImageContent | EncryptedContent>`

          Plaintext, image, or encrypted content sent between agents.

          - `BetaResponseInputTextContent`

            A text input to the model.

          - `BetaResponseInputImageContent`

            An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision)

          - `EncryptedContent`

            Opaque encrypted content that Responses API decrypts inside trusted model execution.

            - `encrypted_content: string`

              Opaque encrypted content.

            - `type: "encrypted_content"`

              The type of the input item. Always `encrypted_content`.

              - `"encrypted_content"`

        - `recipient: string`

          The destination agent identity.

        - `type: "agent_message"`

          The item type. Always `agent_message`.

          - `"agent_message"`

        - `id?: string | null`

          The unique ID of this agent message item.

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

      - `MultiAgentCall`

        - `action: "spawn_agent" | "interrupt_agent" | "list_agents" | 3 more`

          The multi-agent action that was executed.

          - `"spawn_agent"`

          - `"interrupt_agent"`

          - `"list_agents"`

          - `"send_message"`

          - `"followup_task"`

          - `"wait_agent"`

        - `arguments: string`

          The action arguments as a JSON string.

        - `call_id: string`

          The unique ID linking this call to its output.

        - `type: "multi_agent_call"`

          The item type. Always `multi_agent_call`.

          - `"multi_agent_call"`

        - `id?: string | null`

          The unique ID of this multi-agent call.

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

      - `MultiAgentCallOutput`

        - `action: "spawn_agent" | "interrupt_agent" | "list_agents" | 3 more`

          The multi-agent action that produced this result.

          - `"spawn_agent"`

          - `"interrupt_agent"`

          - `"list_agents"`

          - `"send_message"`

          - `"followup_task"`

          - `"wait_agent"`

        - `call_id: string`

          The unique ID of the multi-agent call.

        - `output: Array<Output>`

          Text output returned by the multi-agent action.

          - `text: string`

            The text content.

          - `type: "output_text"`

            The content type. Always `output_text`.

            - `"output_text"`

          - `annotations?: Array<FileCitation | URLCitation | ContainerFileCitation>`

            Citations associated with the text content.

            - `FileCitation`

              - `file_id: string`

                The ID of the file.

              - `filename: string`

                The filename of the file cited.

              - `index: number`

                The index of the file in the list of files.

              - `type: "file_citation"`

                The citation type. Always `file_citation`.

                - `"file_citation"`

            - `URLCitation`

              - `end_index: number`

                The index of the last character of the citation in the message.

              - `start_index: number`

                The index of the first character of the citation in the message.

              - `title: string`

                The title of the cited resource.

              - `type: "url_citation"`

                The citation type. Always `url_citation`.

                - `"url_citation"`

              - `url: string`

                The URL of the cited resource.

            - `ContainerFileCitation`

              - `container_id: string`

                The ID of the container.

              - `end_index: number`

                The index of the last character of the citation in the message.

              - `file_id: string`

                The ID of the container file.

              - `filename: string`

                The filename of the container file cited.

              - `start_index: number`

                The index of the first character of the citation in the message.

              - `type: "container_file_citation"`

                The citation type. Always `container_file_citation`.

                - `"container_file_citation"`

        - `type: "multi_agent_call_output"`

          The item type. Always `multi_agent_call_output`.

          - `"multi_agent_call_output"`

        - `id?: string | null`

          The unique ID of this multi-agent call output.

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

      - `ToolSearchCall`

        - `arguments: unknown`

          The arguments supplied to the tool search call.

        - `type: "tool_search_call"`

          The item type. Always `tool_search_call`.

          - `"tool_search_call"`

        - `id?: string | null`

          The unique ID of this tool search call.

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `call_id?: string | null`

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

        - `execution?: "server" | "client"`

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

          - `"server"`

          - `"client"`

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

          The status of the tool search call.

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

      - `BetaResponseToolSearchOutputItemParam`

        - `tools: Array<BetaTool>`

          The loaded tool definitions returned by the tool search output.

          - `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).

            - `name: string`

              The name of the function to call.

            - `parameters: Record<string, unknown> | null`

              A JSON schema object describing the parameters of the function.

            - `strict: boolean | null`

              Whether strict parameter validation is enforced for this function tool.

            - `type: "function"`

              The type of the function tool. Always `function`.

              - `"function"`

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

              The tool invocation context(s).

              - `"direct"`

              - `"programmatic"`

            - `defer_loading?: boolean`

              Whether this function is deferred and loaded via tool search.

            - `description?: string | null`

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

            - `output_schema?: Record<string, unknown> | null`

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

          - `BetaFileSearchTool`

            A tool that searches for relevant content from uploaded files. Learn more about the [file search tool](https://platform.openai.com/docs/guides/tools-file-search).

            - `type: "file_search"`

              The type of the file search tool. Always `file_search`.

              - `"file_search"`

            - `vector_store_ids: Array<string>`

              The IDs of the vector stores to search.

            - `filters?: ComparisonFilter | CompoundFilter | null`

              A filter to apply.

              - `ComparisonFilter`

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

                - `key: string`

                  The key to compare against the value.

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

                  Specifies the comparison operator: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`, `in`, `nin`.

                  - `eq`: equals
                  - `ne`: not equal
                  - `gt`: greater than
                  - `gte`: greater than or equal
                  - `lt`: less than
                  - `lte`: less than or equal
                  - `in`: in
                  - `nin`: not in

                  - `"eq"`

                  - `"ne"`

                  - `"gt"`

                  - `"gte"`

                  - `"lt"`

                  - `"lte"`

                  - `"in"`

                  - `"nin"`

                - `value: string | number | boolean | Array<string | number>`

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

                  - `string`

                  - `number`

                  - `boolean`

                  - `Array<string | number>`

                    - `string`

                    - `number`

              - `CompoundFilter`

                Combine multiple filters using `and` or `or`.

                - `filters: Array<ComparisonFilter | unknown>`

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

                  - `ComparisonFilter`

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

                    - `key: string`

                      The key to compare against the value.

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

                      Specifies the comparison operator: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`, `in`, `nin`.

                      - `eq`: equals
                      - `ne`: not equal
                      - `gt`: greater than
                      - `gte`: greater than or equal
                      - `lt`: less than
                      - `lte`: less than or equal
                      - `in`: in
                      - `nin`: not in

                      - `"eq"`

                      - `"ne"`

                      - `"gt"`

                      - `"gte"`

                      - `"lt"`

                      - `"lte"`

                      - `"in"`

                      - `"nin"`

                    - `value: string | number | boolean | Array<string | number>`

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

                      - `string`

                      - `number`

                      - `boolean`

                      - `Array<string | number>`

                        - `string`

                        - `number`

                  - `unknown`

                - `type: "and" | "or"`

                  Type of operation: `and` or `or`.

                  - `"and"`

                  - `"or"`

            - `max_num_results?: number`

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

            - `ranking_options?: RankingOptions`

              Ranking options for search.

              - `hybrid_search?: HybridSearch`

                Weights that control how reciprocal rank fusion balances semantic embedding matches versus sparse keyword matches when hybrid search is enabled.

                - `embedding_weight: number`

                  The weight of the embedding in the reciprocal ranking fusion.

                - `text_weight: number`

                  The weight of the text in the reciprocal ranking fusion.

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

                The ranker to use for the file search.

                - `"auto"`

                - `"default-2024-11-15"`

              - `score_threshold?: number`

                The score threshold for the file search, a number between 0 and 1. Numbers closer to 1 will attempt to return only the most relevant results, but may return fewer results.

          - `BetaComputerTool`

            A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use).

            - `type: "computer"`

              The type of the computer tool. Always `computer`.

              - `"computer"`

          - `BetaComputerUsePreviewTool`

            A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use).

            - `display_height: number`

              The height of the computer display.

            - `display_width: number`

              The width of the computer display.

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

              The type of computer environment to control.

              - `"windows"`

              - `"mac"`

              - `"linux"`

              - `"ubuntu"`

              - `"browser"`

            - `type: "computer_use_preview"`

              The type of the computer use tool. Always `computer_use_preview`.

              - `"computer_use_preview"`

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

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

              - `"web_search"`

              - `"web_search_2025_08_26"`

            - `external_web_access?: boolean`

              Allow live internet access for web search. Defaults to true when omitted. When false, the web search tool runs in offline/cache-only mode and will not fetch new external content.

            - `filters?: Filters | null`

              Filters for the search.

              - `allowed_domains?: Array<string> | null`

                Allowed domains for the search. If not provided, all domains are allowed.
                Subdomains of the provided domains are allowed as well.

                Example: `["pubmed.ncbi.nlm.nih.gov"]`

            - `search_context_size?: "low" | "medium" | "high"`

              High level guidance for the amount of context window space to use for the search. One of `low`, `medium`, or `high`. `medium` is the default.

              - `"low"`

              - `"medium"`

              - `"high"`

            - `user_location?: UserLocation | null`

              The approximate location of the user.

              - `city?: string | null`

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

              - `country?: string | null`

                The two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of the user, e.g. `US`.

              - `region?: string | null`

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

              - `timezone?: string | null`

                The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of the user, e.g. `America/Los_Angeles`.

              - `type?: "approximate"`

                The type of location approximation. Always `approximate`.

                - `"approximate"`

          - `Mcp`

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

            - `server_label: string`

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

            - `type: "mcp"`

              The type of the MCP tool. Always `mcp`.

              - `"mcp"`

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

              The tool invocation context(s).

              - `"direct"`

              - `"programmatic"`

            - `allowed_tools?: Array<string> | McpToolFilter | null`

              List of allowed tool names or a filter object.

              - `Array<string>`

              - `McpToolFilter`

                A filter object to specify which tools are allowed.

                - `read_only?: boolean`

                  Indicates whether or not a tool modifies data or is read-only. If an
                  MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint),
                  it will match this filter.

                - `tool_names?: Array<string>`

                  List of allowed tool names.

            - `authorization?: string`

              An OAuth access token that can be used with a remote MCP server, either
              with a custom MCP server URL or a service connector. Your application
              must handle the OAuth authorization flow and provide the token here.

            - `connector_id?: "connector_dropbox" | "connector_gmail" | "connector_googlecalendar" | 5 more`

              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`

              - `"connector_dropbox"`

              - `"connector_gmail"`

              - `"connector_googlecalendar"`

              - `"connector_googledrive"`

              - `"connector_microsoftteams"`

              - `"connector_outlookcalendar"`

              - `"connector_outlookemail"`

              - `"connector_sharepoint"`

            - `defer_loading?: boolean`

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

            - `headers?: Record<string, string> | null`

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

            - `require_approval?: McpToolApprovalFilter | "always" | "never" | null`

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

              - `McpToolApprovalFilter`

                Specify which of the MCP server's tools require approval. Can be
                `always`, `never`, or a filter object associated with tools
                that require approval.

                - `always?: Always`

                  A filter object to specify which tools are allowed.

                  - `read_only?: boolean`

                    Indicates whether or not a tool modifies data or is read-only. If an
                    MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint),
                    it will match this filter.

                  - `tool_names?: Array<string>`

                    List of allowed tool names.

                - `never?: Never`

                  A filter object to specify which tools are allowed.

                  - `read_only?: boolean`

                    Indicates whether or not a tool modifies data or is read-only. If an
                    MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint),
                    it will match this filter.

                  - `tool_names?: Array<string>`

                    List of allowed tool names.

              - `"always" | "never"`

                - `"always"`

                - `"never"`

            - `server_description?: string`

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

            - `server_url?: string`

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

            - `tunnel_id?: string`

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

          - `CodeInterpreter`

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

            - `container: string | CodeInterpreterToolAuto`

              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`

              - `CodeInterpreterToolAuto`

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

                - `type: "auto"`

                  Always `auto`.

                  - `"auto"`

                - `file_ids?: Array<string>`

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

                - `memory_limit?: "1g" | "4g" | "16g" | "64g" | null`

                  The memory limit for the code interpreter container.

                  - `"1g"`

                  - `"4g"`

                  - `"16g"`

                  - `"64g"`

                - `network_policy?: BetaContainerNetworkPolicyDisabled | BetaContainerNetworkPolicyAllowlist`

                  Network access policy for the container.

                  - `BetaContainerNetworkPolicyDisabled`

                    - `type: "disabled"`

                      Disable outbound network access. Always `disabled`.

                      - `"disabled"`

                  - `BetaContainerNetworkPolicyAllowlist`

                    - `allowed_domains: Array<string>`

                      A list of allowed domains when type is `allowlist`.

                    - `type: "allowlist"`

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

                      - `"allowlist"`

                    - `domain_secrets?: Array<BetaContainerNetworkPolicyDomainSecret>`

                      Optional domain-scoped secrets for allowlisted domains.

                      - `domain: string`

                        The domain associated with the secret.

                      - `name: string`

                        The name of the secret to inject for the domain.

                      - `value: string`

                        The secret value to inject for the domain.

            - `type: "code_interpreter"`

              The type of the code interpreter tool. Always `code_interpreter`.

              - `"code_interpreter"`

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

              The tool invocation context(s).

              - `"direct"`

              - `"programmatic"`

          - `ProgrammaticToolCalling`

            - `type: "programmatic_tool_calling"`

              The type of the tool. Always `programmatic_tool_calling`.

              - `"programmatic_tool_calling"`

          - `ImageGeneration`

            A tool that generates images using the GPT image models.

            - `type: "image_generation"`

              The type of the image generation tool. Always `image_generation`.

              - `"image_generation"`

            - `action?: "generate" | "edit" | "auto"`

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

              - `"generate"`

              - `"edit"`

              - `"auto"`

            - `background?: "transparent" | "opaque" | "auto"`

              Allows to set transparency for the background of the generated image(s).
              Must be one of `transparent`, `opaque`, or `auto` (default value). When
              `auto` is used, the model will automatically determine the best
              background for the image.

              Transparent backgrounds are available for supported GPT Image models.
              For `gpt-image-2` and `gpt-image-2-2026-04-21`, this support is in
              preview. When using `transparent`, set the output format to `png` or
              `webp`.

              - `"transparent"`

              - `"opaque"`

              - `"auto"`

            - `input_fidelity?: "high" | "low" | null`

              Control how much effort the model will exert to match the style and features, especially facial features, of input images. This parameter is only supported for `gpt-image-1` and `gpt-image-1.5` and later models, unsupported for `gpt-image-1-mini`. Supports `high` and `low`. Defaults to `low`.

              - `"high"`

              - `"low"`

            - `input_image_mask?: InputImageMask`

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

              - `file_id?: string`

                File ID for the mask image.

              - `image_url?: string`

                Base64-encoded mask image.

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

              The image generation model to use. One of `gpt-image-1`,
              `gpt-image-1-mini`, `gpt-image-1.5`, `gpt-image-2`,
              `gpt-image-2-2026-04-21`, or `chatgpt-image-latest`. Default:
              `gpt-image-1`.

              - `(string & {})`

              - `"gpt-image-1" | "gpt-image-1-mini" | "gpt-image-2" | 3 more`

                - `"gpt-image-1"`

                - `"gpt-image-1-mini"`

                - `"gpt-image-2"`

                - `"gpt-image-2-2026-04-21"`

                - `"gpt-image-1.5"`

                - `"chatgpt-image-latest"`

            - `moderation?: "auto" | "low"`

              Moderation level for the generated image. Default: `auto`.

              - `"auto"`

              - `"low"`

            - `output_compression?: number`

              Compression level for the output image. Default: 100.

            - `output_format?: "png" | "webp" | "jpeg"`

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

              - `"png"`

              - `"webp"`

              - `"jpeg"`

            - `partial_images?: number`

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

            - `quality?: "low" | "medium" | "high" | "auto"`

              The quality of the generated image. One of `low`, `medium`, `high`,
              or `auto`. Default: `auto`.

              - `"low"`

              - `"medium"`

              - `"high"`

              - `"auto"`

            - `size?: (string & {}) | "1024x1024" | "1024x1536" | "1536x1024" | "auto"`

              The size of the generated images. For `gpt-image-2` and `gpt-image-2-2026-04-21`, arbitrary resolutions are supported as `WIDTHxHEIGHT` strings, for example `1536x864`. Width and height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above `2560x1440` are experimental, and the maximum supported resolution is `3840x2160`. The requested size must also satisfy the model's current pixel and edge limits. The standard sizes `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models; `auto` is supported for models that allow automatic sizing. For `dall-e-2`, use one of `256x256`, `512x512`, or `1024x1024`. For `dall-e-3`, use one of `1024x1024`, `1792x1024`, or `1024x1792`.

              - `(string & {})`

              - `"1024x1024" | "1024x1536" | "1536x1024" | "auto"`

                - `"1024x1024"`

                - `"1024x1536"`

                - `"1536x1024"`

                - `"auto"`

          - `LocalShell`

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

            - `type: "local_shell"`

              The type of the local shell tool. Always `local_shell`.

              - `"local_shell"`

          - `BetaFunctionShellTool`

            A tool that allows the model to execute shell commands.

            - `type: "shell"`

              The type of the shell tool. Always `shell`.

              - `"shell"`

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

              The tool invocation context(s).

              - `"direct"`

              - `"programmatic"`

            - `environment?: BetaContainerAuto | BetaLocalEnvironment | BetaContainerReference | null`

              - `BetaContainerAuto`

                - `type: "container_auto"`

                  Automatically creates a container for this request

                  - `"container_auto"`

                - `file_ids?: Array<string>`

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

                - `memory_limit?: "1g" | "4g" | "16g" | "64g" | null`

                  The memory limit for the container.

                  - `"1g"`

                  - `"4g"`

                  - `"16g"`

                  - `"64g"`

                - `network_policy?: BetaContainerNetworkPolicyDisabled | BetaContainerNetworkPolicyAllowlist`

                  Network access policy for the container.

                  - `BetaContainerNetworkPolicyDisabled`

                  - `BetaContainerNetworkPolicyAllowlist`

                - `skills?: Array<BetaSkillReference | BetaInlineSkill>`

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

                  - `BetaSkillReference`

                    - `skill_id: string`

                      The ID of the referenced skill.

                    - `type: "skill_reference"`

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

                      - `"skill_reference"`

                    - `version?: string`

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

                  - `BetaInlineSkill`

                    - `description: string`

                      The description of the skill.

                    - `name: string`

                      The name of the skill.

                    - `source: BetaInlineSkillSource`

                      Inline skill payload

                      - `data: string`

                        Base64-encoded skill zip bundle.

                      - `media_type: "application/zip"`

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

                        - `"application/zip"`

                      - `type: "base64"`

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

                        - `"base64"`

                    - `type: "inline"`

                      Defines an inline skill for this request.

                      - `"inline"`

              - `BetaLocalEnvironment`

                - `type: "local"`

                  Use a local computer environment.

                  - `"local"`

                - `skills?: Array<BetaLocalSkill>`

                  An optional list of skills.

                  - `description: string`

                    The description of the skill.

                  - `name: string`

                    The name of the skill.

                  - `path: string`

                    The path to the directory containing the skill.

              - `BetaContainerReference`

                - `container_id: string`

                  The ID of the referenced container.

                - `type: "container_reference"`

                  References a container created with the /v1/containers endpoint

                  - `"container_reference"`

          - `BetaCustomTool`

            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)

            - `name: string`

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

            - `type: "custom"`

              The type of the custom tool. Always `custom`.

              - `"custom"`

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

              The tool invocation context(s).

              - `"direct"`

              - `"programmatic"`

            - `defer_loading?: boolean`

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

            - `description?: string`

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

            - `format?: Text | Grammar`

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

              - `Text`

                Unconstrained free-form text.

                - `type: "text"`

                  Unconstrained text format. Always `text`.

                  - `"text"`

              - `Grammar`

                A grammar defined by the user.

                - `definition: string`

                  The grammar definition.

                - `syntax: "lark" | "regex"`

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

                  - `"lark"`

                  - `"regex"`

                - `type: "grammar"`

                  Grammar format. Always `grammar`.

                  - `"grammar"`

          - `BetaNamespaceTool`

            Groups function/custom tools under a shared namespace.

            - `description: string`

              A description of the namespace shown to the model.

            - `name: string`

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

            - `tools: Array<Function | BetaCustomTool>`

              The function/custom tools available inside this namespace.

              - `Function`

                - `name: string`

                - `type: "function"`

                  - `"function"`

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

                  The tool invocation context(s).

                  - `"direct"`

                  - `"programmatic"`

                - `defer_loading?: boolean`

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

                - `description?: string | null`

                - `output_schema?: Record<string, unknown> | null`

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

                - `parameters?: unknown`

                - `strict?: boolean | null`

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

              - `BetaCustomTool`

                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: "namespace"`

              The type of the tool. Always `namespace`.

              - `"namespace"`

          - `BetaToolSearchTool`

            Hosted or BYOT tool search configuration for deferred tools.

            - `type: "tool_search"`

              The type of the tool. Always `tool_search`.

              - `"tool_search"`

            - `description?: string | null`

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

            - `execution?: "server" | "client"`

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

              - `"server"`

              - `"client"`

            - `parameters?: unknown`

              Parameter schema for a client-executed tool search tool.

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

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

              - `"web_search_preview"`

              - `"web_search_preview_2025_03_11"`

            - `search_content_types?: Array<"text" | "image">`

              - `"text"`

              - `"image"`

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

              - `"low"`

              - `"medium"`

              - `"high"`

            - `user_location?: UserLocation | null`

              The user's location.

              - `type: "approximate"`

                The type of location approximation. Always `approximate`.

                - `"approximate"`

              - `city?: string | null`

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

              - `country?: string | null`

                The two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of the user, e.g. `US`.

              - `region?: string | null`

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

              - `timezone?: string | null`

                The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of the user, e.g. `America/Los_Angeles`.

          - `BetaApplyPatchTool`

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

            - `type: "apply_patch"`

              The type of the tool. Always `apply_patch`.

              - `"apply_patch"`

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

              The tool invocation context(s).

              - `"direct"`

              - `"programmatic"`

        - `type: "tool_search_output"`

          The item type. Always `tool_search_output`.

          - `"tool_search_output"`

        - `id?: string | null`

          The unique ID of this tool search output.

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `call_id?: string | null`

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

        - `execution?: "server" | "client"`

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

          - `"server"`

          - `"client"`

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

          The status of the tool search output.

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

      - `AdditionalTools`

        - `role: "developer"`

          The role that provided the additional tools. Only `developer` is supported.

          - `"developer"`

        - `tools: Array<BetaTool>`

          A list of additional tools made available at this item.

          - `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).

          - `Mcp`

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

          - `CodeInterpreter`

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

          - `ProgrammaticToolCalling`

          - `ImageGeneration`

            A tool that generates images using the GPT image models.

          - `LocalShell`

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

          - `BetaFunctionShellTool`

            A tool that allows the model to execute shell commands.

          - `BetaCustomTool`

            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)

          - `BetaNamespaceTool`

            Groups function/custom tools under a shared namespace.

          - `BetaToolSearchTool`

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

          - `BetaApplyPatchTool`

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

        - `type: "additional_tools"`

          The item type. Always `additional_tools`.

          - `"additional_tools"`

        - `id?: string | null`

          The unique ID of this additional tools item.

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

      - `BetaResponseReasoningItem`

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

        - `id: string`

          The unique identifier of the reasoning content.

        - `summary: Array<Summary>`

          Reasoning summary content.

          - `text: string`

            A summary of the reasoning output from the model so far.

          - `type: "summary_text"`

            The type of the object. Always `summary_text`.

            - `"summary_text"`

        - `type: "reasoning"`

          The type of the object. Always `reasoning`.

          - `"reasoning"`

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `content?: Array<Content>`

          Reasoning text content.

          - `text: string`

            The reasoning text from the model.

          - `type: "reasoning_text"`

            The type of the reasoning text. Always `reasoning_text`.

            - `"reasoning_text"`

        - `encrypted_content?: string | null`

          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.

          When streaming, use the completed reasoning item and its
          `encrypted_content` from the `response.output_item.done` event in
          subsequent requests. The `encrypted_content` in
          `response.output_item.added` may be incomplete. This is especially
          important when `store` is `false` or when using Zero Data Retention.

        - `status?: "in_progress" | "completed" | "incomplete"`

          The status of the item. One of `in_progress`, `completed`, or
          `incomplete`. Populated when items are returned via API.

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

      - `BetaResponseCompactionItemParam`

        A compaction item generated by the [`v1/responses/compact` API](https://platform.openai.com/docs/api-reference/responses/compact).

        - `encrypted_content: string`

          The encrypted content of the compaction summary.

        - `type: "compaction"`

          The type of the item. Always `compaction`.

          - `"compaction"`

        - `id?: string | null`

          The ID of the compaction item.

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

      - `ImageGenerationCall`

        An image generation request made by the model.

        - `id: string`

          The unique ID of the image generation call.

        - `result: string | null`

          The generated image encoded in base64.

        - `status: "in_progress" | "completed" | "generating" | "failed"`

          The status of the image generation call.

          - `"in_progress"`

          - `"completed"`

          - `"generating"`

          - `"failed"`

        - `type: "image_generation_call"`

          The type of the image generation call. Always `image_generation_call`.

          - `"image_generation_call"`

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

      - `BetaResponseCodeInterpreterToolCall`

        A tool call to run code.

        - `id: string`

          The unique ID of the code interpreter tool call.

        - `code: string | null`

          The code to run, or null if not available.

        - `container_id: string`

          The ID of the container used to run the code.

        - `outputs: Array<Logs | Image> | null`

          The outputs generated by the code interpreter, such as logs or images.
          Can be null if no outputs are available.

          - `Logs`

            The logs output from the code interpreter.

            - `logs: string`

              The logs output from the code interpreter.

            - `type: "logs"`

              The type of the output. Always `logs`.

              - `"logs"`

          - `Image`

            The image output from the code interpreter.

            - `type: "image"`

              The type of the output. Always `image`.

              - `"image"`

            - `url: string`

              The URL of the image output from the code interpreter.

        - `status: "in_progress" | "completed" | "incomplete" | 2 more`

          The status of the code interpreter tool call. Valid values are `in_progress`, `completed`, `incomplete`, `interpreting`, and `failed`.

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

          - `"interpreting"`

          - `"failed"`

        - `type: "code_interpreter_call"`

          The type of the code interpreter tool call. Always `code_interpreter_call`.

          - `"code_interpreter_call"`

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

      - `LocalShellCall`

        A tool call to run a command on the local shell.

        - `id: string`

          The unique ID of the local shell call.

        - `action: Action`

          Execute a shell command on the server.

          - `command: Array<string>`

            The command to run.

          - `env: Record<string, string>`

            Environment variables to set for the command.

          - `type: "exec"`

            The type of the local shell action. Always `exec`.

            - `"exec"`

          - `timeout_ms?: number | null`

            Optional timeout in milliseconds for the command.

          - `user?: string | null`

            Optional user to run the command as.

          - `working_directory?: string | null`

            Optional working directory to run the command in.

        - `call_id: string`

          The unique ID of the local shell tool call generated by the model.

        - `status: "in_progress" | "completed" | "incomplete"`

          The status of the local shell call.

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

        - `type: "local_shell_call"`

          The type of the local shell call. Always `local_shell_call`.

          - `"local_shell_call"`

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

      - `LocalShellCallOutput`

        The output of a local shell tool call.

        - `id: string`

          The unique ID of the local shell tool call generated by the model.

        - `output: string`

          A JSON string of the output of the local shell tool call.

        - `type: "local_shell_call_output"`

          The type of the local shell tool call output. Always `local_shell_call_output`.

          - `"local_shell_call_output"`

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

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

          The status of the item. One of `in_progress`, `completed`, or `incomplete`.

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

      - `ShellCall`

        A tool representing a request to execute one or more shell commands.

        - `action: Action`

          The shell commands and limits that describe how to run the tool call.

          - `commands: Array<string>`

            Ordered shell commands for the execution environment to run.

          - `max_output_length?: number | null`

            Maximum number of UTF-8 characters to capture from combined stdout and stderr output.

          - `timeout_ms?: number | null`

            Maximum wall-clock time in milliseconds to allow the shell commands to run.

        - `call_id: string`

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

        - `type: "shell_call"`

          The type of the item. Always `shell_call`.

          - `"shell_call"`

        - `id?: string | null`

          The unique ID of the shell tool call. Populated when this item is returned via API.

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `caller?: Direct | Program | null`

          The execution context that produced this tool call.

          - `Direct`

            - `type: "direct"`

              The caller type. Always `direct`.

              - `"direct"`

          - `Program`

            - `caller_id: string`

              The call ID of the program item that produced this tool call.

            - `type: "program"`

              The caller type. Always `program`.

              - `"program"`

        - `environment?: BetaLocalEnvironment | BetaContainerReference | null`

          The environment to execute the shell commands in.

          - `BetaLocalEnvironment`

          - `BetaContainerReference`

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

          The status of the shell call. One of `in_progress`, `completed`, or `incomplete`.

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

      - `ShellCallOutput`

        The streamed output items emitted by a shell tool call.

        - `call_id: string`

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

        - `output: Array<BetaResponseFunctionShellCallOutputContent>`

          Captured chunks of stdout and stderr output, along with their associated outcomes.

          - `outcome: Timeout | Exit`

            The exit or timeout outcome associated with this shell call.

            - `Timeout`

              Indicates that the shell call exceeded its configured time limit.

              - `type: "timeout"`

                The outcome type. Always `timeout`.

                - `"timeout"`

            - `Exit`

              Indicates that the shell commands finished and returned an exit code.

              - `exit_code: number`

                The exit code returned by the shell process.

              - `type: "exit"`

                The outcome type. Always `exit`.

                - `"exit"`

          - `stderr: string`

            Captured stderr output for the shell call.

          - `stdout: string`

            Captured stdout output for the shell call.

        - `type: "shell_call_output"`

          The type of the item. Always `shell_call_output`.

          - `"shell_call_output"`

        - `id?: string | null`

          The unique ID of the shell tool call output. Populated when this item is returned via API.

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `caller?: Direct | Program | null`

          The execution context that produced this tool call.

          - `Direct`

            - `type: "direct"`

              The caller type. Always `direct`.

              - `"direct"`

          - `Program`

            - `caller_id: string`

              The call ID of the program item that produced this tool call.

            - `type: "program"`

              The caller type. Always `program`.

              - `"program"`

        - `max_output_length?: number | null`

          The maximum number of UTF-8 characters captured for this shell call's combined output.

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

          The status of the shell call output.

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

      - `ApplyPatchCall`

        A tool call representing a request to create, delete, or update files using diff patches.

        - `call_id: string`

          The unique ID of the apply patch tool call generated by the model.

        - `operation: CreateFile | DeleteFile | UpdateFile`

          The specific create, delete, or update instruction for the apply_patch tool call.

          - `CreateFile`

            Instruction for creating a new file via the apply_patch tool.

            - `diff: string`

              Unified diff content to apply when creating the file.

            - `path: string`

              Path of the file to create relative to the workspace root.

            - `type: "create_file"`

              The operation type. Always `create_file`.

              - `"create_file"`

          - `DeleteFile`

            Instruction for deleting an existing file via the apply_patch tool.

            - `path: string`

              Path of the file to delete relative to the workspace root.

            - `type: "delete_file"`

              The operation type. Always `delete_file`.

              - `"delete_file"`

          - `UpdateFile`

            Instruction for updating an existing file via the apply_patch tool.

            - `diff: string`

              Unified diff content to apply to the existing file.

            - `path: string`

              Path of the file to update relative to the workspace root.

            - `type: "update_file"`

              The operation type. Always `update_file`.

              - `"update_file"`

        - `status: "in_progress" | "completed"`

          The status of the apply patch tool call. One of `in_progress` or `completed`.

          - `"in_progress"`

          - `"completed"`

        - `type: "apply_patch_call"`

          The type of the item. Always `apply_patch_call`.

          - `"apply_patch_call"`

        - `id?: string | null`

          The unique ID of the apply patch tool call. Populated when this item is returned via API.

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `caller?: Direct | Program | null`

          The execution context that produced this tool call.

          - `Direct`

            - `type: "direct"`

              The caller type. Always `direct`.

              - `"direct"`

          - `Program`

            - `caller_id: string`

              The call ID of the program item that produced this tool call.

            - `type: "program"`

              The caller type. Always `program`.

              - `"program"`

      - `ApplyPatchCallOutput`

        The streamed output emitted by an apply patch tool call.

        - `call_id: string`

          The unique ID of the apply patch tool call generated by the model.

        - `status: "completed" | "failed"`

          The status of the apply patch tool call output. One of `completed` or `failed`.

          - `"completed"`

          - `"failed"`

        - `type: "apply_patch_call_output"`

          The type of the item. Always `apply_patch_call_output`.

          - `"apply_patch_call_output"`

        - `id?: string | null`

          The unique ID of the apply patch tool call output. Populated when this item is returned via API.

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `caller?: Direct | Program | null`

          The execution context that produced this tool call.

          - `Direct`

            - `type: "direct"`

              The caller type. Always `direct`.

              - `"direct"`

          - `Program`

            - `caller_id: string`

              The call ID of the program item that produced this tool call.

            - `type: "program"`

              The caller type. Always `program`.

              - `"program"`

        - `output?: string | null`

          Optional human-readable log text from the apply patch tool (e.g., patch results or errors).

      - `McpListTools`

        A list of tools available on an MCP server.

        - `id: string`

          The unique ID of the list.

        - `server_label: string`

          The label of the MCP server.

        - `tools: Array<Tool>`

          The tools available on the server.

          - `input_schema: unknown`

            The JSON schema describing the tool's input.

          - `name: string`

            The name of the tool.

          - `annotations?: unknown`

            Additional annotations about the tool.

          - `description?: string | null`

            The description of the tool.

        - `type: "mcp_list_tools"`

          The type of the item. Always `mcp_list_tools`.

          - `"mcp_list_tools"`

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `error?: string | null`

          Error message if the server could not list tools.

      - `McpApprovalRequest`

        A request for human approval of a tool invocation.

        - `id: string`

          The unique ID of the approval request.

        - `arguments: string`

          A JSON string of arguments for the tool.

        - `name: string`

          The name of the tool to run.

        - `server_label: string`

          The label of the MCP server making the request.

        - `type: "mcp_approval_request"`

          The type of the item. Always `mcp_approval_request`.

          - `"mcp_approval_request"`

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

      - `McpApprovalResponse`

        A response to an MCP approval request.

        - `approval_request_id: string`

          The ID of the approval request being answered.

        - `approve: boolean`

          Whether the request was approved.

        - `type: "mcp_approval_response"`

          The type of the item. Always `mcp_approval_response`.

          - `"mcp_approval_response"`

        - `id?: string | null`

          The unique ID of the approval response

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `reason?: string | null`

          Optional reason for the decision.

      - `McpCall`

        An invocation of a tool on an MCP server.

        - `id: string`

          The unique ID of the tool call.

        - `arguments: string`

          A JSON string of the arguments passed to the tool.

        - `name: string`

          The name of the tool that was run.

        - `server_label: string`

          The label of the MCP server running the tool.

        - `type: "mcp_call"`

          The type of the item. Always `mcp_call`.

          - `"mcp_call"`

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `approval_request_id?: string | null`

          Unique identifier for the MCP tool call approval request.
          Include this value in a subsequent `mcp_approval_response` input to approve or reject the corresponding tool call.

        - `error?: BetaMcpToolCallError | null`

          The error from the tool call, if any.

          - `McpProtocolError`

            - `code: number`

            - `message: string`

            - `type: "mcp_protocol_error"`

              - `"mcp_protocol_error"`

          - `McpToolExecutionError`

            - `content: unknown`

            - `type: "mcp_tool_execution_error"`

              - `"mcp_tool_execution_error"`

          - `HTTPError`

            - `code: number`

            - `message: string`

            - `type: "http_error"`

              - `"http_error"`

        - `output?: string | null`

          The output from the tool call.

        - `status?: "in_progress" | "completed" | "incomplete" | 2 more`

          The status of the tool call. One of `in_progress`, `completed`, `incomplete`, `calling`, or `failed`.

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

          - `"calling"`

          - `"failed"`

      - `BetaResponseCustomToolCallOutput`

        The output of a custom tool call from your code, being sent back to the model.

        - `call_id: string`

          The call ID, used to map this custom tool call output to a custom tool call.

        - `output: string | Array<BetaResponseInputText | BetaResponseInputImage | BetaResponseInputFile>`

          The output from the custom tool call generated by your code.
          Can be a string or an list of output content.

          - `string`

          - `Array<BetaResponseInputText | BetaResponseInputImage | BetaResponseInputFile>`

            - `BetaResponseInputText`

              A text input to the model.

            - `BetaResponseInputImage`

              An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision).

            - `BetaResponseInputFile`

              A file input to the model.

        - `type: "custom_tool_call_output"`

          The type of the custom tool call output. Always `custom_tool_call_output`.

          - `"custom_tool_call_output"`

        - `id?: string`

          The unique ID of the custom tool call output in the OpenAI platform.

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `caller?: Direct | Program | null`

          The execution context that produced this tool call.

          - `Direct`

            - `type: "direct"`

              The caller type. Always `direct`.

              - `"direct"`

          - `Program`

            - `caller_id: string`

              The call ID of the program item that produced this tool call.

            - `type: "program"`

              The caller type. Always `program`.

              - `"program"`

      - `BetaResponseCustomToolCall`

        A call to a custom tool created by the model.

        - `call_id: string`

          An identifier used to map this custom tool call to a tool call output.

        - `input: string`

          The input for the custom tool call generated by the model.

        - `name: string`

          The name of the custom tool being called.

        - `type: "custom_tool_call"`

          The type of the custom tool call. Always `custom_tool_call`.

          - `"custom_tool_call"`

        - `id?: string`

          The unique ID of the custom tool call in the OpenAI platform.

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `caller?: Direct | Program | null`

          The execution context that produced this tool call.

          - `Direct`

            - `type: "direct"`

              - `"direct"`

          - `Program`

            - `caller_id: string`

              The call ID of the program item that produced this tool call.

            - `type: "program"`

              - `"program"`

        - `namespace?: string`

          The namespace of the custom tool being called.

      - `CompactionTrigger`

        Compacts the current context. Must be the final input item.

        - `type: "compaction_trigger"`

          The type of the item. Always `compaction_trigger`.

          - `"compaction_trigger"`

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

      - `ItemReference`

        An internal identifier for an item to reference.

        - `id: string`

          The ID of the item to reference.

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `type?: "item_reference" | null`

          The type of item to reference. Always `item_reference`.

          - `"item_reference"`

      - `Program`

        - `id: string`

          The unique ID of this program item.

        - `call_id: string`

          The stable call ID of the program item.

        - `code: string`

          The JavaScript source executed by programmatic tool calling.

        - `fingerprint: string`

          Opaque program replay fingerprint that must be round-tripped.

        - `type: "program"`

          The item type. Always `program`.

          - `"program"`

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

      - `ProgramOutput`

        - `id: string`

          The unique ID of this program output item.

        - `call_id: string`

          The call ID of the program item.

        - `result: string`

          The result produced by the program item.

        - `status: "completed" | "incomplete"`

          The terminal status of the program output.

          - `"completed"`

          - `"incomplete"`

        - `type: "program_output"`

          The item type. Always `program_output`.

          - `"program_output"`

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

  - `instructions?: string | null`

    Body param: A system (or developer) message inserted into the model's context.
    When used along with `previous_response_id`, the instructions from a previous response will not be carried over to the next response. This makes it simple to swap out system (or developer) messages in new responses.

  - `previous_response_id?: string | null`

    Body param: 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`.

  - `prompt_cache_key?: string | null`

    Body param: A key to use when reading from or writing to the prompt cache.

  - `prompt_cache_options?: PromptCacheOptions | null`

    Body param: Options for prompt caching. Supported for `gpt-5.6` and later models. By default, OpenAI automatically chooses one implicit cache breakpoint. You can add explicit breakpoints to content blocks with `prompt_cache_breakpoint`. Each request can write up to four breakpoints. For cache matching, OpenAI considers up to the latest 80 breakpoints in the conversation, without a content-block lookback limit. Set `mode` to `explicit` to disable the implicit breakpoint. The `ttl` defaults to `30m`, which is currently the only supported value. See the [prompt caching guide](https://platform.openai.com/docs/guides/prompt-caching) for current details.

    - `mode?: "implicit" | "explicit"`

      Controls whether OpenAI automatically creates an implicit cache breakpoint. Defaults to `implicit`. With `implicit`, OpenAI creates one implicit breakpoint and writes up to the latest three explicit breakpoints in the request. With `explicit`, OpenAI does not create an implicit breakpoint and writes up to the latest four explicit breakpoints. If there are no explicit breakpoints, the request does not use prompt caching.

      - `"implicit"`

      - `"explicit"`

    - `ttl?: "30m"`

      The minimum lifetime applied to every implicit and explicit cache breakpoint written by the request. Defaults to `30m`, which is currently the only supported value. The backend may retain cache entries for longer.

      - `"30m"`

  - `prompt_cache_retention?: "in_memory" | "24h" | null`

    Body param: How long to retain a prompt cache entry created by this request.

    - `"in_memory"`

    - `"24h"`

  - `service_tier?: "auto" | "default" | "fast" | 2 more | null`

    Body param: 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.

    - `"auto"`

    - `"default"`

    - `"fast"`

    - `"flex"`

    - `"priority"`

  - `betas?: Array<"responses_multi_agent=v1">`

    Header param: Optional beta features to enable for this request.

    - `"responses_multi_agent=v1"`

### Returns

- `BetaCompactedResponse`

  - `id: string`

    The unique identifier for the compacted response.

  - `created_at: number`

    Unix timestamp (in seconds) when the compacted conversation was created.

  - `object: "response.compaction"`

    The object type. Always `response.compaction`.

    - `"response.compaction"`

  - `output: Array<BetaResponseOutputItem>`

    The compacted list of output items. This is a list of all user messages, followed by a single compaction item.

    - `BetaResponseOutputMessage`

      An output message from the model.

      - `id: string`

        The unique ID of the output message.

      - `content: Array<BetaResponseOutputText | BetaResponseOutputRefusal>`

        The content of the output message.

        - `BetaResponseOutputText`

          A text output from the model.

          - `annotations: Array<FileCitation | URLCitation | ContainerFileCitation | FilePath>`

            The annotations of the text output.

            - `FileCitation`

              A citation to a file.

              - `file_id: string`

                The ID of the file.

              - `filename: string`

                The filename of the file cited.

              - `index: number`

                The index of the file in the list of files.

              - `type: "file_citation"`

                The type of the file citation. Always `file_citation`.

                - `"file_citation"`

            - `URLCitation`

              A citation for a web resource used to generate a model response.

              - `end_index: number`

                The index of the last character of the URL citation in the message.

              - `start_index: number`

                The index of the first character of the URL citation in the message.

              - `title: string`

                The title of the web resource.

              - `type: "url_citation"`

                The type of the URL citation. Always `url_citation`.

                - `"url_citation"`

              - `url: string`

                The URL of the web resource.

            - `ContainerFileCitation`

              A citation for a container file used to generate a model response.

              - `container_id: string`

                The ID of the container file.

              - `end_index: number`

                The index of the last character of the container file citation in the message.

              - `file_id: string`

                The ID of the file.

              - `filename: string`

                The filename of the container file cited.

              - `start_index: number`

                The index of the first character of the container file citation in the message.

              - `type: "container_file_citation"`

                The type of the container file citation. Always `container_file_citation`.

                - `"container_file_citation"`

            - `FilePath`

              A path to a file.

              - `file_id: string`

                The ID of the file.

              - `index: number`

                The index of the file in the list of files.

              - `type: "file_path"`

                The type of the file path. Always `file_path`.

                - `"file_path"`

          - `text: string`

            The text output from the model.

          - `type: "output_text"`

            The type of the output text. Always `output_text`.

            - `"output_text"`

          - `logprobs?: Array<Logprob>`

            - `token: string`

            - `bytes: Array<number>`

            - `logprob: number`

            - `top_logprobs: Array<TopLogprob>`

              - `token: string`

              - `bytes: Array<number>`

              - `logprob: number`

        - `BetaResponseOutputRefusal`

          A refusal from the model.

          - `refusal: string`

            The refusal explanation from the model.

          - `type: "refusal"`

            The type of the refusal. Always `refusal`.

            - `"refusal"`

      - `role: "assistant"`

        The role of the output message. Always `assistant`.

        - `"assistant"`

      - `status: "in_progress" | "completed" | "incomplete"`

        The status of the message input. One of `in_progress`, `completed`, or
        `incomplete`. Populated when input items are returned via API.

        - `"in_progress"`

        - `"completed"`

        - `"incomplete"`

      - `type: "message"`

        The type of the output message. Always `message`.

        - `"message"`

      - `agent?: Agent | null`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

      - `phase?: "commentary" | "final_answer" | null`

        Labels an `assistant` message as intermediate commentary (`commentary`) or the final answer (`final_answer`).
        For models like `gpt-5.3-codex` and beyond, when sending follow-up requests, preserve and resend
        phase on all assistant messages — dropping it can degrade performance. Not used for user messages.

        - `"commentary"`

        - `"final_answer"`

    - `BetaResponseFileSearchToolCall`

      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.

      - `id: string`

        The unique ID of the file search tool call.

      - `queries: Array<string>`

        The queries used to search for files.

      - `status: "in_progress" | "searching" | "completed" | 2 more`

        The status of the file search tool call. One of `in_progress`,
        `searching`, `incomplete` or `failed`,

        - `"in_progress"`

        - `"searching"`

        - `"completed"`

        - `"incomplete"`

        - `"failed"`

      - `type: "file_search_call"`

        The type of the file search tool call. Always `file_search_call`.

        - `"file_search_call"`

      - `agent?: Agent | null`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

      - `results?: Array<Result> | null`

        The results of the file search tool call.

        - `attributes?: Record<string, string | number | boolean> | null`

          Set of 16 key-value pairs that can be attached to an object. This can be
          useful for storing additional information about the object in a structured
          format, and querying for objects via API or the dashboard. Keys are strings
          with a maximum length of 64 characters. Values are strings with a maximum
          length of 512 characters, booleans, or numbers.

          - `string`

          - `number`

          - `boolean`

        - `file_id?: string`

          The unique ID of the file.

        - `filename?: string`

          The name of the file.

        - `score?: number`

          The relevance score of the file - a value between 0 and 1.

        - `text?: string`

          The text that was retrieved from the file.

    - `BetaResponseFunctionToolCall`

      A tool call to run a function. See the
      [function calling guide](https://platform.openai.com/docs/guides/function-calling) for more information.

      - `arguments: string`

        A JSON string of the arguments to pass to the function.

      - `call_id: string`

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

      - `name: string`

        The name of the function to run.

      - `type: "function_call"`

        The type of the function tool call. Always `function_call`.

        - `"function_call"`

      - `id?: string`

        The unique ID of the function tool call.

      - `agent?: Agent | null`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

      - `caller?: Direct | Program | null`

        The execution context that produced this tool call.

        - `Direct`

          - `type: "direct"`

            - `"direct"`

        - `Program`

          - `caller_id: string`

            The call ID of the program item that produced this tool call.

          - `type: "program"`

            - `"program"`

      - `namespace?: string`

        The namespace of the function to run.

      - `status?: "in_progress" | "completed" | "incomplete"`

        The status of the item. One of `in_progress`, `completed`, or
        `incomplete`. Populated when items are returned via API.

        - `"in_progress"`

        - `"completed"`

        - `"incomplete"`

    - `BetaResponseFunctionToolCallOutputItem`

      - `id: string`

        The unique ID of the function call tool output.

      - `call_id: string`

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

      - `output: string | Array<BetaResponseInputText | BetaResponseInputImage | BetaResponseInputFile>`

        The output from the function call generated by your code.
        Can be a string or an list of output content.

        - `string`

        - `Array<BetaResponseInputText | BetaResponseInputImage | BetaResponseInputFile>`

          - `BetaResponseInputText`

            A text input to the model.

            - `text: string`

              The text input to the model.

            - `type: "input_text"`

              The type of the input item. Always `input_text`.

              - `"input_text"`

            - `prompt_cache_breakpoint?: PromptCacheBreakpoint`

              Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.

              - `mode: "explicit"`

                The breakpoint mode. Always `explicit`.

                - `"explicit"`

          - `BetaResponseInputImage`

            An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision).

            - `detail: BetaImageDetail`

              The detail level of the image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`.

              - `"low"`

              - `"high"`

              - `"auto"`

              - `"original"`

            - `type: "input_image"`

              The type of the input item. Always `input_image`.

              - `"input_image"`

            - `file_id?: string | null`

              The ID of the file to be sent to the model.

            - `image_url?: string | null`

              The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.

            - `prompt_cache_breakpoint?: PromptCacheBreakpoint`

              Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.

              - `mode: "explicit"`

                The breakpoint mode. Always `explicit`.

                - `"explicit"`

          - `BetaResponseInputFile`

            A file input to the model.

            - `type: "input_file"`

              The type of the input item. Always `input_file`.

              - `"input_file"`

            - `detail?: "auto" | "low" | "high"`

              The detail level of the file to be sent to the model. Use `auto` to let the system select the detail level; for GPT-5.6 and later models, `auto` uses high-quality rendering, which may increase input token usage. Use `low` for lower-cost rendering, or `high` to render the file at higher quality. Defaults to `auto`.

              - `"auto"`

              - `"low"`

              - `"high"`

            - `file_data?: string`

              The content of the file to be sent to the model.

            - `file_id?: string | null`

              The ID of the file to be sent to the model.

            - `file_url?: string`

              The URL of the file to be sent to the model.

            - `filename?: string`

              The name of the file to be sent to the model.

            - `prompt_cache_breakpoint?: PromptCacheBreakpoint`

              Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.

              - `mode: "explicit"`

                The breakpoint mode. Always `explicit`.

                - `"explicit"`

      - `status: "in_progress" | "completed" | "incomplete"`

        The status of the item. One of `in_progress`, `completed`, or
        `incomplete`. Populated when items are returned via API.

        - `"in_progress"`

        - `"completed"`

        - `"incomplete"`

      - `type: "function_call_output"`

        The type of the function tool call output. Always `function_call_output`.

        - `"function_call_output"`

      - `agent?: Agent | null`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

      - `caller?: Direct | Program | null`

        The execution context that produced this tool call.

        - `Direct`

          - `type: "direct"`

            The caller type. Always `direct`.

            - `"direct"`

        - `Program`

          - `caller_id: string`

            The call ID of the program item that produced this tool call.

          - `type: "program"`

            The caller type. Always `program`.

            - `"program"`

      - `created_by?: string`

        The identifier of the actor that created the item.

      - `name?: string`

        The name of the tool that produced the output.

      - `namespace?: string`

        The namespace of the tool that produced the output.

    - `AgentMessage`

      - `id: string`

        The unique ID of the agent message.

      - `author: string`

        The sending agent identity.

      - `content: Array<BetaResponseInputText | BetaResponseOutputText | Text | 7 more>`

        Encrypted content sent between agents.

        - `BetaResponseInputText`

          A text input to the model.

        - `BetaResponseOutputText`

          A text output from the model.

        - `Text`

          A text content.

          - `text: string`

          - `type: "text"`

            - `"text"`

        - `SummaryText`

          A summary text from the model.

          - `text: string`

            A summary of the reasoning output from the model so far.

          - `type: "summary_text"`

            The type of the object. Always `summary_text`.

            - `"summary_text"`

        - `ReasoningText`

          Reasoning text from the model.

          - `text: string`

            The reasoning text from the model.

          - `type: "reasoning_text"`

            The type of the reasoning text. Always `reasoning_text`.

            - `"reasoning_text"`

        - `BetaResponseOutputRefusal`

          A refusal from the model.

        - `BetaResponseInputImage`

          An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision).

        - `ComputerScreenshot`

          A screenshot of a computer.

          - `detail: BetaImageDetail`

            The detail level of the screenshot image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`.

          - `file_id: string | null`

            The identifier of an uploaded file that contains the screenshot.

          - `image_url: string | null`

            The URL of the screenshot image.

          - `type: "computer_screenshot"`

            Specifies the event type. For a computer screenshot, this property is always set to `computer_screenshot`.

            - `"computer_screenshot"`

          - `prompt_cache_breakpoint?: PromptCacheBreakpoint`

            Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.

            - `mode: "explicit"`

              The breakpoint mode. Always `explicit`.

              - `"explicit"`

        - `BetaResponseInputFile`

          A file input to the model.

        - `EncryptedContent`

          Opaque encrypted content that Responses API decrypts inside trusted model execution.

          - `encrypted_content: string`

            Opaque encrypted content.

          - `type: "encrypted_content"`

            The type of the input item. Always `encrypted_content`.

            - `"encrypted_content"`

      - `recipient: string`

        The destination agent identity.

      - `type: "agent_message"`

        The type of the item. Always `agent_message`.

        - `"agent_message"`

      - `agent?: Agent`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

    - `MultiAgentCall`

      - `id: string`

        The unique ID of the multi-agent call item.

      - `action: "spawn_agent" | "interrupt_agent" | "list_agents" | 3 more`

        The multi-agent action to execute.

        - `"spawn_agent"`

        - `"interrupt_agent"`

        - `"list_agents"`

        - `"send_message"`

        - `"followup_task"`

        - `"wait_agent"`

      - `arguments: string`

        The JSON string of arguments generated for the action.

      - `call_id: string`

        The unique ID linking this call to its output.

      - `type: "multi_agent_call"`

        The type of the multi-agent call. Always `multi_agent_call`.

        - `"multi_agent_call"`

      - `agent?: Agent`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

    - `MultiAgentCallOutput`

      - `id: string`

        The unique ID of the multi-agent call output item.

      - `action: "spawn_agent" | "interrupt_agent" | "list_agents" | 3 more`

        The multi-agent action that produced this result.

        - `"spawn_agent"`

        - `"interrupt_agent"`

        - `"list_agents"`

        - `"send_message"`

        - `"followup_task"`

        - `"wait_agent"`

      - `call_id: string`

        The unique ID of the multi-agent call.

      - `output: Array<BetaResponseOutputText>`

        Text output returned by the multi-agent action.

        - `annotations: Array<FileCitation | URLCitation | ContainerFileCitation | FilePath>`

          The annotations of the text output.

        - `text: string`

          The text output from the model.

        - `type: "output_text"`

          The type of the output text. Always `output_text`.

        - `logprobs?: Array<Logprob>`

      - `type: "multi_agent_call_output"`

        The type of the multi-agent result. Always `multi_agent_call_output`.

        - `"multi_agent_call_output"`

      - `agent?: Agent`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

    - `BetaResponseFunctionWebSearch`

      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.

      - `id: string`

        The unique ID of the web search tool call.

      - `action: Search | OpenPage | FindInPage`

        An object describing the specific action taken in this web search call.
        Includes details on how the model used the web (search, open_page, find_in_page).

        - `Search`

          Action type "search" - Performs a web search query.

          - `type: "search"`

            The action type.

            - `"search"`

          - `queries?: Array<string>`

            The search queries.

          - `query?: string`

            The search query.

          - `sources?: Array<Source>`

            The sources used in the search.

            - `type: "url"`

              The type of source. Always `url`.

              - `"url"`

            - `url: string`

              The URL of the source.

        - `OpenPage`

          Action type "open_page" - Opens a specific URL from search results.

          - `type: "open_page"`

            The action type.

            - `"open_page"`

          - `url?: string | null`

            The URL opened by the model.

        - `FindInPage`

          Action type "find_in_page": Searches for a pattern within a loaded page.

          - `pattern: string`

            The pattern or text to search for within the page.

          - `type: "find_in_page"`

            The action type.

            - `"find_in_page"`

          - `url: string`

            The URL of the page searched for the pattern.

      - `status: "in_progress" | "searching" | "completed" | "failed"`

        The status of the web search tool call.

        - `"in_progress"`

        - `"searching"`

        - `"completed"`

        - `"failed"`

      - `type: "web_search_call"`

        The type of the web search tool call. Always `web_search_call`.

        - `"web_search_call"`

      - `agent?: Agent | null`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

    - `BetaResponseComputerToolCall`

      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.

      - `id: string`

        The unique ID of the computer call.

      - `call_id: string`

        An identifier used when responding to the tool call with output.

      - `pending_safety_checks: Array<PendingSafetyCheck>`

        The pending safety checks for the computer call.

        - `id: string`

          The ID of the pending safety check.

        - `code?: string | null`

          The type of the pending safety check.

        - `message?: string | null`

          Details about the pending safety check.

      - `status: "in_progress" | "completed" | "incomplete"`

        The status of the item. One of `in_progress`, `completed`, or
        `incomplete`. Populated when items are returned via API.

        - `"in_progress"`

        - `"completed"`

        - `"incomplete"`

      - `type: "computer_call"`

        The type of the computer call. Always `computer_call`.

        - `"computer_call"`

      - `action?: BetaComputerAction`

        A click action.

        - `Click`

          A click action.

          - `button: "left" | "right" | "wheel" | 2 more`

            Indicates which mouse button was pressed during the click. One of `left`, `right`, `wheel`, `back`, or `forward`.

            - `"left"`

            - `"right"`

            - `"wheel"`

            - `"back"`

            - `"forward"`

          - `type: "click"`

            Specifies the event type. For a click action, this property is always `click`.

            - `"click"`

          - `x: number`

            The x-coordinate where the click occurred.

          - `y: number`

            The y-coordinate where the click occurred.

          - `keys?: Array<string> | null`

            The keys being held while clicking.

        - `DoubleClick`

          A double click action.

          - `keys: Array<string> | null`

            The keys being held while double-clicking.

          - `type: "double_click"`

            Specifies the event type. For a double click action, this property is always set to `double_click`.

            - `"double_click"`

          - `x: number`

            The x-coordinate where the double click occurred.

          - `y: number`

            The y-coordinate where the double click occurred.

        - `Drag`

          A drag action.

          - `path: Array<Path>`

            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 }
            ]
            ```

            - `x: number`

              The x-coordinate.

            - `y: number`

              The y-coordinate.

          - `type: "drag"`

            Specifies the event type. For a drag action, this property is always set to `drag`.

            - `"drag"`

          - `keys?: Array<string> | null`

            The keys being held while dragging the mouse.

        - `Keypress`

          A collection of keypresses the model would like to perform.

          - `keys: Array<string>`

            The combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key.

          - `type: "keypress"`

            Specifies the event type. For a keypress action, this property is always set to `keypress`.

            - `"keypress"`

        - `Move`

          A mouse move action.

          - `type: "move"`

            Specifies the event type. For a move action, this property is always set to `move`.

            - `"move"`

          - `x: number`

            The x-coordinate to move to.

          - `y: number`

            The y-coordinate to move to.

          - `keys?: Array<string> | null`

            The keys being held while moving the mouse.

        - `Screenshot`

          A screenshot action.

          - `type: "screenshot"`

            Specifies the event type. For a screenshot action, this property is always set to `screenshot`.

            - `"screenshot"`

        - `Scroll`

          A scroll action.

          - `scroll_x: number`

            The horizontal scroll distance.

          - `scroll_y: number`

            The vertical scroll distance.

          - `type: "scroll"`

            Specifies the event type. For a scroll action, this property is always set to `scroll`.

            - `"scroll"`

          - `x: number`

            The x-coordinate where the scroll occurred.

          - `y: number`

            The y-coordinate where the scroll occurred.

          - `keys?: Array<string> | null`

            The keys being held while scrolling.

        - `Type`

          An action to type in text.

          - `text: string`

            The text to type.

          - `type: "type"`

            Specifies the event type. For a type action, this property is always set to `type`.

            - `"type"`

        - `Wait`

          A wait action.

          - `type: "wait"`

            Specifies the event type. For a wait action, this property is always set to `wait`.

            - `"wait"`

      - `actions?: BetaComputerActionList`

        Flattened batched actions for `computer_use`. Each action includes an
        `type` discriminator and action-specific fields.

        - `Click`

          A click action.

        - `DoubleClick`

          A double click action.

        - `Drag`

          A drag action.

        - `Keypress`

          A collection of keypresses the model would like to perform.

        - `Move`

          A mouse move action.

        - `Screenshot`

          A screenshot action.

        - `Scroll`

          A scroll action.

        - `Type`

          An action to type in text.

        - `Wait`

          A wait action.

      - `agent?: Agent | null`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

    - `BetaResponseComputerToolCallOutputItem`

      - `id: string`

        The unique ID of the computer call tool output.

      - `call_id: string`

        The ID of the computer tool call that produced the output.

      - `output: BetaResponseComputerToolCallOutputScreenshot`

        A computer screenshot image used with the computer use tool.

        - `type: "computer_screenshot"`

          Specifies the event type. For a computer screenshot, this property is
          always set to `computer_screenshot`.

          - `"computer_screenshot"`

        - `file_id?: string`

          The identifier of an uploaded file that contains the screenshot.

        - `image_url?: string`

          The URL of the screenshot image.

      - `status: "completed" | "incomplete" | "failed" | "in_progress"`

        The status of the message input. One of `in_progress`, `completed`, or
        `incomplete`. Populated when input items are returned via API.

        - `"completed"`

        - `"incomplete"`

        - `"failed"`

        - `"in_progress"`

      - `type: "computer_call_output"`

        The type of the computer tool call output. Always `computer_call_output`.

        - `"computer_call_output"`

      - `acknowledged_safety_checks?: Array<AcknowledgedSafetyCheck>`

        The safety checks reported by the API that have been acknowledged by the
        developer.

        - `id: string`

          The ID of the pending safety check.

        - `code?: string | null`

          The type of the pending safety check.

        - `message?: string | null`

          Details about the pending safety check.

      - `agent?: Agent | null`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

      - `created_by?: string`

        The identifier of the actor that created the item.

    - `BetaResponseReasoningItem`

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

      - `id: string`

        The unique identifier of the reasoning content.

      - `summary: Array<Summary>`

        Reasoning summary content.

        - `text: string`

          A summary of the reasoning output from the model so far.

        - `type: "summary_text"`

          The type of the object. Always `summary_text`.

          - `"summary_text"`

      - `type: "reasoning"`

        The type of the object. Always `reasoning`.

        - `"reasoning"`

      - `agent?: Agent | null`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

      - `content?: Array<Content>`

        Reasoning text content.

        - `text: string`

          The reasoning text from the model.

        - `type: "reasoning_text"`

          The type of the reasoning text. Always `reasoning_text`.

          - `"reasoning_text"`

      - `encrypted_content?: string | null`

        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.

        When streaming, use the completed reasoning item and its
        `encrypted_content` from the `response.output_item.done` event in
        subsequent requests. The `encrypted_content` in
        `response.output_item.added` may be incomplete. This is especially
        important when `store` is `false` or when using Zero Data Retention.

      - `status?: "in_progress" | "completed" | "incomplete"`

        The status of the item. One of `in_progress`, `completed`, or
        `incomplete`. Populated when items are returned via API.

        - `"in_progress"`

        - `"completed"`

        - `"incomplete"`

    - `Program`

      - `id: string`

        The unique ID of the program item.

      - `call_id: string`

        The stable call ID of the program item.

      - `code: string`

        The JavaScript source executed by programmatic tool calling.

      - `fingerprint: string`

        Opaque program replay fingerprint that must be round-tripped.

      - `type: "program"`

        The type of the item. Always `program`.

        - `"program"`

      - `agent?: Agent`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

    - `ProgramOutput`

      - `id: string`

        The unique ID of the program output item.

      - `call_id: string`

        The call ID of the program item.

      - `result: string`

        The result produced by the program item.

      - `status: "completed" | "incomplete"`

        The terminal status of the program output item.

        - `"completed"`

        - `"incomplete"`

      - `type: "program_output"`

        The type of the item. Always `program_output`.

        - `"program_output"`

      - `agent?: Agent`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

    - `BetaResponseToolSearchCall`

      - `id: string`

        The unique ID of the tool search call item.

      - `arguments: unknown`

        Arguments used for the tool search call.

      - `call_id: string | null`

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

      - `execution: "server" | "client"`

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

        - `"server"`

        - `"client"`

      - `status: "in_progress" | "completed" | "incomplete"`

        The status of the tool search call item that was recorded.

        - `"in_progress"`

        - `"completed"`

        - `"incomplete"`

      - `type: "tool_search_call"`

        The type of the item. Always `tool_search_call`.

        - `"tool_search_call"`

      - `agent?: Agent`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

      - `created_by?: string`

        The identifier of the actor that created the item.

    - `BetaResponseToolSearchOutputItem`

      - `id: string`

        The unique ID of the tool search output item.

      - `call_id: string | null`

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

      - `execution: "server" | "client"`

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

        - `"server"`

        - `"client"`

      - `status: "in_progress" | "completed" | "incomplete"`

        The status of the tool search output item that was recorded.

        - `"in_progress"`

        - `"completed"`

        - `"incomplete"`

      - `tools: Array<BetaTool>`

        The loaded tool definitions returned by tool search.

        - `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).

          - `name: string`

            The name of the function to call.

          - `parameters: Record<string, unknown> | null`

            A JSON schema object describing the parameters of the function.

          - `strict: boolean | null`

            Whether strict parameter validation is enforced for this function tool.

          - `type: "function"`

            The type of the function tool. Always `function`.

            - `"function"`

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

            The tool invocation context(s).

            - `"direct"`

            - `"programmatic"`

          - `defer_loading?: boolean`

            Whether this function is deferred and loaded via tool search.

          - `description?: string | null`

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

          - `output_schema?: Record<string, unknown> | null`

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

        - `BetaFileSearchTool`

          A tool that searches for relevant content from uploaded files. Learn more about the [file search tool](https://platform.openai.com/docs/guides/tools-file-search).

          - `type: "file_search"`

            The type of the file search tool. Always `file_search`.

            - `"file_search"`

          - `vector_store_ids: Array<string>`

            The IDs of the vector stores to search.

          - `filters?: ComparisonFilter | CompoundFilter | null`

            A filter to apply.

            - `ComparisonFilter`

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

              - `key: string`

                The key to compare against the value.

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

                Specifies the comparison operator: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`, `in`, `nin`.

                - `eq`: equals
                - `ne`: not equal
                - `gt`: greater than
                - `gte`: greater than or equal
                - `lt`: less than
                - `lte`: less than or equal
                - `in`: in
                - `nin`: not in

                - `"eq"`

                - `"ne"`

                - `"gt"`

                - `"gte"`

                - `"lt"`

                - `"lte"`

                - `"in"`

                - `"nin"`

              - `value: string | number | boolean | Array<string | number>`

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

                - `string`

                - `number`

                - `boolean`

                - `Array<string | number>`

                  - `string`

                  - `number`

            - `CompoundFilter`

              Combine multiple filters using `and` or `or`.

              - `filters: Array<ComparisonFilter | unknown>`

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

                - `ComparisonFilter`

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

                  - `key: string`

                    The key to compare against the value.

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

                    Specifies the comparison operator: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`, `in`, `nin`.

                    - `eq`: equals
                    - `ne`: not equal
                    - `gt`: greater than
                    - `gte`: greater than or equal
                    - `lt`: less than
                    - `lte`: less than or equal
                    - `in`: in
                    - `nin`: not in

                    - `"eq"`

                    - `"ne"`

                    - `"gt"`

                    - `"gte"`

                    - `"lt"`

                    - `"lte"`

                    - `"in"`

                    - `"nin"`

                  - `value: string | number | boolean | Array<string | number>`

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

                    - `string`

                    - `number`

                    - `boolean`

                    - `Array<string | number>`

                      - `string`

                      - `number`

                - `unknown`

              - `type: "and" | "or"`

                Type of operation: `and` or `or`.

                - `"and"`

                - `"or"`

          - `max_num_results?: number`

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

          - `ranking_options?: RankingOptions`

            Ranking options for search.

            - `hybrid_search?: HybridSearch`

              Weights that control how reciprocal rank fusion balances semantic embedding matches versus sparse keyword matches when hybrid search is enabled.

              - `embedding_weight: number`

                The weight of the embedding in the reciprocal ranking fusion.

              - `text_weight: number`

                The weight of the text in the reciprocal ranking fusion.

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

              The ranker to use for the file search.

              - `"auto"`

              - `"default-2024-11-15"`

            - `score_threshold?: number`

              The score threshold for the file search, a number between 0 and 1. Numbers closer to 1 will attempt to return only the most relevant results, but may return fewer results.

        - `BetaComputerTool`

          A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use).

          - `type: "computer"`

            The type of the computer tool. Always `computer`.

            - `"computer"`

        - `BetaComputerUsePreviewTool`

          A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use).

          - `display_height: number`

            The height of the computer display.

          - `display_width: number`

            The width of the computer display.

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

            The type of computer environment to control.

            - `"windows"`

            - `"mac"`

            - `"linux"`

            - `"ubuntu"`

            - `"browser"`

          - `type: "computer_use_preview"`

            The type of the computer use tool. Always `computer_use_preview`.

            - `"computer_use_preview"`

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

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

            - `"web_search"`

            - `"web_search_2025_08_26"`

          - `external_web_access?: boolean`

            Allow live internet access for web search. Defaults to true when omitted. When false, the web search tool runs in offline/cache-only mode and will not fetch new external content.

          - `filters?: Filters | null`

            Filters for the search.

            - `allowed_domains?: Array<string> | null`

              Allowed domains for the search. If not provided, all domains are allowed.
              Subdomains of the provided domains are allowed as well.

              Example: `["pubmed.ncbi.nlm.nih.gov"]`

          - `search_context_size?: "low" | "medium" | "high"`

            High level guidance for the amount of context window space to use for the search. One of `low`, `medium`, or `high`. `medium` is the default.

            - `"low"`

            - `"medium"`

            - `"high"`

          - `user_location?: UserLocation | null`

            The approximate location of the user.

            - `city?: string | null`

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

            - `country?: string | null`

              The two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of the user, e.g. `US`.

            - `region?: string | null`

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

            - `timezone?: string | null`

              The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of the user, e.g. `America/Los_Angeles`.

            - `type?: "approximate"`

              The type of location approximation. Always `approximate`.

              - `"approximate"`

        - `Mcp`

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

          - `server_label: string`

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

          - `type: "mcp"`

            The type of the MCP tool. Always `mcp`.

            - `"mcp"`

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

            The tool invocation context(s).

            - `"direct"`

            - `"programmatic"`

          - `allowed_tools?: Array<string> | McpToolFilter | null`

            List of allowed tool names or a filter object.

            - `Array<string>`

            - `McpToolFilter`

              A filter object to specify which tools are allowed.

              - `read_only?: boolean`

                Indicates whether or not a tool modifies data or is read-only. If an
                MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint),
                it will match this filter.

              - `tool_names?: Array<string>`

                List of allowed tool names.

          - `authorization?: string`

            An OAuth access token that can be used with a remote MCP server, either
            with a custom MCP server URL or a service connector. Your application
            must handle the OAuth authorization flow and provide the token here.

          - `connector_id?: "connector_dropbox" | "connector_gmail" | "connector_googlecalendar" | 5 more`

            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`

            - `"connector_dropbox"`

            - `"connector_gmail"`

            - `"connector_googlecalendar"`

            - `"connector_googledrive"`

            - `"connector_microsoftteams"`

            - `"connector_outlookcalendar"`

            - `"connector_outlookemail"`

            - `"connector_sharepoint"`

          - `defer_loading?: boolean`

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

          - `headers?: Record<string, string> | null`

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

          - `require_approval?: McpToolApprovalFilter | "always" | "never" | null`

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

            - `McpToolApprovalFilter`

              Specify which of the MCP server's tools require approval. Can be
              `always`, `never`, or a filter object associated with tools
              that require approval.

              - `always?: Always`

                A filter object to specify which tools are allowed.

                - `read_only?: boolean`

                  Indicates whether or not a tool modifies data or is read-only. If an
                  MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint),
                  it will match this filter.

                - `tool_names?: Array<string>`

                  List of allowed tool names.

              - `never?: Never`

                A filter object to specify which tools are allowed.

                - `read_only?: boolean`

                  Indicates whether or not a tool modifies data or is read-only. If an
                  MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint),
                  it will match this filter.

                - `tool_names?: Array<string>`

                  List of allowed tool names.

            - `"always" | "never"`

              - `"always"`

              - `"never"`

          - `server_description?: string`

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

          - `server_url?: string`

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

          - `tunnel_id?: string`

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

        - `CodeInterpreter`

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

          - `container: string | CodeInterpreterToolAuto`

            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`

            - `CodeInterpreterToolAuto`

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

              - `type: "auto"`

                Always `auto`.

                - `"auto"`

              - `file_ids?: Array<string>`

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

              - `memory_limit?: "1g" | "4g" | "16g" | "64g" | null`

                The memory limit for the code interpreter container.

                - `"1g"`

                - `"4g"`

                - `"16g"`

                - `"64g"`

              - `network_policy?: BetaContainerNetworkPolicyDisabled | BetaContainerNetworkPolicyAllowlist`

                Network access policy for the container.

                - `BetaContainerNetworkPolicyDisabled`

                  - `type: "disabled"`

                    Disable outbound network access. Always `disabled`.

                    - `"disabled"`

                - `BetaContainerNetworkPolicyAllowlist`

                  - `allowed_domains: Array<string>`

                    A list of allowed domains when type is `allowlist`.

                  - `type: "allowlist"`

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

                    - `"allowlist"`

                  - `domain_secrets?: Array<BetaContainerNetworkPolicyDomainSecret>`

                    Optional domain-scoped secrets for allowlisted domains.

                    - `domain: string`

                      The domain associated with the secret.

                    - `name: string`

                      The name of the secret to inject for the domain.

                    - `value: string`

                      The secret value to inject for the domain.

          - `type: "code_interpreter"`

            The type of the code interpreter tool. Always `code_interpreter`.

            - `"code_interpreter"`

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

            The tool invocation context(s).

            - `"direct"`

            - `"programmatic"`

        - `ProgrammaticToolCalling`

          - `type: "programmatic_tool_calling"`

            The type of the tool. Always `programmatic_tool_calling`.

            - `"programmatic_tool_calling"`

        - `ImageGeneration`

          A tool that generates images using the GPT image models.

          - `type: "image_generation"`

            The type of the image generation tool. Always `image_generation`.

            - `"image_generation"`

          - `action?: "generate" | "edit" | "auto"`

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

            - `"generate"`

            - `"edit"`

            - `"auto"`

          - `background?: "transparent" | "opaque" | "auto"`

            Allows to set transparency for the background of the generated image(s).
            Must be one of `transparent`, `opaque`, or `auto` (default value). When
            `auto` is used, the model will automatically determine the best
            background for the image.

            Transparent backgrounds are available for supported GPT Image models.
            For `gpt-image-2` and `gpt-image-2-2026-04-21`, this support is in
            preview. When using `transparent`, set the output format to `png` or
            `webp`.

            - `"transparent"`

            - `"opaque"`

            - `"auto"`

          - `input_fidelity?: "high" | "low" | null`

            Control how much effort the model will exert to match the style and features, especially facial features, of input images. This parameter is only supported for `gpt-image-1` and `gpt-image-1.5` and later models, unsupported for `gpt-image-1-mini`. Supports `high` and `low`. Defaults to `low`.

            - `"high"`

            - `"low"`

          - `input_image_mask?: InputImageMask`

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

            - `file_id?: string`

              File ID for the mask image.

            - `image_url?: string`

              Base64-encoded mask image.

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

            The image generation model to use. One of `gpt-image-1`,
            `gpt-image-1-mini`, `gpt-image-1.5`, `gpt-image-2`,
            `gpt-image-2-2026-04-21`, or `chatgpt-image-latest`. Default:
            `gpt-image-1`.

            - `(string & {})`

            - `"gpt-image-1" | "gpt-image-1-mini" | "gpt-image-2" | 3 more`

              - `"gpt-image-1"`

              - `"gpt-image-1-mini"`

              - `"gpt-image-2"`

              - `"gpt-image-2-2026-04-21"`

              - `"gpt-image-1.5"`

              - `"chatgpt-image-latest"`

          - `moderation?: "auto" | "low"`

            Moderation level for the generated image. Default: `auto`.

            - `"auto"`

            - `"low"`

          - `output_compression?: number`

            Compression level for the output image. Default: 100.

          - `output_format?: "png" | "webp" | "jpeg"`

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

            - `"png"`

            - `"webp"`

            - `"jpeg"`

          - `partial_images?: number`

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

          - `quality?: "low" | "medium" | "high" | "auto"`

            The quality of the generated image. One of `low`, `medium`, `high`,
            or `auto`. Default: `auto`.

            - `"low"`

            - `"medium"`

            - `"high"`

            - `"auto"`

          - `size?: (string & {}) | "1024x1024" | "1024x1536" | "1536x1024" | "auto"`

            The size of the generated images. For `gpt-image-2` and `gpt-image-2-2026-04-21`, arbitrary resolutions are supported as `WIDTHxHEIGHT` strings, for example `1536x864`. Width and height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above `2560x1440` are experimental, and the maximum supported resolution is `3840x2160`. The requested size must also satisfy the model's current pixel and edge limits. The standard sizes `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models; `auto` is supported for models that allow automatic sizing. For `dall-e-2`, use one of `256x256`, `512x512`, or `1024x1024`. For `dall-e-3`, use one of `1024x1024`, `1792x1024`, or `1024x1792`.

            - `(string & {})`

            - `"1024x1024" | "1024x1536" | "1536x1024" | "auto"`

              - `"1024x1024"`

              - `"1024x1536"`

              - `"1536x1024"`

              - `"auto"`

        - `LocalShell`

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

          - `type: "local_shell"`

            The type of the local shell tool. Always `local_shell`.

            - `"local_shell"`

        - `BetaFunctionShellTool`

          A tool that allows the model to execute shell commands.

          - `type: "shell"`

            The type of the shell tool. Always `shell`.

            - `"shell"`

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

            The tool invocation context(s).

            - `"direct"`

            - `"programmatic"`

          - `environment?: BetaContainerAuto | BetaLocalEnvironment | BetaContainerReference | null`

            - `BetaContainerAuto`

              - `type: "container_auto"`

                Automatically creates a container for this request

                - `"container_auto"`

              - `file_ids?: Array<string>`

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

              - `memory_limit?: "1g" | "4g" | "16g" | "64g" | null`

                The memory limit for the container.

                - `"1g"`

                - `"4g"`

                - `"16g"`

                - `"64g"`

              - `network_policy?: BetaContainerNetworkPolicyDisabled | BetaContainerNetworkPolicyAllowlist`

                Network access policy for the container.

                - `BetaContainerNetworkPolicyDisabled`

                - `BetaContainerNetworkPolicyAllowlist`

              - `skills?: Array<BetaSkillReference | BetaInlineSkill>`

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

                - `BetaSkillReference`

                  - `skill_id: string`

                    The ID of the referenced skill.

                  - `type: "skill_reference"`

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

                    - `"skill_reference"`

                  - `version?: string`

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

                - `BetaInlineSkill`

                  - `description: string`

                    The description of the skill.

                  - `name: string`

                    The name of the skill.

                  - `source: BetaInlineSkillSource`

                    Inline skill payload

                    - `data: string`

                      Base64-encoded skill zip bundle.

                    - `media_type: "application/zip"`

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

                      - `"application/zip"`

                    - `type: "base64"`

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

                      - `"base64"`

                  - `type: "inline"`

                    Defines an inline skill for this request.

                    - `"inline"`

            - `BetaLocalEnvironment`

              - `type: "local"`

                Use a local computer environment.

                - `"local"`

              - `skills?: Array<BetaLocalSkill>`

                An optional list of skills.

                - `description: string`

                  The description of the skill.

                - `name: string`

                  The name of the skill.

                - `path: string`

                  The path to the directory containing the skill.

            - `BetaContainerReference`

              - `container_id: string`

                The ID of the referenced container.

              - `type: "container_reference"`

                References a container created with the /v1/containers endpoint

                - `"container_reference"`

        - `BetaCustomTool`

          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)

          - `name: string`

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

          - `type: "custom"`

            The type of the custom tool. Always `custom`.

            - `"custom"`

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

            The tool invocation context(s).

            - `"direct"`

            - `"programmatic"`

          - `defer_loading?: boolean`

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

          - `description?: string`

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

          - `format?: Text | Grammar`

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

            - `Text`

              Unconstrained free-form text.

              - `type: "text"`

                Unconstrained text format. Always `text`.

                - `"text"`

            - `Grammar`

              A grammar defined by the user.

              - `definition: string`

                The grammar definition.

              - `syntax: "lark" | "regex"`

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

                - `"lark"`

                - `"regex"`

              - `type: "grammar"`

                Grammar format. Always `grammar`.

                - `"grammar"`

        - `BetaNamespaceTool`

          Groups function/custom tools under a shared namespace.

          - `description: string`

            A description of the namespace shown to the model.

          - `name: string`

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

          - `tools: Array<Function | BetaCustomTool>`

            The function/custom tools available inside this namespace.

            - `Function`

              - `name: string`

              - `type: "function"`

                - `"function"`

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

                The tool invocation context(s).

                - `"direct"`

                - `"programmatic"`

              - `defer_loading?: boolean`

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

              - `description?: string | null`

              - `output_schema?: Record<string, unknown> | null`

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

              - `parameters?: unknown`

              - `strict?: boolean | null`

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

            - `BetaCustomTool`

              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: "namespace"`

            The type of the tool. Always `namespace`.

            - `"namespace"`

        - `BetaToolSearchTool`

          Hosted or BYOT tool search configuration for deferred tools.

          - `type: "tool_search"`

            The type of the tool. Always `tool_search`.

            - `"tool_search"`

          - `description?: string | null`

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

          - `execution?: "server" | "client"`

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

            - `"server"`

            - `"client"`

          - `parameters?: unknown`

            Parameter schema for a client-executed tool search tool.

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

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

            - `"web_search_preview"`

            - `"web_search_preview_2025_03_11"`

          - `search_content_types?: Array<"text" | "image">`

            - `"text"`

            - `"image"`

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

            - `"low"`

            - `"medium"`

            - `"high"`

          - `user_location?: UserLocation | null`

            The user's location.

            - `type: "approximate"`

              The type of location approximation. Always `approximate`.

              - `"approximate"`

            - `city?: string | null`

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

            - `country?: string | null`

              The two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of the user, e.g. `US`.

            - `region?: string | null`

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

            - `timezone?: string | null`

              The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of the user, e.g. `America/Los_Angeles`.

        - `BetaApplyPatchTool`

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

          - `type: "apply_patch"`

            The type of the tool. Always `apply_patch`.

            - `"apply_patch"`

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

            The tool invocation context(s).

            - `"direct"`

            - `"programmatic"`

      - `type: "tool_search_output"`

        The type of the item. Always `tool_search_output`.

        - `"tool_search_output"`

      - `agent?: Agent`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

      - `created_by?: string`

        The identifier of the actor that created the item.

    - `AdditionalTools`

      - `id: string`

        The unique ID of the additional tools item.

      - `role: "unknown" | "user" | "assistant" | 5 more`

        The role that provided the additional tools.

        - `"unknown"`

        - `"user"`

        - `"assistant"`

        - `"system"`

        - `"critic"`

        - `"discriminator"`

        - `"developer"`

        - `"tool"`

      - `tools: Array<BetaTool>`

        The additional tool definitions made available at this item.

        - `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).

        - `Mcp`

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

        - `CodeInterpreter`

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

        - `ProgrammaticToolCalling`

        - `ImageGeneration`

          A tool that generates images using the GPT image models.

        - `LocalShell`

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

        - `BetaFunctionShellTool`

          A tool that allows the model to execute shell commands.

        - `BetaCustomTool`

          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)

        - `BetaNamespaceTool`

          Groups function/custom tools under a shared namespace.

        - `BetaToolSearchTool`

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

        - `BetaApplyPatchTool`

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

      - `type: "additional_tools"`

        The type of the item. Always `additional_tools`.

        - `"additional_tools"`

      - `agent?: Agent`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

    - `BetaResponseCompactionItem`

      A compaction item generated by the [`v1/responses/compact` API](https://platform.openai.com/docs/api-reference/responses/compact).

      - `id: string`

        The unique ID of the compaction item.

      - `encrypted_content: string`

        The encrypted content that was produced by compaction.

      - `type: "compaction"`

        The type of the item. Always `compaction`.

        - `"compaction"`

      - `agent?: Agent`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

      - `created_by?: string`

        The identifier of the actor that created the item.

    - `ImageGenerationCall`

      An image generation request made by the model.

      - `id: string`

        The unique ID of the image generation call.

      - `result: string | null`

        The generated image encoded in base64.

      - `status: "in_progress" | "completed" | "generating" | "failed"`

        The status of the image generation call.

        - `"in_progress"`

        - `"completed"`

        - `"generating"`

        - `"failed"`

      - `type: "image_generation_call"`

        The type of the image generation call. Always `image_generation_call`.

        - `"image_generation_call"`

      - `agent?: Agent | null`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

    - `BetaResponseCodeInterpreterToolCall`

      A tool call to run code.

      - `id: string`

        The unique ID of the code interpreter tool call.

      - `code: string | null`

        The code to run, or null if not available.

      - `container_id: string`

        The ID of the container used to run the code.

      - `outputs: Array<Logs | Image> | null`

        The outputs generated by the code interpreter, such as logs or images.
        Can be null if no outputs are available.

        - `Logs`

          The logs output from the code interpreter.

          - `logs: string`

            The logs output from the code interpreter.

          - `type: "logs"`

            The type of the output. Always `logs`.

            - `"logs"`

        - `Image`

          The image output from the code interpreter.

          - `type: "image"`

            The type of the output. Always `image`.

            - `"image"`

          - `url: string`

            The URL of the image output from the code interpreter.

      - `status: "in_progress" | "completed" | "incomplete" | 2 more`

        The status of the code interpreter tool call. Valid values are `in_progress`, `completed`, `incomplete`, `interpreting`, and `failed`.

        - `"in_progress"`

        - `"completed"`

        - `"incomplete"`

        - `"interpreting"`

        - `"failed"`

      - `type: "code_interpreter_call"`

        The type of the code interpreter tool call. Always `code_interpreter_call`.

        - `"code_interpreter_call"`

      - `agent?: Agent | null`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

    - `LocalShellCall`

      A tool call to run a command on the local shell.

      - `id: string`

        The unique ID of the local shell call.

      - `action: Action`

        Execute a shell command on the server.

        - `command: Array<string>`

          The command to run.

        - `env: Record<string, string>`

          Environment variables to set for the command.

        - `type: "exec"`

          The type of the local shell action. Always `exec`.

          - `"exec"`

        - `timeout_ms?: number | null`

          Optional timeout in milliseconds for the command.

        - `user?: string | null`

          Optional user to run the command as.

        - `working_directory?: string | null`

          Optional working directory to run the command in.

      - `call_id: string`

        The unique ID of the local shell tool call generated by the model.

      - `status: "in_progress" | "completed" | "incomplete"`

        The status of the local shell call.

        - `"in_progress"`

        - `"completed"`

        - `"incomplete"`

      - `type: "local_shell_call"`

        The type of the local shell call. Always `local_shell_call`.

        - `"local_shell_call"`

      - `agent?: Agent | null`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

    - `LocalShellCallOutput`

      The output of a local shell tool call.

      - `id: string`

        The unique ID of the local shell tool call generated by the model.

      - `output: string`

        A JSON string of the output of the local shell tool call.

      - `type: "local_shell_call_output"`

        The type of the local shell tool call output. Always `local_shell_call_output`.

        - `"local_shell_call_output"`

      - `agent?: Agent | null`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

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

        The status of the item. One of `in_progress`, `completed`, or `incomplete`.

        - `"in_progress"`

        - `"completed"`

        - `"incomplete"`

    - `BetaResponseFunctionShellToolCall`

      A tool call that executes one or more shell commands in a managed environment.

      - `id: string`

        The unique ID of the shell tool call. Populated when this item is returned via API.

      - `action: Action`

        The shell commands and limits that describe how to run the tool call.

        - `commands: Array<string>`

        - `max_output_length: number | null`

          Optional maximum number of characters to return from each command.

        - `timeout_ms: number | null`

          Optional timeout in milliseconds for the commands.

      - `call_id: string`

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

      - `environment: BetaResponseLocalEnvironment | BetaResponseContainerReference | null`

        Represents the use of a local environment to perform shell actions.

        - `BetaResponseLocalEnvironment`

          Represents the use of a local environment to perform shell actions.

          - `type: "local"`

            The environment type. Always `local`.

            - `"local"`

        - `BetaResponseContainerReference`

          Represents a container created with /v1/containers.

          - `container_id: string`

          - `type: "container_reference"`

            The environment type. Always `container_reference`.

            - `"container_reference"`

      - `status: "in_progress" | "completed" | "incomplete"`

        The status of the shell call. One of `in_progress`, `completed`, or `incomplete`.

        - `"in_progress"`

        - `"completed"`

        - `"incomplete"`

      - `type: "shell_call"`

        The type of the item. Always `shell_call`.

        - `"shell_call"`

      - `agent?: Agent`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

      - `caller?: Direct | Program | null`

        The execution context that produced this tool call.

        - `Direct`

          - `type: "direct"`

            - `"direct"`

        - `Program`

          - `caller_id: string`

            The call ID of the program item that produced this tool call.

          - `type: "program"`

            - `"program"`

      - `created_by?: string`

        The ID of the entity that created this tool call.

    - `BetaResponseFunctionShellToolCallOutput`

      The output of a shell tool call that was emitted.

      - `id: string`

        The unique ID of the shell call output. Populated when this item is returned via API.

      - `call_id: string`

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

      - `max_output_length: number | null`

        The maximum length of the shell command output. This is generated by the model and should be passed back with the raw output.

      - `output: Array<Output>`

        An array of shell call output contents

        - `outcome: Timeout | Exit`

          Represents either an exit outcome (with an exit code) or a timeout outcome for a shell call output chunk.

          - `Timeout`

            Indicates that the shell call exceeded its configured time limit.

            - `type: "timeout"`

              The outcome type. Always `timeout`.

              - `"timeout"`

          - `Exit`

            Indicates that the shell commands finished and returned an exit code.

            - `exit_code: number`

              Exit code from the shell process.

            - `type: "exit"`

              The outcome type. Always `exit`.

              - `"exit"`

        - `stderr: string`

          The standard error output that was captured.

        - `stdout: string`

          The standard output that was captured.

        - `created_by?: string`

          The identifier of the actor that created the item.

      - `status: "in_progress" | "completed" | "incomplete"`

        The status of the shell call output. One of `in_progress`, `completed`, or `incomplete`.

        - `"in_progress"`

        - `"completed"`

        - `"incomplete"`

      - `type: "shell_call_output"`

        The type of the shell call output. Always `shell_call_output`.

        - `"shell_call_output"`

      - `agent?: Agent`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

      - `caller?: Direct | Program | null`

        The execution context that produced this tool call.

        - `Direct`

          - `type: "direct"`

            - `"direct"`

        - `Program`

          - `caller_id: string`

            The call ID of the program item that produced this tool call.

          - `type: "program"`

            - `"program"`

      - `created_by?: string`

        The identifier of the actor that created the item.

    - `BetaResponseApplyPatchToolCall`

      A tool call that applies file diffs by creating, deleting, or updating files.

      - `id: string`

        The unique ID of the apply patch tool call. Populated when this item is returned via API.

      - `call_id: string`

        The unique ID of the apply patch tool call generated by the model.

      - `operation: CreateFile | DeleteFile | UpdateFile`

        One of the create_file, delete_file, or update_file operations applied via apply_patch.

        - `CreateFile`

          Instruction describing how to create a file via the apply_patch tool.

          - `diff: string`

            Diff to apply.

          - `path: string`

            Path of the file to create.

          - `type: "create_file"`

            Create a new file with the provided diff.

            - `"create_file"`

        - `DeleteFile`

          Instruction describing how to delete a file via the apply_patch tool.

          - `path: string`

            Path of the file to delete.

          - `type: "delete_file"`

            Delete the specified file.

            - `"delete_file"`

        - `UpdateFile`

          Instruction describing how to update a file via the apply_patch tool.

          - `diff: string`

            Diff to apply.

          - `path: string`

            Path of the file to update.

          - `type: "update_file"`

            Update an existing file with the provided diff.

            - `"update_file"`

      - `status: "in_progress" | "completed"`

        The status of the apply patch tool call. One of `in_progress` or `completed`.

        - `"in_progress"`

        - `"completed"`

      - `type: "apply_patch_call"`

        The type of the item. Always `apply_patch_call`.

        - `"apply_patch_call"`

      - `agent?: Agent`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

      - `caller?: Direct | Program | null`

        The execution context that produced this tool call.

        - `Direct`

          - `type: "direct"`

            - `"direct"`

        - `Program`

          - `caller_id: string`

            The call ID of the program item that produced this tool call.

          - `type: "program"`

            - `"program"`

      - `created_by?: string`

        The ID of the entity that created this tool call.

    - `BetaResponseApplyPatchToolCallOutput`

      The output emitted by an apply patch tool call.

      - `id: string`

        The unique ID of the apply patch tool call output. Populated when this item is returned via API.

      - `call_id: string`

        The unique ID of the apply patch tool call generated by the model.

      - `status: "completed" | "failed"`

        The status of the apply patch tool call output. One of `completed` or `failed`.

        - `"completed"`

        - `"failed"`

      - `type: "apply_patch_call_output"`

        The type of the item. Always `apply_patch_call_output`.

        - `"apply_patch_call_output"`

      - `agent?: Agent`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

      - `caller?: Direct | Program | null`

        The execution context that produced this tool call.

        - `Direct`

          - `type: "direct"`

            - `"direct"`

        - `Program`

          - `caller_id: string`

            The call ID of the program item that produced this tool call.

          - `type: "program"`

            - `"program"`

      - `created_by?: string`

        The ID of the entity that created this tool call output.

      - `output?: string | null`

        Optional textual output returned by the apply patch tool.

    - `McpCall`

      An invocation of a tool on an MCP server.

      - `id: string`

        The unique ID of the tool call.

      - `arguments: string`

        A JSON string of the arguments passed to the tool.

      - `name: string`

        The name of the tool that was run.

      - `server_label: string`

        The label of the MCP server running the tool.

      - `type: "mcp_call"`

        The type of the item. Always `mcp_call`.

        - `"mcp_call"`

      - `agent?: Agent | null`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

      - `approval_request_id?: string | null`

        Unique identifier for the MCP tool call approval request.
        Include this value in a subsequent `mcp_approval_response` input to approve or reject the corresponding tool call.

      - `error?: BetaMcpToolCallError | null`

        The error from the tool call, if any.

        - `McpProtocolError`

          - `code: number`

          - `message: string`

          - `type: "mcp_protocol_error"`

            - `"mcp_protocol_error"`

        - `McpToolExecutionError`

          - `content: unknown`

          - `type: "mcp_tool_execution_error"`

            - `"mcp_tool_execution_error"`

        - `HTTPError`

          - `code: number`

          - `message: string`

          - `type: "http_error"`

            - `"http_error"`

      - `output?: string | null`

        The output from the tool call.

      - `status?: "in_progress" | "completed" | "incomplete" | 2 more`

        The status of the tool call. One of `in_progress`, `completed`, `incomplete`, `calling`, or `failed`.

        - `"in_progress"`

        - `"completed"`

        - `"incomplete"`

        - `"calling"`

        - `"failed"`

    - `McpListTools`

      A list of tools available on an MCP server.

      - `id: string`

        The unique ID of the list.

      - `server_label: string`

        The label of the MCP server.

      - `tools: Array<Tool>`

        The tools available on the server.

        - `input_schema: unknown`

          The JSON schema describing the tool's input.

        - `name: string`

          The name of the tool.

        - `annotations?: unknown`

          Additional annotations about the tool.

        - `description?: string | null`

          The description of the tool.

      - `type: "mcp_list_tools"`

        The type of the item. Always `mcp_list_tools`.

        - `"mcp_list_tools"`

      - `agent?: Agent | null`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

      - `error?: string | null`

        Error message if the server could not list tools.

    - `McpApprovalRequest`

      A request for human approval of a tool invocation.

      - `id: string`

        The unique ID of the approval request.

      - `arguments: string`

        A JSON string of arguments for the tool.

      - `name: string`

        The name of the tool to run.

      - `server_label: string`

        The label of the MCP server making the request.

      - `type: "mcp_approval_request"`

        The type of the item. Always `mcp_approval_request`.

        - `"mcp_approval_request"`

      - `agent?: Agent | null`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

    - `McpApprovalResponse`

      A response to an MCP approval request.

      - `id: string`

        The unique ID of the approval response

      - `approval_request_id: string`

        The ID of the approval request being answered.

      - `approve: boolean`

        Whether the request was approved.

      - `type: "mcp_approval_response"`

        The type of the item. Always `mcp_approval_response`.

        - `"mcp_approval_response"`

      - `agent?: Agent | null`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

      - `reason?: string | null`

        Optional reason for the decision.

    - `BetaResponseCustomToolCall`

      A call to a custom tool created by the model.

      - `call_id: string`

        An identifier used to map this custom tool call to a tool call output.

      - `input: string`

        The input for the custom tool call generated by the model.

      - `name: string`

        The name of the custom tool being called.

      - `type: "custom_tool_call"`

        The type of the custom tool call. Always `custom_tool_call`.

        - `"custom_tool_call"`

      - `id?: string`

        The unique ID of the custom tool call in the OpenAI platform.

      - `agent?: Agent | null`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

      - `caller?: Direct | Program | null`

        The execution context that produced this tool call.

        - `Direct`

          - `type: "direct"`

            - `"direct"`

        - `Program`

          - `caller_id: string`

            The call ID of the program item that produced this tool call.

          - `type: "program"`

            - `"program"`

      - `namespace?: string`

        The namespace of the custom tool being called.

    - `BetaResponseCustomToolCallOutputItem extends BetaResponseCustomToolCallOutput`

      The output of a custom tool call from your code, being sent back to the model.

      - `id: string`

        The unique ID of the custom tool call output item.

      - `status: "in_progress" | "completed" | "incomplete"`

        The status of the item. One of `in_progress`, `completed`, or
        `incomplete`. Populated when items are returned via API.

        - `"in_progress"`

        - `"completed"`

        - `"incomplete"`

      - `created_by?: string`

        The identifier of the actor that created the item.

  - `usage: BetaResponseUsage`

    Token accounting for the compaction pass, including cached, reasoning, and total tokens.

    - `input_tokens: number`

      The number of input tokens.

    - `input_tokens_details: InputTokensDetails`

      A detailed breakdown of the input tokens.

      - `cache_write_tokens: number`

        The number of input tokens that were written to the cache.

      - `cached_tokens: number`

        The number of tokens that were retrieved from the cache.
        [More on prompt caching](https://platform.openai.com/docs/guides/prompt-caching).

    - `output_tokens: number`

      The number of output tokens.

    - `output_tokens_details: OutputTokensDetails`

      A detailed breakdown of the output tokens.

      - `reasoning_tokens: number`

        The number of reasoning tokens.

    - `total_tokens: number`

      The total number of tokens used.

### Example

```typescript
import OpenAI from 'openai';

const client = new OpenAI({
  apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
});

const betaCompactedResponse = await client.beta.responses.compact({ model: 'gpt-5.6-sol' });

console.log(betaCompactedResponse.id);
```

#### Response

```json
{
  "id": "id",
  "created_at": 0,
  "object": "response.compaction",
  "output": [
    {
      "id": "id",
      "content": [
        {
          "annotations": [
            {
              "file_id": "file_id",
              "filename": "filename",
              "index": 0,
              "type": "file_citation"
            }
          ],
          "text": "text",
          "type": "output_text",
          "logprobs": [
            {
              "token": "token",
              "bytes": [
                0
              ],
              "logprob": 0,
              "top_logprobs": [
                {
                  "token": "token",
                  "bytes": [
                    0
                  ],
                  "logprob": 0
                }
              ]
            }
          ]
        }
      ],
      "role": "assistant",
      "status": "in_progress",
      "type": "message",
      "agent": {
        "agent_name": "agent_name"
      },
      "phase": "commentary"
    }
  ],
  "usage": {
    "input_tokens": 0,
    "input_tokens_details": {
      "cache_write_tokens": 0,
      "cached_tokens": 0
    },
    "output_tokens": 0,
    "output_tokens_details": {
      "reasoning_tokens": 0
    },
    "total_tokens": 0
  }
}
```

### Example

```typescript
import OpenAI from "openai";

const openai = new OpenAI();

// Compact the previous response if you are running out of tokens
const compactedResponse = await openai.responses.compact({
  model: "gpt-5.1-codex-max",
  input: [
    {
      role: "user",
      content: "Create a simple landing page for a dog petting café.",
    },
    // All items returned from previous requests are included here, like reasoning, message, function call, etc.
    {
      id: "msg_030d085c0b53e67e0069332e3a72d4819c96c6f2c4adc15d33",
      type: "message",
      status: "completed",
      content: [
        {
          type: "output_text",
          annotations: [],
          logprobs: [],
          text: "Below is a single file, ready-to-use landing page for a dog petting café:...",
        },
      ],
      role: "assistant",
    },
  ],
});

// Pass the compactedResponse.output as input to the next request
console.log(compactedResponse);
```

#### Response

```json
{
  "id": "resp_001",
  "object": "response.compaction",
  "created_at": 1764967971,
  "output": [
    {
      "id": "msg_000",
      "type": "message",
      "status": "completed",
      "content": [
        {
          "type": "input_text",
          "text": "Create a simple landing page for a dog petting cafe."
        }
      ],
      "role": "user"
    },
    {
      "id": "cmp_001",
      "type": "compaction",
      "encrypted_content": "gAAAAABpM0Yj-...="
    }
  ],
  "usage": {
    "input_tokens": 139,
    "input_tokens_details": {
      "cached_tokens": 0,
      "cache_write_tokens": 0
    },
    "output_tokens": 438,
    "output_tokens_details": {
      "reasoning_tokens": 64
    },
    "total_tokens": 577
  }
}
```

## 

`client.beta.responses.connect(RequestOptionsoptions?): void`

**** ``

Connect to a persistent Responses API WebSocket. Send `response.create` events and receive response stream events over the socket.

### Example

```typescript
import OpenAI from 'openai';

const client = new OpenAI({
  apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
});

await client.beta.responses.connect();
```

## Create a model response

`client.beta.responses.create(ResponseCreateParamsparams, RequestOptionsoptions?): BetaResponse | Stream<BetaResponseStreamEvent>`

**post** `/responses?beta=true`

Creates a model response. Provide [text](https://platform.openai.com/docs/guides/text) or
[image](https://platform.openai.com/docs/guides/images) inputs to generate [text](https://platform.openai.com/docs/guides/text)
or [JSON](https://platform.openai.com/docs/guides/structured-outputs) outputs. Have the model call
your own [custom code](https://platform.openai.com/docs/guides/function-calling) or use built-in
[tools](https://platform.openai.com/docs/guides/tools) like [web search](https://platform.openai.com/docs/guides/tools-web-search)
or [file search](https://platform.openai.com/docs/guides/tools-file-search) to use your own data
as input for the model's response.

### Parameters

- `ResponseCreateParams = ResponseCreateParamsNonStreaming | ResponseCreateParamsStreaming`

  - `ResponseCreateParamsBase`

    - `background?: boolean | null`

      Body param: Whether to run the model response in the background.
      [Learn more](https://platform.openai.com/docs/guides/background).

    - `context_management?: Array<ContextManagement> | null`

      Body param: Context management configuration for this request.

      - `type: string`

        The context management entry type. Currently only 'compaction' is supported.

      - `compact_threshold?: number | null`

        Token threshold at which compaction should be triggered for this entry.

    - `conversation?: string | BetaResponseConversationParam | null`

      Body param: The conversation that this response belongs to. Items from this conversation are prepended to `input_items` for this response request.
      Input items and output items from this response are automatically added to this conversation after this response completes.

      - `string`

      - `BetaResponseConversationParam`

        The conversation that this response belongs to.

        - `id: string`

          The unique ID of the conversation.

    - `include?: Array<BetaResponseIncludable> | null`

      Body param: Specify additional output data to include in the model response. Currently supported values are:

      - `web_search_call.action.sources`: Include the sources of the web search tool call.
      - `code_interpreter_call.outputs`: Includes the outputs of python code execution in code interpreter tool call items.
      - `computer_call_output.output.image_url`: Include image urls from the computer call output.
      - `file_search_call.results`: Include the search results of the file search tool call.
      - `message.input_image.image_url`: Include image urls from the input message.
      - `message.output_text.logprobs`: Include logprobs with assistant messages.
      - `reasoning.encrypted_content`: Includes an encrypted version of reasoning tokens in reasoning item outputs. This enables reasoning items to be used in multi-turn conversations when using the Responses API statelessly (like when the `store` parameter is set to `false`, or when an organization is enrolled in the zero data retention program).

      - `"file_search_call.results"`

      - `"web_search_call.results"`

      - `"web_search_call.action.sources"`

      - `"message.input_image.image_url"`

      - `"computer_call_output.output.image_url"`

      - `"code_interpreter_call.outputs"`

      - `"reasoning.encrypted_content"`

      - `"message.output_text.logprobs"`

    - `input?: string | BetaResponseInput`

      Body param: Text, image, or file inputs to the model, used to generate a response.

      Learn more:

      - [Text inputs and outputs](https://platform.openai.com/docs/guides/text)
      - [Image inputs](https://platform.openai.com/docs/guides/images)
      - [File inputs](https://platform.openai.com/docs/guides/pdf-files)
      - [Conversation state](https://platform.openai.com/docs/guides/conversation-state)
      - [Function calling](https://platform.openai.com/docs/guides/function-calling)

      - `string`

      - `BetaResponseInput = Array<BetaResponseInputItem>`

        A list of one or many input items to the model, containing
        different content types.

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

          - `content: string | BetaResponseInputMessageContentList`

            Text, image, or audio input to the model, used to generate a response.
            Can also contain previous assistant responses.

            - `string`

            - `BetaResponseInputMessageContentList = Array<BetaResponseInputContent>`

              A list of one or many input items to the model, containing different content
              types.

              - `BetaResponseInputText`

                A text input to the model.

                - `text: string`

                  The text input to the model.

                - `type: "input_text"`

                  The type of the input item. Always `input_text`.

                  - `"input_text"`

                - `prompt_cache_breakpoint?: PromptCacheBreakpoint`

                  Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.

                  - `mode: "explicit"`

                    The breakpoint mode. Always `explicit`.

                    - `"explicit"`

              - `BetaResponseInputImage`

                An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision).

                - `detail: BetaImageDetail`

                  The detail level of the image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`.

                  - `"low"`

                  - `"high"`

                  - `"auto"`

                  - `"original"`

                - `type: "input_image"`

                  The type of the input item. Always `input_image`.

                  - `"input_image"`

                - `file_id?: string | null`

                  The ID of the file to be sent to the model.

                - `image_url?: string | null`

                  The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.

                - `prompt_cache_breakpoint?: PromptCacheBreakpoint`

                  Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.

                  - `mode: "explicit"`

                    The breakpoint mode. Always `explicit`.

                    - `"explicit"`

              - `BetaResponseInputFile`

                A file input to the model.

                - `type: "input_file"`

                  The type of the input item. Always `input_file`.

                  - `"input_file"`

                - `detail?: "auto" | "low" | "high"`

                  The detail level of the file to be sent to the model. Use `auto` to let the system select the detail level; for GPT-5.6 and later models, `auto` uses high-quality rendering, which may increase input token usage. Use `low` for lower-cost rendering, or `high` to render the file at higher quality. Defaults to `auto`.

                  - `"auto"`

                  - `"low"`

                  - `"high"`

                - `file_data?: string`

                  The content of the file to be sent to the model.

                - `file_id?: string | null`

                  The ID of the file to be sent to the model.

                - `file_url?: string`

                  The URL of the file to be sent to the model.

                - `filename?: string`

                  The name of the file to be sent to the model.

                - `prompt_cache_breakpoint?: PromptCacheBreakpoint`

                  Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.

                  - `mode: "explicit"`

                    The breakpoint mode. Always `explicit`.

                    - `"explicit"`

          - `role: "user" | "assistant" | "system" | "developer"`

            The role of the message input. One of `user`, `assistant`, `system`, or
            `developer`.

            - `"user"`

            - `"assistant"`

            - `"system"`

            - `"developer"`

          - `phase?: "commentary" | "final_answer" | null`

            Labels an `assistant` message as intermediate commentary (`commentary`) or the final answer (`final_answer`).
            For models like `gpt-5.3-codex` and beyond, when sending follow-up requests, preserve and resend
            phase on all assistant messages — dropping it can degrade performance. Not used for user messages.

            - `"commentary"`

            - `"final_answer"`

          - `type?: "message"`

            The type of the message input. Always `message`.

            - `"message"`

        - `Message`

          A message input to the model with a role indicating instruction following
          hierarchy. Instructions given with the `developer` or `system` role take
          precedence over instructions given with the `user` role.

          - `content: BetaResponseInputMessageContentList`

            A list of one or many input items to the model, containing different content
            types.

          - `role: "user" | "system" | "developer"`

            The role of the message input. One of `user`, `system`, or `developer`.

            - `"user"`

            - `"system"`

            - `"developer"`

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

          - `status?: "in_progress" | "completed" | "incomplete"`

            The status of item. One of `in_progress`, `completed`, or
            `incomplete`. Populated when items are returned via API.

            - `"in_progress"`

            - `"completed"`

            - `"incomplete"`

          - `type?: "message"`

            The type of the message input. Always set to `message`.

            - `"message"`

        - `BetaResponseOutputMessage`

          An output message from the model.

          - `id: string`

            The unique ID of the output message.

          - `content: Array<BetaResponseOutputText | BetaResponseOutputRefusal>`

            The content of the output message.

            - `BetaResponseOutputText`

              A text output from the model.

              - `annotations: Array<FileCitation | URLCitation | ContainerFileCitation | FilePath>`

                The annotations of the text output.

                - `FileCitation`

                  A citation to a file.

                  - `file_id: string`

                    The ID of the file.

                  - `filename: string`

                    The filename of the file cited.

                  - `index: number`

                    The index of the file in the list of files.

                  - `type: "file_citation"`

                    The type of the file citation. Always `file_citation`.

                    - `"file_citation"`

                - `URLCitation`

                  A citation for a web resource used to generate a model response.

                  - `end_index: number`

                    The index of the last character of the URL citation in the message.

                  - `start_index: number`

                    The index of the first character of the URL citation in the message.

                  - `title: string`

                    The title of the web resource.

                  - `type: "url_citation"`

                    The type of the URL citation. Always `url_citation`.

                    - `"url_citation"`

                  - `url: string`

                    The URL of the web resource.

                - `ContainerFileCitation`

                  A citation for a container file used to generate a model response.

                  - `container_id: string`

                    The ID of the container file.

                  - `end_index: number`

                    The index of the last character of the container file citation in the message.

                  - `file_id: string`

                    The ID of the file.

                  - `filename: string`

                    The filename of the container file cited.

                  - `start_index: number`

                    The index of the first character of the container file citation in the message.

                  - `type: "container_file_citation"`

                    The type of the container file citation. Always `container_file_citation`.

                    - `"container_file_citation"`

                - `FilePath`

                  A path to a file.

                  - `file_id: string`

                    The ID of the file.

                  - `index: number`

                    The index of the file in the list of files.

                  - `type: "file_path"`

                    The type of the file path. Always `file_path`.

                    - `"file_path"`

              - `text: string`

                The text output from the model.

              - `type: "output_text"`

                The type of the output text. Always `output_text`.

                - `"output_text"`

              - `logprobs?: Array<Logprob>`

                - `token: string`

                - `bytes: Array<number>`

                - `logprob: number`

                - `top_logprobs: Array<TopLogprob>`

                  - `token: string`

                  - `bytes: Array<number>`

                  - `logprob: number`

            - `BetaResponseOutputRefusal`

              A refusal from the model.

              - `refusal: string`

                The refusal explanation from the model.

              - `type: "refusal"`

                The type of the refusal. Always `refusal`.

                - `"refusal"`

          - `role: "assistant"`

            The role of the output message. Always `assistant`.

            - `"assistant"`

          - `status: "in_progress" | "completed" | "incomplete"`

            The status of the message input. One of `in_progress`, `completed`, or
            `incomplete`. Populated when input items are returned via API.

            - `"in_progress"`

            - `"completed"`

            - `"incomplete"`

          - `type: "message"`

            The type of the output message. Always `message`.

            - `"message"`

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

          - `phase?: "commentary" | "final_answer" | null`

            Labels an `assistant` message as intermediate commentary (`commentary`) or the final answer (`final_answer`).
            For models like `gpt-5.3-codex` and beyond, when sending follow-up requests, preserve and resend
            phase on all assistant messages — dropping it can degrade performance. Not used for user messages.

            - `"commentary"`

            - `"final_answer"`

        - `BetaResponseFileSearchToolCall`

          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.

          - `id: string`

            The unique ID of the file search tool call.

          - `queries: Array<string>`

            The queries used to search for files.

          - `status: "in_progress" | "searching" | "completed" | 2 more`

            The status of the file search tool call. One of `in_progress`,
            `searching`, `incomplete` or `failed`,

            - `"in_progress"`

            - `"searching"`

            - `"completed"`

            - `"incomplete"`

            - `"failed"`

          - `type: "file_search_call"`

            The type of the file search tool call. Always `file_search_call`.

            - `"file_search_call"`

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

          - `results?: Array<Result> | null`

            The results of the file search tool call.

            - `attributes?: Record<string, string | number | boolean> | null`

              Set of 16 key-value pairs that can be attached to an object. This can be
              useful for storing additional information about the object in a structured
              format, and querying for objects via API or the dashboard. Keys are strings
              with a maximum length of 64 characters. Values are strings with a maximum
              length of 512 characters, booleans, or numbers.

              - `string`

              - `number`

              - `boolean`

            - `file_id?: string`

              The unique ID of the file.

            - `filename?: string`

              The name of the file.

            - `score?: number`

              The relevance score of the file - a value between 0 and 1.

            - `text?: string`

              The text that was retrieved from the file.

        - `BetaResponseComputerToolCall`

          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.

          - `id: string`

            The unique ID of the computer call.

          - `call_id: string`

            An identifier used when responding to the tool call with output.

          - `pending_safety_checks: Array<PendingSafetyCheck>`

            The pending safety checks for the computer call.

            - `id: string`

              The ID of the pending safety check.

            - `code?: string | null`

              The type of the pending safety check.

            - `message?: string | null`

              Details about the pending safety check.

          - `status: "in_progress" | "completed" | "incomplete"`

            The status of the item. One of `in_progress`, `completed`, or
            `incomplete`. Populated when items are returned via API.

            - `"in_progress"`

            - `"completed"`

            - `"incomplete"`

          - `type: "computer_call"`

            The type of the computer call. Always `computer_call`.

            - `"computer_call"`

          - `action?: BetaComputerAction`

            A click action.

            - `Click`

              A click action.

              - `button: "left" | "right" | "wheel" | 2 more`

                Indicates which mouse button was pressed during the click. One of `left`, `right`, `wheel`, `back`, or `forward`.

                - `"left"`

                - `"right"`

                - `"wheel"`

                - `"back"`

                - `"forward"`

              - `type: "click"`

                Specifies the event type. For a click action, this property is always `click`.

                - `"click"`

              - `x: number`

                The x-coordinate where the click occurred.

              - `y: number`

                The y-coordinate where the click occurred.

              - `keys?: Array<string> | null`

                The keys being held while clicking.

            - `DoubleClick`

              A double click action.

              - `keys: Array<string> | null`

                The keys being held while double-clicking.

              - `type: "double_click"`

                Specifies the event type. For a double click action, this property is always set to `double_click`.

                - `"double_click"`

              - `x: number`

                The x-coordinate where the double click occurred.

              - `y: number`

                The y-coordinate where the double click occurred.

            - `Drag`

              A drag action.

              - `path: Array<Path>`

                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 }
                ]
                ```

                - `x: number`

                  The x-coordinate.

                - `y: number`

                  The y-coordinate.

              - `type: "drag"`

                Specifies the event type. For a drag action, this property is always set to `drag`.

                - `"drag"`

              - `keys?: Array<string> | null`

                The keys being held while dragging the mouse.

            - `Keypress`

              A collection of keypresses the model would like to perform.

              - `keys: Array<string>`

                The combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key.

              - `type: "keypress"`

                Specifies the event type. For a keypress action, this property is always set to `keypress`.

                - `"keypress"`

            - `Move`

              A mouse move action.

              - `type: "move"`

                Specifies the event type. For a move action, this property is always set to `move`.

                - `"move"`

              - `x: number`

                The x-coordinate to move to.

              - `y: number`

                The y-coordinate to move to.

              - `keys?: Array<string> | null`

                The keys being held while moving the mouse.

            - `Screenshot`

              A screenshot action.

              - `type: "screenshot"`

                Specifies the event type. For a screenshot action, this property is always set to `screenshot`.

                - `"screenshot"`

            - `Scroll`

              A scroll action.

              - `scroll_x: number`

                The horizontal scroll distance.

              - `scroll_y: number`

                The vertical scroll distance.

              - `type: "scroll"`

                Specifies the event type. For a scroll action, this property is always set to `scroll`.

                - `"scroll"`

              - `x: number`

                The x-coordinate where the scroll occurred.

              - `y: number`

                The y-coordinate where the scroll occurred.

              - `keys?: Array<string> | null`

                The keys being held while scrolling.

            - `Type`

              An action to type in text.

              - `text: string`

                The text to type.

              - `type: "type"`

                Specifies the event type. For a type action, this property is always set to `type`.

                - `"type"`

            - `Wait`

              A wait action.

              - `type: "wait"`

                Specifies the event type. For a wait action, this property is always set to `wait`.

                - `"wait"`

          - `actions?: BetaComputerActionList`

            Flattened batched actions for `computer_use`. Each action includes an
            `type` discriminator and action-specific fields.

            - `Click`

              A click action.

            - `DoubleClick`

              A double click action.

            - `Drag`

              A drag action.

            - `Keypress`

              A collection of keypresses the model would like to perform.

            - `Move`

              A mouse move action.

            - `Screenshot`

              A screenshot action.

            - `Scroll`

              A scroll action.

            - `Type`

              An action to type in text.

            - `Wait`

              A wait action.

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

        - `ComputerCallOutput`

          The output of a computer tool call.

          - `call_id: string`

            The ID of the computer tool call that produced the output.

          - `output: BetaResponseComputerToolCallOutputScreenshot`

            A computer screenshot image used with the computer use tool.

            - `type: "computer_screenshot"`

              Specifies the event type. For a computer screenshot, this property is
              always set to `computer_screenshot`.

              - `"computer_screenshot"`

            - `file_id?: string`

              The identifier of an uploaded file that contains the screenshot.

            - `image_url?: string`

              The URL of the screenshot image.

          - `type: "computer_call_output"`

            The type of the computer tool call output. Always `computer_call_output`.

            - `"computer_call_output"`

          - `id?: string | null`

            The ID of the computer tool call output.

          - `acknowledged_safety_checks?: Array<AcknowledgedSafetyCheck> | null`

            The safety checks reported by the API that have been acknowledged by the developer.

            - `id: string`

              The ID of the pending safety check.

            - `code?: string | null`

              The type of the pending safety check.

            - `message?: string | null`

              Details about the pending safety check.

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

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

            The status of the message input. One of `in_progress`, `completed`, or `incomplete`. Populated when input items are returned via API.

            - `"in_progress"`

            - `"completed"`

            - `"incomplete"`

        - `BetaResponseFunctionWebSearch`

          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.

          - `id: string`

            The unique ID of the web search tool call.

          - `action: Search | OpenPage | FindInPage`

            An object describing the specific action taken in this web search call.
            Includes details on how the model used the web (search, open_page, find_in_page).

            - `Search`

              Action type "search" - Performs a web search query.

              - `type: "search"`

                The action type.

                - `"search"`

              - `queries?: Array<string>`

                The search queries.

              - `query?: string`

                The search query.

              - `sources?: Array<Source>`

                The sources used in the search.

                - `type: "url"`

                  The type of source. Always `url`.

                  - `"url"`

                - `url: string`

                  The URL of the source.

            - `OpenPage`

              Action type "open_page" - Opens a specific URL from search results.

              - `type: "open_page"`

                The action type.

                - `"open_page"`

              - `url?: string | null`

                The URL opened by the model.

            - `FindInPage`

              Action type "find_in_page": Searches for a pattern within a loaded page.

              - `pattern: string`

                The pattern or text to search for within the page.

              - `type: "find_in_page"`

                The action type.

                - `"find_in_page"`

              - `url: string`

                The URL of the page searched for the pattern.

          - `status: "in_progress" | "searching" | "completed" | "failed"`

            The status of the web search tool call.

            - `"in_progress"`

            - `"searching"`

            - `"completed"`

            - `"failed"`

          - `type: "web_search_call"`

            The type of the web search tool call. Always `web_search_call`.

            - `"web_search_call"`

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

        - `BetaResponseFunctionToolCall`

          A tool call to run a function. See the
          [function calling guide](https://platform.openai.com/docs/guides/function-calling) for more information.

          - `arguments: string`

            A JSON string of the arguments to pass to the function.

          - `call_id: string`

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

          - `name: string`

            The name of the function to run.

          - `type: "function_call"`

            The type of the function tool call. Always `function_call`.

            - `"function_call"`

          - `id?: string`

            The unique ID of the function tool call.

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

          - `caller?: Direct | Program | null`

            The execution context that produced this tool call.

            - `Direct`

              - `type: "direct"`

                - `"direct"`

            - `Program`

              - `caller_id: string`

                The call ID of the program item that produced this tool call.

              - `type: "program"`

                - `"program"`

          - `namespace?: string`

            The namespace of the function to run.

          - `status?: "in_progress" | "completed" | "incomplete"`

            The status of the item. One of `in_progress`, `completed`, or
            `incomplete`. Populated when items are returned via API.

            - `"in_progress"`

            - `"completed"`

            - `"incomplete"`

        - `FunctionCallOutput`

          The output of a function tool call.

          - `call_id: string`

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

          - `output: string | BetaResponseFunctionCallOutputItemList`

            Text, image, or file output of the function tool call.

            - `string`

            - `BetaResponseFunctionCallOutputItemList = Array<BetaResponseFunctionCallOutputItem>`

              An array of content outputs (text, image, file) for the function tool call.

              - `BetaResponseInputTextContent`

                A text input to the model.

                - `text: string`

                  The text input to the model.

                - `type: "input_text"`

                  The type of the input item. Always `input_text`.

                  - `"input_text"`

                - `prompt_cache_breakpoint?: PromptCacheBreakpoint | null`

                  Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.

                  - `mode: "explicit"`

                    The breakpoint mode. Always `explicit`.

                    - `"explicit"`

              - `BetaResponseInputImageContent`

                An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision)

                - `type: "input_image"`

                  The type of the input item. Always `input_image`.

                  - `"input_image"`

                - `detail?: BetaImageDetail | null`

                  The detail level of the image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`.

                - `file_id?: string | null`

                  The ID of the file to be sent to the model.

                - `image_url?: string | null`

                  The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.

                - `prompt_cache_breakpoint?: PromptCacheBreakpoint | null`

                  Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.

                  - `mode: "explicit"`

                    The breakpoint mode. Always `explicit`.

                    - `"explicit"`

              - `BetaResponseInputFileContent`

                A file input to the model.

                - `type: "input_file"`

                  The type of the input item. Always `input_file`.

                  - `"input_file"`

                - `detail?: "auto" | "low" | "high"`

                  The detail level of the file to be sent to the model. Use `auto` to let the system select the detail level; for GPT-5.6 and later models, `auto` uses high-quality rendering, which may increase input token usage. Use `low` for lower-cost rendering, or `high` to render the file at higher quality. Defaults to `auto`.

                  - `"auto"`

                  - `"low"`

                  - `"high"`

                - `file_data?: string | null`

                  The base64-encoded data of the file to be sent to the model.

                - `file_id?: string | null`

                  The ID of the file to be sent to the model.

                - `file_url?: string | null`

                  The URL of the file to be sent to the model.

                - `filename?: string | null`

                  The name of the file to be sent to the model.

                - `prompt_cache_breakpoint?: PromptCacheBreakpoint | null`

                  Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.

                  - `mode: "explicit"`

                    The breakpoint mode. Always `explicit`.

                    - `"explicit"`

          - `type: "function_call_output"`

            The type of the function tool call output. Always `function_call_output`.

            - `"function_call_output"`

          - `id?: string | null`

            The unique ID of the function tool call output. Populated when this item is returned via API.

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

          - `caller?: Direct | Program | null`

            The execution context that produced this tool call.

            - `Direct`

              - `type: "direct"`

                The caller type. Always `direct`.

                - `"direct"`

            - `Program`

              - `caller_id: string`

                The call ID of the program item that produced this tool call.

              - `type: "program"`

                The caller type. Always `program`.

                - `"program"`

          - `name?: string | null`

            The name of the tool that produced the output.

          - `namespace?: string | null`

            The namespace of the tool that produced the output.

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

            The status of the item. One of `in_progress`, `completed`, or `incomplete`. Populated when items are returned via API.

            - `"in_progress"`

            - `"completed"`

            - `"incomplete"`

        - `AgentMessage`

          A message routed between agents.

          - `author: string`

            The sending agent identity.

          - `content: Array<BetaResponseInputTextContent | BetaResponseInputImageContent | EncryptedContent>`

            Plaintext, image, or encrypted content sent between agents.

            - `BetaResponseInputTextContent`

              A text input to the model.

            - `BetaResponseInputImageContent`

              An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision)

            - `EncryptedContent`

              Opaque encrypted content that Responses API decrypts inside trusted model execution.

              - `encrypted_content: string`

                Opaque encrypted content.

              - `type: "encrypted_content"`

                The type of the input item. Always `encrypted_content`.

                - `"encrypted_content"`

          - `recipient: string`

            The destination agent identity.

          - `type: "agent_message"`

            The item type. Always `agent_message`.

            - `"agent_message"`

          - `id?: string | null`

            The unique ID of this agent message item.

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

        - `MultiAgentCall`

          - `action: "spawn_agent" | "interrupt_agent" | "list_agents" | 3 more`

            The multi-agent action that was executed.

            - `"spawn_agent"`

            - `"interrupt_agent"`

            - `"list_agents"`

            - `"send_message"`

            - `"followup_task"`

            - `"wait_agent"`

          - `arguments: string`

            The action arguments as a JSON string.

          - `call_id: string`

            The unique ID linking this call to its output.

          - `type: "multi_agent_call"`

            The item type. Always `multi_agent_call`.

            - `"multi_agent_call"`

          - `id?: string | null`

            The unique ID of this multi-agent call.

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

        - `MultiAgentCallOutput`

          - `action: "spawn_agent" | "interrupt_agent" | "list_agents" | 3 more`

            The multi-agent action that produced this result.

            - `"spawn_agent"`

            - `"interrupt_agent"`

            - `"list_agents"`

            - `"send_message"`

            - `"followup_task"`

            - `"wait_agent"`

          - `call_id: string`

            The unique ID of the multi-agent call.

          - `output: Array<Output>`

            Text output returned by the multi-agent action.

            - `text: string`

              The text content.

            - `type: "output_text"`

              The content type. Always `output_text`.

              - `"output_text"`

            - `annotations?: Array<FileCitation | URLCitation | ContainerFileCitation>`

              Citations associated with the text content.

              - `FileCitation`

                - `file_id: string`

                  The ID of the file.

                - `filename: string`

                  The filename of the file cited.

                - `index: number`

                  The index of the file in the list of files.

                - `type: "file_citation"`

                  The citation type. Always `file_citation`.

                  - `"file_citation"`

              - `URLCitation`

                - `end_index: number`

                  The index of the last character of the citation in the message.

                - `start_index: number`

                  The index of the first character of the citation in the message.

                - `title: string`

                  The title of the cited resource.

                - `type: "url_citation"`

                  The citation type. Always `url_citation`.

                  - `"url_citation"`

                - `url: string`

                  The URL of the cited resource.

              - `ContainerFileCitation`

                - `container_id: string`

                  The ID of the container.

                - `end_index: number`

                  The index of the last character of the citation in the message.

                - `file_id: string`

                  The ID of the container file.

                - `filename: string`

                  The filename of the container file cited.

                - `start_index: number`

                  The index of the first character of the citation in the message.

                - `type: "container_file_citation"`

                  The citation type. Always `container_file_citation`.

                  - `"container_file_citation"`

          - `type: "multi_agent_call_output"`

            The item type. Always `multi_agent_call_output`.

            - `"multi_agent_call_output"`

          - `id?: string | null`

            The unique ID of this multi-agent call output.

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

        - `ToolSearchCall`

          - `arguments: unknown`

            The arguments supplied to the tool search call.

          - `type: "tool_search_call"`

            The item type. Always `tool_search_call`.

            - `"tool_search_call"`

          - `id?: string | null`

            The unique ID of this tool search call.

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

          - `call_id?: string | null`

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

          - `execution?: "server" | "client"`

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

            - `"server"`

            - `"client"`

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

            The status of the tool search call.

            - `"in_progress"`

            - `"completed"`

            - `"incomplete"`

        - `BetaResponseToolSearchOutputItemParam`

          - `tools: Array<BetaTool>`

            The loaded tool definitions returned by the tool search output.

            - `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).

              - `name: string`

                The name of the function to call.

              - `parameters: Record<string, unknown> | null`

                A JSON schema object describing the parameters of the function.

              - `strict: boolean | null`

                Whether strict parameter validation is enforced for this function tool.

              - `type: "function"`

                The type of the function tool. Always `function`.

                - `"function"`

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

                The tool invocation context(s).

                - `"direct"`

                - `"programmatic"`

              - `defer_loading?: boolean`

                Whether this function is deferred and loaded via tool search.

              - `description?: string | null`

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

              - `output_schema?: Record<string, unknown> | null`

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

            - `BetaFileSearchTool`

              A tool that searches for relevant content from uploaded files. Learn more about the [file search tool](https://platform.openai.com/docs/guides/tools-file-search).

              - `type: "file_search"`

                The type of the file search tool. Always `file_search`.

                - `"file_search"`

              - `vector_store_ids: Array<string>`

                The IDs of the vector stores to search.

              - `filters?: ComparisonFilter | CompoundFilter | null`

                A filter to apply.

                - `ComparisonFilter`

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

                  - `key: string`

                    The key to compare against the value.

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

                    Specifies the comparison operator: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`, `in`, `nin`.

                    - `eq`: equals
                    - `ne`: not equal
                    - `gt`: greater than
                    - `gte`: greater than or equal
                    - `lt`: less than
                    - `lte`: less than or equal
                    - `in`: in
                    - `nin`: not in

                    - `"eq"`

                    - `"ne"`

                    - `"gt"`

                    - `"gte"`

                    - `"lt"`

                    - `"lte"`

                    - `"in"`

                    - `"nin"`

                  - `value: string | number | boolean | Array<string | number>`

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

                    - `string`

                    - `number`

                    - `boolean`

                    - `Array<string | number>`

                      - `string`

                      - `number`

                - `CompoundFilter`

                  Combine multiple filters using `and` or `or`.

                  - `filters: Array<ComparisonFilter | unknown>`

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

                    - `ComparisonFilter`

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

                      - `key: string`

                        The key to compare against the value.

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

                        Specifies the comparison operator: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`, `in`, `nin`.

                        - `eq`: equals
                        - `ne`: not equal
                        - `gt`: greater than
                        - `gte`: greater than or equal
                        - `lt`: less than
                        - `lte`: less than or equal
                        - `in`: in
                        - `nin`: not in

                        - `"eq"`

                        - `"ne"`

                        - `"gt"`

                        - `"gte"`

                        - `"lt"`

                        - `"lte"`

                        - `"in"`

                        - `"nin"`

                      - `value: string | number | boolean | Array<string | number>`

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

                        - `string`

                        - `number`

                        - `boolean`

                        - `Array<string | number>`

                          - `string`

                          - `number`

                    - `unknown`

                  - `type: "and" | "or"`

                    Type of operation: `and` or `or`.

                    - `"and"`

                    - `"or"`

              - `max_num_results?: number`

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

              - `ranking_options?: RankingOptions`

                Ranking options for search.

                - `hybrid_search?: HybridSearch`

                  Weights that control how reciprocal rank fusion balances semantic embedding matches versus sparse keyword matches when hybrid search is enabled.

                  - `embedding_weight: number`

                    The weight of the embedding in the reciprocal ranking fusion.

                  - `text_weight: number`

                    The weight of the text in the reciprocal ranking fusion.

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

                  The ranker to use for the file search.

                  - `"auto"`

                  - `"default-2024-11-15"`

                - `score_threshold?: number`

                  The score threshold for the file search, a number between 0 and 1. Numbers closer to 1 will attempt to return only the most relevant results, but may return fewer results.

            - `BetaComputerTool`

              A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use).

              - `type: "computer"`

                The type of the computer tool. Always `computer`.

                - `"computer"`

            - `BetaComputerUsePreviewTool`

              A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use).

              - `display_height: number`

                The height of the computer display.

              - `display_width: number`

                The width of the computer display.

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

                The type of computer environment to control.

                - `"windows"`

                - `"mac"`

                - `"linux"`

                - `"ubuntu"`

                - `"browser"`

              - `type: "computer_use_preview"`

                The type of the computer use tool. Always `computer_use_preview`.

                - `"computer_use_preview"`

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

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

                - `"web_search"`

                - `"web_search_2025_08_26"`

              - `external_web_access?: boolean`

                Allow live internet access for web search. Defaults to true when omitted. When false, the web search tool runs in offline/cache-only mode and will not fetch new external content.

              - `filters?: Filters | null`

                Filters for the search.

                - `allowed_domains?: Array<string> | null`

                  Allowed domains for the search. If not provided, all domains are allowed.
                  Subdomains of the provided domains are allowed as well.

                  Example: `["pubmed.ncbi.nlm.nih.gov"]`

              - `search_context_size?: "low" | "medium" | "high"`

                High level guidance for the amount of context window space to use for the search. One of `low`, `medium`, or `high`. `medium` is the default.

                - `"low"`

                - `"medium"`

                - `"high"`

              - `user_location?: UserLocation | null`

                The approximate location of the user.

                - `city?: string | null`

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

                - `country?: string | null`

                  The two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of the user, e.g. `US`.

                - `region?: string | null`

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

                - `timezone?: string | null`

                  The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of the user, e.g. `America/Los_Angeles`.

                - `type?: "approximate"`

                  The type of location approximation. Always `approximate`.

                  - `"approximate"`

            - `Mcp`

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

              - `server_label: string`

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

              - `type: "mcp"`

                The type of the MCP tool. Always `mcp`.

                - `"mcp"`

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

                The tool invocation context(s).

                - `"direct"`

                - `"programmatic"`

              - `allowed_tools?: Array<string> | McpToolFilter | null`

                List of allowed tool names or a filter object.

                - `Array<string>`

                - `McpToolFilter`

                  A filter object to specify which tools are allowed.

                  - `read_only?: boolean`

                    Indicates whether or not a tool modifies data or is read-only. If an
                    MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint),
                    it will match this filter.

                  - `tool_names?: Array<string>`

                    List of allowed tool names.

              - `authorization?: string`

                An OAuth access token that can be used with a remote MCP server, either
                with a custom MCP server URL or a service connector. Your application
                must handle the OAuth authorization flow and provide the token here.

              - `connector_id?: "connector_dropbox" | "connector_gmail" | "connector_googlecalendar" | 5 more`

                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`

                - `"connector_dropbox"`

                - `"connector_gmail"`

                - `"connector_googlecalendar"`

                - `"connector_googledrive"`

                - `"connector_microsoftteams"`

                - `"connector_outlookcalendar"`

                - `"connector_outlookemail"`

                - `"connector_sharepoint"`

              - `defer_loading?: boolean`

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

              - `headers?: Record<string, string> | null`

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

              - `require_approval?: McpToolApprovalFilter | "always" | "never" | null`

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

                - `McpToolApprovalFilter`

                  Specify which of the MCP server's tools require approval. Can be
                  `always`, `never`, or a filter object associated with tools
                  that require approval.

                  - `always?: Always`

                    A filter object to specify which tools are allowed.

                    - `read_only?: boolean`

                      Indicates whether or not a tool modifies data or is read-only. If an
                      MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint),
                      it will match this filter.

                    - `tool_names?: Array<string>`

                      List of allowed tool names.

                  - `never?: Never`

                    A filter object to specify which tools are allowed.

                    - `read_only?: boolean`

                      Indicates whether or not a tool modifies data or is read-only. If an
                      MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint),
                      it will match this filter.

                    - `tool_names?: Array<string>`

                      List of allowed tool names.

                - `"always" | "never"`

                  - `"always"`

                  - `"never"`

              - `server_description?: string`

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

              - `server_url?: string`

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

              - `tunnel_id?: string`

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

            - `CodeInterpreter`

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

              - `container: string | CodeInterpreterToolAuto`

                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`

                - `CodeInterpreterToolAuto`

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

                  - `type: "auto"`

                    Always `auto`.

                    - `"auto"`

                  - `file_ids?: Array<string>`

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

                  - `memory_limit?: "1g" | "4g" | "16g" | "64g" | null`

                    The memory limit for the code interpreter container.

                    - `"1g"`

                    - `"4g"`

                    - `"16g"`

                    - `"64g"`

                  - `network_policy?: BetaContainerNetworkPolicyDisabled | BetaContainerNetworkPolicyAllowlist`

                    Network access policy for the container.

                    - `BetaContainerNetworkPolicyDisabled`

                      - `type: "disabled"`

                        Disable outbound network access. Always `disabled`.

                        - `"disabled"`

                    - `BetaContainerNetworkPolicyAllowlist`

                      - `allowed_domains: Array<string>`

                        A list of allowed domains when type is `allowlist`.

                      - `type: "allowlist"`

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

                        - `"allowlist"`

                      - `domain_secrets?: Array<BetaContainerNetworkPolicyDomainSecret>`

                        Optional domain-scoped secrets for allowlisted domains.

                        - `domain: string`

                          The domain associated with the secret.

                        - `name: string`

                          The name of the secret to inject for the domain.

                        - `value: string`

                          The secret value to inject for the domain.

              - `type: "code_interpreter"`

                The type of the code interpreter tool. Always `code_interpreter`.

                - `"code_interpreter"`

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

                The tool invocation context(s).

                - `"direct"`

                - `"programmatic"`

            - `ProgrammaticToolCalling`

              - `type: "programmatic_tool_calling"`

                The type of the tool. Always `programmatic_tool_calling`.

                - `"programmatic_tool_calling"`

            - `ImageGeneration`

              A tool that generates images using the GPT image models.

              - `type: "image_generation"`

                The type of the image generation tool. Always `image_generation`.

                - `"image_generation"`

              - `action?: "generate" | "edit" | "auto"`

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

                - `"generate"`

                - `"edit"`

                - `"auto"`

              - `background?: "transparent" | "opaque" | "auto"`

                Allows to set transparency for the background of the generated image(s).
                Must be one of `transparent`, `opaque`, or `auto` (default value). When
                `auto` is used, the model will automatically determine the best
                background for the image.

                Transparent backgrounds are available for supported GPT Image models.
                For `gpt-image-2` and `gpt-image-2-2026-04-21`, this support is in
                preview. When using `transparent`, set the output format to `png` or
                `webp`.

                - `"transparent"`

                - `"opaque"`

                - `"auto"`

              - `input_fidelity?: "high" | "low" | null`

                Control how much effort the model will exert to match the style and features, especially facial features, of input images. This parameter is only supported for `gpt-image-1` and `gpt-image-1.5` and later models, unsupported for `gpt-image-1-mini`. Supports `high` and `low`. Defaults to `low`.

                - `"high"`

                - `"low"`

              - `input_image_mask?: InputImageMask`

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

                - `file_id?: string`

                  File ID for the mask image.

                - `image_url?: string`

                  Base64-encoded mask image.

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

                The image generation model to use. One of `gpt-image-1`,
                `gpt-image-1-mini`, `gpt-image-1.5`, `gpt-image-2`,
                `gpt-image-2-2026-04-21`, or `chatgpt-image-latest`. Default:
                `gpt-image-1`.

                - `(string & {})`

                - `"gpt-image-1" | "gpt-image-1-mini" | "gpt-image-2" | 3 more`

                  - `"gpt-image-1"`

                  - `"gpt-image-1-mini"`

                  - `"gpt-image-2"`

                  - `"gpt-image-2-2026-04-21"`

                  - `"gpt-image-1.5"`

                  - `"chatgpt-image-latest"`

              - `moderation?: "auto" | "low"`

                Moderation level for the generated image. Default: `auto`.

                - `"auto"`

                - `"low"`

              - `output_compression?: number`

                Compression level for the output image. Default: 100.

              - `output_format?: "png" | "webp" | "jpeg"`

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

                - `"png"`

                - `"webp"`

                - `"jpeg"`

              - `partial_images?: number`

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

              - `quality?: "low" | "medium" | "high" | "auto"`

                The quality of the generated image. One of `low`, `medium`, `high`,
                or `auto`. Default: `auto`.

                - `"low"`

                - `"medium"`

                - `"high"`

                - `"auto"`

              - `size?: (string & {}) | "1024x1024" | "1024x1536" | "1536x1024" | "auto"`

                The size of the generated images. For `gpt-image-2` and `gpt-image-2-2026-04-21`, arbitrary resolutions are supported as `WIDTHxHEIGHT` strings, for example `1536x864`. Width and height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above `2560x1440` are experimental, and the maximum supported resolution is `3840x2160`. The requested size must also satisfy the model's current pixel and edge limits. The standard sizes `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models; `auto` is supported for models that allow automatic sizing. For `dall-e-2`, use one of `256x256`, `512x512`, or `1024x1024`. For `dall-e-3`, use one of `1024x1024`, `1792x1024`, or `1024x1792`.

                - `(string & {})`

                - `"1024x1024" | "1024x1536" | "1536x1024" | "auto"`

                  - `"1024x1024"`

                  - `"1024x1536"`

                  - `"1536x1024"`

                  - `"auto"`

            - `LocalShell`

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

              - `type: "local_shell"`

                The type of the local shell tool. Always `local_shell`.

                - `"local_shell"`

            - `BetaFunctionShellTool`

              A tool that allows the model to execute shell commands.

              - `type: "shell"`

                The type of the shell tool. Always `shell`.

                - `"shell"`

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

                The tool invocation context(s).

                - `"direct"`

                - `"programmatic"`

              - `environment?: BetaContainerAuto | BetaLocalEnvironment | BetaContainerReference | null`

                - `BetaContainerAuto`

                  - `type: "container_auto"`

                    Automatically creates a container for this request

                    - `"container_auto"`

                  - `file_ids?: Array<string>`

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

                  - `memory_limit?: "1g" | "4g" | "16g" | "64g" | null`

                    The memory limit for the container.

                    - `"1g"`

                    - `"4g"`

                    - `"16g"`

                    - `"64g"`

                  - `network_policy?: BetaContainerNetworkPolicyDisabled | BetaContainerNetworkPolicyAllowlist`

                    Network access policy for the container.

                    - `BetaContainerNetworkPolicyDisabled`

                    - `BetaContainerNetworkPolicyAllowlist`

                  - `skills?: Array<BetaSkillReference | BetaInlineSkill>`

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

                    - `BetaSkillReference`

                      - `skill_id: string`

                        The ID of the referenced skill.

                      - `type: "skill_reference"`

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

                        - `"skill_reference"`

                      - `version?: string`

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

                    - `BetaInlineSkill`

                      - `description: string`

                        The description of the skill.

                      - `name: string`

                        The name of the skill.

                      - `source: BetaInlineSkillSource`

                        Inline skill payload

                        - `data: string`

                          Base64-encoded skill zip bundle.

                        - `media_type: "application/zip"`

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

                          - `"application/zip"`

                        - `type: "base64"`

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

                          - `"base64"`

                      - `type: "inline"`

                        Defines an inline skill for this request.

                        - `"inline"`

                - `BetaLocalEnvironment`

                  - `type: "local"`

                    Use a local computer environment.

                    - `"local"`

                  - `skills?: Array<BetaLocalSkill>`

                    An optional list of skills.

                    - `description: string`

                      The description of the skill.

                    - `name: string`

                      The name of the skill.

                    - `path: string`

                      The path to the directory containing the skill.

                - `BetaContainerReference`

                  - `container_id: string`

                    The ID of the referenced container.

                  - `type: "container_reference"`

                    References a container created with the /v1/containers endpoint

                    - `"container_reference"`

            - `BetaCustomTool`

              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)

              - `name: string`

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

              - `type: "custom"`

                The type of the custom tool. Always `custom`.

                - `"custom"`

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

                The tool invocation context(s).

                - `"direct"`

                - `"programmatic"`

              - `defer_loading?: boolean`

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

              - `description?: string`

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

              - `format?: Text | Grammar`

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

                - `Text`

                  Unconstrained free-form text.

                  - `type: "text"`

                    Unconstrained text format. Always `text`.

                    - `"text"`

                - `Grammar`

                  A grammar defined by the user.

                  - `definition: string`

                    The grammar definition.

                  - `syntax: "lark" | "regex"`

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

                    - `"lark"`

                    - `"regex"`

                  - `type: "grammar"`

                    Grammar format. Always `grammar`.

                    - `"grammar"`

            - `BetaNamespaceTool`

              Groups function/custom tools under a shared namespace.

              - `description: string`

                A description of the namespace shown to the model.

              - `name: string`

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

              - `tools: Array<Function | BetaCustomTool>`

                The function/custom tools available inside this namespace.

                - `Function`

                  - `name: string`

                  - `type: "function"`

                    - `"function"`

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

                    The tool invocation context(s).

                    - `"direct"`

                    - `"programmatic"`

                  - `defer_loading?: boolean`

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

                  - `description?: string | null`

                  - `output_schema?: Record<string, unknown> | null`

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

                  - `parameters?: unknown`

                  - `strict?: boolean | null`

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

                - `BetaCustomTool`

                  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: "namespace"`

                The type of the tool. Always `namespace`.

                - `"namespace"`

            - `BetaToolSearchTool`

              Hosted or BYOT tool search configuration for deferred tools.

              - `type: "tool_search"`

                The type of the tool. Always `tool_search`.

                - `"tool_search"`

              - `description?: string | null`

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

              - `execution?: "server" | "client"`

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

                - `"server"`

                - `"client"`

              - `parameters?: unknown`

                Parameter schema for a client-executed tool search tool.

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

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

                - `"web_search_preview"`

                - `"web_search_preview_2025_03_11"`

              - `search_content_types?: Array<"text" | "image">`

                - `"text"`

                - `"image"`

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

                - `"low"`

                - `"medium"`

                - `"high"`

              - `user_location?: UserLocation | null`

                The user's location.

                - `type: "approximate"`

                  The type of location approximation. Always `approximate`.

                  - `"approximate"`

                - `city?: string | null`

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

                - `country?: string | null`

                  The two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of the user, e.g. `US`.

                - `region?: string | null`

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

                - `timezone?: string | null`

                  The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of the user, e.g. `America/Los_Angeles`.

            - `BetaApplyPatchTool`

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

              - `type: "apply_patch"`

                The type of the tool. Always `apply_patch`.

                - `"apply_patch"`

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

                The tool invocation context(s).

                - `"direct"`

                - `"programmatic"`

          - `type: "tool_search_output"`

            The item type. Always `tool_search_output`.

            - `"tool_search_output"`

          - `id?: string | null`

            The unique ID of this tool search output.

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

          - `call_id?: string | null`

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

          - `execution?: "server" | "client"`

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

            - `"server"`

            - `"client"`

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

            The status of the tool search output.

            - `"in_progress"`

            - `"completed"`

            - `"incomplete"`

        - `AdditionalTools`

          - `role: "developer"`

            The role that provided the additional tools. Only `developer` is supported.

            - `"developer"`

          - `tools: Array<BetaTool>`

            A list of additional tools made available at this item.

            - `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).

            - `Mcp`

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

            - `CodeInterpreter`

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

            - `ProgrammaticToolCalling`

            - `ImageGeneration`

              A tool that generates images using the GPT image models.

            - `LocalShell`

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

            - `BetaFunctionShellTool`

              A tool that allows the model to execute shell commands.

            - `BetaCustomTool`

              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)

            - `BetaNamespaceTool`

              Groups function/custom tools under a shared namespace.

            - `BetaToolSearchTool`

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

            - `BetaApplyPatchTool`

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

          - `type: "additional_tools"`

            The item type. Always `additional_tools`.

            - `"additional_tools"`

          - `id?: string | null`

            The unique ID of this additional tools item.

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

        - `BetaResponseReasoningItem`

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

          - `id: string`

            The unique identifier of the reasoning content.

          - `summary: Array<Summary>`

            Reasoning summary content.

            - `text: string`

              A summary of the reasoning output from the model so far.

            - `type: "summary_text"`

              The type of the object. Always `summary_text`.

              - `"summary_text"`

          - `type: "reasoning"`

            The type of the object. Always `reasoning`.

            - `"reasoning"`

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

          - `content?: Array<Content>`

            Reasoning text content.

            - `text: string`

              The reasoning text from the model.

            - `type: "reasoning_text"`

              The type of the reasoning text. Always `reasoning_text`.

              - `"reasoning_text"`

          - `encrypted_content?: string | null`

            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.

            When streaming, use the completed reasoning item and its
            `encrypted_content` from the `response.output_item.done` event in
            subsequent requests. The `encrypted_content` in
            `response.output_item.added` may be incomplete. This is especially
            important when `store` is `false` or when using Zero Data Retention.

          - `status?: "in_progress" | "completed" | "incomplete"`

            The status of the item. One of `in_progress`, `completed`, or
            `incomplete`. Populated when items are returned via API.

            - `"in_progress"`

            - `"completed"`

            - `"incomplete"`

        - `BetaResponseCompactionItemParam`

          A compaction item generated by the [`v1/responses/compact` API](https://platform.openai.com/docs/api-reference/responses/compact).

          - `encrypted_content: string`

            The encrypted content of the compaction summary.

          - `type: "compaction"`

            The type of the item. Always `compaction`.

            - `"compaction"`

          - `id?: string | null`

            The ID of the compaction item.

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

        - `ImageGenerationCall`

          An image generation request made by the model.

          - `id: string`

            The unique ID of the image generation call.

          - `result: string | null`

            The generated image encoded in base64.

          - `status: "in_progress" | "completed" | "generating" | "failed"`

            The status of the image generation call.

            - `"in_progress"`

            - `"completed"`

            - `"generating"`

            - `"failed"`

          - `type: "image_generation_call"`

            The type of the image generation call. Always `image_generation_call`.

            - `"image_generation_call"`

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

        - `BetaResponseCodeInterpreterToolCall`

          A tool call to run code.

          - `id: string`

            The unique ID of the code interpreter tool call.

          - `code: string | null`

            The code to run, or null if not available.

          - `container_id: string`

            The ID of the container used to run the code.

          - `outputs: Array<Logs | Image> | null`

            The outputs generated by the code interpreter, such as logs or images.
            Can be null if no outputs are available.

            - `Logs`

              The logs output from the code interpreter.

              - `logs: string`

                The logs output from the code interpreter.

              - `type: "logs"`

                The type of the output. Always `logs`.

                - `"logs"`

            - `Image`

              The image output from the code interpreter.

              - `type: "image"`

                The type of the output. Always `image`.

                - `"image"`

              - `url: string`

                The URL of the image output from the code interpreter.

          - `status: "in_progress" | "completed" | "incomplete" | 2 more`

            The status of the code interpreter tool call. Valid values are `in_progress`, `completed`, `incomplete`, `interpreting`, and `failed`.

            - `"in_progress"`

            - `"completed"`

            - `"incomplete"`

            - `"interpreting"`

            - `"failed"`

          - `type: "code_interpreter_call"`

            The type of the code interpreter tool call. Always `code_interpreter_call`.

            - `"code_interpreter_call"`

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

        - `LocalShellCall`

          A tool call to run a command on the local shell.

          - `id: string`

            The unique ID of the local shell call.

          - `action: Action`

            Execute a shell command on the server.

            - `command: Array<string>`

              The command to run.

            - `env: Record<string, string>`

              Environment variables to set for the command.

            - `type: "exec"`

              The type of the local shell action. Always `exec`.

              - `"exec"`

            - `timeout_ms?: number | null`

              Optional timeout in milliseconds for the command.

            - `user?: string | null`

              Optional user to run the command as.

            - `working_directory?: string | null`

              Optional working directory to run the command in.

          - `call_id: string`

            The unique ID of the local shell tool call generated by the model.

          - `status: "in_progress" | "completed" | "incomplete"`

            The status of the local shell call.

            - `"in_progress"`

            - `"completed"`

            - `"incomplete"`

          - `type: "local_shell_call"`

            The type of the local shell call. Always `local_shell_call`.

            - `"local_shell_call"`

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

        - `LocalShellCallOutput`

          The output of a local shell tool call.

          - `id: string`

            The unique ID of the local shell tool call generated by the model.

          - `output: string`

            A JSON string of the output of the local shell tool call.

          - `type: "local_shell_call_output"`

            The type of the local shell tool call output. Always `local_shell_call_output`.

            - `"local_shell_call_output"`

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

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

            The status of the item. One of `in_progress`, `completed`, or `incomplete`.

            - `"in_progress"`

            - `"completed"`

            - `"incomplete"`

        - `ShellCall`

          A tool representing a request to execute one or more shell commands.

          - `action: Action`

            The shell commands and limits that describe how to run the tool call.

            - `commands: Array<string>`

              Ordered shell commands for the execution environment to run.

            - `max_output_length?: number | null`

              Maximum number of UTF-8 characters to capture from combined stdout and stderr output.

            - `timeout_ms?: number | null`

              Maximum wall-clock time in milliseconds to allow the shell commands to run.

          - `call_id: string`

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

          - `type: "shell_call"`

            The type of the item. Always `shell_call`.

            - `"shell_call"`

          - `id?: string | null`

            The unique ID of the shell tool call. Populated when this item is returned via API.

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

          - `caller?: Direct | Program | null`

            The execution context that produced this tool call.

            - `Direct`

              - `type: "direct"`

                The caller type. Always `direct`.

                - `"direct"`

            - `Program`

              - `caller_id: string`

                The call ID of the program item that produced this tool call.

              - `type: "program"`

                The caller type. Always `program`.

                - `"program"`

          - `environment?: BetaLocalEnvironment | BetaContainerReference | null`

            The environment to execute the shell commands in.

            - `BetaLocalEnvironment`

            - `BetaContainerReference`

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

            The status of the shell call. One of `in_progress`, `completed`, or `incomplete`.

            - `"in_progress"`

            - `"completed"`

            - `"incomplete"`

        - `ShellCallOutput`

          The streamed output items emitted by a shell tool call.

          - `call_id: string`

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

          - `output: Array<BetaResponseFunctionShellCallOutputContent>`

            Captured chunks of stdout and stderr output, along with their associated outcomes.

            - `outcome: Timeout | Exit`

              The exit or timeout outcome associated with this shell call.

              - `Timeout`

                Indicates that the shell call exceeded its configured time limit.

                - `type: "timeout"`

                  The outcome type. Always `timeout`.

                  - `"timeout"`

              - `Exit`

                Indicates that the shell commands finished and returned an exit code.

                - `exit_code: number`

                  The exit code returned by the shell process.

                - `type: "exit"`

                  The outcome type. Always `exit`.

                  - `"exit"`

            - `stderr: string`

              Captured stderr output for the shell call.

            - `stdout: string`

              Captured stdout output for the shell call.

          - `type: "shell_call_output"`

            The type of the item. Always `shell_call_output`.

            - `"shell_call_output"`

          - `id?: string | null`

            The unique ID of the shell tool call output. Populated when this item is returned via API.

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

          - `caller?: Direct | Program | null`

            The execution context that produced this tool call.

            - `Direct`

              - `type: "direct"`

                The caller type. Always `direct`.

                - `"direct"`

            - `Program`

              - `caller_id: string`

                The call ID of the program item that produced this tool call.

              - `type: "program"`

                The caller type. Always `program`.

                - `"program"`

          - `max_output_length?: number | null`

            The maximum number of UTF-8 characters captured for this shell call's combined output.

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

            The status of the shell call output.

            - `"in_progress"`

            - `"completed"`

            - `"incomplete"`

        - `ApplyPatchCall`

          A tool call representing a request to create, delete, or update files using diff patches.

          - `call_id: string`

            The unique ID of the apply patch tool call generated by the model.

          - `operation: CreateFile | DeleteFile | UpdateFile`

            The specific create, delete, or update instruction for the apply_patch tool call.

            - `CreateFile`

              Instruction for creating a new file via the apply_patch tool.

              - `diff: string`

                Unified diff content to apply when creating the file.

              - `path: string`

                Path of the file to create relative to the workspace root.

              - `type: "create_file"`

                The operation type. Always `create_file`.

                - `"create_file"`

            - `DeleteFile`

              Instruction for deleting an existing file via the apply_patch tool.

              - `path: string`

                Path of the file to delete relative to the workspace root.

              - `type: "delete_file"`

                The operation type. Always `delete_file`.

                - `"delete_file"`

            - `UpdateFile`

              Instruction for updating an existing file via the apply_patch tool.

              - `diff: string`

                Unified diff content to apply to the existing file.

              - `path: string`

                Path of the file to update relative to the workspace root.

              - `type: "update_file"`

                The operation type. Always `update_file`.

                - `"update_file"`

          - `status: "in_progress" | "completed"`

            The status of the apply patch tool call. One of `in_progress` or `completed`.

            - `"in_progress"`

            - `"completed"`

          - `type: "apply_patch_call"`

            The type of the item. Always `apply_patch_call`.

            - `"apply_patch_call"`

          - `id?: string | null`

            The unique ID of the apply patch tool call. Populated when this item is returned via API.

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

          - `caller?: Direct | Program | null`

            The execution context that produced this tool call.

            - `Direct`

              - `type: "direct"`

                The caller type. Always `direct`.

                - `"direct"`

            - `Program`

              - `caller_id: string`

                The call ID of the program item that produced this tool call.

              - `type: "program"`

                The caller type. Always `program`.

                - `"program"`

        - `ApplyPatchCallOutput`

          The streamed output emitted by an apply patch tool call.

          - `call_id: string`

            The unique ID of the apply patch tool call generated by the model.

          - `status: "completed" | "failed"`

            The status of the apply patch tool call output. One of `completed` or `failed`.

            - `"completed"`

            - `"failed"`

          - `type: "apply_patch_call_output"`

            The type of the item. Always `apply_patch_call_output`.

            - `"apply_patch_call_output"`

          - `id?: string | null`

            The unique ID of the apply patch tool call output. Populated when this item is returned via API.

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

          - `caller?: Direct | Program | null`

            The execution context that produced this tool call.

            - `Direct`

              - `type: "direct"`

                The caller type. Always `direct`.

                - `"direct"`

            - `Program`

              - `caller_id: string`

                The call ID of the program item that produced this tool call.

              - `type: "program"`

                The caller type. Always `program`.

                - `"program"`

          - `output?: string | null`

            Optional human-readable log text from the apply patch tool (e.g., patch results or errors).

        - `McpListTools`

          A list of tools available on an MCP server.

          - `id: string`

            The unique ID of the list.

          - `server_label: string`

            The label of the MCP server.

          - `tools: Array<Tool>`

            The tools available on the server.

            - `input_schema: unknown`

              The JSON schema describing the tool's input.

            - `name: string`

              The name of the tool.

            - `annotations?: unknown`

              Additional annotations about the tool.

            - `description?: string | null`

              The description of the tool.

          - `type: "mcp_list_tools"`

            The type of the item. Always `mcp_list_tools`.

            - `"mcp_list_tools"`

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

          - `error?: string | null`

            Error message if the server could not list tools.

        - `McpApprovalRequest`

          A request for human approval of a tool invocation.

          - `id: string`

            The unique ID of the approval request.

          - `arguments: string`

            A JSON string of arguments for the tool.

          - `name: string`

            The name of the tool to run.

          - `server_label: string`

            The label of the MCP server making the request.

          - `type: "mcp_approval_request"`

            The type of the item. Always `mcp_approval_request`.

            - `"mcp_approval_request"`

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

        - `McpApprovalResponse`

          A response to an MCP approval request.

          - `approval_request_id: string`

            The ID of the approval request being answered.

          - `approve: boolean`

            Whether the request was approved.

          - `type: "mcp_approval_response"`

            The type of the item. Always `mcp_approval_response`.

            - `"mcp_approval_response"`

          - `id?: string | null`

            The unique ID of the approval response

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

          - `reason?: string | null`

            Optional reason for the decision.

        - `McpCall`

          An invocation of a tool on an MCP server.

          - `id: string`

            The unique ID of the tool call.

          - `arguments: string`

            A JSON string of the arguments passed to the tool.

          - `name: string`

            The name of the tool that was run.

          - `server_label: string`

            The label of the MCP server running the tool.

          - `type: "mcp_call"`

            The type of the item. Always `mcp_call`.

            - `"mcp_call"`

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

          - `approval_request_id?: string | null`

            Unique identifier for the MCP tool call approval request.
            Include this value in a subsequent `mcp_approval_response` input to approve or reject the corresponding tool call.

          - `error?: BetaMcpToolCallError | null`

            The error from the tool call, if any.

            - `McpProtocolError`

              - `code: number`

              - `message: string`

              - `type: "mcp_protocol_error"`

                - `"mcp_protocol_error"`

            - `McpToolExecutionError`

              - `content: unknown`

              - `type: "mcp_tool_execution_error"`

                - `"mcp_tool_execution_error"`

            - `HTTPError`

              - `code: number`

              - `message: string`

              - `type: "http_error"`

                - `"http_error"`

          - `output?: string | null`

            The output from the tool call.

          - `status?: "in_progress" | "completed" | "incomplete" | 2 more`

            The status of the tool call. One of `in_progress`, `completed`, `incomplete`, `calling`, or `failed`.

            - `"in_progress"`

            - `"completed"`

            - `"incomplete"`

            - `"calling"`

            - `"failed"`

        - `BetaResponseCustomToolCallOutput`

          The output of a custom tool call from your code, being sent back to the model.

          - `call_id: string`

            The call ID, used to map this custom tool call output to a custom tool call.

          - `output: string | Array<BetaResponseInputText | BetaResponseInputImage | BetaResponseInputFile>`

            The output from the custom tool call generated by your code.
            Can be a string or an list of output content.

            - `string`

            - `Array<BetaResponseInputText | BetaResponseInputImage | BetaResponseInputFile>`

              - `BetaResponseInputText`

                A text input to the model.

              - `BetaResponseInputImage`

                An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision).

              - `BetaResponseInputFile`

                A file input to the model.

          - `type: "custom_tool_call_output"`

            The type of the custom tool call output. Always `custom_tool_call_output`.

            - `"custom_tool_call_output"`

          - `id?: string`

            The unique ID of the custom tool call output in the OpenAI platform.

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

          - `caller?: Direct | Program | null`

            The execution context that produced this tool call.

            - `Direct`

              - `type: "direct"`

                The caller type. Always `direct`.

                - `"direct"`

            - `Program`

              - `caller_id: string`

                The call ID of the program item that produced this tool call.

              - `type: "program"`

                The caller type. Always `program`.

                - `"program"`

        - `BetaResponseCustomToolCall`

          A call to a custom tool created by the model.

          - `call_id: string`

            An identifier used to map this custom tool call to a tool call output.

          - `input: string`

            The input for the custom tool call generated by the model.

          - `name: string`

            The name of the custom tool being called.

          - `type: "custom_tool_call"`

            The type of the custom tool call. Always `custom_tool_call`.

            - `"custom_tool_call"`

          - `id?: string`

            The unique ID of the custom tool call in the OpenAI platform.

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

          - `caller?: Direct | Program | null`

            The execution context that produced this tool call.

            - `Direct`

              - `type: "direct"`

                - `"direct"`

            - `Program`

              - `caller_id: string`

                The call ID of the program item that produced this tool call.

              - `type: "program"`

                - `"program"`

          - `namespace?: string`

            The namespace of the custom tool being called.

        - `CompactionTrigger`

          Compacts the current context. Must be the final input item.

          - `type: "compaction_trigger"`

            The type of the item. Always `compaction_trigger`.

            - `"compaction_trigger"`

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

        - `ItemReference`

          An internal identifier for an item to reference.

          - `id: string`

            The ID of the item to reference.

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

          - `type?: "item_reference" | null`

            The type of item to reference. Always `item_reference`.

            - `"item_reference"`

        - `Program`

          - `id: string`

            The unique ID of this program item.

          - `call_id: string`

            The stable call ID of the program item.

          - `code: string`

            The JavaScript source executed by programmatic tool calling.

          - `fingerprint: string`

            Opaque program replay fingerprint that must be round-tripped.

          - `type: "program"`

            The item type. Always `program`.

            - `"program"`

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

        - `ProgramOutput`

          - `id: string`

            The unique ID of this program output item.

          - `call_id: string`

            The call ID of the program item.

          - `result: string`

            The result produced by the program item.

          - `status: "completed" | "incomplete"`

            The terminal status of the program output.

            - `"completed"`

            - `"incomplete"`

          - `type: "program_output"`

            The item type. Always `program_output`.

            - `"program_output"`

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

    - `instructions?: string | null`

      Body param: A system (or developer) message inserted into the model's context.

      When using along with `previous_response_id`, the instructions from a previous
      response will not be carried over to the next response. This makes it simple
      to swap out system (or developer) messages in new responses.

    - `max_output_tokens?: number | null`

      Body param: 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).

    - `max_tool_calls?: number | null`

      Body param: The maximum number of total calls to built-in tools that can be processed in a response. This maximum number applies across all built-in tool calls, not per individual tool. Any further attempts to call a tool by the model will be ignored.

    - `metadata?: Record<string, string> | null`

      Body param: Set of 16 key-value pairs that can be attached to an object. This can be
      useful for storing additional information about the object in a structured
      format, and querying for objects via API or the dashboard.

      Keys are strings with a maximum length of 64 characters. Values are strings
      with a maximum length of 512 characters.

    - `model?: "gpt-5.6-sol" | "gpt-5.6-terra" | "gpt-5.6-luna" | 99 more | (string & {})`

      Body param: Model ID used to generate the response, like `gpt-4o` or `o3`. OpenAI
      offers a wide range of models with different capabilities, performance
      characteristics, and price points. Refer to the [model guide](https://platform.openai.com/docs/models)
      to browse and compare available models.

      - `"gpt-5.6-sol" | "gpt-5.6-terra" | "gpt-5.6-luna" | 99 more`

        - `"gpt-5.6-sol"`

        - `"gpt-5.6-terra"`

        - `"gpt-5.6-luna"`

        - `"gpt-5.5"`

        - `"gpt-5.5-2026-04-23"`

        - `"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.5-pro"`

        - `"gpt-5.5-pro-2026-04-23"`

        - `"gpt-5-codex"`

        - `"gpt-5-pro"`

        - `"gpt-5-pro-2025-10-06"`

        - `"gpt-5.1-codex-max"`

        - `"gpt-daybreak-blue-latest"`

        - `"gpt-daybreak-red-latest"`

        - `"gpt-5.6-cyber"`

      - `(string & {})`

    - `moderation?: Moderation | null`

      Body param: Configuration for running moderation on the input and output of this response.

      - `model: string`

        The moderation model to use for moderated completions, e.g. 'omni-moderation-latest'.

      - `policy?: Policy | null`

        The policy to apply to moderated response input and output.

        - `input?: Input | null`

          The moderation policy for the response input.

          - `mode: "score" | "block"`

            - `"score"`

            - `"block"`

        - `output?: Output | null`

          The moderation policy for the response output.

          - `mode: "score" | "block"`

            - `"score"`

            - `"block"`

    - `multi_agent?: MultiAgent | null`

      Body param: Configuration for server-hosted multi-agent execution.

      - `enabled: boolean`

        Whether to enable server-hosted multi-agent execution for this response.

      - `max_concurrent_subagents?: number`

        `max_concurrent_subagents` sets the maximum number of subagents that can be active simultaneously across the entire agent tree. It includes all descendants—children, grandchildren, and deeper subagents—but excludes the root agent.
        The API does not impose a fixed upper bound on this setting. The default is `3`, which is recommended for most workloads. Multi-agent runs also have no fixed limit on tree depth or the total number of subagents created during a run.

    - `parallel_tool_calls?: boolean | null`

      Body param: Whether to allow the model to run tool calls in parallel.

    - `previous_response_id?: string | null`

      Body param: 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`.

    - `prompt?: BetaResponsePrompt | null`

      Body param: Reference to a prompt template and its variables.
      [Learn more](https://platform.openai.com/docs/guides/text?api-mode=responses#reusable-prompts).

      - `id: string`

        The unique identifier of the prompt template to use.

      - `variables?: Record<string, string | BetaResponseInputText | BetaResponseInputImage | BetaResponseInputFile> | null`

        Optional map of values to substitute in for variables in your
        prompt. The substitution values can either be strings, or other
        Response input types like images or files.

        - `string`

        - `BetaResponseInputText`

          A text input to the model.

        - `BetaResponseInputImage`

          An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision).

        - `BetaResponseInputFile`

          A file input to the model.

      - `version?: string | null`

        Optional version of the prompt template.

    - `prompt_cache_key?: string | null`

      Body param: 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).

    - `prompt_cache_options?: PromptCacheOptions`

      Body param: Options for prompt caching. Supported for `gpt-5.6` and later models. By default, OpenAI automatically chooses one implicit cache breakpoint. You can add explicit breakpoints to content blocks with `prompt_cache_breakpoint`. Each request can write up to four breakpoints. For cache matching, OpenAI considers up to the latest 80 breakpoints in the conversation, without a content-block lookback limit. Set `mode` to `explicit` to disable the implicit breakpoint. The `ttl` defaults to `30m`, which is currently the only supported value. See the [prompt caching guide](https://platform.openai.com/docs/guides/prompt-caching) for current details.

      - `mode?: "implicit" | "explicit"`

        Controls whether OpenAI automatically creates an implicit cache breakpoint. Defaults to `implicit`. With `implicit`, OpenAI creates one implicit breakpoint and writes up to the latest three explicit breakpoints in the request. With `explicit`, OpenAI does not create an implicit breakpoint and writes up to the latest four explicit breakpoints. If there are no explicit breakpoints, the request does not use prompt caching.

        - `"implicit"`

        - `"explicit"`

      - `ttl?: "30m"`

        The minimum lifetime applied to every implicit and explicit cache breakpoint written by the request. Defaults to `30m`, which is currently the only supported value. The backend may retain cache entries for longer.

        - `"30m"`

    - `prompt_cache_retention?: "in_memory" | "24h" | null`

      Body param: 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.

      - `"in_memory"`

      - `"24h"`

    - `reasoning?: Reasoning | null`

      Body param: **gpt-5 and o-series models only**

      Configuration options for
      [reasoning models](https://platform.openai.com/docs/guides/reasoning).

      - `context?: "auto" | "current_turn" | "all_turns" | null`

        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.

        - `"auto"`

        - `"current_turn"`

        - `"all_turns"`

      - `effort?: "none" | "minimal" | "low" | 4 more | null`

        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.

        - `"none"`

        - `"minimal"`

        - `"low"`

        - `"medium"`

        - `"high"`

        - `"xhigh"`

        - `"max"`

      - `generate_summary?: "auto" | "concise" | "detailed" | null`

        **Deprecated:** use `summary` instead.

        A summary of the reasoning performed by the model. This can be
        useful for debugging and understanding the model's reasoning process.
        One of `auto`, `concise`, or `detailed`.

        - `"auto"`

        - `"concise"`

        - `"detailed"`

      - `mode?: (string & {}) | "standard" | "pro"`

        Controls the reasoning execution mode for the request.

        When returned on a response, this is the effective execution mode.

        - `(string & {})`

        - `"standard" | "pro"`

          - `"standard"`

          - `"pro"`

      - `summary?: "auto" | "concise" | "detailed" | null`

        A summary of the reasoning performed by the model. This can be
        useful for debugging and understanding the model's reasoning process.
        One of `auto`, `concise`, or `detailed`.

        `concise` is supported for `computer-use-preview` models and all reasoning models after `gpt-5`.

        - `"auto"`

        - `"concise"`

        - `"detailed"`

    - `safety_identifier?: string | null`

      Body param: 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).

    - `service_tier?: BetaServiceTier | null`

      Body param: 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.
      - If set to 'ultrafast', then the request will be processed with the access-controlled Ultrafast Processing service tier. This tier is currently available for `gpt-5.6-sol`; a response served through it will show `service_tier=ultrafast`.
      - When not set, the default behavior is 'auto'.

      When the `service_tier` parameter is set, the response body will include the `service_tier` value based on the processing mode actually used to serve the request. This response value may be different from the value set in the parameter.

      - `"auto"`

      - `"default"`

      - `"flex"`

      - `"scale"`

      - `"priority"`

      - `"fast"`

      - `"ultrafast"`

    - `store?: boolean | null`

      Body param: Whether to store the generated model response for later retrieval via
      API.

    - `stream?: false | null`

      Body param: If set to true, the model response data will be streamed to the client
      as it is generated using [server-sent events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events#Event_stream_format).
      See the [Streaming section below](https://platform.openai.com/docs/api-reference/responses-streaming)
      for more information.

      - `false`

    - `stream_options?: StreamOptions | null`

      Body param: Options for streaming responses. Only set this when you set `stream: true`.

      - `include_obfuscation?: boolean`

        When true, stream obfuscation will be enabled. Stream obfuscation adds
        random characters to an `obfuscation` field on streaming delta events to
        normalize payload sizes as a mitigation to certain side-channel attacks.
        These obfuscation fields are included by default, but add a small amount
        of overhead to the data stream. You can set `include_obfuscation` to
        false to optimize for bandwidth if you trust the network links between
        your application and the OpenAI API.

    - `temperature?: number | null`

      Body param: What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic.
      We generally recommend altering this or `top_p` but not both.

    - `text?: BetaResponseTextConfig`

      Body param: 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?: BetaResponseFormatTextConfig`

        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.

        - `Text`

          Default response format. Used to generate text responses.

          - `type: "text"`

            The type of response format being defined. Always `text`.

            - `"text"`

        - `BetaResponseFormatTextJSONSchemaConfig`

          JSON Schema response format. Used to generate structured JSON responses.
          Learn more about [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs).

          - `name: string`

            The name of the response format. Must be a-z, A-Z, 0-9, or contain
            underscores and dashes, with a maximum length of 64.

          - `schema: Record<string, unknown>`

            The schema for the response format, described as a JSON Schema object.
            Learn how to build JSON schemas [here](https://json-schema.org/).

          - `type: "json_schema"`

            The type of response format being defined. Always `json_schema`.

            - `"json_schema"`

          - `description?: string`

            A description of what the response format is for, used by the model to
            determine how to respond in the format.

          - `strict?: boolean | null`

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

        - `JSONObject`

          JSON object response format. An older method of generating JSON responses.
          Using `json_schema` is recommended for models that support it. Note that the
          model will not generate JSON without a system or user message instructing it
          to do so.

          - `type: "json_object"`

            The type of response format being defined. Always `json_object`.

            - `"json_object"`

      - `verbosity?: "low" | "medium" | "high" | null`

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

        - `"low"`

        - `"medium"`

        - `"high"`

    - `tool_choice?: BetaToolChoiceOptions | BetaToolChoiceAllowed | BetaToolChoiceTypes | 6 more`

      Body param: 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.

      - `BetaToolChoiceOptions = "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.

        - `"none"`

        - `"auto"`

        - `"required"`

      - `BetaToolChoiceAllowed`

        Constrains the tools available to the model to a pre-defined set.

        - `mode: "auto" | "required"`

          Constrains the tools available to the model to a pre-defined set.

          `auto` allows the model to pick from among the allowed tools and generate a
          message.

          `required` requires the model to call one or more of the allowed tools.

          - `"auto"`

          - `"required"`

        - `tools: Array<Record<string, unknown>>`

          A list of tool definitions that the model should be allowed to call.

          For the Responses API, the list of tool definitions might look like:

          ```json
          [
            { "type": "function", "name": "get_weather" },
            { "type": "mcp", "server_label": "deepwiki" },
            { "type": "image_generation" }
          ]
          ```

        - `type: "allowed_tools"`

          Allowed tool configuration type. Always `allowed_tools`.

          - `"allowed_tools"`

      - `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" | 5 more`

          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`

          - `"file_search"`

          - `"web_search_preview"`

          - `"computer"`

          - `"computer_use_preview"`

          - `"computer_use"`

          - `"web_search_preview_2025_03_11"`

          - `"image_generation"`

          - `"code_interpreter"`

      - `BetaToolChoiceFunction`

        Use this option to force the model to call a specific function.

        - `name: string`

          The name of the function to call.

        - `type: "function"`

          For function calling, the type is always `function`.

          - `"function"`

      - `BetaToolChoiceMcp`

        Use this option to force the model to call a specific tool on a remote MCP server.

        - `server_label: string`

          The label of the MCP server to use.

        - `type: "mcp"`

          For MCP tools, the type is always `mcp`.

          - `"mcp"`

        - `name?: string | null`

          The name of the tool to call on the server.

      - `BetaToolChoiceCustom`

        Use this option to force the model to call a specific custom tool.

        - `name: string`

          The name of the custom tool to call.

        - `type: "custom"`

          For custom tool calling, the type is always `custom`.

          - `"custom"`

      - `BetaSpecificProgrammaticToolCallingParam`

        - `type: "programmatic_tool_calling"`

          The tool to call. Always `programmatic_tool_calling`.

          - `"programmatic_tool_calling"`

      - `BetaToolChoiceApplyPatch`

        Forces the model to call the apply_patch tool when executing a tool call.

        - `type: "apply_patch"`

          The tool to call. Always `apply_patch`.

          - `"apply_patch"`

      - `BetaToolChoiceShell`

        Forces the model to call the shell tool when a tool call is required.

        - `type: "shell"`

          The tool to call. Always `shell`.

          - `"shell"`

    - `tools?: Array<BetaTool>`

      Body param: 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.

      - `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).

      - `Mcp`

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

      - `CodeInterpreter`

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

      - `ProgrammaticToolCalling`

      - `ImageGeneration`

        A tool that generates images using the GPT image models.

      - `LocalShell`

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

      - `BetaFunctionShellTool`

        A tool that allows the model to execute shell commands.

      - `BetaCustomTool`

        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)

      - `BetaNamespaceTool`

        Groups function/custom tools under a shared namespace.

      - `BetaToolSearchTool`

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

      - `BetaApplyPatchTool`

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

    - `top_logprobs?: number | null`

      Body param: An integer between 0 and 20 specifying the maximum number of most likely
      tokens to return at each token position, each with an associated log
      probability. In some cases, the number of returned tokens may be fewer than
      requested.

    - `top_p?: number | null`

      Body param: An alternative to sampling with temperature, called nucleus sampling,
      where the model considers the results of the tokens with top_p probability
      mass. So 0.1 means only the tokens comprising the top 10% probability mass
      are considered.

      We generally recommend altering this or `temperature` but not both.

    - `truncation?: "auto" | "disabled" | null`

      Body param: The truncation strategy to use for the model response.

      - `auto`: If the input to this Response exceeds
        the model's context window size, the model will truncate the
        response to fit the context window by dropping items from the beginning of the conversation.
      - `disabled` (default): If the input size will exceed the context window
        size for a model, the request will fail with a 400 error.

      - `"auto"`

      - `"disabled"`

    - `user?: string`

      Body param: 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).

    - `betas?: Array<"responses_multi_agent=v1">`

      Header param: Optional beta features to enable for this request.

      - `"responses_multi_agent=v1"`

  - `ResponseCreateParamsNonStreaming extends ResponseCreateParamsBase`

    - `stream?: false | null`

      Body param: If set to true, the model response data will be streamed to the client
      as it is generated using [server-sent events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events#Event_stream_format).
      See the [Streaming section below](https://platform.openai.com/docs/api-reference/responses-streaming)
      for more information.

  - `ResponseCreateParamsStreaming extends ResponseCreateParamsBase`

    - `stream: true`

      Body param: If set to true, the model response data will be streamed to the client
      as it is generated using [server-sent events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events#Event_stream_format).
      See the [Streaming section below](https://platform.openai.com/docs/api-reference/responses-streaming)
      for more information.

      - `true`

### Returns

- `BetaResponse`

  - `id: string`

    Unique identifier for this Response.

  - `created_at: number`

    Unix timestamp (in seconds) of when this Response was created.

  - `error: BetaResponseError | null`

    An error object returned when the model fails to generate a Response.

    - `code: "server_error" | "rate_limit_exceeded" | "invalid_prompt" | 17 more`

      The error code for the response.

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

    - `message: string`

      A human-readable description of the error.

  - `incomplete_details: IncompleteDetails | null`

    Details about why the response is incomplete.

    - `reason?: "max_output_tokens" | "content_filter"`

      The reason why the response is incomplete.

      - `"max_output_tokens"`

      - `"content_filter"`

  - `instructions: string | Array<BetaResponseInputItem> | null`

    A system (or developer) message inserted into the model's context.

    When using along with `previous_response_id`, the instructions from a previous
    response will not be carried over to the next response. This makes it simple
    to swap out system (or developer) messages in new responses.

    - `string`

    - `Array<BetaResponseInputItem>`

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

        - `content: string | BetaResponseInputMessageContentList`

          Text, image, or audio input to the model, used to generate a response.
          Can also contain previous assistant responses.

          - `string`

          - `BetaResponseInputMessageContentList = Array<BetaResponseInputContent>`

            A list of one or many input items to the model, containing different content
            types.

            - `BetaResponseInputText`

              A text input to the model.

              - `text: string`

                The text input to the model.

              - `type: "input_text"`

                The type of the input item. Always `input_text`.

                - `"input_text"`

              - `prompt_cache_breakpoint?: PromptCacheBreakpoint`

                Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.

                - `mode: "explicit"`

                  The breakpoint mode. Always `explicit`.

                  - `"explicit"`

            - `BetaResponseInputImage`

              An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision).

              - `detail: BetaImageDetail`

                The detail level of the image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`.

                - `"low"`

                - `"high"`

                - `"auto"`

                - `"original"`

              - `type: "input_image"`

                The type of the input item. Always `input_image`.

                - `"input_image"`

              - `file_id?: string | null`

                The ID of the file to be sent to the model.

              - `image_url?: string | null`

                The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.

              - `prompt_cache_breakpoint?: PromptCacheBreakpoint`

                Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.

                - `mode: "explicit"`

                  The breakpoint mode. Always `explicit`.

                  - `"explicit"`

            - `BetaResponseInputFile`

              A file input to the model.

              - `type: "input_file"`

                The type of the input item. Always `input_file`.

                - `"input_file"`

              - `detail?: "auto" | "low" | "high"`

                The detail level of the file to be sent to the model. Use `auto` to let the system select the detail level; for GPT-5.6 and later models, `auto` uses high-quality rendering, which may increase input token usage. Use `low` for lower-cost rendering, or `high` to render the file at higher quality. Defaults to `auto`.

                - `"auto"`

                - `"low"`

                - `"high"`

              - `file_data?: string`

                The content of the file to be sent to the model.

              - `file_id?: string | null`

                The ID of the file to be sent to the model.

              - `file_url?: string`

                The URL of the file to be sent to the model.

              - `filename?: string`

                The name of the file to be sent to the model.

              - `prompt_cache_breakpoint?: PromptCacheBreakpoint`

                Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.

                - `mode: "explicit"`

                  The breakpoint mode. Always `explicit`.

                  - `"explicit"`

        - `role: "user" | "assistant" | "system" | "developer"`

          The role of the message input. One of `user`, `assistant`, `system`, or
          `developer`.

          - `"user"`

          - `"assistant"`

          - `"system"`

          - `"developer"`

        - `phase?: "commentary" | "final_answer" | null`

          Labels an `assistant` message as intermediate commentary (`commentary`) or the final answer (`final_answer`).
          For models like `gpt-5.3-codex` and beyond, when sending follow-up requests, preserve and resend
          phase on all assistant messages — dropping it can degrade performance. Not used for user messages.

          - `"commentary"`

          - `"final_answer"`

        - `type?: "message"`

          The type of the message input. Always `message`.

          - `"message"`

      - `Message`

        A message input to the model with a role indicating instruction following
        hierarchy. Instructions given with the `developer` or `system` role take
        precedence over instructions given with the `user` role.

        - `content: BetaResponseInputMessageContentList`

          A list of one or many input items to the model, containing different content
          types.

        - `role: "user" | "system" | "developer"`

          The role of the message input. One of `user`, `system`, or `developer`.

          - `"user"`

          - `"system"`

          - `"developer"`

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `status?: "in_progress" | "completed" | "incomplete"`

          The status of item. One of `in_progress`, `completed`, or
          `incomplete`. Populated when items are returned via API.

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

        - `type?: "message"`

          The type of the message input. Always set to `message`.

          - `"message"`

      - `BetaResponseOutputMessage`

        An output message from the model.

        - `id: string`

          The unique ID of the output message.

        - `content: Array<BetaResponseOutputText | BetaResponseOutputRefusal>`

          The content of the output message.

          - `BetaResponseOutputText`

            A text output from the model.

            - `annotations: Array<FileCitation | URLCitation | ContainerFileCitation | FilePath>`

              The annotations of the text output.

              - `FileCitation`

                A citation to a file.

                - `file_id: string`

                  The ID of the file.

                - `filename: string`

                  The filename of the file cited.

                - `index: number`

                  The index of the file in the list of files.

                - `type: "file_citation"`

                  The type of the file citation. Always `file_citation`.

                  - `"file_citation"`

              - `URLCitation`

                A citation for a web resource used to generate a model response.

                - `end_index: number`

                  The index of the last character of the URL citation in the message.

                - `start_index: number`

                  The index of the first character of the URL citation in the message.

                - `title: string`

                  The title of the web resource.

                - `type: "url_citation"`

                  The type of the URL citation. Always `url_citation`.

                  - `"url_citation"`

                - `url: string`

                  The URL of the web resource.

              - `ContainerFileCitation`

                A citation for a container file used to generate a model response.

                - `container_id: string`

                  The ID of the container file.

                - `end_index: number`

                  The index of the last character of the container file citation in the message.

                - `file_id: string`

                  The ID of the file.

                - `filename: string`

                  The filename of the container file cited.

                - `start_index: number`

                  The index of the first character of the container file citation in the message.

                - `type: "container_file_citation"`

                  The type of the container file citation. Always `container_file_citation`.

                  - `"container_file_citation"`

              - `FilePath`

                A path to a file.

                - `file_id: string`

                  The ID of the file.

                - `index: number`

                  The index of the file in the list of files.

                - `type: "file_path"`

                  The type of the file path. Always `file_path`.

                  - `"file_path"`

            - `text: string`

              The text output from the model.

            - `type: "output_text"`

              The type of the output text. Always `output_text`.

              - `"output_text"`

            - `logprobs?: Array<Logprob>`

              - `token: string`

              - `bytes: Array<number>`

              - `logprob: number`

              - `top_logprobs: Array<TopLogprob>`

                - `token: string`

                - `bytes: Array<number>`

                - `logprob: number`

          - `BetaResponseOutputRefusal`

            A refusal from the model.

            - `refusal: string`

              The refusal explanation from the model.

            - `type: "refusal"`

              The type of the refusal. Always `refusal`.

              - `"refusal"`

        - `role: "assistant"`

          The role of the output message. Always `assistant`.

          - `"assistant"`

        - `status: "in_progress" | "completed" | "incomplete"`

          The status of the message input. One of `in_progress`, `completed`, or
          `incomplete`. Populated when input items are returned via API.

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

        - `type: "message"`

          The type of the output message. Always `message`.

          - `"message"`

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `phase?: "commentary" | "final_answer" | null`

          Labels an `assistant` message as intermediate commentary (`commentary`) or the final answer (`final_answer`).
          For models like `gpt-5.3-codex` and beyond, when sending follow-up requests, preserve and resend
          phase on all assistant messages — dropping it can degrade performance. Not used for user messages.

          - `"commentary"`

          - `"final_answer"`

      - `BetaResponseFileSearchToolCall`

        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.

        - `id: string`

          The unique ID of the file search tool call.

        - `queries: Array<string>`

          The queries used to search for files.

        - `status: "in_progress" | "searching" | "completed" | 2 more`

          The status of the file search tool call. One of `in_progress`,
          `searching`, `incomplete` or `failed`,

          - `"in_progress"`

          - `"searching"`

          - `"completed"`

          - `"incomplete"`

          - `"failed"`

        - `type: "file_search_call"`

          The type of the file search tool call. Always `file_search_call`.

          - `"file_search_call"`

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `results?: Array<Result> | null`

          The results of the file search tool call.

          - `attributes?: Record<string, string | number | boolean> | null`

            Set of 16 key-value pairs that can be attached to an object. This can be
            useful for storing additional information about the object in a structured
            format, and querying for objects via API or the dashboard. Keys are strings
            with a maximum length of 64 characters. Values are strings with a maximum
            length of 512 characters, booleans, or numbers.

            - `string`

            - `number`

            - `boolean`

          - `file_id?: string`

            The unique ID of the file.

          - `filename?: string`

            The name of the file.

          - `score?: number`

            The relevance score of the file - a value between 0 and 1.

          - `text?: string`

            The text that was retrieved from the file.

      - `BetaResponseComputerToolCall`

        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.

        - `id: string`

          The unique ID of the computer call.

        - `call_id: string`

          An identifier used when responding to the tool call with output.

        - `pending_safety_checks: Array<PendingSafetyCheck>`

          The pending safety checks for the computer call.

          - `id: string`

            The ID of the pending safety check.

          - `code?: string | null`

            The type of the pending safety check.

          - `message?: string | null`

            Details about the pending safety check.

        - `status: "in_progress" | "completed" | "incomplete"`

          The status of the item. One of `in_progress`, `completed`, or
          `incomplete`. Populated when items are returned via API.

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

        - `type: "computer_call"`

          The type of the computer call. Always `computer_call`.

          - `"computer_call"`

        - `action?: BetaComputerAction`

          A click action.

          - `Click`

            A click action.

            - `button: "left" | "right" | "wheel" | 2 more`

              Indicates which mouse button was pressed during the click. One of `left`, `right`, `wheel`, `back`, or `forward`.

              - `"left"`

              - `"right"`

              - `"wheel"`

              - `"back"`

              - `"forward"`

            - `type: "click"`

              Specifies the event type. For a click action, this property is always `click`.

              - `"click"`

            - `x: number`

              The x-coordinate where the click occurred.

            - `y: number`

              The y-coordinate where the click occurred.

            - `keys?: Array<string> | null`

              The keys being held while clicking.

          - `DoubleClick`

            A double click action.

            - `keys: Array<string> | null`

              The keys being held while double-clicking.

            - `type: "double_click"`

              Specifies the event type. For a double click action, this property is always set to `double_click`.

              - `"double_click"`

            - `x: number`

              The x-coordinate where the double click occurred.

            - `y: number`

              The y-coordinate where the double click occurred.

          - `Drag`

            A drag action.

            - `path: Array<Path>`

              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 }
              ]
              ```

              - `x: number`

                The x-coordinate.

              - `y: number`

                The y-coordinate.

            - `type: "drag"`

              Specifies the event type. For a drag action, this property is always set to `drag`.

              - `"drag"`

            - `keys?: Array<string> | null`

              The keys being held while dragging the mouse.

          - `Keypress`

            A collection of keypresses the model would like to perform.

            - `keys: Array<string>`

              The combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key.

            - `type: "keypress"`

              Specifies the event type. For a keypress action, this property is always set to `keypress`.

              - `"keypress"`

          - `Move`

            A mouse move action.

            - `type: "move"`

              Specifies the event type. For a move action, this property is always set to `move`.

              - `"move"`

            - `x: number`

              The x-coordinate to move to.

            - `y: number`

              The y-coordinate to move to.

            - `keys?: Array<string> | null`

              The keys being held while moving the mouse.

          - `Screenshot`

            A screenshot action.

            - `type: "screenshot"`

              Specifies the event type. For a screenshot action, this property is always set to `screenshot`.

              - `"screenshot"`

          - `Scroll`

            A scroll action.

            - `scroll_x: number`

              The horizontal scroll distance.

            - `scroll_y: number`

              The vertical scroll distance.

            - `type: "scroll"`

              Specifies the event type. For a scroll action, this property is always set to `scroll`.

              - `"scroll"`

            - `x: number`

              The x-coordinate where the scroll occurred.

            - `y: number`

              The y-coordinate where the scroll occurred.

            - `keys?: Array<string> | null`

              The keys being held while scrolling.

          - `Type`

            An action to type in text.

            - `text: string`

              The text to type.

            - `type: "type"`

              Specifies the event type. For a type action, this property is always set to `type`.

              - `"type"`

          - `Wait`

            A wait action.

            - `type: "wait"`

              Specifies the event type. For a wait action, this property is always set to `wait`.

              - `"wait"`

        - `actions?: BetaComputerActionList`

          Flattened batched actions for `computer_use`. Each action includes an
          `type` discriminator and action-specific fields.

          - `Click`

            A click action.

          - `DoubleClick`

            A double click action.

          - `Drag`

            A drag action.

          - `Keypress`

            A collection of keypresses the model would like to perform.

          - `Move`

            A mouse move action.

          - `Screenshot`

            A screenshot action.

          - `Scroll`

            A scroll action.

          - `Type`

            An action to type in text.

          - `Wait`

            A wait action.

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

      - `ComputerCallOutput`

        The output of a computer tool call.

        - `call_id: string`

          The ID of the computer tool call that produced the output.

        - `output: BetaResponseComputerToolCallOutputScreenshot`

          A computer screenshot image used with the computer use tool.

          - `type: "computer_screenshot"`

            Specifies the event type. For a computer screenshot, this property is
            always set to `computer_screenshot`.

            - `"computer_screenshot"`

          - `file_id?: string`

            The identifier of an uploaded file that contains the screenshot.

          - `image_url?: string`

            The URL of the screenshot image.

        - `type: "computer_call_output"`

          The type of the computer tool call output. Always `computer_call_output`.

          - `"computer_call_output"`

        - `id?: string | null`

          The ID of the computer tool call output.

        - `acknowledged_safety_checks?: Array<AcknowledgedSafetyCheck> | null`

          The safety checks reported by the API that have been acknowledged by the developer.

          - `id: string`

            The ID of the pending safety check.

          - `code?: string | null`

            The type of the pending safety check.

          - `message?: string | null`

            Details about the pending safety check.

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

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

          The status of the message input. One of `in_progress`, `completed`, or `incomplete`. Populated when input items are returned via API.

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

      - `BetaResponseFunctionWebSearch`

        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.

        - `id: string`

          The unique ID of the web search tool call.

        - `action: Search | OpenPage | FindInPage`

          An object describing the specific action taken in this web search call.
          Includes details on how the model used the web (search, open_page, find_in_page).

          - `Search`

            Action type "search" - Performs a web search query.

            - `type: "search"`

              The action type.

              - `"search"`

            - `queries?: Array<string>`

              The search queries.

            - `query?: string`

              The search query.

            - `sources?: Array<Source>`

              The sources used in the search.

              - `type: "url"`

                The type of source. Always `url`.

                - `"url"`

              - `url: string`

                The URL of the source.

          - `OpenPage`

            Action type "open_page" - Opens a specific URL from search results.

            - `type: "open_page"`

              The action type.

              - `"open_page"`

            - `url?: string | null`

              The URL opened by the model.

          - `FindInPage`

            Action type "find_in_page": Searches for a pattern within a loaded page.

            - `pattern: string`

              The pattern or text to search for within the page.

            - `type: "find_in_page"`

              The action type.

              - `"find_in_page"`

            - `url: string`

              The URL of the page searched for the pattern.

        - `status: "in_progress" | "searching" | "completed" | "failed"`

          The status of the web search tool call.

          - `"in_progress"`

          - `"searching"`

          - `"completed"`

          - `"failed"`

        - `type: "web_search_call"`

          The type of the web search tool call. Always `web_search_call`.

          - `"web_search_call"`

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

      - `BetaResponseFunctionToolCall`

        A tool call to run a function. See the
        [function calling guide](https://platform.openai.com/docs/guides/function-calling) for more information.

        - `arguments: string`

          A JSON string of the arguments to pass to the function.

        - `call_id: string`

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

        - `name: string`

          The name of the function to run.

        - `type: "function_call"`

          The type of the function tool call. Always `function_call`.

          - `"function_call"`

        - `id?: string`

          The unique ID of the function tool call.

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `caller?: Direct | Program | null`

          The execution context that produced this tool call.

          - `Direct`

            - `type: "direct"`

              - `"direct"`

          - `Program`

            - `caller_id: string`

              The call ID of the program item that produced this tool call.

            - `type: "program"`

              - `"program"`

        - `namespace?: string`

          The namespace of the function to run.

        - `status?: "in_progress" | "completed" | "incomplete"`

          The status of the item. One of `in_progress`, `completed`, or
          `incomplete`. Populated when items are returned via API.

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

      - `FunctionCallOutput`

        The output of a function tool call.

        - `call_id: string`

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

        - `output: string | BetaResponseFunctionCallOutputItemList`

          Text, image, or file output of the function tool call.

          - `string`

          - `BetaResponseFunctionCallOutputItemList = Array<BetaResponseFunctionCallOutputItem>`

            An array of content outputs (text, image, file) for the function tool call.

            - `BetaResponseInputTextContent`

              A text input to the model.

              - `text: string`

                The text input to the model.

              - `type: "input_text"`

                The type of the input item. Always `input_text`.

                - `"input_text"`

              - `prompt_cache_breakpoint?: PromptCacheBreakpoint | null`

                Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.

                - `mode: "explicit"`

                  The breakpoint mode. Always `explicit`.

                  - `"explicit"`

            - `BetaResponseInputImageContent`

              An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision)

              - `type: "input_image"`

                The type of the input item. Always `input_image`.

                - `"input_image"`

              - `detail?: BetaImageDetail | null`

                The detail level of the image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`.

              - `file_id?: string | null`

                The ID of the file to be sent to the model.

              - `image_url?: string | null`

                The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.

              - `prompt_cache_breakpoint?: PromptCacheBreakpoint | null`

                Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.

                - `mode: "explicit"`

                  The breakpoint mode. Always `explicit`.

                  - `"explicit"`

            - `BetaResponseInputFileContent`

              A file input to the model.

              - `type: "input_file"`

                The type of the input item. Always `input_file`.

                - `"input_file"`

              - `detail?: "auto" | "low" | "high"`

                The detail level of the file to be sent to the model. Use `auto` to let the system select the detail level; for GPT-5.6 and later models, `auto` uses high-quality rendering, which may increase input token usage. Use `low` for lower-cost rendering, or `high` to render the file at higher quality. Defaults to `auto`.

                - `"auto"`

                - `"low"`

                - `"high"`

              - `file_data?: string | null`

                The base64-encoded data of the file to be sent to the model.

              - `file_id?: string | null`

                The ID of the file to be sent to the model.

              - `file_url?: string | null`

                The URL of the file to be sent to the model.

              - `filename?: string | null`

                The name of the file to be sent to the model.

              - `prompt_cache_breakpoint?: PromptCacheBreakpoint | null`

                Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.

                - `mode: "explicit"`

                  The breakpoint mode. Always `explicit`.

                  - `"explicit"`

        - `type: "function_call_output"`

          The type of the function tool call output. Always `function_call_output`.

          - `"function_call_output"`

        - `id?: string | null`

          The unique ID of the function tool call output. Populated when this item is returned via API.

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `caller?: Direct | Program | null`

          The execution context that produced this tool call.

          - `Direct`

            - `type: "direct"`

              The caller type. Always `direct`.

              - `"direct"`

          - `Program`

            - `caller_id: string`

              The call ID of the program item that produced this tool call.

            - `type: "program"`

              The caller type. Always `program`.

              - `"program"`

        - `name?: string | null`

          The name of the tool that produced the output.

        - `namespace?: string | null`

          The namespace of the tool that produced the output.

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

          The status of the item. One of `in_progress`, `completed`, or `incomplete`. Populated when items are returned via API.

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

      - `AgentMessage`

        A message routed between agents.

        - `author: string`

          The sending agent identity.

        - `content: Array<BetaResponseInputTextContent | BetaResponseInputImageContent | EncryptedContent>`

          Plaintext, image, or encrypted content sent between agents.

          - `BetaResponseInputTextContent`

            A text input to the model.

          - `BetaResponseInputImageContent`

            An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision)

          - `EncryptedContent`

            Opaque encrypted content that Responses API decrypts inside trusted model execution.

            - `encrypted_content: string`

              Opaque encrypted content.

            - `type: "encrypted_content"`

              The type of the input item. Always `encrypted_content`.

              - `"encrypted_content"`

        - `recipient: string`

          The destination agent identity.

        - `type: "agent_message"`

          The item type. Always `agent_message`.

          - `"agent_message"`

        - `id?: string | null`

          The unique ID of this agent message item.

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

      - `MultiAgentCall`

        - `action: "spawn_agent" | "interrupt_agent" | "list_agents" | 3 more`

          The multi-agent action that was executed.

          - `"spawn_agent"`

          - `"interrupt_agent"`

          - `"list_agents"`

          - `"send_message"`

          - `"followup_task"`

          - `"wait_agent"`

        - `arguments: string`

          The action arguments as a JSON string.

        - `call_id: string`

          The unique ID linking this call to its output.

        - `type: "multi_agent_call"`

          The item type. Always `multi_agent_call`.

          - `"multi_agent_call"`

        - `id?: string | null`

          The unique ID of this multi-agent call.

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

      - `MultiAgentCallOutput`

        - `action: "spawn_agent" | "interrupt_agent" | "list_agents" | 3 more`

          The multi-agent action that produced this result.

          - `"spawn_agent"`

          - `"interrupt_agent"`

          - `"list_agents"`

          - `"send_message"`

          - `"followup_task"`

          - `"wait_agent"`

        - `call_id: string`

          The unique ID of the multi-agent call.

        - `output: Array<Output>`

          Text output returned by the multi-agent action.

          - `text: string`

            The text content.

          - `type: "output_text"`

            The content type. Always `output_text`.

            - `"output_text"`

          - `annotations?: Array<FileCitation | URLCitation | ContainerFileCitation>`

            Citations associated with the text content.

            - `FileCitation`

              - `file_id: string`

                The ID of the file.

              - `filename: string`

                The filename of the file cited.

              - `index: number`

                The index of the file in the list of files.

              - `type: "file_citation"`

                The citation type. Always `file_citation`.

                - `"file_citation"`

            - `URLCitation`

              - `end_index: number`

                The index of the last character of the citation in the message.

              - `start_index: number`

                The index of the first character of the citation in the message.

              - `title: string`

                The title of the cited resource.

              - `type: "url_citation"`

                The citation type. Always `url_citation`.

                - `"url_citation"`

              - `url: string`

                The URL of the cited resource.

            - `ContainerFileCitation`

              - `container_id: string`

                The ID of the container.

              - `end_index: number`

                The index of the last character of the citation in the message.

              - `file_id: string`

                The ID of the container file.

              - `filename: string`

                The filename of the container file cited.

              - `start_index: number`

                The index of the first character of the citation in the message.

              - `type: "container_file_citation"`

                The citation type. Always `container_file_citation`.

                - `"container_file_citation"`

        - `type: "multi_agent_call_output"`

          The item type. Always `multi_agent_call_output`.

          - `"multi_agent_call_output"`

        - `id?: string | null`

          The unique ID of this multi-agent call output.

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

      - `ToolSearchCall`

        - `arguments: unknown`

          The arguments supplied to the tool search call.

        - `type: "tool_search_call"`

          The item type. Always `tool_search_call`.

          - `"tool_search_call"`

        - `id?: string | null`

          The unique ID of this tool search call.

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `call_id?: string | null`

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

        - `execution?: "server" | "client"`

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

          - `"server"`

          - `"client"`

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

          The status of the tool search call.

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

      - `BetaResponseToolSearchOutputItemParam`

        - `tools: Array<BetaTool>`

          The loaded tool definitions returned by the tool search output.

          - `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).

            - `name: string`

              The name of the function to call.

            - `parameters: Record<string, unknown> | null`

              A JSON schema object describing the parameters of the function.

            - `strict: boolean | null`

              Whether strict parameter validation is enforced for this function tool.

            - `type: "function"`

              The type of the function tool. Always `function`.

              - `"function"`

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

              The tool invocation context(s).

              - `"direct"`

              - `"programmatic"`

            - `defer_loading?: boolean`

              Whether this function is deferred and loaded via tool search.

            - `description?: string | null`

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

            - `output_schema?: Record<string, unknown> | null`

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

          - `BetaFileSearchTool`

            A tool that searches for relevant content from uploaded files. Learn more about the [file search tool](https://platform.openai.com/docs/guides/tools-file-search).

            - `type: "file_search"`

              The type of the file search tool. Always `file_search`.

              - `"file_search"`

            - `vector_store_ids: Array<string>`

              The IDs of the vector stores to search.

            - `filters?: ComparisonFilter | CompoundFilter | null`

              A filter to apply.

              - `ComparisonFilter`

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

                - `key: string`

                  The key to compare against the value.

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

                  Specifies the comparison operator: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`, `in`, `nin`.

                  - `eq`: equals
                  - `ne`: not equal
                  - `gt`: greater than
                  - `gte`: greater than or equal
                  - `lt`: less than
                  - `lte`: less than or equal
                  - `in`: in
                  - `nin`: not in

                  - `"eq"`

                  - `"ne"`

                  - `"gt"`

                  - `"gte"`

                  - `"lt"`

                  - `"lte"`

                  - `"in"`

                  - `"nin"`

                - `value: string | number | boolean | Array<string | number>`

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

                  - `string`

                  - `number`

                  - `boolean`

                  - `Array<string | number>`

                    - `string`

                    - `number`

              - `CompoundFilter`

                Combine multiple filters using `and` or `or`.

                - `filters: Array<ComparisonFilter | unknown>`

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

                  - `ComparisonFilter`

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

                    - `key: string`

                      The key to compare against the value.

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

                      Specifies the comparison operator: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`, `in`, `nin`.

                      - `eq`: equals
                      - `ne`: not equal
                      - `gt`: greater than
                      - `gte`: greater than or equal
                      - `lt`: less than
                      - `lte`: less than or equal
                      - `in`: in
                      - `nin`: not in

                      - `"eq"`

                      - `"ne"`

                      - `"gt"`

                      - `"gte"`

                      - `"lt"`

                      - `"lte"`

                      - `"in"`

                      - `"nin"`

                    - `value: string | number | boolean | Array<string | number>`

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

                      - `string`

                      - `number`

                      - `boolean`

                      - `Array<string | number>`

                        - `string`

                        - `number`

                  - `unknown`

                - `type: "and" | "or"`

                  Type of operation: `and` or `or`.

                  - `"and"`

                  - `"or"`

            - `max_num_results?: number`

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

            - `ranking_options?: RankingOptions`

              Ranking options for search.

              - `hybrid_search?: HybridSearch`

                Weights that control how reciprocal rank fusion balances semantic embedding matches versus sparse keyword matches when hybrid search is enabled.

                - `embedding_weight: number`

                  The weight of the embedding in the reciprocal ranking fusion.

                - `text_weight: number`

                  The weight of the text in the reciprocal ranking fusion.

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

                The ranker to use for the file search.

                - `"auto"`

                - `"default-2024-11-15"`

              - `score_threshold?: number`

                The score threshold for the file search, a number between 0 and 1. Numbers closer to 1 will attempt to return only the most relevant results, but may return fewer results.

          - `BetaComputerTool`

            A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use).

            - `type: "computer"`

              The type of the computer tool. Always `computer`.

              - `"computer"`

          - `BetaComputerUsePreviewTool`

            A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use).

            - `display_height: number`

              The height of the computer display.

            - `display_width: number`

              The width of the computer display.

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

              The type of computer environment to control.

              - `"windows"`

              - `"mac"`

              - `"linux"`

              - `"ubuntu"`

              - `"browser"`

            - `type: "computer_use_preview"`

              The type of the computer use tool. Always `computer_use_preview`.

              - `"computer_use_preview"`

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

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

              - `"web_search"`

              - `"web_search_2025_08_26"`

            - `external_web_access?: boolean`

              Allow live internet access for web search. Defaults to true when omitted. When false, the web search tool runs in offline/cache-only mode and will not fetch new external content.

            - `filters?: Filters | null`

              Filters for the search.

              - `allowed_domains?: Array<string> | null`

                Allowed domains for the search. If not provided, all domains are allowed.
                Subdomains of the provided domains are allowed as well.

                Example: `["pubmed.ncbi.nlm.nih.gov"]`

            - `search_context_size?: "low" | "medium" | "high"`

              High level guidance for the amount of context window space to use for the search. One of `low`, `medium`, or `high`. `medium` is the default.

              - `"low"`

              - `"medium"`

              - `"high"`

            - `user_location?: UserLocation | null`

              The approximate location of the user.

              - `city?: string | null`

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

              - `country?: string | null`

                The two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of the user, e.g. `US`.

              - `region?: string | null`

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

              - `timezone?: string | null`

                The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of the user, e.g. `America/Los_Angeles`.

              - `type?: "approximate"`

                The type of location approximation. Always `approximate`.

                - `"approximate"`

          - `Mcp`

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

            - `server_label: string`

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

            - `type: "mcp"`

              The type of the MCP tool. Always `mcp`.

              - `"mcp"`

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

              The tool invocation context(s).

              - `"direct"`

              - `"programmatic"`

            - `allowed_tools?: Array<string> | McpToolFilter | null`

              List of allowed tool names or a filter object.

              - `Array<string>`

              - `McpToolFilter`

                A filter object to specify which tools are allowed.

                - `read_only?: boolean`

                  Indicates whether or not a tool modifies data or is read-only. If an
                  MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint),
                  it will match this filter.

                - `tool_names?: Array<string>`

                  List of allowed tool names.

            - `authorization?: string`

              An OAuth access token that can be used with a remote MCP server, either
              with a custom MCP server URL or a service connector. Your application
              must handle the OAuth authorization flow and provide the token here.

            - `connector_id?: "connector_dropbox" | "connector_gmail" | "connector_googlecalendar" | 5 more`

              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`

              - `"connector_dropbox"`

              - `"connector_gmail"`

              - `"connector_googlecalendar"`

              - `"connector_googledrive"`

              - `"connector_microsoftteams"`

              - `"connector_outlookcalendar"`

              - `"connector_outlookemail"`

              - `"connector_sharepoint"`

            - `defer_loading?: boolean`

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

            - `headers?: Record<string, string> | null`

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

            - `require_approval?: McpToolApprovalFilter | "always" | "never" | null`

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

              - `McpToolApprovalFilter`

                Specify which of the MCP server's tools require approval. Can be
                `always`, `never`, or a filter object associated with tools
                that require approval.

                - `always?: Always`

                  A filter object to specify which tools are allowed.

                  - `read_only?: boolean`

                    Indicates whether or not a tool modifies data or is read-only. If an
                    MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint),
                    it will match this filter.

                  - `tool_names?: Array<string>`

                    List of allowed tool names.

                - `never?: Never`

                  A filter object to specify which tools are allowed.

                  - `read_only?: boolean`

                    Indicates whether or not a tool modifies data or is read-only. If an
                    MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint),
                    it will match this filter.

                  - `tool_names?: Array<string>`

                    List of allowed tool names.

              - `"always" | "never"`

                - `"always"`

                - `"never"`

            - `server_description?: string`

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

            - `server_url?: string`

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

            - `tunnel_id?: string`

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

          - `CodeInterpreter`

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

            - `container: string | CodeInterpreterToolAuto`

              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`

              - `CodeInterpreterToolAuto`

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

                - `type: "auto"`

                  Always `auto`.

                  - `"auto"`

                - `file_ids?: Array<string>`

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

                - `memory_limit?: "1g" | "4g" | "16g" | "64g" | null`

                  The memory limit for the code interpreter container.

                  - `"1g"`

                  - `"4g"`

                  - `"16g"`

                  - `"64g"`

                - `network_policy?: BetaContainerNetworkPolicyDisabled | BetaContainerNetworkPolicyAllowlist`

                  Network access policy for the container.

                  - `BetaContainerNetworkPolicyDisabled`

                    - `type: "disabled"`

                      Disable outbound network access. Always `disabled`.

                      - `"disabled"`

                  - `BetaContainerNetworkPolicyAllowlist`

                    - `allowed_domains: Array<string>`

                      A list of allowed domains when type is `allowlist`.

                    - `type: "allowlist"`

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

                      - `"allowlist"`

                    - `domain_secrets?: Array<BetaContainerNetworkPolicyDomainSecret>`

                      Optional domain-scoped secrets for allowlisted domains.

                      - `domain: string`

                        The domain associated with the secret.

                      - `name: string`

                        The name of the secret to inject for the domain.

                      - `value: string`

                        The secret value to inject for the domain.

            - `type: "code_interpreter"`

              The type of the code interpreter tool. Always `code_interpreter`.

              - `"code_interpreter"`

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

              The tool invocation context(s).

              - `"direct"`

              - `"programmatic"`

          - `ProgrammaticToolCalling`

            - `type: "programmatic_tool_calling"`

              The type of the tool. Always `programmatic_tool_calling`.

              - `"programmatic_tool_calling"`

          - `ImageGeneration`

            A tool that generates images using the GPT image models.

            - `type: "image_generation"`

              The type of the image generation tool. Always `image_generation`.

              - `"image_generation"`

            - `action?: "generate" | "edit" | "auto"`

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

              - `"generate"`

              - `"edit"`

              - `"auto"`

            - `background?: "transparent" | "opaque" | "auto"`

              Allows to set transparency for the background of the generated image(s).
              Must be one of `transparent`, `opaque`, or `auto` (default value). When
              `auto` is used, the model will automatically determine the best
              background for the image.

              Transparent backgrounds are available for supported GPT Image models.
              For `gpt-image-2` and `gpt-image-2-2026-04-21`, this support is in
              preview. When using `transparent`, set the output format to `png` or
              `webp`.

              - `"transparent"`

              - `"opaque"`

              - `"auto"`

            - `input_fidelity?: "high" | "low" | null`

              Control how much effort the model will exert to match the style and features, especially facial features, of input images. This parameter is only supported for `gpt-image-1` and `gpt-image-1.5` and later models, unsupported for `gpt-image-1-mini`. Supports `high` and `low`. Defaults to `low`.

              - `"high"`

              - `"low"`

            - `input_image_mask?: InputImageMask`

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

              - `file_id?: string`

                File ID for the mask image.

              - `image_url?: string`

                Base64-encoded mask image.

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

              The image generation model to use. One of `gpt-image-1`,
              `gpt-image-1-mini`, `gpt-image-1.5`, `gpt-image-2`,
              `gpt-image-2-2026-04-21`, or `chatgpt-image-latest`. Default:
              `gpt-image-1`.

              - `(string & {})`

              - `"gpt-image-1" | "gpt-image-1-mini" | "gpt-image-2" | 3 more`

                - `"gpt-image-1"`

                - `"gpt-image-1-mini"`

                - `"gpt-image-2"`

                - `"gpt-image-2-2026-04-21"`

                - `"gpt-image-1.5"`

                - `"chatgpt-image-latest"`

            - `moderation?: "auto" | "low"`

              Moderation level for the generated image. Default: `auto`.

              - `"auto"`

              - `"low"`

            - `output_compression?: number`

              Compression level for the output image. Default: 100.

            - `output_format?: "png" | "webp" | "jpeg"`

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

              - `"png"`

              - `"webp"`

              - `"jpeg"`

            - `partial_images?: number`

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

            - `quality?: "low" | "medium" | "high" | "auto"`

              The quality of the generated image. One of `low`, `medium`, `high`,
              or `auto`. Default: `auto`.

              - `"low"`

              - `"medium"`

              - `"high"`

              - `"auto"`

            - `size?: (string & {}) | "1024x1024" | "1024x1536" | "1536x1024" | "auto"`

              The size of the generated images. For `gpt-image-2` and `gpt-image-2-2026-04-21`, arbitrary resolutions are supported as `WIDTHxHEIGHT` strings, for example `1536x864`. Width and height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above `2560x1440` are experimental, and the maximum supported resolution is `3840x2160`. The requested size must also satisfy the model's current pixel and edge limits. The standard sizes `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models; `auto` is supported for models that allow automatic sizing. For `dall-e-2`, use one of `256x256`, `512x512`, or `1024x1024`. For `dall-e-3`, use one of `1024x1024`, `1792x1024`, or `1024x1792`.

              - `(string & {})`

              - `"1024x1024" | "1024x1536" | "1536x1024" | "auto"`

                - `"1024x1024"`

                - `"1024x1536"`

                - `"1536x1024"`

                - `"auto"`

          - `LocalShell`

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

            - `type: "local_shell"`

              The type of the local shell tool. Always `local_shell`.

              - `"local_shell"`

          - `BetaFunctionShellTool`

            A tool that allows the model to execute shell commands.

            - `type: "shell"`

              The type of the shell tool. Always `shell`.

              - `"shell"`

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

              The tool invocation context(s).

              - `"direct"`

              - `"programmatic"`

            - `environment?: BetaContainerAuto | BetaLocalEnvironment | BetaContainerReference | null`

              - `BetaContainerAuto`

                - `type: "container_auto"`

                  Automatically creates a container for this request

                  - `"container_auto"`

                - `file_ids?: Array<string>`

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

                - `memory_limit?: "1g" | "4g" | "16g" | "64g" | null`

                  The memory limit for the container.

                  - `"1g"`

                  - `"4g"`

                  - `"16g"`

                  - `"64g"`

                - `network_policy?: BetaContainerNetworkPolicyDisabled | BetaContainerNetworkPolicyAllowlist`

                  Network access policy for the container.

                  - `BetaContainerNetworkPolicyDisabled`

                  - `BetaContainerNetworkPolicyAllowlist`

                - `skills?: Array<BetaSkillReference | BetaInlineSkill>`

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

                  - `BetaSkillReference`

                    - `skill_id: string`

                      The ID of the referenced skill.

                    - `type: "skill_reference"`

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

                      - `"skill_reference"`

                    - `version?: string`

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

                  - `BetaInlineSkill`

                    - `description: string`

                      The description of the skill.

                    - `name: string`

                      The name of the skill.

                    - `source: BetaInlineSkillSource`

                      Inline skill payload

                      - `data: string`

                        Base64-encoded skill zip bundle.

                      - `media_type: "application/zip"`

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

                        - `"application/zip"`

                      - `type: "base64"`

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

                        - `"base64"`

                    - `type: "inline"`

                      Defines an inline skill for this request.

                      - `"inline"`

              - `BetaLocalEnvironment`

                - `type: "local"`

                  Use a local computer environment.

                  - `"local"`

                - `skills?: Array<BetaLocalSkill>`

                  An optional list of skills.

                  - `description: string`

                    The description of the skill.

                  - `name: string`

                    The name of the skill.

                  - `path: string`

                    The path to the directory containing the skill.

              - `BetaContainerReference`

                - `container_id: string`

                  The ID of the referenced container.

                - `type: "container_reference"`

                  References a container created with the /v1/containers endpoint

                  - `"container_reference"`

          - `BetaCustomTool`

            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)

            - `name: string`

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

            - `type: "custom"`

              The type of the custom tool. Always `custom`.

              - `"custom"`

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

              The tool invocation context(s).

              - `"direct"`

              - `"programmatic"`

            - `defer_loading?: boolean`

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

            - `description?: string`

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

            - `format?: Text | Grammar`

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

              - `Text`

                Unconstrained free-form text.

                - `type: "text"`

                  Unconstrained text format. Always `text`.

                  - `"text"`

              - `Grammar`

                A grammar defined by the user.

                - `definition: string`

                  The grammar definition.

                - `syntax: "lark" | "regex"`

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

                  - `"lark"`

                  - `"regex"`

                - `type: "grammar"`

                  Grammar format. Always `grammar`.

                  - `"grammar"`

          - `BetaNamespaceTool`

            Groups function/custom tools under a shared namespace.

            - `description: string`

              A description of the namespace shown to the model.

            - `name: string`

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

            - `tools: Array<Function | BetaCustomTool>`

              The function/custom tools available inside this namespace.

              - `Function`

                - `name: string`

                - `type: "function"`

                  - `"function"`

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

                  The tool invocation context(s).

                  - `"direct"`

                  - `"programmatic"`

                - `defer_loading?: boolean`

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

                - `description?: string | null`

                - `output_schema?: Record<string, unknown> | null`

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

                - `parameters?: unknown`

                - `strict?: boolean | null`

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

              - `BetaCustomTool`

                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: "namespace"`

              The type of the tool. Always `namespace`.

              - `"namespace"`

          - `BetaToolSearchTool`

            Hosted or BYOT tool search configuration for deferred tools.

            - `type: "tool_search"`

              The type of the tool. Always `tool_search`.

              - `"tool_search"`

            - `description?: string | null`

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

            - `execution?: "server" | "client"`

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

              - `"server"`

              - `"client"`

            - `parameters?: unknown`

              Parameter schema for a client-executed tool search tool.

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

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

              - `"web_search_preview"`

              - `"web_search_preview_2025_03_11"`

            - `search_content_types?: Array<"text" | "image">`

              - `"text"`

              - `"image"`

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

              - `"low"`

              - `"medium"`

              - `"high"`

            - `user_location?: UserLocation | null`

              The user's location.

              - `type: "approximate"`

                The type of location approximation. Always `approximate`.

                - `"approximate"`

              - `city?: string | null`

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

              - `country?: string | null`

                The two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of the user, e.g. `US`.

              - `region?: string | null`

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

              - `timezone?: string | null`

                The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of the user, e.g. `America/Los_Angeles`.

          - `BetaApplyPatchTool`

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

            - `type: "apply_patch"`

              The type of the tool. Always `apply_patch`.

              - `"apply_patch"`

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

              The tool invocation context(s).

              - `"direct"`

              - `"programmatic"`

        - `type: "tool_search_output"`

          The item type. Always `tool_search_output`.

          - `"tool_search_output"`

        - `id?: string | null`

          The unique ID of this tool search output.

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `call_id?: string | null`

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

        - `execution?: "server" | "client"`

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

          - `"server"`

          - `"client"`

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

          The status of the tool search output.

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

      - `AdditionalTools`

        - `role: "developer"`

          The role that provided the additional tools. Only `developer` is supported.

          - `"developer"`

        - `tools: Array<BetaTool>`

          A list of additional tools made available at this item.

          - `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).

          - `Mcp`

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

          - `CodeInterpreter`

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

          - `ProgrammaticToolCalling`

          - `ImageGeneration`

            A tool that generates images using the GPT image models.

          - `LocalShell`

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

          - `BetaFunctionShellTool`

            A tool that allows the model to execute shell commands.

          - `BetaCustomTool`

            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)

          - `BetaNamespaceTool`

            Groups function/custom tools under a shared namespace.

          - `BetaToolSearchTool`

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

          - `BetaApplyPatchTool`

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

        - `type: "additional_tools"`

          The item type. Always `additional_tools`.

          - `"additional_tools"`

        - `id?: string | null`

          The unique ID of this additional tools item.

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

      - `BetaResponseReasoningItem`

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

        - `id: string`

          The unique identifier of the reasoning content.

        - `summary: Array<Summary>`

          Reasoning summary content.

          - `text: string`

            A summary of the reasoning output from the model so far.

          - `type: "summary_text"`

            The type of the object. Always `summary_text`.

            - `"summary_text"`

        - `type: "reasoning"`

          The type of the object. Always `reasoning`.

          - `"reasoning"`

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `content?: Array<Content>`

          Reasoning text content.

          - `text: string`

            The reasoning text from the model.

          - `type: "reasoning_text"`

            The type of the reasoning text. Always `reasoning_text`.

            - `"reasoning_text"`

        - `encrypted_content?: string | null`

          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.

          When streaming, use the completed reasoning item and its
          `encrypted_content` from the `response.output_item.done` event in
          subsequent requests. The `encrypted_content` in
          `response.output_item.added` may be incomplete. This is especially
          important when `store` is `false` or when using Zero Data Retention.

        - `status?: "in_progress" | "completed" | "incomplete"`

          The status of the item. One of `in_progress`, `completed`, or
          `incomplete`. Populated when items are returned via API.

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

      - `BetaResponseCompactionItemParam`

        A compaction item generated by the [`v1/responses/compact` API](https://platform.openai.com/docs/api-reference/responses/compact).

        - `encrypted_content: string`

          The encrypted content of the compaction summary.

        - `type: "compaction"`

          The type of the item. Always `compaction`.

          - `"compaction"`

        - `id?: string | null`

          The ID of the compaction item.

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

      - `ImageGenerationCall`

        An image generation request made by the model.

        - `id: string`

          The unique ID of the image generation call.

        - `result: string | null`

          The generated image encoded in base64.

        - `status: "in_progress" | "completed" | "generating" | "failed"`

          The status of the image generation call.

          - `"in_progress"`

          - `"completed"`

          - `"generating"`

          - `"failed"`

        - `type: "image_generation_call"`

          The type of the image generation call. Always `image_generation_call`.

          - `"image_generation_call"`

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

      - `BetaResponseCodeInterpreterToolCall`

        A tool call to run code.

        - `id: string`

          The unique ID of the code interpreter tool call.

        - `code: string | null`

          The code to run, or null if not available.

        - `container_id: string`

          The ID of the container used to run the code.

        - `outputs: Array<Logs | Image> | null`

          The outputs generated by the code interpreter, such as logs or images.
          Can be null if no outputs are available.

          - `Logs`

            The logs output from the code interpreter.

            - `logs: string`

              The logs output from the code interpreter.

            - `type: "logs"`

              The type of the output. Always `logs`.

              - `"logs"`

          - `Image`

            The image output from the code interpreter.

            - `type: "image"`

              The type of the output. Always `image`.

              - `"image"`

            - `url: string`

              The URL of the image output from the code interpreter.

        - `status: "in_progress" | "completed" | "incomplete" | 2 more`

          The status of the code interpreter tool call. Valid values are `in_progress`, `completed`, `incomplete`, `interpreting`, and `failed`.

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

          - `"interpreting"`

          - `"failed"`

        - `type: "code_interpreter_call"`

          The type of the code interpreter tool call. Always `code_interpreter_call`.

          - `"code_interpreter_call"`

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

      - `LocalShellCall`

        A tool call to run a command on the local shell.

        - `id: string`

          The unique ID of the local shell call.

        - `action: Action`

          Execute a shell command on the server.

          - `command: Array<string>`

            The command to run.

          - `env: Record<string, string>`

            Environment variables to set for the command.

          - `type: "exec"`

            The type of the local shell action. Always `exec`.

            - `"exec"`

          - `timeout_ms?: number | null`

            Optional timeout in milliseconds for the command.

          - `user?: string | null`

            Optional user to run the command as.

          - `working_directory?: string | null`

            Optional working directory to run the command in.

        - `call_id: string`

          The unique ID of the local shell tool call generated by the model.

        - `status: "in_progress" | "completed" | "incomplete"`

          The status of the local shell call.

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

        - `type: "local_shell_call"`

          The type of the local shell call. Always `local_shell_call`.

          - `"local_shell_call"`

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

      - `LocalShellCallOutput`

        The output of a local shell tool call.

        - `id: string`

          The unique ID of the local shell tool call generated by the model.

        - `output: string`

          A JSON string of the output of the local shell tool call.

        - `type: "local_shell_call_output"`

          The type of the local shell tool call output. Always `local_shell_call_output`.

          - `"local_shell_call_output"`

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

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

          The status of the item. One of `in_progress`, `completed`, or `incomplete`.

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

      - `ShellCall`

        A tool representing a request to execute one or more shell commands.

        - `action: Action`

          The shell commands and limits that describe how to run the tool call.

          - `commands: Array<string>`

            Ordered shell commands for the execution environment to run.

          - `max_output_length?: number | null`

            Maximum number of UTF-8 characters to capture from combined stdout and stderr output.

          - `timeout_ms?: number | null`

            Maximum wall-clock time in milliseconds to allow the shell commands to run.

        - `call_id: string`

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

        - `type: "shell_call"`

          The type of the item. Always `shell_call`.

          - `"shell_call"`

        - `id?: string | null`

          The unique ID of the shell tool call. Populated when this item is returned via API.

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `caller?: Direct | Program | null`

          The execution context that produced this tool call.

          - `Direct`

            - `type: "direct"`

              The caller type. Always `direct`.

              - `"direct"`

          - `Program`

            - `caller_id: string`

              The call ID of the program item that produced this tool call.

            - `type: "program"`

              The caller type. Always `program`.

              - `"program"`

        - `environment?: BetaLocalEnvironment | BetaContainerReference | null`

          The environment to execute the shell commands in.

          - `BetaLocalEnvironment`

          - `BetaContainerReference`

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

          The status of the shell call. One of `in_progress`, `completed`, or `incomplete`.

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

      - `ShellCallOutput`

        The streamed output items emitted by a shell tool call.

        - `call_id: string`

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

        - `output: Array<BetaResponseFunctionShellCallOutputContent>`

          Captured chunks of stdout and stderr output, along with their associated outcomes.

          - `outcome: Timeout | Exit`

            The exit or timeout outcome associated with this shell call.

            - `Timeout`

              Indicates that the shell call exceeded its configured time limit.

              - `type: "timeout"`

                The outcome type. Always `timeout`.

                - `"timeout"`

            - `Exit`

              Indicates that the shell commands finished and returned an exit code.

              - `exit_code: number`

                The exit code returned by the shell process.

              - `type: "exit"`

                The outcome type. Always `exit`.

                - `"exit"`

          - `stderr: string`

            Captured stderr output for the shell call.

          - `stdout: string`

            Captured stdout output for the shell call.

        - `type: "shell_call_output"`

          The type of the item. Always `shell_call_output`.

          - `"shell_call_output"`

        - `id?: string | null`

          The unique ID of the shell tool call output. Populated when this item is returned via API.

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `caller?: Direct | Program | null`

          The execution context that produced this tool call.

          - `Direct`

            - `type: "direct"`

              The caller type. Always `direct`.

              - `"direct"`

          - `Program`

            - `caller_id: string`

              The call ID of the program item that produced this tool call.

            - `type: "program"`

              The caller type. Always `program`.

              - `"program"`

        - `max_output_length?: number | null`

          The maximum number of UTF-8 characters captured for this shell call's combined output.

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

          The status of the shell call output.

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

      - `ApplyPatchCall`

        A tool call representing a request to create, delete, or update files using diff patches.

        - `call_id: string`

          The unique ID of the apply patch tool call generated by the model.

        - `operation: CreateFile | DeleteFile | UpdateFile`

          The specific create, delete, or update instruction for the apply_patch tool call.

          - `CreateFile`

            Instruction for creating a new file via the apply_patch tool.

            - `diff: string`

              Unified diff content to apply when creating the file.

            - `path: string`

              Path of the file to create relative to the workspace root.

            - `type: "create_file"`

              The operation type. Always `create_file`.

              - `"create_file"`

          - `DeleteFile`

            Instruction for deleting an existing file via the apply_patch tool.

            - `path: string`

              Path of the file to delete relative to the workspace root.

            - `type: "delete_file"`

              The operation type. Always `delete_file`.

              - `"delete_file"`

          - `UpdateFile`

            Instruction for updating an existing file via the apply_patch tool.

            - `diff: string`

              Unified diff content to apply to the existing file.

            - `path: string`

              Path of the file to update relative to the workspace root.

            - `type: "update_file"`

              The operation type. Always `update_file`.

              - `"update_file"`

        - `status: "in_progress" | "completed"`

          The status of the apply patch tool call. One of `in_progress` or `completed`.

          - `"in_progress"`

          - `"completed"`

        - `type: "apply_patch_call"`

          The type of the item. Always `apply_patch_call`.

          - `"apply_patch_call"`

        - `id?: string | null`

          The unique ID of the apply patch tool call. Populated when this item is returned via API.

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `caller?: Direct | Program | null`

          The execution context that produced this tool call.

          - `Direct`

            - `type: "direct"`

              The caller type. Always `direct`.

              - `"direct"`

          - `Program`

            - `caller_id: string`

              The call ID of the program item that produced this tool call.

            - `type: "program"`

              The caller type. Always `program`.

              - `"program"`

      - `ApplyPatchCallOutput`

        The streamed output emitted by an apply patch tool call.

        - `call_id: string`

          The unique ID of the apply patch tool call generated by the model.

        - `status: "completed" | "failed"`

          The status of the apply patch tool call output. One of `completed` or `failed`.

          - `"completed"`

          - `"failed"`

        - `type: "apply_patch_call_output"`

          The type of the item. Always `apply_patch_call_output`.

          - `"apply_patch_call_output"`

        - `id?: string | null`

          The unique ID of the apply patch tool call output. Populated when this item is returned via API.

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `caller?: Direct | Program | null`

          The execution context that produced this tool call.

          - `Direct`

            - `type: "direct"`

              The caller type. Always `direct`.

              - `"direct"`

          - `Program`

            - `caller_id: string`

              The call ID of the program item that produced this tool call.

            - `type: "program"`

              The caller type. Always `program`.

              - `"program"`

        - `output?: string | null`

          Optional human-readable log text from the apply patch tool (e.g., patch results or errors).

      - `McpListTools`

        A list of tools available on an MCP server.

        - `id: string`

          The unique ID of the list.

        - `server_label: string`

          The label of the MCP server.

        - `tools: Array<Tool>`

          The tools available on the server.

          - `input_schema: unknown`

            The JSON schema describing the tool's input.

          - `name: string`

            The name of the tool.

          - `annotations?: unknown`

            Additional annotations about the tool.

          - `description?: string | null`

            The description of the tool.

        - `type: "mcp_list_tools"`

          The type of the item. Always `mcp_list_tools`.

          - `"mcp_list_tools"`

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `error?: string | null`

          Error message if the server could not list tools.

      - `McpApprovalRequest`

        A request for human approval of a tool invocation.

        - `id: string`

          The unique ID of the approval request.

        - `arguments: string`

          A JSON string of arguments for the tool.

        - `name: string`

          The name of the tool to run.

        - `server_label: string`

          The label of the MCP server making the request.

        - `type: "mcp_approval_request"`

          The type of the item. Always `mcp_approval_request`.

          - `"mcp_approval_request"`

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

      - `McpApprovalResponse`

        A response to an MCP approval request.

        - `approval_request_id: string`

          The ID of the approval request being answered.

        - `approve: boolean`

          Whether the request was approved.

        - `type: "mcp_approval_response"`

          The type of the item. Always `mcp_approval_response`.

          - `"mcp_approval_response"`

        - `id?: string | null`

          The unique ID of the approval response

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `reason?: string | null`

          Optional reason for the decision.

      - `McpCall`

        An invocation of a tool on an MCP server.

        - `id: string`

          The unique ID of the tool call.

        - `arguments: string`

          A JSON string of the arguments passed to the tool.

        - `name: string`

          The name of the tool that was run.

        - `server_label: string`

          The label of the MCP server running the tool.

        - `type: "mcp_call"`

          The type of the item. Always `mcp_call`.

          - `"mcp_call"`

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `approval_request_id?: string | null`

          Unique identifier for the MCP tool call approval request.
          Include this value in a subsequent `mcp_approval_response` input to approve or reject the corresponding tool call.

        - `error?: BetaMcpToolCallError | null`

          The error from the tool call, if any.

          - `McpProtocolError`

            - `code: number`

            - `message: string`

            - `type: "mcp_protocol_error"`

              - `"mcp_protocol_error"`

          - `McpToolExecutionError`

            - `content: unknown`

            - `type: "mcp_tool_execution_error"`

              - `"mcp_tool_execution_error"`

          - `HTTPError`

            - `code: number`

            - `message: string`

            - `type: "http_error"`

              - `"http_error"`

        - `output?: string | null`

          The output from the tool call.

        - `status?: "in_progress" | "completed" | "incomplete" | 2 more`

          The status of the tool call. One of `in_progress`, `completed`, `incomplete`, `calling`, or `failed`.

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

          - `"calling"`

          - `"failed"`

      - `BetaResponseCustomToolCallOutput`

        The output of a custom tool call from your code, being sent back to the model.

        - `call_id: string`

          The call ID, used to map this custom tool call output to a custom tool call.

        - `output: string | Array<BetaResponseInputText | BetaResponseInputImage | BetaResponseInputFile>`

          The output from the custom tool call generated by your code.
          Can be a string or an list of output content.

          - `string`

          - `Array<BetaResponseInputText | BetaResponseInputImage | BetaResponseInputFile>`

            - `BetaResponseInputText`

              A text input to the model.

            - `BetaResponseInputImage`

              An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision).

            - `BetaResponseInputFile`

              A file input to the model.

        - `type: "custom_tool_call_output"`

          The type of the custom tool call output. Always `custom_tool_call_output`.

          - `"custom_tool_call_output"`

        - `id?: string`

          The unique ID of the custom tool call output in the OpenAI platform.

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `caller?: Direct | Program | null`

          The execution context that produced this tool call.

          - `Direct`

            - `type: "direct"`

              The caller type. Always `direct`.

              - `"direct"`

          - `Program`

            - `caller_id: string`

              The call ID of the program item that produced this tool call.

            - `type: "program"`

              The caller type. Always `program`.

              - `"program"`

      - `BetaResponseCustomToolCall`

        A call to a custom tool created by the model.

        - `call_id: string`

          An identifier used to map this custom tool call to a tool call output.

        - `input: string`

          The input for the custom tool call generated by the model.

        - `name: string`

          The name of the custom tool being called.

        - `type: "custom_tool_call"`

          The type of the custom tool call. Always `custom_tool_call`.

          - `"custom_tool_call"`

        - `id?: string`

          The unique ID of the custom tool call in the OpenAI platform.

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `caller?: Direct | Program | null`

          The execution context that produced this tool call.

          - `Direct`

            - `type: "direct"`

              - `"direct"`

          - `Program`

            - `caller_id: string`

              The call ID of the program item that produced this tool call.

            - `type: "program"`

              - `"program"`

        - `namespace?: string`

          The namespace of the custom tool being called.

      - `CompactionTrigger`

        Compacts the current context. Must be the final input item.

        - `type: "compaction_trigger"`

          The type of the item. Always `compaction_trigger`.

          - `"compaction_trigger"`

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

      - `ItemReference`

        An internal identifier for an item to reference.

        - `id: string`

          The ID of the item to reference.

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `type?: "item_reference" | null`

          The type of item to reference. Always `item_reference`.

          - `"item_reference"`

      - `Program`

        - `id: string`

          The unique ID of this program item.

        - `call_id: string`

          The stable call ID of the program item.

        - `code: string`

          The JavaScript source executed by programmatic tool calling.

        - `fingerprint: string`

          Opaque program replay fingerprint that must be round-tripped.

        - `type: "program"`

          The item type. Always `program`.

          - `"program"`

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

      - `ProgramOutput`

        - `id: string`

          The unique ID of this program output item.

        - `call_id: string`

          The call ID of the program item.

        - `result: string`

          The result produced by the program item.

        - `status: "completed" | "incomplete"`

          The terminal status of the program output.

          - `"completed"`

          - `"incomplete"`

        - `type: "program_output"`

          The item type. Always `program_output`.

          - `"program_output"`

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

  - `metadata: Record<string, string> | null`

    Set of 16 key-value pairs that can be attached to an object. This can be
    useful for storing additional information about the object in a structured
    format, and querying for objects via API or the dashboard.

    Keys are strings with a maximum length of 64 characters. Values are strings
    with a maximum length of 512 characters.

  - `model: "gpt-5.6-sol" | "gpt-5.6-terra" | "gpt-5.6-luna" | 99 more | (string & {})`

    Model ID used to generate the response, like `gpt-4o` or `o3`. OpenAI
    offers a wide range of models with different capabilities, performance
    characteristics, and price points. Refer to the [model guide](https://platform.openai.com/docs/models)
    to browse and compare available models.

    - `"gpt-5.6-sol" | "gpt-5.6-terra" | "gpt-5.6-luna" | 99 more`

      - `"gpt-5.6-sol"`

      - `"gpt-5.6-terra"`

      - `"gpt-5.6-luna"`

      - `"gpt-5.5"`

      - `"gpt-5.5-2026-04-23"`

      - `"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.5-pro"`

      - `"gpt-5.5-pro-2026-04-23"`

      - `"gpt-5-codex"`

      - `"gpt-5-pro"`

      - `"gpt-5-pro-2025-10-06"`

      - `"gpt-5.1-codex-max"`

      - `"gpt-daybreak-blue-latest"`

      - `"gpt-daybreak-red-latest"`

      - `"gpt-5.6-cyber"`

    - `(string & {})`

  - `object: "response"`

    The object type of this resource - always set to `response`.

    - `"response"`

  - `output: Array<BetaResponseOutputItem>`

    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.

    - `BetaResponseOutputMessage`

      An output message from the model.

    - `BetaResponseFileSearchToolCall`

      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.

    - `BetaResponseFunctionToolCall`

      A tool call to run a function. See the
      [function calling guide](https://platform.openai.com/docs/guides/function-calling) for more information.

    - `BetaResponseFunctionToolCallOutputItem`

      - `id: string`

        The unique ID of the function call tool output.

      - `call_id: string`

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

      - `output: string | Array<BetaResponseInputText | BetaResponseInputImage | BetaResponseInputFile>`

        The output from the function call generated by your code.
        Can be a string or an list of output content.

        - `string`

        - `Array<BetaResponseInputText | BetaResponseInputImage | BetaResponseInputFile>`

          - `BetaResponseInputText`

            A text input to the model.

          - `BetaResponseInputImage`

            An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision).

          - `BetaResponseInputFile`

            A file input to 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.

        - `"in_progress"`

        - `"completed"`

        - `"incomplete"`

      - `type: "function_call_output"`

        The type of the function tool call output. Always `function_call_output`.

        - `"function_call_output"`

      - `agent?: Agent | null`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

      - `caller?: Direct | Program | null`

        The execution context that produced this tool call.

        - `Direct`

          - `type: "direct"`

            The caller type. Always `direct`.

            - `"direct"`

        - `Program`

          - `caller_id: string`

            The call ID of the program item that produced this tool call.

          - `type: "program"`

            The caller type. Always `program`.

            - `"program"`

      - `created_by?: string`

        The identifier of the actor that created the item.

      - `name?: string`

        The name of the tool that produced the output.

      - `namespace?: string`

        The namespace of the tool that produced the output.

    - `AgentMessage`

      - `id: string`

        The unique ID of the agent message.

      - `author: string`

        The sending agent identity.

      - `content: Array<BetaResponseInputText | BetaResponseOutputText | Text | 7 more>`

        Encrypted content sent between agents.

        - `BetaResponseInputText`

          A text input to the model.

        - `BetaResponseOutputText`

          A text output from the model.

        - `Text`

          A text content.

          - `text: string`

          - `type: "text"`

            - `"text"`

        - `SummaryText`

          A summary text from the model.

          - `text: string`

            A summary of the reasoning output from the model so far.

          - `type: "summary_text"`

            The type of the object. Always `summary_text`.

            - `"summary_text"`

        - `ReasoningText`

          Reasoning text from the model.

          - `text: string`

            The reasoning text from the model.

          - `type: "reasoning_text"`

            The type of the reasoning text. Always `reasoning_text`.

            - `"reasoning_text"`

        - `BetaResponseOutputRefusal`

          A refusal from the model.

        - `BetaResponseInputImage`

          An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision).

        - `ComputerScreenshot`

          A screenshot of a computer.

          - `detail: BetaImageDetail`

            The detail level of the screenshot image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`.

          - `file_id: string | null`

            The identifier of an uploaded file that contains the screenshot.

          - `image_url: string | null`

            The URL of the screenshot image.

          - `type: "computer_screenshot"`

            Specifies the event type. For a computer screenshot, this property is always set to `computer_screenshot`.

            - `"computer_screenshot"`

          - `prompt_cache_breakpoint?: PromptCacheBreakpoint`

            Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.

            - `mode: "explicit"`

              The breakpoint mode. Always `explicit`.

              - `"explicit"`

        - `BetaResponseInputFile`

          A file input to the model.

        - `EncryptedContent`

          Opaque encrypted content that Responses API decrypts inside trusted model execution.

          - `encrypted_content: string`

            Opaque encrypted content.

          - `type: "encrypted_content"`

            The type of the input item. Always `encrypted_content`.

            - `"encrypted_content"`

      - `recipient: string`

        The destination agent identity.

      - `type: "agent_message"`

        The type of the item. Always `agent_message`.

        - `"agent_message"`

      - `agent?: Agent`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

    - `MultiAgentCall`

      - `id: string`

        The unique ID of the multi-agent call item.

      - `action: "spawn_agent" | "interrupt_agent" | "list_agents" | 3 more`

        The multi-agent action to execute.

        - `"spawn_agent"`

        - `"interrupt_agent"`

        - `"list_agents"`

        - `"send_message"`

        - `"followup_task"`

        - `"wait_agent"`

      - `arguments: string`

        The JSON string of arguments generated for the action.

      - `call_id: string`

        The unique ID linking this call to its output.

      - `type: "multi_agent_call"`

        The type of the multi-agent call. Always `multi_agent_call`.

        - `"multi_agent_call"`

      - `agent?: Agent`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

    - `MultiAgentCallOutput`

      - `id: string`

        The unique ID of the multi-agent call output item.

      - `action: "spawn_agent" | "interrupt_agent" | "list_agents" | 3 more`

        The multi-agent action that produced this result.

        - `"spawn_agent"`

        - `"interrupt_agent"`

        - `"list_agents"`

        - `"send_message"`

        - `"followup_task"`

        - `"wait_agent"`

      - `call_id: string`

        The unique ID of the multi-agent call.

      - `output: Array<BetaResponseOutputText>`

        Text output returned by the multi-agent action.

        - `annotations: Array<FileCitation | URLCitation | ContainerFileCitation | FilePath>`

          The annotations of the text output.

        - `text: string`

          The text output from the model.

        - `type: "output_text"`

          The type of the output text. Always `output_text`.

        - `logprobs?: Array<Logprob>`

      - `type: "multi_agent_call_output"`

        The type of the multi-agent result. Always `multi_agent_call_output`.

        - `"multi_agent_call_output"`

      - `agent?: Agent`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

    - `BetaResponseFunctionWebSearch`

      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.

    - `BetaResponseComputerToolCall`

      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.

    - `BetaResponseComputerToolCallOutputItem`

      - `id: string`

        The unique ID of the computer call tool output.

      - `call_id: string`

        The ID of the computer tool call that produced the output.

      - `output: BetaResponseComputerToolCallOutputScreenshot`

        A computer screenshot image used with the computer use tool.

      - `status: "completed" | "incomplete" | "failed" | "in_progress"`

        The status of the message input. One of `in_progress`, `completed`, or
        `incomplete`. Populated when input items are returned via API.

        - `"completed"`

        - `"incomplete"`

        - `"failed"`

        - `"in_progress"`

      - `type: "computer_call_output"`

        The type of the computer tool call output. Always `computer_call_output`.

        - `"computer_call_output"`

      - `acknowledged_safety_checks?: Array<AcknowledgedSafetyCheck>`

        The safety checks reported by the API that have been acknowledged by the
        developer.

        - `id: string`

          The ID of the pending safety check.

        - `code?: string | null`

          The type of the pending safety check.

        - `message?: string | null`

          Details about the pending safety check.

      - `agent?: Agent | null`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

      - `created_by?: string`

        The identifier of the actor that created the item.

    - `BetaResponseReasoningItem`

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

    - `Program`

      - `id: string`

        The unique ID of the program item.

      - `call_id: string`

        The stable call ID of the program item.

      - `code: string`

        The JavaScript source executed by programmatic tool calling.

      - `fingerprint: string`

        Opaque program replay fingerprint that must be round-tripped.

      - `type: "program"`

        The type of the item. Always `program`.

        - `"program"`

      - `agent?: Agent`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

    - `ProgramOutput`

      - `id: string`

        The unique ID of the program output item.

      - `call_id: string`

        The call ID of the program item.

      - `result: string`

        The result produced by the program item.

      - `status: "completed" | "incomplete"`

        The terminal status of the program output item.

        - `"completed"`

        - `"incomplete"`

      - `type: "program_output"`

        The type of the item. Always `program_output`.

        - `"program_output"`

      - `agent?: Agent`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

    - `BetaResponseToolSearchCall`

      - `id: string`

        The unique ID of the tool search call item.

      - `arguments: unknown`

        Arguments used for the tool search call.

      - `call_id: string | null`

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

      - `execution: "server" | "client"`

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

        - `"server"`

        - `"client"`

      - `status: "in_progress" | "completed" | "incomplete"`

        The status of the tool search call item that was recorded.

        - `"in_progress"`

        - `"completed"`

        - `"incomplete"`

      - `type: "tool_search_call"`

        The type of the item. Always `tool_search_call`.

        - `"tool_search_call"`

      - `agent?: Agent`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

      - `created_by?: string`

        The identifier of the actor that created the item.

    - `BetaResponseToolSearchOutputItem`

      - `id: string`

        The unique ID of the tool search output item.

      - `call_id: string | null`

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

      - `execution: "server" | "client"`

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

        - `"server"`

        - `"client"`

      - `status: "in_progress" | "completed" | "incomplete"`

        The status of the tool search output item that was recorded.

        - `"in_progress"`

        - `"completed"`

        - `"incomplete"`

      - `tools: Array<BetaTool>`

        The loaded tool definitions returned by tool search.

        - `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).

        - `Mcp`

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

        - `CodeInterpreter`

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

        - `ProgrammaticToolCalling`

        - `ImageGeneration`

          A tool that generates images using the GPT image models.

        - `LocalShell`

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

        - `BetaFunctionShellTool`

          A tool that allows the model to execute shell commands.

        - `BetaCustomTool`

          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)

        - `BetaNamespaceTool`

          Groups function/custom tools under a shared namespace.

        - `BetaToolSearchTool`

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

        - `BetaApplyPatchTool`

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

      - `type: "tool_search_output"`

        The type of the item. Always `tool_search_output`.

        - `"tool_search_output"`

      - `agent?: Agent`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

      - `created_by?: string`

        The identifier of the actor that created the item.

    - `AdditionalTools`

      - `id: string`

        The unique ID of the additional tools item.

      - `role: "unknown" | "user" | "assistant" | 5 more`

        The role that provided the additional tools.

        - `"unknown"`

        - `"user"`

        - `"assistant"`

        - `"system"`

        - `"critic"`

        - `"discriminator"`

        - `"developer"`

        - `"tool"`

      - `tools: Array<BetaTool>`

        The additional tool definitions made available at this item.

        - `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).

        - `Mcp`

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

        - `CodeInterpreter`

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

        - `ProgrammaticToolCalling`

        - `ImageGeneration`

          A tool that generates images using the GPT image models.

        - `LocalShell`

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

        - `BetaFunctionShellTool`

          A tool that allows the model to execute shell commands.

        - `BetaCustomTool`

          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)

        - `BetaNamespaceTool`

          Groups function/custom tools under a shared namespace.

        - `BetaToolSearchTool`

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

        - `BetaApplyPatchTool`

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

      - `type: "additional_tools"`

        The type of the item. Always `additional_tools`.

        - `"additional_tools"`

      - `agent?: Agent`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

    - `BetaResponseCompactionItem`

      A compaction item generated by the [`v1/responses/compact` API](https://platform.openai.com/docs/api-reference/responses/compact).

      - `id: string`

        The unique ID of the compaction item.

      - `encrypted_content: string`

        The encrypted content that was produced by compaction.

      - `type: "compaction"`

        The type of the item. Always `compaction`.

        - `"compaction"`

      - `agent?: Agent`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

      - `created_by?: string`

        The identifier of the actor that created the item.

    - `ImageGenerationCall`

      An image generation request made by the model.

      - `id: string`

        The unique ID of the image generation call.

      - `result: string | null`

        The generated image encoded in base64.

      - `status: "in_progress" | "completed" | "generating" | "failed"`

        The status of the image generation call.

        - `"in_progress"`

        - `"completed"`

        - `"generating"`

        - `"failed"`

      - `type: "image_generation_call"`

        The type of the image generation call. Always `image_generation_call`.

        - `"image_generation_call"`

      - `agent?: Agent | null`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

    - `BetaResponseCodeInterpreterToolCall`

      A tool call to run code.

    - `LocalShellCall`

      A tool call to run a command on the local shell.

      - `id: string`

        The unique ID of the local shell call.

      - `action: Action`

        Execute a shell command on the server.

        - `command: Array<string>`

          The command to run.

        - `env: Record<string, string>`

          Environment variables to set for the command.

        - `type: "exec"`

          The type of the local shell action. Always `exec`.

          - `"exec"`

        - `timeout_ms?: number | null`

          Optional timeout in milliseconds for the command.

        - `user?: string | null`

          Optional user to run the command as.

        - `working_directory?: string | null`

          Optional working directory to run the command in.

      - `call_id: string`

        The unique ID of the local shell tool call generated by the model.

      - `status: "in_progress" | "completed" | "incomplete"`

        The status of the local shell call.

        - `"in_progress"`

        - `"completed"`

        - `"incomplete"`

      - `type: "local_shell_call"`

        The type of the local shell call. Always `local_shell_call`.

        - `"local_shell_call"`

      - `agent?: Agent | null`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

    - `LocalShellCallOutput`

      The output of a local shell tool call.

      - `id: string`

        The unique ID of the local shell tool call generated by the model.

      - `output: string`

        A JSON string of the output of the local shell tool call.

      - `type: "local_shell_call_output"`

        The type of the local shell tool call output. Always `local_shell_call_output`.

        - `"local_shell_call_output"`

      - `agent?: Agent | null`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

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

        The status of the item. One of `in_progress`, `completed`, or `incomplete`.

        - `"in_progress"`

        - `"completed"`

        - `"incomplete"`

    - `BetaResponseFunctionShellToolCall`

      A tool call that executes one or more shell commands in a managed environment.

      - `id: string`

        The unique ID of the shell tool call. Populated when this item is returned via API.

      - `action: Action`

        The shell commands and limits that describe how to run the tool call.

        - `commands: Array<string>`

        - `max_output_length: number | null`

          Optional maximum number of characters to return from each command.

        - `timeout_ms: number | null`

          Optional timeout in milliseconds for the commands.

      - `call_id: string`

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

      - `environment: BetaResponseLocalEnvironment | BetaResponseContainerReference | null`

        Represents the use of a local environment to perform shell actions.

        - `BetaResponseLocalEnvironment`

          Represents the use of a local environment to perform shell actions.

          - `type: "local"`

            The environment type. Always `local`.

            - `"local"`

        - `BetaResponseContainerReference`

          Represents a container created with /v1/containers.

          - `container_id: string`

          - `type: "container_reference"`

            The environment type. Always `container_reference`.

            - `"container_reference"`

      - `status: "in_progress" | "completed" | "incomplete"`

        The status of the shell call. One of `in_progress`, `completed`, or `incomplete`.

        - `"in_progress"`

        - `"completed"`

        - `"incomplete"`

      - `type: "shell_call"`

        The type of the item. Always `shell_call`.

        - `"shell_call"`

      - `agent?: Agent`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

      - `caller?: Direct | Program | null`

        The execution context that produced this tool call.

        - `Direct`

          - `type: "direct"`

            - `"direct"`

        - `Program`

          - `caller_id: string`

            The call ID of the program item that produced this tool call.

          - `type: "program"`

            - `"program"`

      - `created_by?: string`

        The ID of the entity that created this tool call.

    - `BetaResponseFunctionShellToolCallOutput`

      The output of a shell tool call that was emitted.

      - `id: string`

        The unique ID of the shell call output. Populated when this item is returned via API.

      - `call_id: string`

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

      - `max_output_length: number | null`

        The maximum length of the shell command output. This is generated by the model and should be passed back with the raw output.

      - `output: Array<Output>`

        An array of shell call output contents

        - `outcome: Timeout | Exit`

          Represents either an exit outcome (with an exit code) or a timeout outcome for a shell call output chunk.

          - `Timeout`

            Indicates that the shell call exceeded its configured time limit.

            - `type: "timeout"`

              The outcome type. Always `timeout`.

              - `"timeout"`

          - `Exit`

            Indicates that the shell commands finished and returned an exit code.

            - `exit_code: number`

              Exit code from the shell process.

            - `type: "exit"`

              The outcome type. Always `exit`.

              - `"exit"`

        - `stderr: string`

          The standard error output that was captured.

        - `stdout: string`

          The standard output that was captured.

        - `created_by?: string`

          The identifier of the actor that created the item.

      - `status: "in_progress" | "completed" | "incomplete"`

        The status of the shell call output. One of `in_progress`, `completed`, or `incomplete`.

        - `"in_progress"`

        - `"completed"`

        - `"incomplete"`

      - `type: "shell_call_output"`

        The type of the shell call output. Always `shell_call_output`.

        - `"shell_call_output"`

      - `agent?: Agent`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

      - `caller?: Direct | Program | null`

        The execution context that produced this tool call.

        - `Direct`

          - `type: "direct"`

            - `"direct"`

        - `Program`

          - `caller_id: string`

            The call ID of the program item that produced this tool call.

          - `type: "program"`

            - `"program"`

      - `created_by?: string`

        The identifier of the actor that created the item.

    - `BetaResponseApplyPatchToolCall`

      A tool call that applies file diffs by creating, deleting, or updating files.

      - `id: string`

        The unique ID of the apply patch tool call. Populated when this item is returned via API.

      - `call_id: string`

        The unique ID of the apply patch tool call generated by the model.

      - `operation: CreateFile | DeleteFile | UpdateFile`

        One of the create_file, delete_file, or update_file operations applied via apply_patch.

        - `CreateFile`

          Instruction describing how to create a file via the apply_patch tool.

          - `diff: string`

            Diff to apply.

          - `path: string`

            Path of the file to create.

          - `type: "create_file"`

            Create a new file with the provided diff.

            - `"create_file"`

        - `DeleteFile`

          Instruction describing how to delete a file via the apply_patch tool.

          - `path: string`

            Path of the file to delete.

          - `type: "delete_file"`

            Delete the specified file.

            - `"delete_file"`

        - `UpdateFile`

          Instruction describing how to update a file via the apply_patch tool.

          - `diff: string`

            Diff to apply.

          - `path: string`

            Path of the file to update.

          - `type: "update_file"`

            Update an existing file with the provided diff.

            - `"update_file"`

      - `status: "in_progress" | "completed"`

        The status of the apply patch tool call. One of `in_progress` or `completed`.

        - `"in_progress"`

        - `"completed"`

      - `type: "apply_patch_call"`

        The type of the item. Always `apply_patch_call`.

        - `"apply_patch_call"`

      - `agent?: Agent`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

      - `caller?: Direct | Program | null`

        The execution context that produced this tool call.

        - `Direct`

          - `type: "direct"`

            - `"direct"`

        - `Program`

          - `caller_id: string`

            The call ID of the program item that produced this tool call.

          - `type: "program"`

            - `"program"`

      - `created_by?: string`

        The ID of the entity that created this tool call.

    - `BetaResponseApplyPatchToolCallOutput`

      The output emitted by an apply patch tool call.

      - `id: string`

        The unique ID of the apply patch tool call output. Populated when this item is returned via API.

      - `call_id: string`

        The unique ID of the apply patch tool call generated by the model.

      - `status: "completed" | "failed"`

        The status of the apply patch tool call output. One of `completed` or `failed`.

        - `"completed"`

        - `"failed"`

      - `type: "apply_patch_call_output"`

        The type of the item. Always `apply_patch_call_output`.

        - `"apply_patch_call_output"`

      - `agent?: Agent`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

      - `caller?: Direct | Program | null`

        The execution context that produced this tool call.

        - `Direct`

          - `type: "direct"`

            - `"direct"`

        - `Program`

          - `caller_id: string`

            The call ID of the program item that produced this tool call.

          - `type: "program"`

            - `"program"`

      - `created_by?: string`

        The ID of the entity that created this tool call output.

      - `output?: string | null`

        Optional textual output returned by the apply patch tool.

    - `McpCall`

      An invocation of a tool on an MCP server.

      - `id: string`

        The unique ID of the tool call.

      - `arguments: string`

        A JSON string of the arguments passed to the tool.

      - `name: string`

        The name of the tool that was run.

      - `server_label: string`

        The label of the MCP server running the tool.

      - `type: "mcp_call"`

        The type of the item. Always `mcp_call`.

        - `"mcp_call"`

      - `agent?: Agent | null`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

      - `approval_request_id?: string | null`

        Unique identifier for the MCP tool call approval request.
        Include this value in a subsequent `mcp_approval_response` input to approve or reject the corresponding tool call.

      - `error?: BetaMcpToolCallError | null`

        The error from the tool call, if any.

      - `output?: string | null`

        The output from the tool call.

      - `status?: "in_progress" | "completed" | "incomplete" | 2 more`

        The status of the tool call. One of `in_progress`, `completed`, `incomplete`, `calling`, or `failed`.

        - `"in_progress"`

        - `"completed"`

        - `"incomplete"`

        - `"calling"`

        - `"failed"`

    - `McpListTools`

      A list of tools available on an MCP server.

      - `id: string`

        The unique ID of the list.

      - `server_label: string`

        The label of the MCP server.

      - `tools: Array<Tool>`

        The tools available on the server.

        - `input_schema: unknown`

          The JSON schema describing the tool's input.

        - `name: string`

          The name of the tool.

        - `annotations?: unknown`

          Additional annotations about the tool.

        - `description?: string | null`

          The description of the tool.

      - `type: "mcp_list_tools"`

        The type of the item. Always `mcp_list_tools`.

        - `"mcp_list_tools"`

      - `agent?: Agent | null`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

      - `error?: string | null`

        Error message if the server could not list tools.

    - `McpApprovalRequest`

      A request for human approval of a tool invocation.

      - `id: string`

        The unique ID of the approval request.

      - `arguments: string`

        A JSON string of arguments for the tool.

      - `name: string`

        The name of the tool to run.

      - `server_label: string`

        The label of the MCP server making the request.

      - `type: "mcp_approval_request"`

        The type of the item. Always `mcp_approval_request`.

        - `"mcp_approval_request"`

      - `agent?: Agent | null`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

    - `McpApprovalResponse`

      A response to an MCP approval request.

      - `id: string`

        The unique ID of the approval response

      - `approval_request_id: string`

        The ID of the approval request being answered.

      - `approve: boolean`

        Whether the request was approved.

      - `type: "mcp_approval_response"`

        The type of the item. Always `mcp_approval_response`.

        - `"mcp_approval_response"`

      - `agent?: Agent | null`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

      - `reason?: string | null`

        Optional reason for the decision.

    - `BetaResponseCustomToolCall`

      A call to a custom tool created by the model.

    - `BetaResponseCustomToolCallOutputItem extends BetaResponseCustomToolCallOutput`

      The output of a custom tool call from your code, being sent back to the model.

      - `id: string`

        The unique ID of the custom tool call output item.

      - `status: "in_progress" | "completed" | "incomplete"`

        The status of the item. One of `in_progress`, `completed`, or
        `incomplete`. Populated when items are returned via API.

        - `"in_progress"`

        - `"completed"`

        - `"incomplete"`

      - `created_by?: string`

        The identifier of the actor that created the item.

  - `parallel_tool_calls: boolean`

    Whether to allow the model to run tool calls in parallel.

  - `temperature: number | null`

    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.

  - `tool_choice: BetaToolChoiceOptions | BetaToolChoiceAllowed | BetaToolChoiceTypes | 6 more`

    How the model should select which tool (or tools) to use when generating
    a response. See the `tools` parameter to see how to specify which tools
    the model can call.

    - `BetaToolChoiceOptions = "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.

      - `"none"`

      - `"auto"`

      - `"required"`

    - `BetaToolChoiceAllowed`

      Constrains the tools available to the model to a pre-defined set.

      - `mode: "auto" | "required"`

        Constrains the tools available to the model to a pre-defined set.

        `auto` allows the model to pick from among the allowed tools and generate a
        message.

        `required` requires the model to call one or more of the allowed tools.

        - `"auto"`

        - `"required"`

      - `tools: Array<Record<string, unknown>>`

        A list of tool definitions that the model should be allowed to call.

        For the Responses API, the list of tool definitions might look like:

        ```json
        [
          { "type": "function", "name": "get_weather" },
          { "type": "mcp", "server_label": "deepwiki" },
          { "type": "image_generation" }
        ]
        ```

      - `type: "allowed_tools"`

        Allowed tool configuration type. Always `allowed_tools`.

        - `"allowed_tools"`

    - `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" | 5 more`

        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`

        - `"file_search"`

        - `"web_search_preview"`

        - `"computer"`

        - `"computer_use_preview"`

        - `"computer_use"`

        - `"web_search_preview_2025_03_11"`

        - `"image_generation"`

        - `"code_interpreter"`

    - `BetaToolChoiceFunction`

      Use this option to force the model to call a specific function.

      - `name: string`

        The name of the function to call.

      - `type: "function"`

        For function calling, the type is always `function`.

        - `"function"`

    - `BetaToolChoiceMcp`

      Use this option to force the model to call a specific tool on a remote MCP server.

      - `server_label: string`

        The label of the MCP server to use.

      - `type: "mcp"`

        For MCP tools, the type is always `mcp`.

        - `"mcp"`

      - `name?: string | null`

        The name of the tool to call on the server.

    - `BetaToolChoiceCustom`

      Use this option to force the model to call a specific custom tool.

      - `name: string`

        The name of the custom tool to call.

      - `type: "custom"`

        For custom tool calling, the type is always `custom`.

        - `"custom"`

    - `BetaSpecificProgrammaticToolCallingParam`

      - `type: "programmatic_tool_calling"`

        The tool to call. Always `programmatic_tool_calling`.

        - `"programmatic_tool_calling"`

    - `BetaToolChoiceApplyPatch`

      Forces the model to call the apply_patch tool when executing a tool call.

      - `type: "apply_patch"`

        The tool to call. Always `apply_patch`.

        - `"apply_patch"`

    - `BetaToolChoiceShell`

      Forces the model to call the shell tool when a tool call is required.

      - `type: "shell"`

        The tool to call. Always `shell`.

        - `"shell"`

  - `tools: Array<BetaTool>`

    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.

    - `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).

    - `Mcp`

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

    - `CodeInterpreter`

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

    - `ProgrammaticToolCalling`

    - `ImageGeneration`

      A tool that generates images using the GPT image models.

    - `LocalShell`

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

    - `BetaFunctionShellTool`

      A tool that allows the model to execute shell commands.

    - `BetaCustomTool`

      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)

    - `BetaNamespaceTool`

      Groups function/custom tools under a shared namespace.

    - `BetaToolSearchTool`

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

    - `BetaApplyPatchTool`

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

  - `top_p: number | null`

    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.

  - `background?: boolean | null`

    Whether to run the model response in the background.
    [Learn more](https://platform.openai.com/docs/guides/background).

  - `completed_at?: number | null`

    Unix timestamp (in seconds) of when this Response was completed.
    Only present when the status is `completed`.

  - `conversation?: Conversation | null`

    The conversation that this response belonged to. Input items and output items from this response were automatically added to this conversation.

    - `id: string`

      The unique ID of the conversation that this response was associated with.

  - `max_output_tokens?: number | null`

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

  - `max_tool_calls?: number | null`

    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.

  - `moderation?: Moderation | null`

    Moderation results for the response input and output, if moderated completions were requested.

    - `input: ModerationResult | Error`

      Moderation for the response input.

      - `ModerationResult`

        A moderation result produced for the response input or output.

        - `categories: Record<string, boolean>`

          A dictionary of moderation categories to booleans, True if the input is flagged under this category.

        - `category_applied_input_types: Record<string, Array<"text" | "image">>`

          Which modalities of input are reflected by the score for each category.

          - `"text"`

          - `"image"`

        - `category_scores: Record<string, number>`

          A dictionary of moderation categories to scores.

        - `flagged: boolean`

          A boolean indicating whether the content was flagged by any category.

        - `model: string`

          The moderation model that produced this result.

        - `type: "moderation_result"`

          The object type, which was always `moderation_result` for successful moderation results.

          - `"moderation_result"`

      - `Error`

        An error produced while attempting moderation for the response input or output.

        - `code: string`

          The error code.

        - `message: string`

          The error message.

        - `type: "error"`

          The object type, which was always `error` for moderation failures.

          - `"error"`

    - `output: ModerationResult | Error`

      Moderation for the response output.

      - `ModerationResult`

        A moderation result produced for the response input or output.

        - `categories: Record<string, boolean>`

          A dictionary of moderation categories to booleans, True if the input is flagged under this category.

        - `category_applied_input_types: Record<string, Array<"text" | "image">>`

          Which modalities of input are reflected by the score for each category.

          - `"text"`

          - `"image"`

        - `category_scores: Record<string, number>`

          A dictionary of moderation categories to scores.

        - `flagged: boolean`

          A boolean indicating whether the content was flagged by any category.

        - `model: string`

          The moderation model that produced this result.

        - `type: "moderation_result"`

          The object type, which was always `moderation_result` for successful moderation results.

          - `"moderation_result"`

      - `Error`

        An error produced while attempting moderation for the response input or output.

        - `code: string`

          The error code.

        - `message: string`

          The error message.

        - `type: "error"`

          The object type, which was always `error` for moderation failures.

          - `"error"`

  - `previous_response_id?: string | null`

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

  - `prompt?: BetaResponsePrompt | null`

    Reference to a prompt template and its variables.
    [Learn more](https://platform.openai.com/docs/guides/text?api-mode=responses#reusable-prompts).

    - `id: string`

      The unique identifier of the prompt template to use.

    - `variables?: Record<string, string | BetaResponseInputText | BetaResponseInputImage | BetaResponseInputFile> | null`

      Optional map of values to substitute in for variables in your
      prompt. The substitution values can either be strings, or other
      Response input types like images or files.

      - `string`

      - `BetaResponseInputText`

        A text input to the model.

      - `BetaResponseInputImage`

        An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision).

      - `BetaResponseInputFile`

        A file input to the model.

    - `version?: string | null`

      Optional version of the prompt template.

  - `prompt_cache_key?: string | null`

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

  - `prompt_cache_options?: PromptCacheOptions`

    The prompt-caching options that were applied to the response. Supported for `gpt-5.6` and later models.

    - `mode: "implicit" | "explicit"`

      Whether implicit prompt-cache breakpoints were enabled.

      - `"implicit"`

      - `"explicit"`

    - `ttl: "30m"`

      The minimum lifetime applied to each cache breakpoint.

      - `"30m"`

  - `prompt_cache_retention?: "in_memory" | "24h" | null`

    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.

    - `"in_memory"`

    - `"24h"`

  - `reasoning?: Reasoning | null`

    **gpt-5 and o-series models only**

    Configuration options for
    [reasoning models](https://platform.openai.com/docs/guides/reasoning).

    - `context?: "auto" | "current_turn" | "all_turns" | null`

      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.

      - `"auto"`

      - `"current_turn"`

      - `"all_turns"`

    - `effort?: "none" | "minimal" | "low" | 4 more | null`

      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.

      - `"none"`

      - `"minimal"`

      - `"low"`

      - `"medium"`

      - `"high"`

      - `"xhigh"`

      - `"max"`

    - `generate_summary?: "auto" | "concise" | "detailed" | null`

      **Deprecated:** use `summary` instead.

      A summary of the reasoning performed by the model. This can be
      useful for debugging and understanding the model's reasoning process.
      One of `auto`, `concise`, or `detailed`.

      - `"auto"`

      - `"concise"`

      - `"detailed"`

    - `mode?: (string & {}) | "standard" | "pro"`

      Controls the reasoning execution mode for the request.

      When returned on a response, this is the effective execution mode.

      - `(string & {})`

      - `"standard" | "pro"`

        - `"standard"`

        - `"pro"`

    - `summary?: "auto" | "concise" | "detailed" | null`

      A summary of the reasoning performed by the model. This can be
      useful for debugging and understanding the model's reasoning process.
      One of `auto`, `concise`, or `detailed`.

      `concise` is supported for `computer-use-preview` models and all reasoning models after `gpt-5`.

      - `"auto"`

      - `"concise"`

      - `"detailed"`

  - `safety_identifier?: string | null`

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

  - `service_tier?: BetaServiceTier | null`

    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.
    - If set to 'ultrafast', then the request will be processed with the access-controlled Ultrafast Processing service tier. This tier is currently available for `gpt-5.6-sol`; a response served through it will show `service_tier=ultrafast`.
    - When not set, the default behavior is 'auto'.

    When the `service_tier` parameter is set, the response body will include the `service_tier` value based on the processing mode actually used to serve the request. This response value may be different from the value set in the parameter.

    - `"auto"`

    - `"default"`

    - `"flex"`

    - `"scale"`

    - `"priority"`

    - `"fast"`

    - `"ultrafast"`

  - `status?: BetaResponseStatus`

    The status of the response generation. One of `completed`, `failed`,
    `in_progress`, `cancelled`, `queued`, or `incomplete`.

    - `"completed"`

    - `"failed"`

    - `"in_progress"`

    - `"cancelled"`

    - `"queued"`

    - `"incomplete"`

  - `text?: BetaResponseTextConfig`

    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?: BetaResponseFormatTextConfig`

      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.

      - `Text`

        Default response format. Used to generate text responses.

        - `type: "text"`

          The type of response format being defined. Always `text`.

          - `"text"`

      - `BetaResponseFormatTextJSONSchemaConfig`

        JSON Schema response format. Used to generate structured JSON responses.
        Learn more about [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs).

        - `name: string`

          The name of the response format. Must be a-z, A-Z, 0-9, or contain
          underscores and dashes, with a maximum length of 64.

        - `schema: Record<string, unknown>`

          The schema for the response format, described as a JSON Schema object.
          Learn how to build JSON schemas [here](https://json-schema.org/).

        - `type: "json_schema"`

          The type of response format being defined. Always `json_schema`.

          - `"json_schema"`

        - `description?: string`

          A description of what the response format is for, used by the model to
          determine how to respond in the format.

        - `strict?: boolean | null`

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

      - `JSONObject`

        JSON object response format. An older method of generating JSON responses.
        Using `json_schema` is recommended for models that support it. Note that the
        model will not generate JSON without a system or user message instructing it
        to do so.

        - `type: "json_object"`

          The type of response format being defined. Always `json_object`.

          - `"json_object"`

    - `verbosity?: "low" | "medium" | "high" | null`

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

      - `"low"`

      - `"medium"`

      - `"high"`

  - `top_logprobs?: number | null`

    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.

  - `truncation?: "auto" | "disabled" | null`

    The truncation strategy to use for the model response.

    - `auto`: If the input to this Response exceeds
      the model's context window size, the model will truncate the
      response to fit the context window by dropping items from the beginning of the conversation.
    - `disabled` (default): If the input size will exceed the context window
      size for a model, the request will fail with a 400 error.

    - `"auto"`

    - `"disabled"`

  - `usage?: BetaResponseUsage`

    Represents token usage details including input tokens, output tokens,
    a breakdown of output tokens, and the total tokens used.

    - `input_tokens: number`

      The number of input tokens.

    - `input_tokens_details: InputTokensDetails`

      A detailed breakdown of the input tokens.

      - `cache_write_tokens: number`

        The number of input tokens that were written to the cache.

      - `cached_tokens: number`

        The number of tokens that were retrieved from the cache.
        [More on prompt caching](https://platform.openai.com/docs/guides/prompt-caching).

    - `output_tokens: number`

      The number of output tokens.

    - `output_tokens_details: OutputTokensDetails`

      A detailed breakdown of the output tokens.

      - `reasoning_tokens: number`

        The number of reasoning tokens.

    - `total_tokens: number`

      The total number of tokens used.

  - `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).

### Example

```typescript
import OpenAI from 'openai';

const client = new OpenAI({
  apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
});

const betaResponse = await client.beta.responses.create();

console.log(betaResponse.id);
```

#### Response

```json
{
  "id": "id",
  "created_at": 0,
  "error": {
    "code": "server_error",
    "message": "message"
  },
  "incomplete_details": {
    "reason": "max_output_tokens"
  },
  "instructions": "string",
  "metadata": {
    "foo": "string"
  },
  "model": "gpt-5.1",
  "object": "response",
  "output": [
    {
      "id": "id",
      "content": [
        {
          "annotations": [
            {
              "file_id": "file_id",
              "filename": "filename",
              "index": 0,
              "type": "file_citation"
            }
          ],
          "text": "text",
          "type": "output_text",
          "logprobs": [
            {
              "token": "token",
              "bytes": [
                0
              ],
              "logprob": 0,
              "top_logprobs": [
                {
                  "token": "token",
                  "bytes": [
                    0
                  ],
                  "logprob": 0
                }
              ]
            }
          ]
        }
      ],
      "role": "assistant",
      "status": "in_progress",
      "type": "message",
      "agent": {
        "agent_name": "agent_name"
      },
      "phase": "commentary"
    }
  ],
  "parallel_tool_calls": true,
  "temperature": 1,
  "tool_choice": "none",
  "tools": [
    {
      "name": "name",
      "parameters": {
        "foo": "bar"
      },
      "strict": true,
      "type": "function",
      "allowed_callers": [
        "direct"
      ],
      "defer_loading": true,
      "description": "description",
      "output_schema": {
        "foo": "bar"
      }
    }
  ],
  "top_p": 1,
  "background": true,
  "completed_at": 0,
  "conversation": {
    "id": "id"
  },
  "max_output_tokens": 0,
  "max_tool_calls": 0,
  "moderation": {
    "input": {
      "categories": {
        "foo": true
      },
      "category_applied_input_types": {
        "foo": [
          "text"
        ]
      },
      "category_scores": {
        "foo": 0
      },
      "flagged": true,
      "model": "model",
      "type": "moderation_result"
    },
    "output": {
      "categories": {
        "foo": true
      },
      "category_applied_input_types": {
        "foo": [
          "text"
        ]
      },
      "category_scores": {
        "foo": 0
      },
      "flagged": true,
      "model": "model",
      "type": "moderation_result"
    }
  },
  "output_text": "output_text",
  "previous_response_id": "previous_response_id",
  "prompt": {
    "id": "id",
    "variables": {
      "foo": "string"
    },
    "version": "version"
  },
  "prompt_cache_key": "prompt-cache-key-1234",
  "prompt_cache_options": {
    "mode": "implicit",
    "ttl": "30m"
  },
  "prompt_cache_retention": "in_memory",
  "reasoning": {
    "context": "auto",
    "effort": "none",
    "generate_summary": "auto",
    "mode": "standard",
    "summary": "auto"
  },
  "safety_identifier": "safety-identifier-1234",
  "service_tier": "auto",
  "status": "completed",
  "text": {
    "format": {
      "type": "text"
    },
    "verbosity": "low"
  },
  "top_logprobs": 0,
  "truncation": "auto",
  "usage": {
    "input_tokens": 0,
    "input_tokens_details": {
      "cache_write_tokens": 0,
      "cached_tokens": 0
    },
    "output_tokens": 0,
    "output_tokens_details": {
      "reasoning_tokens": 0
    },
    "total_tokens": 0
  },
  "user": "user-1234"
}
```

### File input

```typescript
import OpenAI from "openai";

const openai = new OpenAI();

const response = await openai.responses.create({
    model: "gpt-5.4",
    input: [
        {
            role: "user",
            content: [
                { type: "input_text", text: "what is in this file?" },
                {
                    type: "input_file",
                    file_url: "https://www.berkshirehathaway.com/letters/2024ltr.pdf",
                    detail: "auto",
                },
            ],
        },
    ],
});

console.log(response);
```

#### Response

```json
{
  "id": "resp_686eef60237881a2bd1180bb8b13de430e34c516d176ff86",
  "object": "response",
  "created_at": 1752100704,
  "status": "completed",
  "completed_at": 1752100705,
  "background": false,
  "error": null,
  "incomplete_details": null,
  "instructions": null,
  "max_output_tokens": null,
  "max_tool_calls": null,
  "model": "gpt-5.4",
  "output": [
    {
      "id": "msg_686eef60d3e081a29283bdcbc4322fd90e34c516d176ff86",
      "type": "message",
      "status": "completed",
      "content": [
        {
          "type": "output_text",
          "annotations": [],
          "logprobs": [],
          "text": "The file seems to contain excerpts from a letter to the shareholders of Berkshire Hathaway Inc., likely written by Warren Buffett. It covers several topics:\n\n1. **Communication Philosophy**: Buffett emphasizes the importance of transparency and candidness in reporting mistakes and successes to shareholders.\n\n2. **Mistakes and Learnings**: The letter acknowledges past mistakes in business assessments and management hires, highlighting the importance of correcting errors promptly.\n\n3. **CEO Succession**: Mention of Greg Abel stepping in as the new CEO and continuing the tradition of honest communication.\n\n4. **Pete Liegl Story**: A detailed account of acquiring Forest River and the relationship with its founder, highlighting trust and effective business decisions.\n\n5. **2024 Performance**: Overview of business performance, particularly in insurance and investment activities, with a focus on GEICO's improvement.\n\n6. **Tax Contributions**: Discussion of significant tax payments to the U.S. Treasury, credited to shareholders' reinvestments.\n\n7. **Investment Strategy**: A breakdown of Berkshire\u2019s investments in both controlled subsidiaries and marketable equities, along with a focus on long-term holding strategies.\n\n8. **American Capitalism**: Reflections on America\u2019s economic development and Berkshire\u2019s role within it.\n\n9. **Property-Casualty Insurance**: Insights into the P/C insurance business model and its challenges and benefits.\n\n10. **Japanese Investments**: Information about Berkshire\u2019s investments in Japanese companies and future plans.\n\n11. **Annual Meeting**: Details about the upcoming annual gathering in Omaha, including schedule changes and new book releases.\n\n12. **Personal Anecdotes**: Light-hearted stories about family and interactions, conveying Buffett's personable approach.\n\n13. **Financial Performance Data**: Tables comparing Berkshire\u2019s annual performance to the S&P 500, showing impressive long-term gains.\n\nOverall, the letter reinforces Berkshire Hathaway's commitment to transparency, investment in both its businesses and the wider economy, and emphasizes strong leadership and prudent financial management."
        }
      ],
      "role": "assistant"
    }
  ],
  "parallel_tool_calls": true,
  "previous_response_id": null,
  "reasoning": {
    "effort": null,
    "summary": null
  },
  "service_tier": "default",
  "store": true,
  "temperature": 1.0,
  "text": {
    "format": {
      "type": "text"
    }
  },
  "tool_choice": "auto",
  "tools": [],
  "top_logprobs": 0,
  "top_p": 1.0,
  "truncation": "disabled",
  "usage": {
    "input_tokens": 8438,
    "input_tokens_details": {
      "cached_tokens": 0,
      "cache_write_tokens": 0
    },
    "output_tokens": 398,
    "output_tokens_details": {
      "reasoning_tokens": 0
    },
    "total_tokens": 8836
  },
  "user": null,
  "metadata": {}
}
```

### File search

```typescript
import OpenAI from "openai";

const openai = new OpenAI();

const response = await openai.responses.create({
    model: "gpt-5.4",
    tools: [{
      type: "file_search",
      vector_store_ids: ["vs_1234567890"],
      max_num_results: 20
    }],
    input: "What are the attributes of an ancient brown dragon?",
});

console.log(response);
```

#### Response

```json
{
  "id": "resp_67ccf4c55fc48190b71bd0463ad3306d09504fb6872380d7",
  "object": "response",
  "created_at": 1741485253,
  "status": "completed",
  "completed_at": 1741485254,
  "error": null,
  "incomplete_details": null,
  "instructions": null,
  "max_output_tokens": null,
  "model": "gpt-5.4",
  "output": [
    {
      "type": "file_search_call",
      "id": "fs_67ccf4c63cd08190887ef6464ba5681609504fb6872380d7",
      "status": "completed",
      "queries": [
        "attributes of an ancient brown dragon"
      ],
      "results": null
    },
    {
      "type": "message",
      "id": "msg_67ccf4c93e5c81909d595b369351a9d309504fb6872380d7",
      "status": "completed",
      "role": "assistant",
      "content": [
        {
          "type": "output_text",
          "text": "The attributes of an ancient brown dragon include...",
          "annotations": [
            {
              "type": "file_citation",
              "index": 320,
              "file_id": "file-4wDz5b167pAf72nx1h9eiN",
              "filename": "dragons.pdf"
            },
            {
              "type": "file_citation",
              "index": 576,
              "file_id": "file-4wDz5b167pAf72nx1h9eiN",
              "filename": "dragons.pdf"
            },
            {
              "type": "file_citation",
              "index": 815,
              "file_id": "file-4wDz5b167pAf72nx1h9eiN",
              "filename": "dragons.pdf"
            },
            {
              "type": "file_citation",
              "index": 815,
              "file_id": "file-4wDz5b167pAf72nx1h9eiN",
              "filename": "dragons.pdf"
            },
            {
              "type": "file_citation",
              "index": 1030,
              "file_id": "file-4wDz5b167pAf72nx1h9eiN",
              "filename": "dragons.pdf"
            },
            {
              "type": "file_citation",
              "index": 1030,
              "file_id": "file-4wDz5b167pAf72nx1h9eiN",
              "filename": "dragons.pdf"
            },
            {
              "type": "file_citation",
              "index": 1156,
              "file_id": "file-4wDz5b167pAf72nx1h9eiN",
              "filename": "dragons.pdf"
            },
            {
              "type": "file_citation",
              "index": 1225,
              "file_id": "file-4wDz5b167pAf72nx1h9eiN",
              "filename": "dragons.pdf"
            }
          ]
        }
      ]
    }
  ],
  "parallel_tool_calls": true,
  "previous_response_id": null,
  "reasoning": {
    "effort": null,
    "summary": null
  },
  "store": true,
  "temperature": 1.0,
  "text": {
    "format": {
      "type": "text"
    }
  },
  "tool_choice": "auto",
  "tools": [
    {
      "type": "file_search",
      "filters": null,
      "max_num_results": 20,
      "ranking_options": {
        "ranker": "auto",
        "score_threshold": 0.0
      },
      "vector_store_ids": [
        "vs_1234567890"
      ]
    }
  ],
  "top_p": 1.0,
  "truncation": "disabled",
  "usage": {
    "input_tokens": 18307,
    "input_tokens_details": {
      "cached_tokens": 0,
      "cache_write_tokens": 0
    },
    "output_tokens": 348,
    "output_tokens_details": {
      "reasoning_tokens": 0
    },
    "total_tokens": 18655
  },
  "user": null,
  "metadata": {}
}
```

### Functions

```typescript
import OpenAI from "openai";

const openai = new OpenAI();

const tools = [
    {
        type: "function",
        name: "get_current_weather",
        description: "Get the current weather in a given location",
        parameters: {
            type: "object",
            properties: {
                location: {
                    type: "string",
                    description: "The city and state, e.g. San Francisco, CA",
                },
                unit: { type: "string", enum: ["celsius", "fahrenheit"] },
            },
            required: ["location", "unit"],
        },
    },
];

const response = await openai.responses.create({
    model: "gpt-5.4",
    tools: tools,
    input: "What is the weather like in Boston today?",
    tool_choice: "auto",
});

console.log(response);
```

#### Response

```json
{
  "id": "resp_67ca09c5efe0819096d0511c92b8c890096610f474011cc0",
  "object": "response",
  "created_at": 1741294021,
  "status": "completed",
  "completed_at": 1741294022,
  "error": null,
  "incomplete_details": null,
  "instructions": null,
  "max_output_tokens": null,
  "model": "gpt-5.4",
  "output": [
    {
      "type": "function_call",
      "id": "fc_67ca09c6bedc8190a7abfec07b1a1332096610f474011cc0",
      "call_id": "call_unLAR8MvFNptuiZK6K6HCy5k",
      "name": "get_current_weather",
      "arguments": "{\"location\":\"Boston, MA\",\"unit\":\"celsius\"}",
      "status": "completed"
    }
  ],
  "parallel_tool_calls": true,
  "previous_response_id": null,
  "reasoning": {
    "effort": null,
    "summary": null
  },
  "store": true,
  "temperature": 1.0,
  "text": {
    "format": {
      "type": "text"
    }
  },
  "tool_choice": "auto",
  "tools": [
    {
      "type": "function",
      "description": "Get the current weather in a given location",
      "name": "get_current_weather",
      "parameters": {
        "type": "object",
        "properties": {
          "location": {
            "type": "string",
            "description": "The city and state, e.g. San Francisco, CA"
          },
          "unit": {
            "type": "string",
            "enum": [
              "celsius",
              "fahrenheit"
            ]
          }
        },
        "required": [
          "location",
          "unit"
        ]
      },
      "strict": true
    }
  ],
  "top_p": 1.0,
  "truncation": "disabled",
  "usage": {
    "input_tokens": 291,
    "output_tokens": 23,
    "output_tokens_details": {
      "reasoning_tokens": 0
    },
    "total_tokens": 314
  },
  "user": null,
  "metadata": {}
}
```

### Image input

```typescript
import OpenAI from "openai";

const openai = new OpenAI();

const response = await openai.responses.create({
    model: "gpt-5.4",
    input: [
        {
            role: "user",
            content: [
                { type: "input_text", text: "what is in this image?" },
                {
                    type: "input_image",
                    image_url:
                        "https://upload.wikimedia.org/wikipedia/commons/thumb/d/dd/Gfp-wisconsin-madison-the-nature-boardwalk.jpg/2560px-Gfp-wisconsin-madison-the-nature-boardwalk.jpg",
                },
            ],
        },
    ],
});

console.log(response);
```

#### Response

```json
{
  "id": "resp_67ccd3a9da748190baa7f1570fe91ac604becb25c45c1d41",
  "object": "response",
  "created_at": 1741476777,
  "status": "completed",
  "completed_at": 1741476778,
  "error": null,
  "incomplete_details": null,
  "instructions": null,
  "max_output_tokens": null,
  "model": "gpt-5.4",
  "output": [
    {
      "type": "message",
      "id": "msg_67ccd3acc8d48190a77525dc6de64b4104becb25c45c1d41",
      "status": "completed",
      "role": "assistant",
      "content": [
        {
          "type": "output_text",
          "text": "The image depicts a scenic landscape with a wooden boardwalk or pathway leading through lush, green grass under a blue sky with some clouds. The setting suggests a peaceful natural area, possibly a park or nature reserve. There are trees and shrubs in the background.",
          "annotations": []
        }
      ]
    }
  ],
  "parallel_tool_calls": true,
  "previous_response_id": null,
  "reasoning": {
    "effort": null,
    "summary": null
  },
  "store": true,
  "temperature": 1.0,
  "text": {
    "format": {
      "type": "text"
    }
  },
  "tool_choice": "auto",
  "tools": [],
  "top_p": 1.0,
  "truncation": "disabled",
  "usage": {
    "input_tokens": 328,
    "input_tokens_details": {
      "cached_tokens": 0,
      "cache_write_tokens": 0
    },
    "output_tokens": 52,
    "output_tokens_details": {
      "reasoning_tokens": 0
    },
    "total_tokens": 380
  },
  "user": null,
  "metadata": {}
}
```

### Reasoning

```typescript
import OpenAI from "openai";
const openai = new OpenAI();

const response = await openai.responses.create({
    model: "o3-mini",
    input: "How much wood would a woodchuck chuck?",
    reasoning: {
      effort: "high"
    }
});

console.log(response);
```

#### Response

```json
{
  "id": "resp_67ccd7eca01881908ff0b5146584e408072912b2993db808",
  "object": "response",
  "created_at": 1741477868,
  "status": "completed",
  "completed_at": 1741477869,
  "error": null,
  "incomplete_details": null,
  "instructions": null,
  "max_output_tokens": null,
  "model": "o1-2024-12-17",
  "output": [
    {
      "type": "message",
      "id": "msg_67ccd7f7b5848190a6f3e95d809f6b44072912b2993db808",
      "status": "completed",
      "role": "assistant",
      "content": [
        {
          "type": "output_text",
          "text": "The classic tongue twister...",
          "annotations": []
        }
      ]
    }
  ],
  "parallel_tool_calls": true,
  "previous_response_id": null,
  "reasoning": {
    "effort": "high",
    "summary": null
  },
  "store": true,
  "temperature": 1.0,
  "text": {
    "format": {
      "type": "text"
    }
  },
  "tool_choice": "auto",
  "tools": [],
  "top_p": 1.0,
  "truncation": "disabled",
  "usage": {
    "input_tokens": 81,
    "input_tokens_details": {
      "cached_tokens": 0,
      "cache_write_tokens": 0
    },
    "output_tokens": 1035,
    "output_tokens_details": {
      "reasoning_tokens": 832
    },
    "total_tokens": 1116
  },
  "user": null,
  "metadata": {}
}
```

### Streaming

```typescript
import OpenAI from "openai";

const openai = new OpenAI();

const response = await openai.responses.create({
    model: "gpt-5.4",
    instructions: "You are a helpful assistant.",
    input: "Hello!",
    stream: true,
});

for await (const event of response) {
    console.log(event);
}
```

#### Response

```json
event: response.created
data: {"type":"response.created","response":{"id":"resp_67c9fdcecf488190bdd9a0409de3a1ec07b8b0ad4e5eb654","object":"response","created_at":1741290958,"status":"in_progress","error":null,"incomplete_details":null,"instructions":"You are a helpful assistant.","max_output_tokens":null,"model":"gpt-5.4","output":[],"parallel_tool_calls":true,"previous_response_id":null,"reasoning":{"effort":null,"summary":null},"store":true,"temperature":1.0,"text":{"format":{"type":"text"}},"tool_choice":"auto","tools":[],"top_p":1.0,"truncation":"disabled","usage":null,"user":null,"metadata":{}}}

event: response.in_progress
data: {"type":"response.in_progress","response":{"id":"resp_67c9fdcecf488190bdd9a0409de3a1ec07b8b0ad4e5eb654","object":"response","created_at":1741290958,"status":"in_progress","error":null,"incomplete_details":null,"instructions":"You are a helpful assistant.","max_output_tokens":null,"model":"gpt-5.4","output":[],"parallel_tool_calls":true,"previous_response_id":null,"reasoning":{"effort":null,"summary":null},"store":true,"temperature":1.0,"text":{"format":{"type":"text"}},"tool_choice":"auto","tools":[],"top_p":1.0,"truncation":"disabled","usage":null,"user":null,"metadata":{}}}

event: response.output_item.added
data: {"type":"response.output_item.added","output_index":0,"item":{"id":"msg_67c9fdcf37fc8190ba82116e33fb28c507b8b0ad4e5eb654","type":"message","status":"in_progress","role":"assistant","content":[]}}

event: response.content_part.added
data: {"type":"response.content_part.added","item_id":"msg_67c9fdcf37fc8190ba82116e33fb28c507b8b0ad4e5eb654","output_index":0,"content_index":0,"part":{"type":"output_text","text":"","annotations":[]}}

event: response.output_text.delta
data: {"type":"response.output_text.delta","item_id":"msg_67c9fdcf37fc8190ba82116e33fb28c507b8b0ad4e5eb654","output_index":0,"content_index":0,"delta":"Hi"}

...

event: response.output_text.done
data: {"type":"response.output_text.done","item_id":"msg_67c9fdcf37fc8190ba82116e33fb28c507b8b0ad4e5eb654","output_index":0,"content_index":0,"text":"Hi there! How can I assist you today?"}

event: response.content_part.done
data: {"type":"response.content_part.done","item_id":"msg_67c9fdcf37fc8190ba82116e33fb28c507b8b0ad4e5eb654","output_index":0,"content_index":0,"part":{"type":"output_text","text":"Hi there! How can I assist you today?","annotations":[]}}

event: response.output_item.done
data: {"type":"response.output_item.done","output_index":0,"item":{"id":"msg_67c9fdcf37fc8190ba82116e33fb28c507b8b0ad4e5eb654","type":"message","status":"completed","role":"assistant","content":[{"type":"output_text","text":"Hi there! How can I assist you today?","annotations":[]}]}}

event: response.completed
data: {"type":"response.completed","response":{"id":"resp_67c9fdcecf488190bdd9a0409de3a1ec07b8b0ad4e5eb654","object":"response","created_at":1741290958,"status":"completed","error":null,"incomplete_details":null,"instructions":"You are a helpful assistant.","max_output_tokens":null,"model":"gpt-5.4","output":[{"id":"msg_67c9fdcf37fc8190ba82116e33fb28c507b8b0ad4e5eb654","type":"message","status":"completed","role":"assistant","content":[{"type":"output_text","text":"Hi there! How can I assist you today?","annotations":[]}]}],"parallel_tool_calls":true,"previous_response_id":null,"reasoning":{"effort":null,"summary":null},"store":true,"temperature":1.0,"text":{"format":{"type":"text"}},"tool_choice":"auto","tools":[],"top_p":1.0,"truncation":"disabled","usage":{"input_tokens":37,"output_tokens":11,"output_tokens_details":{"reasoning_tokens":0},"total_tokens":48},"user":null,"metadata":{}}}
```

### Text input

```typescript
import OpenAI from "openai";

const openai = new OpenAI();

const response = await openai.responses.create({
    model: "gpt-5.4",
    input: "Tell me a three sentence bedtime story about a unicorn."
});

console.log(response);
```

#### Response

```json
{
  "id": "resp_67ccd2bed1ec8190b14f964abc0542670bb6a6b452d3795b",
  "object": "response",
  "created_at": 1741476542,
  "status": "completed",
  "completed_at": 1741476543,
  "error": null,
  "incomplete_details": null,
  "instructions": null,
  "max_output_tokens": null,
  "model": "gpt-5.4",
  "output": [
    {
      "type": "message",
      "id": "msg_67ccd2bf17f0819081ff3bb2cf6508e60bb6a6b452d3795b",
      "status": "completed",
      "role": "assistant",
      "content": [
        {
          "type": "output_text",
          "text": "In a peaceful grove beneath a silver moon, a unicorn named Lumina discovered a hidden pool that reflected the stars. As she dipped her horn into the water, the pool began to shimmer, revealing a pathway to a magical realm of endless night skies. Filled with wonder, Lumina whispered a wish for all who dream to find their own hidden magic, and as she glanced back, her hoofprints sparkled like stardust.",
          "annotations": []
        }
      ]
    }
  ],
  "parallel_tool_calls": true,
  "previous_response_id": null,
  "reasoning": {
    "effort": null,
    "summary": null
  },
  "store": true,
  "temperature": 1.0,
  "text": {
    "format": {
      "type": "text"
    }
  },
  "tool_choice": "auto",
  "tools": [],
  "top_p": 1.0,
  "truncation": "disabled",
  "usage": {
    "input_tokens": 36,
    "input_tokens_details": {
      "cached_tokens": 0,
      "cache_write_tokens": 0
    },
    "output_tokens": 87,
    "output_tokens_details": {
      "reasoning_tokens": 0
    },
    "total_tokens": 123
  },
  "user": null,
  "metadata": {}
}
```

### Web search

```typescript
import OpenAI from "openai";

const openai = new OpenAI();

const response = await openai.responses.create({
    model: "gpt-5.4",
    tools: [{ type: "web_search_preview" }],
    input: "What was a positive news story from today?",
});

console.log(response);
```

#### Response

```json
{
  "id": "resp_67ccf18ef5fc8190b16dbee19bc54e5f087bb177ab789d5c",
  "object": "response",
  "created_at": 1741484430,
  "status": "completed",
  "completed_at": 1741484431,
  "error": null,
  "incomplete_details": null,
  "instructions": null,
  "max_output_tokens": null,
  "model": "gpt-5.4",
  "output": [
    {
      "type": "web_search_call",
      "id": "ws_67ccf18f64008190a39b619f4c8455ef087bb177ab789d5c",
      "status": "completed"
    },
    {
      "type": "message",
      "id": "msg_67ccf190ca3881909d433c50b1f6357e087bb177ab789d5c",
      "status": "completed",
      "role": "assistant",
      "content": [
        {
          "type": "output_text",
          "text": "As of today, March 9, 2025, one notable positive news story...",
          "annotations": [
            {
              "type": "url_citation",
              "start_index": 442,
              "end_index": 557,
              "url": "https://.../?utm_source=chatgpt.com",
              "title": "..."
            },
            {
              "type": "url_citation",
              "start_index": 962,
              "end_index": 1077,
              "url": "https://.../?utm_source=chatgpt.com",
              "title": "..."
            },
            {
              "type": "url_citation",
              "start_index": 1336,
              "end_index": 1451,
              "url": "https://.../?utm_source=chatgpt.com",
              "title": "..."
            }
          ]
        }
      ]
    }
  ],
  "parallel_tool_calls": true,
  "previous_response_id": null,
  "reasoning": {
    "effort": null,
    "summary": null
  },
  "store": true,
  "temperature": 1.0,
  "text": {
    "format": {
      "type": "text"
    }
  },
  "tool_choice": "auto",
  "tools": [
    {
      "type": "web_search_preview",
      "domains": [],
      "search_context_size": "medium",
      "user_location": {
        "type": "approximate",
        "city": null,
        "country": "US",
        "region": null,
        "timezone": null
      }
    }
  ],
  "top_p": 1.0,
  "truncation": "disabled",
  "usage": {
    "input_tokens": 328,
    "input_tokens_details": {
      "cached_tokens": 0,
      "cache_write_tokens": 0
    },
    "output_tokens": 356,
    "output_tokens_details": {
      "reasoning_tokens": 0
    },
    "total_tokens": 684
  },
  "user": null,
  "metadata": {}
}
```

## Delete a model response

`client.beta.responses.delete(stringresponseID, ResponseDeleteParamsparams?, RequestOptionsoptions?): void`

**delete** `/responses/{response_id}?beta=true`

Deletes a model response with the given ID.

### Parameters

- `responseID: string`

- `params: ResponseDeleteParams`

  - `betas?: Array<"responses_multi_agent=v1">`

    Optional beta features to enable for this request.

    - `"responses_multi_agent=v1"`

### Example

```typescript
import OpenAI from 'openai';

const client = new OpenAI({
  apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
});

await client.beta.responses.delete('resp_677efb5139a88190b512bc3fef8e535d');
```

### Example

```typescript
import OpenAI from "openai";
const client = new OpenAI();

const response = await client.responses.delete("resp_123");
console.log(response);
```

#### Response

```json
{
  "id": "resp_6786a1bec27481909a17d673315b29f6",
  "object": "response",
  "deleted": true
}
```

## Get a model response

`client.beta.responses.retrieve(stringresponseID, ResponseRetrieveParamsparams?, RequestOptionsoptions?): BetaResponse | Stream<BetaResponseStreamEvent>`

**get** `/responses/{response_id}?beta=true`

Retrieves a model response with the given ID.

### Parameters

- `responseID: string`

- `ResponseRetrieveParams = ResponseRetrieveParamsNonStreaming | ResponseRetrieveParamsStreaming`

  - `ResponseRetrieveParamsBase`

    - `include?: Array<BetaResponseIncludable>`

      Query param: Additional fields to include in the response. See the `include`
      parameter for Response creation above for more information.

      - `"file_search_call.results"`

      - `"web_search_call.results"`

      - `"web_search_call.action.sources"`

      - `"message.input_image.image_url"`

      - `"computer_call_output.output.image_url"`

      - `"code_interpreter_call.outputs"`

      - `"reasoning.encrypted_content"`

      - `"message.output_text.logprobs"`

    - `include_obfuscation?: boolean`

      Query param: When true, stream obfuscation will be enabled. Stream obfuscation adds
      random characters to an `obfuscation` field on streaming delta events
      to normalize payload sizes as a mitigation to certain side-channel
      attacks. These obfuscation fields are included by default, but add a
      small amount of overhead to the data stream. You can set
      `include_obfuscation` to false to optimize for bandwidth if you trust
      the network links between your application and the OpenAI API.

    - `starting_after?: number`

      Query param: The sequence number of the event after which to start streaming.

    - `stream?: false`

      Query param: If set to true, the model response data will be streamed to the client
      as it is generated using [server-sent events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events#Event_stream_format).
      See the [Streaming section below](https://platform.openai.com/docs/api-reference/responses-streaming)
      for more information.

      - `false`

    - `betas?: Array<"responses_multi_agent=v1">`

      Header param: Optional beta features to enable for this request.

      - `"responses_multi_agent=v1"`

  - `ResponseRetrieveParamsNonStreaming extends ResponseRetrieveParamsBase`

    - `stream?: false`

      Query param: If set to true, the model response data will be streamed to the client
      as it is generated using [server-sent events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events#Event_stream_format).
      See the [Streaming section below](https://platform.openai.com/docs/api-reference/responses-streaming)
      for more information.

  - `ResponseRetrieveParamsStreaming extends ResponseRetrieveParamsBase`

    - `stream: true`

      Query param: If set to true, the model response data will be streamed to the client
      as it is generated using [server-sent events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events#Event_stream_format).
      See the [Streaming section below](https://platform.openai.com/docs/api-reference/responses-streaming)
      for more information.

      - `true`

### Returns

- `BetaResponse`

  - `id: string`

    Unique identifier for this Response.

  - `created_at: number`

    Unix timestamp (in seconds) of when this Response was created.

  - `error: BetaResponseError | null`

    An error object returned when the model fails to generate a Response.

    - `code: "server_error" | "rate_limit_exceeded" | "invalid_prompt" | 17 more`

      The error code for the response.

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

    - `message: string`

      A human-readable description of the error.

  - `incomplete_details: IncompleteDetails | null`

    Details about why the response is incomplete.

    - `reason?: "max_output_tokens" | "content_filter"`

      The reason why the response is incomplete.

      - `"max_output_tokens"`

      - `"content_filter"`

  - `instructions: string | Array<BetaResponseInputItem> | null`

    A system (or developer) message inserted into the model's context.

    When using along with `previous_response_id`, the instructions from a previous
    response will not be carried over to the next response. This makes it simple
    to swap out system (or developer) messages in new responses.

    - `string`

    - `Array<BetaResponseInputItem>`

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

        - `content: string | BetaResponseInputMessageContentList`

          Text, image, or audio input to the model, used to generate a response.
          Can also contain previous assistant responses.

          - `string`

          - `BetaResponseInputMessageContentList = Array<BetaResponseInputContent>`

            A list of one or many input items to the model, containing different content
            types.

            - `BetaResponseInputText`

              A text input to the model.

              - `text: string`

                The text input to the model.

              - `type: "input_text"`

                The type of the input item. Always `input_text`.

                - `"input_text"`

              - `prompt_cache_breakpoint?: PromptCacheBreakpoint`

                Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.

                - `mode: "explicit"`

                  The breakpoint mode. Always `explicit`.

                  - `"explicit"`

            - `BetaResponseInputImage`

              An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision).

              - `detail: BetaImageDetail`

                The detail level of the image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`.

                - `"low"`

                - `"high"`

                - `"auto"`

                - `"original"`

              - `type: "input_image"`

                The type of the input item. Always `input_image`.

                - `"input_image"`

              - `file_id?: string | null`

                The ID of the file to be sent to the model.

              - `image_url?: string | null`

                The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.

              - `prompt_cache_breakpoint?: PromptCacheBreakpoint`

                Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.

                - `mode: "explicit"`

                  The breakpoint mode. Always `explicit`.

                  - `"explicit"`

            - `BetaResponseInputFile`

              A file input to the model.

              - `type: "input_file"`

                The type of the input item. Always `input_file`.

                - `"input_file"`

              - `detail?: "auto" | "low" | "high"`

                The detail level of the file to be sent to the model. Use `auto` to let the system select the detail level; for GPT-5.6 and later models, `auto` uses high-quality rendering, which may increase input token usage. Use `low` for lower-cost rendering, or `high` to render the file at higher quality. Defaults to `auto`.

                - `"auto"`

                - `"low"`

                - `"high"`

              - `file_data?: string`

                The content of the file to be sent to the model.

              - `file_id?: string | null`

                The ID of the file to be sent to the model.

              - `file_url?: string`

                The URL of the file to be sent to the model.

              - `filename?: string`

                The name of the file to be sent to the model.

              - `prompt_cache_breakpoint?: PromptCacheBreakpoint`

                Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.

                - `mode: "explicit"`

                  The breakpoint mode. Always `explicit`.

                  - `"explicit"`

        - `role: "user" | "assistant" | "system" | "developer"`

          The role of the message input. One of `user`, `assistant`, `system`, or
          `developer`.

          - `"user"`

          - `"assistant"`

          - `"system"`

          - `"developer"`

        - `phase?: "commentary" | "final_answer" | null`

          Labels an `assistant` message as intermediate commentary (`commentary`) or the final answer (`final_answer`).
          For models like `gpt-5.3-codex` and beyond, when sending follow-up requests, preserve and resend
          phase on all assistant messages — dropping it can degrade performance. Not used for user messages.

          - `"commentary"`

          - `"final_answer"`

        - `type?: "message"`

          The type of the message input. Always `message`.

          - `"message"`

      - `Message`

        A message input to the model with a role indicating instruction following
        hierarchy. Instructions given with the `developer` or `system` role take
        precedence over instructions given with the `user` role.

        - `content: BetaResponseInputMessageContentList`

          A list of one or many input items to the model, containing different content
          types.

        - `role: "user" | "system" | "developer"`

          The role of the message input. One of `user`, `system`, or `developer`.

          - `"user"`

          - `"system"`

          - `"developer"`

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `status?: "in_progress" | "completed" | "incomplete"`

          The status of item. One of `in_progress`, `completed`, or
          `incomplete`. Populated when items are returned via API.

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

        - `type?: "message"`

          The type of the message input. Always set to `message`.

          - `"message"`

      - `BetaResponseOutputMessage`

        An output message from the model.

        - `id: string`

          The unique ID of the output message.

        - `content: Array<BetaResponseOutputText | BetaResponseOutputRefusal>`

          The content of the output message.

          - `BetaResponseOutputText`

            A text output from the model.

            - `annotations: Array<FileCitation | URLCitation | ContainerFileCitation | FilePath>`

              The annotations of the text output.

              - `FileCitation`

                A citation to a file.

                - `file_id: string`

                  The ID of the file.

                - `filename: string`

                  The filename of the file cited.

                - `index: number`

                  The index of the file in the list of files.

                - `type: "file_citation"`

                  The type of the file citation. Always `file_citation`.

                  - `"file_citation"`

              - `URLCitation`

                A citation for a web resource used to generate a model response.

                - `end_index: number`

                  The index of the last character of the URL citation in the message.

                - `start_index: number`

                  The index of the first character of the URL citation in the message.

                - `title: string`

                  The title of the web resource.

                - `type: "url_citation"`

                  The type of the URL citation. Always `url_citation`.

                  - `"url_citation"`

                - `url: string`

                  The URL of the web resource.

              - `ContainerFileCitation`

                A citation for a container file used to generate a model response.

                - `container_id: string`

                  The ID of the container file.

                - `end_index: number`

                  The index of the last character of the container file citation in the message.

                - `file_id: string`

                  The ID of the file.

                - `filename: string`

                  The filename of the container file cited.

                - `start_index: number`

                  The index of the first character of the container file citation in the message.

                - `type: "container_file_citation"`

                  The type of the container file citation. Always `container_file_citation`.

                  - `"container_file_citation"`

              - `FilePath`

                A path to a file.

                - `file_id: string`

                  The ID of the file.

                - `index: number`

                  The index of the file in the list of files.

                - `type: "file_path"`

                  The type of the file path. Always `file_path`.

                  - `"file_path"`

            - `text: string`

              The text output from the model.

            - `type: "output_text"`

              The type of the output text. Always `output_text`.

              - `"output_text"`

            - `logprobs?: Array<Logprob>`

              - `token: string`

              - `bytes: Array<number>`

              - `logprob: number`

              - `top_logprobs: Array<TopLogprob>`

                - `token: string`

                - `bytes: Array<number>`

                - `logprob: number`

          - `BetaResponseOutputRefusal`

            A refusal from the model.

            - `refusal: string`

              The refusal explanation from the model.

            - `type: "refusal"`

              The type of the refusal. Always `refusal`.

              - `"refusal"`

        - `role: "assistant"`

          The role of the output message. Always `assistant`.

          - `"assistant"`

        - `status: "in_progress" | "completed" | "incomplete"`

          The status of the message input. One of `in_progress`, `completed`, or
          `incomplete`. Populated when input items are returned via API.

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

        - `type: "message"`

          The type of the output message. Always `message`.

          - `"message"`

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `phase?: "commentary" | "final_answer" | null`

          Labels an `assistant` message as intermediate commentary (`commentary`) or the final answer (`final_answer`).
          For models like `gpt-5.3-codex` and beyond, when sending follow-up requests, preserve and resend
          phase on all assistant messages — dropping it can degrade performance. Not used for user messages.

          - `"commentary"`

          - `"final_answer"`

      - `BetaResponseFileSearchToolCall`

        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.

        - `id: string`

          The unique ID of the file search tool call.

        - `queries: Array<string>`

          The queries used to search for files.

        - `status: "in_progress" | "searching" | "completed" | 2 more`

          The status of the file search tool call. One of `in_progress`,
          `searching`, `incomplete` or `failed`,

          - `"in_progress"`

          - `"searching"`

          - `"completed"`

          - `"incomplete"`

          - `"failed"`

        - `type: "file_search_call"`

          The type of the file search tool call. Always `file_search_call`.

          - `"file_search_call"`

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `results?: Array<Result> | null`

          The results of the file search tool call.

          - `attributes?: Record<string, string | number | boolean> | null`

            Set of 16 key-value pairs that can be attached to an object. This can be
            useful for storing additional information about the object in a structured
            format, and querying for objects via API or the dashboard. Keys are strings
            with a maximum length of 64 characters. Values are strings with a maximum
            length of 512 characters, booleans, or numbers.

            - `string`

            - `number`

            - `boolean`

          - `file_id?: string`

            The unique ID of the file.

          - `filename?: string`

            The name of the file.

          - `score?: number`

            The relevance score of the file - a value between 0 and 1.

          - `text?: string`

            The text that was retrieved from the file.

      - `BetaResponseComputerToolCall`

        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.

        - `id: string`

          The unique ID of the computer call.

        - `call_id: string`

          An identifier used when responding to the tool call with output.

        - `pending_safety_checks: Array<PendingSafetyCheck>`

          The pending safety checks for the computer call.

          - `id: string`

            The ID of the pending safety check.

          - `code?: string | null`

            The type of the pending safety check.

          - `message?: string | null`

            Details about the pending safety check.

        - `status: "in_progress" | "completed" | "incomplete"`

          The status of the item. One of `in_progress`, `completed`, or
          `incomplete`. Populated when items are returned via API.

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

        - `type: "computer_call"`

          The type of the computer call. Always `computer_call`.

          - `"computer_call"`

        - `action?: BetaComputerAction`

          A click action.

          - `Click`

            A click action.

            - `button: "left" | "right" | "wheel" | 2 more`

              Indicates which mouse button was pressed during the click. One of `left`, `right`, `wheel`, `back`, or `forward`.

              - `"left"`

              - `"right"`

              - `"wheel"`

              - `"back"`

              - `"forward"`

            - `type: "click"`

              Specifies the event type. For a click action, this property is always `click`.

              - `"click"`

            - `x: number`

              The x-coordinate where the click occurred.

            - `y: number`

              The y-coordinate where the click occurred.

            - `keys?: Array<string> | null`

              The keys being held while clicking.

          - `DoubleClick`

            A double click action.

            - `keys: Array<string> | null`

              The keys being held while double-clicking.

            - `type: "double_click"`

              Specifies the event type. For a double click action, this property is always set to `double_click`.

              - `"double_click"`

            - `x: number`

              The x-coordinate where the double click occurred.

            - `y: number`

              The y-coordinate where the double click occurred.

          - `Drag`

            A drag action.

            - `path: Array<Path>`

              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 }
              ]
              ```

              - `x: number`

                The x-coordinate.

              - `y: number`

                The y-coordinate.

            - `type: "drag"`

              Specifies the event type. For a drag action, this property is always set to `drag`.

              - `"drag"`

            - `keys?: Array<string> | null`

              The keys being held while dragging the mouse.

          - `Keypress`

            A collection of keypresses the model would like to perform.

            - `keys: Array<string>`

              The combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key.

            - `type: "keypress"`

              Specifies the event type. For a keypress action, this property is always set to `keypress`.

              - `"keypress"`

          - `Move`

            A mouse move action.

            - `type: "move"`

              Specifies the event type. For a move action, this property is always set to `move`.

              - `"move"`

            - `x: number`

              The x-coordinate to move to.

            - `y: number`

              The y-coordinate to move to.

            - `keys?: Array<string> | null`

              The keys being held while moving the mouse.

          - `Screenshot`

            A screenshot action.

            - `type: "screenshot"`

              Specifies the event type. For a screenshot action, this property is always set to `screenshot`.

              - `"screenshot"`

          - `Scroll`

            A scroll action.

            - `scroll_x: number`

              The horizontal scroll distance.

            - `scroll_y: number`

              The vertical scroll distance.

            - `type: "scroll"`

              Specifies the event type. For a scroll action, this property is always set to `scroll`.

              - `"scroll"`

            - `x: number`

              The x-coordinate where the scroll occurred.

            - `y: number`

              The y-coordinate where the scroll occurred.

            - `keys?: Array<string> | null`

              The keys being held while scrolling.

          - `Type`

            An action to type in text.

            - `text: string`

              The text to type.

            - `type: "type"`

              Specifies the event type. For a type action, this property is always set to `type`.

              - `"type"`

          - `Wait`

            A wait action.

            - `type: "wait"`

              Specifies the event type. For a wait action, this property is always set to `wait`.

              - `"wait"`

        - `actions?: BetaComputerActionList`

          Flattened batched actions for `computer_use`. Each action includes an
          `type` discriminator and action-specific fields.

          - `Click`

            A click action.

          - `DoubleClick`

            A double click action.

          - `Drag`

            A drag action.

          - `Keypress`

            A collection of keypresses the model would like to perform.

          - `Move`

            A mouse move action.

          - `Screenshot`

            A screenshot action.

          - `Scroll`

            A scroll action.

          - `Type`

            An action to type in text.

          - `Wait`

            A wait action.

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

      - `ComputerCallOutput`

        The output of a computer tool call.

        - `call_id: string`

          The ID of the computer tool call that produced the output.

        - `output: BetaResponseComputerToolCallOutputScreenshot`

          A computer screenshot image used with the computer use tool.

          - `type: "computer_screenshot"`

            Specifies the event type. For a computer screenshot, this property is
            always set to `computer_screenshot`.

            - `"computer_screenshot"`

          - `file_id?: string`

            The identifier of an uploaded file that contains the screenshot.

          - `image_url?: string`

            The URL of the screenshot image.

        - `type: "computer_call_output"`

          The type of the computer tool call output. Always `computer_call_output`.

          - `"computer_call_output"`

        - `id?: string | null`

          The ID of the computer tool call output.

        - `acknowledged_safety_checks?: Array<AcknowledgedSafetyCheck> | null`

          The safety checks reported by the API that have been acknowledged by the developer.

          - `id: string`

            The ID of the pending safety check.

          - `code?: string | null`

            The type of the pending safety check.

          - `message?: string | null`

            Details about the pending safety check.

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

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

          The status of the message input. One of `in_progress`, `completed`, or `incomplete`. Populated when input items are returned via API.

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

      - `BetaResponseFunctionWebSearch`

        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.

        - `id: string`

          The unique ID of the web search tool call.

        - `action: Search | OpenPage | FindInPage`

          An object describing the specific action taken in this web search call.
          Includes details on how the model used the web (search, open_page, find_in_page).

          - `Search`

            Action type "search" - Performs a web search query.

            - `type: "search"`

              The action type.

              - `"search"`

            - `queries?: Array<string>`

              The search queries.

            - `query?: string`

              The search query.

            - `sources?: Array<Source>`

              The sources used in the search.

              - `type: "url"`

                The type of source. Always `url`.

                - `"url"`

              - `url: string`

                The URL of the source.

          - `OpenPage`

            Action type "open_page" - Opens a specific URL from search results.

            - `type: "open_page"`

              The action type.

              - `"open_page"`

            - `url?: string | null`

              The URL opened by the model.

          - `FindInPage`

            Action type "find_in_page": Searches for a pattern within a loaded page.

            - `pattern: string`

              The pattern or text to search for within the page.

            - `type: "find_in_page"`

              The action type.

              - `"find_in_page"`

            - `url: string`

              The URL of the page searched for the pattern.

        - `status: "in_progress" | "searching" | "completed" | "failed"`

          The status of the web search tool call.

          - `"in_progress"`

          - `"searching"`

          - `"completed"`

          - `"failed"`

        - `type: "web_search_call"`

          The type of the web search tool call. Always `web_search_call`.

          - `"web_search_call"`

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

      - `BetaResponseFunctionToolCall`

        A tool call to run a function. See the
        [function calling guide](https://platform.openai.com/docs/guides/function-calling) for more information.

        - `arguments: string`

          A JSON string of the arguments to pass to the function.

        - `call_id: string`

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

        - `name: string`

          The name of the function to run.

        - `type: "function_call"`

          The type of the function tool call. Always `function_call`.

          - `"function_call"`

        - `id?: string`

          The unique ID of the function tool call.

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `caller?: Direct | Program | null`

          The execution context that produced this tool call.

          - `Direct`

            - `type: "direct"`

              - `"direct"`

          - `Program`

            - `caller_id: string`

              The call ID of the program item that produced this tool call.

            - `type: "program"`

              - `"program"`

        - `namespace?: string`

          The namespace of the function to run.

        - `status?: "in_progress" | "completed" | "incomplete"`

          The status of the item. One of `in_progress`, `completed`, or
          `incomplete`. Populated when items are returned via API.

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

      - `FunctionCallOutput`

        The output of a function tool call.

        - `call_id: string`

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

        - `output: string | BetaResponseFunctionCallOutputItemList`

          Text, image, or file output of the function tool call.

          - `string`

          - `BetaResponseFunctionCallOutputItemList = Array<BetaResponseFunctionCallOutputItem>`

            An array of content outputs (text, image, file) for the function tool call.

            - `BetaResponseInputTextContent`

              A text input to the model.

              - `text: string`

                The text input to the model.

              - `type: "input_text"`

                The type of the input item. Always `input_text`.

                - `"input_text"`

              - `prompt_cache_breakpoint?: PromptCacheBreakpoint | null`

                Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.

                - `mode: "explicit"`

                  The breakpoint mode. Always `explicit`.

                  - `"explicit"`

            - `BetaResponseInputImageContent`

              An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision)

              - `type: "input_image"`

                The type of the input item. Always `input_image`.

                - `"input_image"`

              - `detail?: BetaImageDetail | null`

                The detail level of the image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`.

              - `file_id?: string | null`

                The ID of the file to be sent to the model.

              - `image_url?: string | null`

                The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.

              - `prompt_cache_breakpoint?: PromptCacheBreakpoint | null`

                Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.

                - `mode: "explicit"`

                  The breakpoint mode. Always `explicit`.

                  - `"explicit"`

            - `BetaResponseInputFileContent`

              A file input to the model.

              - `type: "input_file"`

                The type of the input item. Always `input_file`.

                - `"input_file"`

              - `detail?: "auto" | "low" | "high"`

                The detail level of the file to be sent to the model. Use `auto` to let the system select the detail level; for GPT-5.6 and later models, `auto` uses high-quality rendering, which may increase input token usage. Use `low` for lower-cost rendering, or `high` to render the file at higher quality. Defaults to `auto`.

                - `"auto"`

                - `"low"`

                - `"high"`

              - `file_data?: string | null`

                The base64-encoded data of the file to be sent to the model.

              - `file_id?: string | null`

                The ID of the file to be sent to the model.

              - `file_url?: string | null`

                The URL of the file to be sent to the model.

              - `filename?: string | null`

                The name of the file to be sent to the model.

              - `prompt_cache_breakpoint?: PromptCacheBreakpoint | null`

                Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.

                - `mode: "explicit"`

                  The breakpoint mode. Always `explicit`.

                  - `"explicit"`

        - `type: "function_call_output"`

          The type of the function tool call output. Always `function_call_output`.

          - `"function_call_output"`

        - `id?: string | null`

          The unique ID of the function tool call output. Populated when this item is returned via API.

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `caller?: Direct | Program | null`

          The execution context that produced this tool call.

          - `Direct`

            - `type: "direct"`

              The caller type. Always `direct`.

              - `"direct"`

          - `Program`

            - `caller_id: string`

              The call ID of the program item that produced this tool call.

            - `type: "program"`

              The caller type. Always `program`.

              - `"program"`

        - `name?: string | null`

          The name of the tool that produced the output.

        - `namespace?: string | null`

          The namespace of the tool that produced the output.

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

          The status of the item. One of `in_progress`, `completed`, or `incomplete`. Populated when items are returned via API.

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

      - `AgentMessage`

        A message routed between agents.

        - `author: string`

          The sending agent identity.

        - `content: Array<BetaResponseInputTextContent | BetaResponseInputImageContent | EncryptedContent>`

          Plaintext, image, or encrypted content sent between agents.

          - `BetaResponseInputTextContent`

            A text input to the model.

          - `BetaResponseInputImageContent`

            An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision)

          - `EncryptedContent`

            Opaque encrypted content that Responses API decrypts inside trusted model execution.

            - `encrypted_content: string`

              Opaque encrypted content.

            - `type: "encrypted_content"`

              The type of the input item. Always `encrypted_content`.

              - `"encrypted_content"`

        - `recipient: string`

          The destination agent identity.

        - `type: "agent_message"`

          The item type. Always `agent_message`.

          - `"agent_message"`

        - `id?: string | null`

          The unique ID of this agent message item.

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

      - `MultiAgentCall`

        - `action: "spawn_agent" | "interrupt_agent" | "list_agents" | 3 more`

          The multi-agent action that was executed.

          - `"spawn_agent"`

          - `"interrupt_agent"`

          - `"list_agents"`

          - `"send_message"`

          - `"followup_task"`

          - `"wait_agent"`

        - `arguments: string`

          The action arguments as a JSON string.

        - `call_id: string`

          The unique ID linking this call to its output.

        - `type: "multi_agent_call"`

          The item type. Always `multi_agent_call`.

          - `"multi_agent_call"`

        - `id?: string | null`

          The unique ID of this multi-agent call.

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

      - `MultiAgentCallOutput`

        - `action: "spawn_agent" | "interrupt_agent" | "list_agents" | 3 more`

          The multi-agent action that produced this result.

          - `"spawn_agent"`

          - `"interrupt_agent"`

          - `"list_agents"`

          - `"send_message"`

          - `"followup_task"`

          - `"wait_agent"`

        - `call_id: string`

          The unique ID of the multi-agent call.

        - `output: Array<Output>`

          Text output returned by the multi-agent action.

          - `text: string`

            The text content.

          - `type: "output_text"`

            The content type. Always `output_text`.

            - `"output_text"`

          - `annotations?: Array<FileCitation | URLCitation | ContainerFileCitation>`

            Citations associated with the text content.

            - `FileCitation`

              - `file_id: string`

                The ID of the file.

              - `filename: string`

                The filename of the file cited.

              - `index: number`

                The index of the file in the list of files.

              - `type: "file_citation"`

                The citation type. Always `file_citation`.

                - `"file_citation"`

            - `URLCitation`

              - `end_index: number`

                The index of the last character of the citation in the message.

              - `start_index: number`

                The index of the first character of the citation in the message.

              - `title: string`

                The title of the cited resource.

              - `type: "url_citation"`

                The citation type. Always `url_citation`.

                - `"url_citation"`

              - `url: string`

                The URL of the cited resource.

            - `ContainerFileCitation`

              - `container_id: string`

                The ID of the container.

              - `end_index: number`

                The index of the last character of the citation in the message.

              - `file_id: string`

                The ID of the container file.

              - `filename: string`

                The filename of the container file cited.

              - `start_index: number`

                The index of the first character of the citation in the message.

              - `type: "container_file_citation"`

                The citation type. Always `container_file_citation`.

                - `"container_file_citation"`

        - `type: "multi_agent_call_output"`

          The item type. Always `multi_agent_call_output`.

          - `"multi_agent_call_output"`

        - `id?: string | null`

          The unique ID of this multi-agent call output.

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

      - `ToolSearchCall`

        - `arguments: unknown`

          The arguments supplied to the tool search call.

        - `type: "tool_search_call"`

          The item type. Always `tool_search_call`.

          - `"tool_search_call"`

        - `id?: string | null`

          The unique ID of this tool search call.

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `call_id?: string | null`

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

        - `execution?: "server" | "client"`

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

          - `"server"`

          - `"client"`

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

          The status of the tool search call.

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

      - `BetaResponseToolSearchOutputItemParam`

        - `tools: Array<BetaTool>`

          The loaded tool definitions returned by the tool search output.

          - `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).

            - `name: string`

              The name of the function to call.

            - `parameters: Record<string, unknown> | null`

              A JSON schema object describing the parameters of the function.

            - `strict: boolean | null`

              Whether strict parameter validation is enforced for this function tool.

            - `type: "function"`

              The type of the function tool. Always `function`.

              - `"function"`

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

              The tool invocation context(s).

              - `"direct"`

              - `"programmatic"`

            - `defer_loading?: boolean`

              Whether this function is deferred and loaded via tool search.

            - `description?: string | null`

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

            - `output_schema?: Record<string, unknown> | null`

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

          - `BetaFileSearchTool`

            A tool that searches for relevant content from uploaded files. Learn more about the [file search tool](https://platform.openai.com/docs/guides/tools-file-search).

            - `type: "file_search"`

              The type of the file search tool. Always `file_search`.

              - `"file_search"`

            - `vector_store_ids: Array<string>`

              The IDs of the vector stores to search.

            - `filters?: ComparisonFilter | CompoundFilter | null`

              A filter to apply.

              - `ComparisonFilter`

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

                - `key: string`

                  The key to compare against the value.

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

                  Specifies the comparison operator: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`, `in`, `nin`.

                  - `eq`: equals
                  - `ne`: not equal
                  - `gt`: greater than
                  - `gte`: greater than or equal
                  - `lt`: less than
                  - `lte`: less than or equal
                  - `in`: in
                  - `nin`: not in

                  - `"eq"`

                  - `"ne"`

                  - `"gt"`

                  - `"gte"`

                  - `"lt"`

                  - `"lte"`

                  - `"in"`

                  - `"nin"`

                - `value: string | number | boolean | Array<string | number>`

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

                  - `string`

                  - `number`

                  - `boolean`

                  - `Array<string | number>`

                    - `string`

                    - `number`

              - `CompoundFilter`

                Combine multiple filters using `and` or `or`.

                - `filters: Array<ComparisonFilter | unknown>`

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

                  - `ComparisonFilter`

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

                    - `key: string`

                      The key to compare against the value.

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

                      Specifies the comparison operator: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`, `in`, `nin`.

                      - `eq`: equals
                      - `ne`: not equal
                      - `gt`: greater than
                      - `gte`: greater than or equal
                      - `lt`: less than
                      - `lte`: less than or equal
                      - `in`: in
                      - `nin`: not in

                      - `"eq"`

                      - `"ne"`

                      - `"gt"`

                      - `"gte"`

                      - `"lt"`

                      - `"lte"`

                      - `"in"`

                      - `"nin"`

                    - `value: string | number | boolean | Array<string | number>`

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

                      - `string`

                      - `number`

                      - `boolean`

                      - `Array<string | number>`

                        - `string`

                        - `number`

                  - `unknown`

                - `type: "and" | "or"`

                  Type of operation: `and` or `or`.

                  - `"and"`

                  - `"or"`

            - `max_num_results?: number`

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

            - `ranking_options?: RankingOptions`

              Ranking options for search.

              - `hybrid_search?: HybridSearch`

                Weights that control how reciprocal rank fusion balances semantic embedding matches versus sparse keyword matches when hybrid search is enabled.

                - `embedding_weight: number`

                  The weight of the embedding in the reciprocal ranking fusion.

                - `text_weight: number`

                  The weight of the text in the reciprocal ranking fusion.

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

                The ranker to use for the file search.

                - `"auto"`

                - `"default-2024-11-15"`

              - `score_threshold?: number`

                The score threshold for the file search, a number between 0 and 1. Numbers closer to 1 will attempt to return only the most relevant results, but may return fewer results.

          - `BetaComputerTool`

            A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use).

            - `type: "computer"`

              The type of the computer tool. Always `computer`.

              - `"computer"`

          - `BetaComputerUsePreviewTool`

            A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use).

            - `display_height: number`

              The height of the computer display.

            - `display_width: number`

              The width of the computer display.

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

              The type of computer environment to control.

              - `"windows"`

              - `"mac"`

              - `"linux"`

              - `"ubuntu"`

              - `"browser"`

            - `type: "computer_use_preview"`

              The type of the computer use tool. Always `computer_use_preview`.

              - `"computer_use_preview"`

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

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

              - `"web_search"`

              - `"web_search_2025_08_26"`

            - `external_web_access?: boolean`

              Allow live internet access for web search. Defaults to true when omitted. When false, the web search tool runs in offline/cache-only mode and will not fetch new external content.

            - `filters?: Filters | null`

              Filters for the search.

              - `allowed_domains?: Array<string> | null`

                Allowed domains for the search. If not provided, all domains are allowed.
                Subdomains of the provided domains are allowed as well.

                Example: `["pubmed.ncbi.nlm.nih.gov"]`

            - `search_context_size?: "low" | "medium" | "high"`

              High level guidance for the amount of context window space to use for the search. One of `low`, `medium`, or `high`. `medium` is the default.

              - `"low"`

              - `"medium"`

              - `"high"`

            - `user_location?: UserLocation | null`

              The approximate location of the user.

              - `city?: string | null`

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

              - `country?: string | null`

                The two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of the user, e.g. `US`.

              - `region?: string | null`

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

              - `timezone?: string | null`

                The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of the user, e.g. `America/Los_Angeles`.

              - `type?: "approximate"`

                The type of location approximation. Always `approximate`.

                - `"approximate"`

          - `Mcp`

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

            - `server_label: string`

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

            - `type: "mcp"`

              The type of the MCP tool. Always `mcp`.

              - `"mcp"`

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

              The tool invocation context(s).

              - `"direct"`

              - `"programmatic"`

            - `allowed_tools?: Array<string> | McpToolFilter | null`

              List of allowed tool names or a filter object.

              - `Array<string>`

              - `McpToolFilter`

                A filter object to specify which tools are allowed.

                - `read_only?: boolean`

                  Indicates whether or not a tool modifies data or is read-only. If an
                  MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint),
                  it will match this filter.

                - `tool_names?: Array<string>`

                  List of allowed tool names.

            - `authorization?: string`

              An OAuth access token that can be used with a remote MCP server, either
              with a custom MCP server URL or a service connector. Your application
              must handle the OAuth authorization flow and provide the token here.

            - `connector_id?: "connector_dropbox" | "connector_gmail" | "connector_googlecalendar" | 5 more`

              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`

              - `"connector_dropbox"`

              - `"connector_gmail"`

              - `"connector_googlecalendar"`

              - `"connector_googledrive"`

              - `"connector_microsoftteams"`

              - `"connector_outlookcalendar"`

              - `"connector_outlookemail"`

              - `"connector_sharepoint"`

            - `defer_loading?: boolean`

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

            - `headers?: Record<string, string> | null`

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

            - `require_approval?: McpToolApprovalFilter | "always" | "never" | null`

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

              - `McpToolApprovalFilter`

                Specify which of the MCP server's tools require approval. Can be
                `always`, `never`, or a filter object associated with tools
                that require approval.

                - `always?: Always`

                  A filter object to specify which tools are allowed.

                  - `read_only?: boolean`

                    Indicates whether or not a tool modifies data or is read-only. If an
                    MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint),
                    it will match this filter.

                  - `tool_names?: Array<string>`

                    List of allowed tool names.

                - `never?: Never`

                  A filter object to specify which tools are allowed.

                  - `read_only?: boolean`

                    Indicates whether or not a tool modifies data or is read-only. If an
                    MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint),
                    it will match this filter.

                  - `tool_names?: Array<string>`

                    List of allowed tool names.

              - `"always" | "never"`

                - `"always"`

                - `"never"`

            - `server_description?: string`

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

            - `server_url?: string`

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

            - `tunnel_id?: string`

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

          - `CodeInterpreter`

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

            - `container: string | CodeInterpreterToolAuto`

              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`

              - `CodeInterpreterToolAuto`

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

                - `type: "auto"`

                  Always `auto`.

                  - `"auto"`

                - `file_ids?: Array<string>`

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

                - `memory_limit?: "1g" | "4g" | "16g" | "64g" | null`

                  The memory limit for the code interpreter container.

                  - `"1g"`

                  - `"4g"`

                  - `"16g"`

                  - `"64g"`

                - `network_policy?: BetaContainerNetworkPolicyDisabled | BetaContainerNetworkPolicyAllowlist`

                  Network access policy for the container.

                  - `BetaContainerNetworkPolicyDisabled`

                    - `type: "disabled"`

                      Disable outbound network access. Always `disabled`.

                      - `"disabled"`

                  - `BetaContainerNetworkPolicyAllowlist`

                    - `allowed_domains: Array<string>`

                      A list of allowed domains when type is `allowlist`.

                    - `type: "allowlist"`

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

                      - `"allowlist"`

                    - `domain_secrets?: Array<BetaContainerNetworkPolicyDomainSecret>`

                      Optional domain-scoped secrets for allowlisted domains.

                      - `domain: string`

                        The domain associated with the secret.

                      - `name: string`

                        The name of the secret to inject for the domain.

                      - `value: string`

                        The secret value to inject for the domain.

            - `type: "code_interpreter"`

              The type of the code interpreter tool. Always `code_interpreter`.

              - `"code_interpreter"`

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

              The tool invocation context(s).

              - `"direct"`

              - `"programmatic"`

          - `ProgrammaticToolCalling`

            - `type: "programmatic_tool_calling"`

              The type of the tool. Always `programmatic_tool_calling`.

              - `"programmatic_tool_calling"`

          - `ImageGeneration`

            A tool that generates images using the GPT image models.

            - `type: "image_generation"`

              The type of the image generation tool. Always `image_generation`.

              - `"image_generation"`

            - `action?: "generate" | "edit" | "auto"`

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

              - `"generate"`

              - `"edit"`

              - `"auto"`

            - `background?: "transparent" | "opaque" | "auto"`

              Allows to set transparency for the background of the generated image(s).
              Must be one of `transparent`, `opaque`, or `auto` (default value). When
              `auto` is used, the model will automatically determine the best
              background for the image.

              Transparent backgrounds are available for supported GPT Image models.
              For `gpt-image-2` and `gpt-image-2-2026-04-21`, this support is in
              preview. When using `transparent`, set the output format to `png` or
              `webp`.

              - `"transparent"`

              - `"opaque"`

              - `"auto"`

            - `input_fidelity?: "high" | "low" | null`

              Control how much effort the model will exert to match the style and features, especially facial features, of input images. This parameter is only supported for `gpt-image-1` and `gpt-image-1.5` and later models, unsupported for `gpt-image-1-mini`. Supports `high` and `low`. Defaults to `low`.

              - `"high"`

              - `"low"`

            - `input_image_mask?: InputImageMask`

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

              - `file_id?: string`

                File ID for the mask image.

              - `image_url?: string`

                Base64-encoded mask image.

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

              The image generation model to use. One of `gpt-image-1`,
              `gpt-image-1-mini`, `gpt-image-1.5`, `gpt-image-2`,
              `gpt-image-2-2026-04-21`, or `chatgpt-image-latest`. Default:
              `gpt-image-1`.

              - `(string & {})`

              - `"gpt-image-1" | "gpt-image-1-mini" | "gpt-image-2" | 3 more`

                - `"gpt-image-1"`

                - `"gpt-image-1-mini"`

                - `"gpt-image-2"`

                - `"gpt-image-2-2026-04-21"`

                - `"gpt-image-1.5"`

                - `"chatgpt-image-latest"`

            - `moderation?: "auto" | "low"`

              Moderation level for the generated image. Default: `auto`.

              - `"auto"`

              - `"low"`

            - `output_compression?: number`

              Compression level for the output image. Default: 100.

            - `output_format?: "png" | "webp" | "jpeg"`

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

              - `"png"`

              - `"webp"`

              - `"jpeg"`

            - `partial_images?: number`

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

            - `quality?: "low" | "medium" | "high" | "auto"`

              The quality of the generated image. One of `low`, `medium`, `high`,
              or `auto`. Default: `auto`.

              - `"low"`

              - `"medium"`

              - `"high"`

              - `"auto"`

            - `size?: (string & {}) | "1024x1024" | "1024x1536" | "1536x1024" | "auto"`

              The size of the generated images. For `gpt-image-2` and `gpt-image-2-2026-04-21`, arbitrary resolutions are supported as `WIDTHxHEIGHT` strings, for example `1536x864`. Width and height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above `2560x1440` are experimental, and the maximum supported resolution is `3840x2160`. The requested size must also satisfy the model's current pixel and edge limits. The standard sizes `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models; `auto` is supported for models that allow automatic sizing. For `dall-e-2`, use one of `256x256`, `512x512`, or `1024x1024`. For `dall-e-3`, use one of `1024x1024`, `1792x1024`, or `1024x1792`.

              - `(string & {})`

              - `"1024x1024" | "1024x1536" | "1536x1024" | "auto"`

                - `"1024x1024"`

                - `"1024x1536"`

                - `"1536x1024"`

                - `"auto"`

          - `LocalShell`

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

            - `type: "local_shell"`

              The type of the local shell tool. Always `local_shell`.

              - `"local_shell"`

          - `BetaFunctionShellTool`

            A tool that allows the model to execute shell commands.

            - `type: "shell"`

              The type of the shell tool. Always `shell`.

              - `"shell"`

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

              The tool invocation context(s).

              - `"direct"`

              - `"programmatic"`

            - `environment?: BetaContainerAuto | BetaLocalEnvironment | BetaContainerReference | null`

              - `BetaContainerAuto`

                - `type: "container_auto"`

                  Automatically creates a container for this request

                  - `"container_auto"`

                - `file_ids?: Array<string>`

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

                - `memory_limit?: "1g" | "4g" | "16g" | "64g" | null`

                  The memory limit for the container.

                  - `"1g"`

                  - `"4g"`

                  - `"16g"`

                  - `"64g"`

                - `network_policy?: BetaContainerNetworkPolicyDisabled | BetaContainerNetworkPolicyAllowlist`

                  Network access policy for the container.

                  - `BetaContainerNetworkPolicyDisabled`

                  - `BetaContainerNetworkPolicyAllowlist`

                - `skills?: Array<BetaSkillReference | BetaInlineSkill>`

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

                  - `BetaSkillReference`

                    - `skill_id: string`

                      The ID of the referenced skill.

                    - `type: "skill_reference"`

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

                      - `"skill_reference"`

                    - `version?: string`

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

                  - `BetaInlineSkill`

                    - `description: string`

                      The description of the skill.

                    - `name: string`

                      The name of the skill.

                    - `source: BetaInlineSkillSource`

                      Inline skill payload

                      - `data: string`

                        Base64-encoded skill zip bundle.

                      - `media_type: "application/zip"`

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

                        - `"application/zip"`

                      - `type: "base64"`

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

                        - `"base64"`

                    - `type: "inline"`

                      Defines an inline skill for this request.

                      - `"inline"`

              - `BetaLocalEnvironment`

                - `type: "local"`

                  Use a local computer environment.

                  - `"local"`

                - `skills?: Array<BetaLocalSkill>`

                  An optional list of skills.

                  - `description: string`

                    The description of the skill.

                  - `name: string`

                    The name of the skill.

                  - `path: string`

                    The path to the directory containing the skill.

              - `BetaContainerReference`

                - `container_id: string`

                  The ID of the referenced container.

                - `type: "container_reference"`

                  References a container created with the /v1/containers endpoint

                  - `"container_reference"`

          - `BetaCustomTool`

            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)

            - `name: string`

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

            - `type: "custom"`

              The type of the custom tool. Always `custom`.

              - `"custom"`

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

              The tool invocation context(s).

              - `"direct"`

              - `"programmatic"`

            - `defer_loading?: boolean`

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

            - `description?: string`

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

            - `format?: Text | Grammar`

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

              - `Text`

                Unconstrained free-form text.

                - `type: "text"`

                  Unconstrained text format. Always `text`.

                  - `"text"`

              - `Grammar`

                A grammar defined by the user.

                - `definition: string`

                  The grammar definition.

                - `syntax: "lark" | "regex"`

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

                  - `"lark"`

                  - `"regex"`

                - `type: "grammar"`

                  Grammar format. Always `grammar`.

                  - `"grammar"`

          - `BetaNamespaceTool`

            Groups function/custom tools under a shared namespace.

            - `description: string`

              A description of the namespace shown to the model.

            - `name: string`

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

            - `tools: Array<Function | BetaCustomTool>`

              The function/custom tools available inside this namespace.

              - `Function`

                - `name: string`

                - `type: "function"`

                  - `"function"`

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

                  The tool invocation context(s).

                  - `"direct"`

                  - `"programmatic"`

                - `defer_loading?: boolean`

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

                - `description?: string | null`

                - `output_schema?: Record<string, unknown> | null`

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

                - `parameters?: unknown`

                - `strict?: boolean | null`

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

              - `BetaCustomTool`

                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: "namespace"`

              The type of the tool. Always `namespace`.

              - `"namespace"`

          - `BetaToolSearchTool`

            Hosted or BYOT tool search configuration for deferred tools.

            - `type: "tool_search"`

              The type of the tool. Always `tool_search`.

              - `"tool_search"`

            - `description?: string | null`

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

            - `execution?: "server" | "client"`

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

              - `"server"`

              - `"client"`

            - `parameters?: unknown`

              Parameter schema for a client-executed tool search tool.

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

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

              - `"web_search_preview"`

              - `"web_search_preview_2025_03_11"`

            - `search_content_types?: Array<"text" | "image">`

              - `"text"`

              - `"image"`

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

              - `"low"`

              - `"medium"`

              - `"high"`

            - `user_location?: UserLocation | null`

              The user's location.

              - `type: "approximate"`

                The type of location approximation. Always `approximate`.

                - `"approximate"`

              - `city?: string | null`

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

              - `country?: string | null`

                The two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of the user, e.g. `US`.

              - `region?: string | null`

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

              - `timezone?: string | null`

                The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of the user, e.g. `America/Los_Angeles`.

          - `BetaApplyPatchTool`

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

            - `type: "apply_patch"`

              The type of the tool. Always `apply_patch`.

              - `"apply_patch"`

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

              The tool invocation context(s).

              - `"direct"`

              - `"programmatic"`

        - `type: "tool_search_output"`

          The item type. Always `tool_search_output`.

          - `"tool_search_output"`

        - `id?: string | null`

          The unique ID of this tool search output.

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `call_id?: string | null`

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

        - `execution?: "server" | "client"`

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

          - `"server"`

          - `"client"`

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

          The status of the tool search output.

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

      - `AdditionalTools`

        - `role: "developer"`

          The role that provided the additional tools. Only `developer` is supported.

          - `"developer"`

        - `tools: Array<BetaTool>`

          A list of additional tools made available at this item.

          - `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).

          - `Mcp`

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

          - `CodeInterpreter`

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

          - `ProgrammaticToolCalling`

          - `ImageGeneration`

            A tool that generates images using the GPT image models.

          - `LocalShell`

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

          - `BetaFunctionShellTool`

            A tool that allows the model to execute shell commands.

          - `BetaCustomTool`

            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)

          - `BetaNamespaceTool`

            Groups function/custom tools under a shared namespace.

          - `BetaToolSearchTool`

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

          - `BetaApplyPatchTool`

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

        - `type: "additional_tools"`

          The item type. Always `additional_tools`.

          - `"additional_tools"`

        - `id?: string | null`

          The unique ID of this additional tools item.

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

      - `BetaResponseReasoningItem`

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

        - `id: string`

          The unique identifier of the reasoning content.

        - `summary: Array<Summary>`

          Reasoning summary content.

          - `text: string`

            A summary of the reasoning output from the model so far.

          - `type: "summary_text"`

            The type of the object. Always `summary_text`.

            - `"summary_text"`

        - `type: "reasoning"`

          The type of the object. Always `reasoning`.

          - `"reasoning"`

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `content?: Array<Content>`

          Reasoning text content.

          - `text: string`

            The reasoning text from the model.

          - `type: "reasoning_text"`

            The type of the reasoning text. Always `reasoning_text`.

            - `"reasoning_text"`

        - `encrypted_content?: string | null`

          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.

          When streaming, use the completed reasoning item and its
          `encrypted_content` from the `response.output_item.done` event in
          subsequent requests. The `encrypted_content` in
          `response.output_item.added` may be incomplete. This is especially
          important when `store` is `false` or when using Zero Data Retention.

        - `status?: "in_progress" | "completed" | "incomplete"`

          The status of the item. One of `in_progress`, `completed`, or
          `incomplete`. Populated when items are returned via API.

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

      - `BetaResponseCompactionItemParam`

        A compaction item generated by the [`v1/responses/compact` API](https://platform.openai.com/docs/api-reference/responses/compact).

        - `encrypted_content: string`

          The encrypted content of the compaction summary.

        - `type: "compaction"`

          The type of the item. Always `compaction`.

          - `"compaction"`

        - `id?: string | null`

          The ID of the compaction item.

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

      - `ImageGenerationCall`

        An image generation request made by the model.

        - `id: string`

          The unique ID of the image generation call.

        - `result: string | null`

          The generated image encoded in base64.

        - `status: "in_progress" | "completed" | "generating" | "failed"`

          The status of the image generation call.

          - `"in_progress"`

          - `"completed"`

          - `"generating"`

          - `"failed"`

        - `type: "image_generation_call"`

          The type of the image generation call. Always `image_generation_call`.

          - `"image_generation_call"`

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

      - `BetaResponseCodeInterpreterToolCall`

        A tool call to run code.

        - `id: string`

          The unique ID of the code interpreter tool call.

        - `code: string | null`

          The code to run, or null if not available.

        - `container_id: string`

          The ID of the container used to run the code.

        - `outputs: Array<Logs | Image> | null`

          The outputs generated by the code interpreter, such as logs or images.
          Can be null if no outputs are available.

          - `Logs`

            The logs output from the code interpreter.

            - `logs: string`

              The logs output from the code interpreter.

            - `type: "logs"`

              The type of the output. Always `logs`.

              - `"logs"`

          - `Image`

            The image output from the code interpreter.

            - `type: "image"`

              The type of the output. Always `image`.

              - `"image"`

            - `url: string`

              The URL of the image output from the code interpreter.

        - `status: "in_progress" | "completed" | "incomplete" | 2 more`

          The status of the code interpreter tool call. Valid values are `in_progress`, `completed`, `incomplete`, `interpreting`, and `failed`.

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

          - `"interpreting"`

          - `"failed"`

        - `type: "code_interpreter_call"`

          The type of the code interpreter tool call. Always `code_interpreter_call`.

          - `"code_interpreter_call"`

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

      - `LocalShellCall`

        A tool call to run a command on the local shell.

        - `id: string`

          The unique ID of the local shell call.

        - `action: Action`

          Execute a shell command on the server.

          - `command: Array<string>`

            The command to run.

          - `env: Record<string, string>`

            Environment variables to set for the command.

          - `type: "exec"`

            The type of the local shell action. Always `exec`.

            - `"exec"`

          - `timeout_ms?: number | null`

            Optional timeout in milliseconds for the command.

          - `user?: string | null`

            Optional user to run the command as.

          - `working_directory?: string | null`

            Optional working directory to run the command in.

        - `call_id: string`

          The unique ID of the local shell tool call generated by the model.

        - `status: "in_progress" | "completed" | "incomplete"`

          The status of the local shell call.

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

        - `type: "local_shell_call"`

          The type of the local shell call. Always `local_shell_call`.

          - `"local_shell_call"`

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

      - `LocalShellCallOutput`

        The output of a local shell tool call.

        - `id: string`

          The unique ID of the local shell tool call generated by the model.

        - `output: string`

          A JSON string of the output of the local shell tool call.

        - `type: "local_shell_call_output"`

          The type of the local shell tool call output. Always `local_shell_call_output`.

          - `"local_shell_call_output"`

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

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

          The status of the item. One of `in_progress`, `completed`, or `incomplete`.

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

      - `ShellCall`

        A tool representing a request to execute one or more shell commands.

        - `action: Action`

          The shell commands and limits that describe how to run the tool call.

          - `commands: Array<string>`

            Ordered shell commands for the execution environment to run.

          - `max_output_length?: number | null`

            Maximum number of UTF-8 characters to capture from combined stdout and stderr output.

          - `timeout_ms?: number | null`

            Maximum wall-clock time in milliseconds to allow the shell commands to run.

        - `call_id: string`

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

        - `type: "shell_call"`

          The type of the item. Always `shell_call`.

          - `"shell_call"`

        - `id?: string | null`

          The unique ID of the shell tool call. Populated when this item is returned via API.

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `caller?: Direct | Program | null`

          The execution context that produced this tool call.

          - `Direct`

            - `type: "direct"`

              The caller type. Always `direct`.

              - `"direct"`

          - `Program`

            - `caller_id: string`

              The call ID of the program item that produced this tool call.

            - `type: "program"`

              The caller type. Always `program`.

              - `"program"`

        - `environment?: BetaLocalEnvironment | BetaContainerReference | null`

          The environment to execute the shell commands in.

          - `BetaLocalEnvironment`

          - `BetaContainerReference`

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

          The status of the shell call. One of `in_progress`, `completed`, or `incomplete`.

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

      - `ShellCallOutput`

        The streamed output items emitted by a shell tool call.

        - `call_id: string`

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

        - `output: Array<BetaResponseFunctionShellCallOutputContent>`

          Captured chunks of stdout and stderr output, along with their associated outcomes.

          - `outcome: Timeout | Exit`

            The exit or timeout outcome associated with this shell call.

            - `Timeout`

              Indicates that the shell call exceeded its configured time limit.

              - `type: "timeout"`

                The outcome type. Always `timeout`.

                - `"timeout"`

            - `Exit`

              Indicates that the shell commands finished and returned an exit code.

              - `exit_code: number`

                The exit code returned by the shell process.

              - `type: "exit"`

                The outcome type. Always `exit`.

                - `"exit"`

          - `stderr: string`

            Captured stderr output for the shell call.

          - `stdout: string`

            Captured stdout output for the shell call.

        - `type: "shell_call_output"`

          The type of the item. Always `shell_call_output`.

          - `"shell_call_output"`

        - `id?: string | null`

          The unique ID of the shell tool call output. Populated when this item is returned via API.

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `caller?: Direct | Program | null`

          The execution context that produced this tool call.

          - `Direct`

            - `type: "direct"`

              The caller type. Always `direct`.

              - `"direct"`

          - `Program`

            - `caller_id: string`

              The call ID of the program item that produced this tool call.

            - `type: "program"`

              The caller type. Always `program`.

              - `"program"`

        - `max_output_length?: number | null`

          The maximum number of UTF-8 characters captured for this shell call's combined output.

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

          The status of the shell call output.

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

      - `ApplyPatchCall`

        A tool call representing a request to create, delete, or update files using diff patches.

        - `call_id: string`

          The unique ID of the apply patch tool call generated by the model.

        - `operation: CreateFile | DeleteFile | UpdateFile`

          The specific create, delete, or update instruction for the apply_patch tool call.

          - `CreateFile`

            Instruction for creating a new file via the apply_patch tool.

            - `diff: string`

              Unified diff content to apply when creating the file.

            - `path: string`

              Path of the file to create relative to the workspace root.

            - `type: "create_file"`

              The operation type. Always `create_file`.

              - `"create_file"`

          - `DeleteFile`

            Instruction for deleting an existing file via the apply_patch tool.

            - `path: string`

              Path of the file to delete relative to the workspace root.

            - `type: "delete_file"`

              The operation type. Always `delete_file`.

              - `"delete_file"`

          - `UpdateFile`

            Instruction for updating an existing file via the apply_patch tool.

            - `diff: string`

              Unified diff content to apply to the existing file.

            - `path: string`

              Path of the file to update relative to the workspace root.

            - `type: "update_file"`

              The operation type. Always `update_file`.

              - `"update_file"`

        - `status: "in_progress" | "completed"`

          The status of the apply patch tool call. One of `in_progress` or `completed`.

          - `"in_progress"`

          - `"completed"`

        - `type: "apply_patch_call"`

          The type of the item. Always `apply_patch_call`.

          - `"apply_patch_call"`

        - `id?: string | null`

          The unique ID of the apply patch tool call. Populated when this item is returned via API.

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `caller?: Direct | Program | null`

          The execution context that produced this tool call.

          - `Direct`

            - `type: "direct"`

              The caller type. Always `direct`.

              - `"direct"`

          - `Program`

            - `caller_id: string`

              The call ID of the program item that produced this tool call.

            - `type: "program"`

              The caller type. Always `program`.

              - `"program"`

      - `ApplyPatchCallOutput`

        The streamed output emitted by an apply patch tool call.

        - `call_id: string`

          The unique ID of the apply patch tool call generated by the model.

        - `status: "completed" | "failed"`

          The status of the apply patch tool call output. One of `completed` or `failed`.

          - `"completed"`

          - `"failed"`

        - `type: "apply_patch_call_output"`

          The type of the item. Always `apply_patch_call_output`.

          - `"apply_patch_call_output"`

        - `id?: string | null`

          The unique ID of the apply patch tool call output. Populated when this item is returned via API.

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `caller?: Direct | Program | null`

          The execution context that produced this tool call.

          - `Direct`

            - `type: "direct"`

              The caller type. Always `direct`.

              - `"direct"`

          - `Program`

            - `caller_id: string`

              The call ID of the program item that produced this tool call.

            - `type: "program"`

              The caller type. Always `program`.

              - `"program"`

        - `output?: string | null`

          Optional human-readable log text from the apply patch tool (e.g., patch results or errors).

      - `McpListTools`

        A list of tools available on an MCP server.

        - `id: string`

          The unique ID of the list.

        - `server_label: string`

          The label of the MCP server.

        - `tools: Array<Tool>`

          The tools available on the server.

          - `input_schema: unknown`

            The JSON schema describing the tool's input.

          - `name: string`

            The name of the tool.

          - `annotations?: unknown`

            Additional annotations about the tool.

          - `description?: string | null`

            The description of the tool.

        - `type: "mcp_list_tools"`

          The type of the item. Always `mcp_list_tools`.

          - `"mcp_list_tools"`

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `error?: string | null`

          Error message if the server could not list tools.

      - `McpApprovalRequest`

        A request for human approval of a tool invocation.

        - `id: string`

          The unique ID of the approval request.

        - `arguments: string`

          A JSON string of arguments for the tool.

        - `name: string`

          The name of the tool to run.

        - `server_label: string`

          The label of the MCP server making the request.

        - `type: "mcp_approval_request"`

          The type of the item. Always `mcp_approval_request`.

          - `"mcp_approval_request"`

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

      - `McpApprovalResponse`

        A response to an MCP approval request.

        - `approval_request_id: string`

          The ID of the approval request being answered.

        - `approve: boolean`

          Whether the request was approved.

        - `type: "mcp_approval_response"`

          The type of the item. Always `mcp_approval_response`.

          - `"mcp_approval_response"`

        - `id?: string | null`

          The unique ID of the approval response

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `reason?: string | null`

          Optional reason for the decision.

      - `McpCall`

        An invocation of a tool on an MCP server.

        - `id: string`

          The unique ID of the tool call.

        - `arguments: string`

          A JSON string of the arguments passed to the tool.

        - `name: string`

          The name of the tool that was run.

        - `server_label: string`

          The label of the MCP server running the tool.

        - `type: "mcp_call"`

          The type of the item. Always `mcp_call`.

          - `"mcp_call"`

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `approval_request_id?: string | null`

          Unique identifier for the MCP tool call approval request.
          Include this value in a subsequent `mcp_approval_response` input to approve or reject the corresponding tool call.

        - `error?: BetaMcpToolCallError | null`

          The error from the tool call, if any.

          - `McpProtocolError`

            - `code: number`

            - `message: string`

            - `type: "mcp_protocol_error"`

              - `"mcp_protocol_error"`

          - `McpToolExecutionError`

            - `content: unknown`

            - `type: "mcp_tool_execution_error"`

              - `"mcp_tool_execution_error"`

          - `HTTPError`

            - `code: number`

            - `message: string`

            - `type: "http_error"`

              - `"http_error"`

        - `output?: string | null`

          The output from the tool call.

        - `status?: "in_progress" | "completed" | "incomplete" | 2 more`

          The status of the tool call. One of `in_progress`, `completed`, `incomplete`, `calling`, or `failed`.

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

          - `"calling"`

          - `"failed"`

      - `BetaResponseCustomToolCallOutput`

        The output of a custom tool call from your code, being sent back to the model.

        - `call_id: string`

          The call ID, used to map this custom tool call output to a custom tool call.

        - `output: string | Array<BetaResponseInputText | BetaResponseInputImage | BetaResponseInputFile>`

          The output from the custom tool call generated by your code.
          Can be a string or an list of output content.

          - `string`

          - `Array<BetaResponseInputText | BetaResponseInputImage | BetaResponseInputFile>`

            - `BetaResponseInputText`

              A text input to the model.

            - `BetaResponseInputImage`

              An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision).

            - `BetaResponseInputFile`

              A file input to the model.

        - `type: "custom_tool_call_output"`

          The type of the custom tool call output. Always `custom_tool_call_output`.

          - `"custom_tool_call_output"`

        - `id?: string`

          The unique ID of the custom tool call output in the OpenAI platform.

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `caller?: Direct | Program | null`

          The execution context that produced this tool call.

          - `Direct`

            - `type: "direct"`

              The caller type. Always `direct`.

              - `"direct"`

          - `Program`

            - `caller_id: string`

              The call ID of the program item that produced this tool call.

            - `type: "program"`

              The caller type. Always `program`.

              - `"program"`

      - `BetaResponseCustomToolCall`

        A call to a custom tool created by the model.

        - `call_id: string`

          An identifier used to map this custom tool call to a tool call output.

        - `input: string`

          The input for the custom tool call generated by the model.

        - `name: string`

          The name of the custom tool being called.

        - `type: "custom_tool_call"`

          The type of the custom tool call. Always `custom_tool_call`.

          - `"custom_tool_call"`

        - `id?: string`

          The unique ID of the custom tool call in the OpenAI platform.

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `caller?: Direct | Program | null`

          The execution context that produced this tool call.

          - `Direct`

            - `type: "direct"`

              - `"direct"`

          - `Program`

            - `caller_id: string`

              The call ID of the program item that produced this tool call.

            - `type: "program"`

              - `"program"`

        - `namespace?: string`

          The namespace of the custom tool being called.

      - `CompactionTrigger`

        Compacts the current context. Must be the final input item.

        - `type: "compaction_trigger"`

          The type of the item. Always `compaction_trigger`.

          - `"compaction_trigger"`

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

      - `ItemReference`

        An internal identifier for an item to reference.

        - `id: string`

          The ID of the item to reference.

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `type?: "item_reference" | null`

          The type of item to reference. Always `item_reference`.

          - `"item_reference"`

      - `Program`

        - `id: string`

          The unique ID of this program item.

        - `call_id: string`

          The stable call ID of the program item.

        - `code: string`

          The JavaScript source executed by programmatic tool calling.

        - `fingerprint: string`

          Opaque program replay fingerprint that must be round-tripped.

        - `type: "program"`

          The item type. Always `program`.

          - `"program"`

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

      - `ProgramOutput`

        - `id: string`

          The unique ID of this program output item.

        - `call_id: string`

          The call ID of the program item.

        - `result: string`

          The result produced by the program item.

        - `status: "completed" | "incomplete"`

          The terminal status of the program output.

          - `"completed"`

          - `"incomplete"`

        - `type: "program_output"`

          The item type. Always `program_output`.

          - `"program_output"`

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

  - `metadata: Record<string, string> | null`

    Set of 16 key-value pairs that can be attached to an object. This can be
    useful for storing additional information about the object in a structured
    format, and querying for objects via API or the dashboard.

    Keys are strings with a maximum length of 64 characters. Values are strings
    with a maximum length of 512 characters.

  - `model: "gpt-5.6-sol" | "gpt-5.6-terra" | "gpt-5.6-luna" | 99 more | (string & {})`

    Model ID used to generate the response, like `gpt-4o` or `o3`. OpenAI
    offers a wide range of models with different capabilities, performance
    characteristics, and price points. Refer to the [model guide](https://platform.openai.com/docs/models)
    to browse and compare available models.

    - `"gpt-5.6-sol" | "gpt-5.6-terra" | "gpt-5.6-luna" | 99 more`

      - `"gpt-5.6-sol"`

      - `"gpt-5.6-terra"`

      - `"gpt-5.6-luna"`

      - `"gpt-5.5"`

      - `"gpt-5.5-2026-04-23"`

      - `"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.5-pro"`

      - `"gpt-5.5-pro-2026-04-23"`

      - `"gpt-5-codex"`

      - `"gpt-5-pro"`

      - `"gpt-5-pro-2025-10-06"`

      - `"gpt-5.1-codex-max"`

      - `"gpt-daybreak-blue-latest"`

      - `"gpt-daybreak-red-latest"`

      - `"gpt-5.6-cyber"`

    - `(string & {})`

  - `object: "response"`

    The object type of this resource - always set to `response`.

    - `"response"`

  - `output: Array<BetaResponseOutputItem>`

    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.

    - `BetaResponseOutputMessage`

      An output message from the model.

    - `BetaResponseFileSearchToolCall`

      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.

    - `BetaResponseFunctionToolCall`

      A tool call to run a function. See the
      [function calling guide](https://platform.openai.com/docs/guides/function-calling) for more information.

    - `BetaResponseFunctionToolCallOutputItem`

      - `id: string`

        The unique ID of the function call tool output.

      - `call_id: string`

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

      - `output: string | Array<BetaResponseInputText | BetaResponseInputImage | BetaResponseInputFile>`

        The output from the function call generated by your code.
        Can be a string or an list of output content.

        - `string`

        - `Array<BetaResponseInputText | BetaResponseInputImage | BetaResponseInputFile>`

          - `BetaResponseInputText`

            A text input to the model.

          - `BetaResponseInputImage`

            An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision).

          - `BetaResponseInputFile`

            A file input to 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.

        - `"in_progress"`

        - `"completed"`

        - `"incomplete"`

      - `type: "function_call_output"`

        The type of the function tool call output. Always `function_call_output`.

        - `"function_call_output"`

      - `agent?: Agent | null`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

      - `caller?: Direct | Program | null`

        The execution context that produced this tool call.

        - `Direct`

          - `type: "direct"`

            The caller type. Always `direct`.

            - `"direct"`

        - `Program`

          - `caller_id: string`

            The call ID of the program item that produced this tool call.

          - `type: "program"`

            The caller type. Always `program`.

            - `"program"`

      - `created_by?: string`

        The identifier of the actor that created the item.

      - `name?: string`

        The name of the tool that produced the output.

      - `namespace?: string`

        The namespace of the tool that produced the output.

    - `AgentMessage`

      - `id: string`

        The unique ID of the agent message.

      - `author: string`

        The sending agent identity.

      - `content: Array<BetaResponseInputText | BetaResponseOutputText | Text | 7 more>`

        Encrypted content sent between agents.

        - `BetaResponseInputText`

          A text input to the model.

        - `BetaResponseOutputText`

          A text output from the model.

        - `Text`

          A text content.

          - `text: string`

          - `type: "text"`

            - `"text"`

        - `SummaryText`

          A summary text from the model.

          - `text: string`

            A summary of the reasoning output from the model so far.

          - `type: "summary_text"`

            The type of the object. Always `summary_text`.

            - `"summary_text"`

        - `ReasoningText`

          Reasoning text from the model.

          - `text: string`

            The reasoning text from the model.

          - `type: "reasoning_text"`

            The type of the reasoning text. Always `reasoning_text`.

            - `"reasoning_text"`

        - `BetaResponseOutputRefusal`

          A refusal from the model.

        - `BetaResponseInputImage`

          An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision).

        - `ComputerScreenshot`

          A screenshot of a computer.

          - `detail: BetaImageDetail`

            The detail level of the screenshot image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`.

          - `file_id: string | null`

            The identifier of an uploaded file that contains the screenshot.

          - `image_url: string | null`

            The URL of the screenshot image.

          - `type: "computer_screenshot"`

            Specifies the event type. For a computer screenshot, this property is always set to `computer_screenshot`.

            - `"computer_screenshot"`

          - `prompt_cache_breakpoint?: PromptCacheBreakpoint`

            Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.

            - `mode: "explicit"`

              The breakpoint mode. Always `explicit`.

              - `"explicit"`

        - `BetaResponseInputFile`

          A file input to the model.

        - `EncryptedContent`

          Opaque encrypted content that Responses API decrypts inside trusted model execution.

          - `encrypted_content: string`

            Opaque encrypted content.

          - `type: "encrypted_content"`

            The type of the input item. Always `encrypted_content`.

            - `"encrypted_content"`

      - `recipient: string`

        The destination agent identity.

      - `type: "agent_message"`

        The type of the item. Always `agent_message`.

        - `"agent_message"`

      - `agent?: Agent`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

    - `MultiAgentCall`

      - `id: string`

        The unique ID of the multi-agent call item.

      - `action: "spawn_agent" | "interrupt_agent" | "list_agents" | 3 more`

        The multi-agent action to execute.

        - `"spawn_agent"`

        - `"interrupt_agent"`

        - `"list_agents"`

        - `"send_message"`

        - `"followup_task"`

        - `"wait_agent"`

      - `arguments: string`

        The JSON string of arguments generated for the action.

      - `call_id: string`

        The unique ID linking this call to its output.

      - `type: "multi_agent_call"`

        The type of the multi-agent call. Always `multi_agent_call`.

        - `"multi_agent_call"`

      - `agent?: Agent`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

    - `MultiAgentCallOutput`

      - `id: string`

        The unique ID of the multi-agent call output item.

      - `action: "spawn_agent" | "interrupt_agent" | "list_agents" | 3 more`

        The multi-agent action that produced this result.

        - `"spawn_agent"`

        - `"interrupt_agent"`

        - `"list_agents"`

        - `"send_message"`

        - `"followup_task"`

        - `"wait_agent"`

      - `call_id: string`

        The unique ID of the multi-agent call.

      - `output: Array<BetaResponseOutputText>`

        Text output returned by the multi-agent action.

        - `annotations: Array<FileCitation | URLCitation | ContainerFileCitation | FilePath>`

          The annotations of the text output.

        - `text: string`

          The text output from the model.

        - `type: "output_text"`

          The type of the output text. Always `output_text`.

        - `logprobs?: Array<Logprob>`

      - `type: "multi_agent_call_output"`

        The type of the multi-agent result. Always `multi_agent_call_output`.

        - `"multi_agent_call_output"`

      - `agent?: Agent`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

    - `BetaResponseFunctionWebSearch`

      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.

    - `BetaResponseComputerToolCall`

      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.

    - `BetaResponseComputerToolCallOutputItem`

      - `id: string`

        The unique ID of the computer call tool output.

      - `call_id: string`

        The ID of the computer tool call that produced the output.

      - `output: BetaResponseComputerToolCallOutputScreenshot`

        A computer screenshot image used with the computer use tool.

      - `status: "completed" | "incomplete" | "failed" | "in_progress"`

        The status of the message input. One of `in_progress`, `completed`, or
        `incomplete`. Populated when input items are returned via API.

        - `"completed"`

        - `"incomplete"`

        - `"failed"`

        - `"in_progress"`

      - `type: "computer_call_output"`

        The type of the computer tool call output. Always `computer_call_output`.

        - `"computer_call_output"`

      - `acknowledged_safety_checks?: Array<AcknowledgedSafetyCheck>`

        The safety checks reported by the API that have been acknowledged by the
        developer.

        - `id: string`

          The ID of the pending safety check.

        - `code?: string | null`

          The type of the pending safety check.

        - `message?: string | null`

          Details about the pending safety check.

      - `agent?: Agent | null`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

      - `created_by?: string`

        The identifier of the actor that created the item.

    - `BetaResponseReasoningItem`

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

    - `Program`

      - `id: string`

        The unique ID of the program item.

      - `call_id: string`

        The stable call ID of the program item.

      - `code: string`

        The JavaScript source executed by programmatic tool calling.

      - `fingerprint: string`

        Opaque program replay fingerprint that must be round-tripped.

      - `type: "program"`

        The type of the item. Always `program`.

        - `"program"`

      - `agent?: Agent`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

    - `ProgramOutput`

      - `id: string`

        The unique ID of the program output item.

      - `call_id: string`

        The call ID of the program item.

      - `result: string`

        The result produced by the program item.

      - `status: "completed" | "incomplete"`

        The terminal status of the program output item.

        - `"completed"`

        - `"incomplete"`

      - `type: "program_output"`

        The type of the item. Always `program_output`.

        - `"program_output"`

      - `agent?: Agent`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

    - `BetaResponseToolSearchCall`

      - `id: string`

        The unique ID of the tool search call item.

      - `arguments: unknown`

        Arguments used for the tool search call.

      - `call_id: string | null`

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

      - `execution: "server" | "client"`

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

        - `"server"`

        - `"client"`

      - `status: "in_progress" | "completed" | "incomplete"`

        The status of the tool search call item that was recorded.

        - `"in_progress"`

        - `"completed"`

        - `"incomplete"`

      - `type: "tool_search_call"`

        The type of the item. Always `tool_search_call`.

        - `"tool_search_call"`

      - `agent?: Agent`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

      - `created_by?: string`

        The identifier of the actor that created the item.

    - `BetaResponseToolSearchOutputItem`

      - `id: string`

        The unique ID of the tool search output item.

      - `call_id: string | null`

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

      - `execution: "server" | "client"`

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

        - `"server"`

        - `"client"`

      - `status: "in_progress" | "completed" | "incomplete"`

        The status of the tool search output item that was recorded.

        - `"in_progress"`

        - `"completed"`

        - `"incomplete"`

      - `tools: Array<BetaTool>`

        The loaded tool definitions returned by tool search.

        - `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).

        - `Mcp`

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

        - `CodeInterpreter`

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

        - `ProgrammaticToolCalling`

        - `ImageGeneration`

          A tool that generates images using the GPT image models.

        - `LocalShell`

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

        - `BetaFunctionShellTool`

          A tool that allows the model to execute shell commands.

        - `BetaCustomTool`

          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)

        - `BetaNamespaceTool`

          Groups function/custom tools under a shared namespace.

        - `BetaToolSearchTool`

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

        - `BetaApplyPatchTool`

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

      - `type: "tool_search_output"`

        The type of the item. Always `tool_search_output`.

        - `"tool_search_output"`

      - `agent?: Agent`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

      - `created_by?: string`

        The identifier of the actor that created the item.

    - `AdditionalTools`

      - `id: string`

        The unique ID of the additional tools item.

      - `role: "unknown" | "user" | "assistant" | 5 more`

        The role that provided the additional tools.

        - `"unknown"`

        - `"user"`

        - `"assistant"`

        - `"system"`

        - `"critic"`

        - `"discriminator"`

        - `"developer"`

        - `"tool"`

      - `tools: Array<BetaTool>`

        The additional tool definitions made available at this item.

        - `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).

        - `Mcp`

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

        - `CodeInterpreter`

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

        - `ProgrammaticToolCalling`

        - `ImageGeneration`

          A tool that generates images using the GPT image models.

        - `LocalShell`

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

        - `BetaFunctionShellTool`

          A tool that allows the model to execute shell commands.

        - `BetaCustomTool`

          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)

        - `BetaNamespaceTool`

          Groups function/custom tools under a shared namespace.

        - `BetaToolSearchTool`

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

        - `BetaApplyPatchTool`

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

      - `type: "additional_tools"`

        The type of the item. Always `additional_tools`.

        - `"additional_tools"`

      - `agent?: Agent`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

    - `BetaResponseCompactionItem`

      A compaction item generated by the [`v1/responses/compact` API](https://platform.openai.com/docs/api-reference/responses/compact).

      - `id: string`

        The unique ID of the compaction item.

      - `encrypted_content: string`

        The encrypted content that was produced by compaction.

      - `type: "compaction"`

        The type of the item. Always `compaction`.

        - `"compaction"`

      - `agent?: Agent`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

      - `created_by?: string`

        The identifier of the actor that created the item.

    - `ImageGenerationCall`

      An image generation request made by the model.

      - `id: string`

        The unique ID of the image generation call.

      - `result: string | null`

        The generated image encoded in base64.

      - `status: "in_progress" | "completed" | "generating" | "failed"`

        The status of the image generation call.

        - `"in_progress"`

        - `"completed"`

        - `"generating"`

        - `"failed"`

      - `type: "image_generation_call"`

        The type of the image generation call. Always `image_generation_call`.

        - `"image_generation_call"`

      - `agent?: Agent | null`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

    - `BetaResponseCodeInterpreterToolCall`

      A tool call to run code.

    - `LocalShellCall`

      A tool call to run a command on the local shell.

      - `id: string`

        The unique ID of the local shell call.

      - `action: Action`

        Execute a shell command on the server.

        - `command: Array<string>`

          The command to run.

        - `env: Record<string, string>`

          Environment variables to set for the command.

        - `type: "exec"`

          The type of the local shell action. Always `exec`.

          - `"exec"`

        - `timeout_ms?: number | null`

          Optional timeout in milliseconds for the command.

        - `user?: string | null`

          Optional user to run the command as.

        - `working_directory?: string | null`

          Optional working directory to run the command in.

      - `call_id: string`

        The unique ID of the local shell tool call generated by the model.

      - `status: "in_progress" | "completed" | "incomplete"`

        The status of the local shell call.

        - `"in_progress"`

        - `"completed"`

        - `"incomplete"`

      - `type: "local_shell_call"`

        The type of the local shell call. Always `local_shell_call`.

        - `"local_shell_call"`

      - `agent?: Agent | null`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

    - `LocalShellCallOutput`

      The output of a local shell tool call.

      - `id: string`

        The unique ID of the local shell tool call generated by the model.

      - `output: string`

        A JSON string of the output of the local shell tool call.

      - `type: "local_shell_call_output"`

        The type of the local shell tool call output. Always `local_shell_call_output`.

        - `"local_shell_call_output"`

      - `agent?: Agent | null`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

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

        The status of the item. One of `in_progress`, `completed`, or `incomplete`.

        - `"in_progress"`

        - `"completed"`

        - `"incomplete"`

    - `BetaResponseFunctionShellToolCall`

      A tool call that executes one or more shell commands in a managed environment.

      - `id: string`

        The unique ID of the shell tool call. Populated when this item is returned via API.

      - `action: Action`

        The shell commands and limits that describe how to run the tool call.

        - `commands: Array<string>`

        - `max_output_length: number | null`

          Optional maximum number of characters to return from each command.

        - `timeout_ms: number | null`

          Optional timeout in milliseconds for the commands.

      - `call_id: string`

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

      - `environment: BetaResponseLocalEnvironment | BetaResponseContainerReference | null`

        Represents the use of a local environment to perform shell actions.

        - `BetaResponseLocalEnvironment`

          Represents the use of a local environment to perform shell actions.

          - `type: "local"`

            The environment type. Always `local`.

            - `"local"`

        - `BetaResponseContainerReference`

          Represents a container created with /v1/containers.

          - `container_id: string`

          - `type: "container_reference"`

            The environment type. Always `container_reference`.

            - `"container_reference"`

      - `status: "in_progress" | "completed" | "incomplete"`

        The status of the shell call. One of `in_progress`, `completed`, or `incomplete`.

        - `"in_progress"`

        - `"completed"`

        - `"incomplete"`

      - `type: "shell_call"`

        The type of the item. Always `shell_call`.

        - `"shell_call"`

      - `agent?: Agent`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

      - `caller?: Direct | Program | null`

        The execution context that produced this tool call.

        - `Direct`

          - `type: "direct"`

            - `"direct"`

        - `Program`

          - `caller_id: string`

            The call ID of the program item that produced this tool call.

          - `type: "program"`

            - `"program"`

      - `created_by?: string`

        The ID of the entity that created this tool call.

    - `BetaResponseFunctionShellToolCallOutput`

      The output of a shell tool call that was emitted.

      - `id: string`

        The unique ID of the shell call output. Populated when this item is returned via API.

      - `call_id: string`

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

      - `max_output_length: number | null`

        The maximum length of the shell command output. This is generated by the model and should be passed back with the raw output.

      - `output: Array<Output>`

        An array of shell call output contents

        - `outcome: Timeout | Exit`

          Represents either an exit outcome (with an exit code) or a timeout outcome for a shell call output chunk.

          - `Timeout`

            Indicates that the shell call exceeded its configured time limit.

            - `type: "timeout"`

              The outcome type. Always `timeout`.

              - `"timeout"`

          - `Exit`

            Indicates that the shell commands finished and returned an exit code.

            - `exit_code: number`

              Exit code from the shell process.

            - `type: "exit"`

              The outcome type. Always `exit`.

              - `"exit"`

        - `stderr: string`

          The standard error output that was captured.

        - `stdout: string`

          The standard output that was captured.

        - `created_by?: string`

          The identifier of the actor that created the item.

      - `status: "in_progress" | "completed" | "incomplete"`

        The status of the shell call output. One of `in_progress`, `completed`, or `incomplete`.

        - `"in_progress"`

        - `"completed"`

        - `"incomplete"`

      - `type: "shell_call_output"`

        The type of the shell call output. Always `shell_call_output`.

        - `"shell_call_output"`

      - `agent?: Agent`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

      - `caller?: Direct | Program | null`

        The execution context that produced this tool call.

        - `Direct`

          - `type: "direct"`

            - `"direct"`

        - `Program`

          - `caller_id: string`

            The call ID of the program item that produced this tool call.

          - `type: "program"`

            - `"program"`

      - `created_by?: string`

        The identifier of the actor that created the item.

    - `BetaResponseApplyPatchToolCall`

      A tool call that applies file diffs by creating, deleting, or updating files.

      - `id: string`

        The unique ID of the apply patch tool call. Populated when this item is returned via API.

      - `call_id: string`

        The unique ID of the apply patch tool call generated by the model.

      - `operation: CreateFile | DeleteFile | UpdateFile`

        One of the create_file, delete_file, or update_file operations applied via apply_patch.

        - `CreateFile`

          Instruction describing how to create a file via the apply_patch tool.

          - `diff: string`

            Diff to apply.

          - `path: string`

            Path of the file to create.

          - `type: "create_file"`

            Create a new file with the provided diff.

            - `"create_file"`

        - `DeleteFile`

          Instruction describing how to delete a file via the apply_patch tool.

          - `path: string`

            Path of the file to delete.

          - `type: "delete_file"`

            Delete the specified file.

            - `"delete_file"`

        - `UpdateFile`

          Instruction describing how to update a file via the apply_patch tool.

          - `diff: string`

            Diff to apply.

          - `path: string`

            Path of the file to update.

          - `type: "update_file"`

            Update an existing file with the provided diff.

            - `"update_file"`

      - `status: "in_progress" | "completed"`

        The status of the apply patch tool call. One of `in_progress` or `completed`.

        - `"in_progress"`

        - `"completed"`

      - `type: "apply_patch_call"`

        The type of the item. Always `apply_patch_call`.

        - `"apply_patch_call"`

      - `agent?: Agent`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

      - `caller?: Direct | Program | null`

        The execution context that produced this tool call.

        - `Direct`

          - `type: "direct"`

            - `"direct"`

        - `Program`

          - `caller_id: string`

            The call ID of the program item that produced this tool call.

          - `type: "program"`

            - `"program"`

      - `created_by?: string`

        The ID of the entity that created this tool call.

    - `BetaResponseApplyPatchToolCallOutput`

      The output emitted by an apply patch tool call.

      - `id: string`

        The unique ID of the apply patch tool call output. Populated when this item is returned via API.

      - `call_id: string`

        The unique ID of the apply patch tool call generated by the model.

      - `status: "completed" | "failed"`

        The status of the apply patch tool call output. One of `completed` or `failed`.

        - `"completed"`

        - `"failed"`

      - `type: "apply_patch_call_output"`

        The type of the item. Always `apply_patch_call_output`.

        - `"apply_patch_call_output"`

      - `agent?: Agent`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

      - `caller?: Direct | Program | null`

        The execution context that produced this tool call.

        - `Direct`

          - `type: "direct"`

            - `"direct"`

        - `Program`

          - `caller_id: string`

            The call ID of the program item that produced this tool call.

          - `type: "program"`

            - `"program"`

      - `created_by?: string`

        The ID of the entity that created this tool call output.

      - `output?: string | null`

        Optional textual output returned by the apply patch tool.

    - `McpCall`

      An invocation of a tool on an MCP server.

      - `id: string`

        The unique ID of the tool call.

      - `arguments: string`

        A JSON string of the arguments passed to the tool.

      - `name: string`

        The name of the tool that was run.

      - `server_label: string`

        The label of the MCP server running the tool.

      - `type: "mcp_call"`

        The type of the item. Always `mcp_call`.

        - `"mcp_call"`

      - `agent?: Agent | null`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

      - `approval_request_id?: string | null`

        Unique identifier for the MCP tool call approval request.
        Include this value in a subsequent `mcp_approval_response` input to approve or reject the corresponding tool call.

      - `error?: BetaMcpToolCallError | null`

        The error from the tool call, if any.

      - `output?: string | null`

        The output from the tool call.

      - `status?: "in_progress" | "completed" | "incomplete" | 2 more`

        The status of the tool call. One of `in_progress`, `completed`, `incomplete`, `calling`, or `failed`.

        - `"in_progress"`

        - `"completed"`

        - `"incomplete"`

        - `"calling"`

        - `"failed"`

    - `McpListTools`

      A list of tools available on an MCP server.

      - `id: string`

        The unique ID of the list.

      - `server_label: string`

        The label of the MCP server.

      - `tools: Array<Tool>`

        The tools available on the server.

        - `input_schema: unknown`

          The JSON schema describing the tool's input.

        - `name: string`

          The name of the tool.

        - `annotations?: unknown`

          Additional annotations about the tool.

        - `description?: string | null`

          The description of the tool.

      - `type: "mcp_list_tools"`

        The type of the item. Always `mcp_list_tools`.

        - `"mcp_list_tools"`

      - `agent?: Agent | null`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

      - `error?: string | null`

        Error message if the server could not list tools.

    - `McpApprovalRequest`

      A request for human approval of a tool invocation.

      - `id: string`

        The unique ID of the approval request.

      - `arguments: string`

        A JSON string of arguments for the tool.

      - `name: string`

        The name of the tool to run.

      - `server_label: string`

        The label of the MCP server making the request.

      - `type: "mcp_approval_request"`

        The type of the item. Always `mcp_approval_request`.

        - `"mcp_approval_request"`

      - `agent?: Agent | null`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

    - `McpApprovalResponse`

      A response to an MCP approval request.

      - `id: string`

        The unique ID of the approval response

      - `approval_request_id: string`

        The ID of the approval request being answered.

      - `approve: boolean`

        Whether the request was approved.

      - `type: "mcp_approval_response"`

        The type of the item. Always `mcp_approval_response`.

        - `"mcp_approval_response"`

      - `agent?: Agent | null`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

      - `reason?: string | null`

        Optional reason for the decision.

    - `BetaResponseCustomToolCall`

      A call to a custom tool created by the model.

    - `BetaResponseCustomToolCallOutputItem extends BetaResponseCustomToolCallOutput`

      The output of a custom tool call from your code, being sent back to the model.

      - `id: string`

        The unique ID of the custom tool call output item.

      - `status: "in_progress" | "completed" | "incomplete"`

        The status of the item. One of `in_progress`, `completed`, or
        `incomplete`. Populated when items are returned via API.

        - `"in_progress"`

        - `"completed"`

        - `"incomplete"`

      - `created_by?: string`

        The identifier of the actor that created the item.

  - `parallel_tool_calls: boolean`

    Whether to allow the model to run tool calls in parallel.

  - `temperature: number | null`

    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.

  - `tool_choice: BetaToolChoiceOptions | BetaToolChoiceAllowed | BetaToolChoiceTypes | 6 more`

    How the model should select which tool (or tools) to use when generating
    a response. See the `tools` parameter to see how to specify which tools
    the model can call.

    - `BetaToolChoiceOptions = "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.

      - `"none"`

      - `"auto"`

      - `"required"`

    - `BetaToolChoiceAllowed`

      Constrains the tools available to the model to a pre-defined set.

      - `mode: "auto" | "required"`

        Constrains the tools available to the model to a pre-defined set.

        `auto` allows the model to pick from among the allowed tools and generate a
        message.

        `required` requires the model to call one or more of the allowed tools.

        - `"auto"`

        - `"required"`

      - `tools: Array<Record<string, unknown>>`

        A list of tool definitions that the model should be allowed to call.

        For the Responses API, the list of tool definitions might look like:

        ```json
        [
          { "type": "function", "name": "get_weather" },
          { "type": "mcp", "server_label": "deepwiki" },
          { "type": "image_generation" }
        ]
        ```

      - `type: "allowed_tools"`

        Allowed tool configuration type. Always `allowed_tools`.

        - `"allowed_tools"`

    - `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" | 5 more`

        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`

        - `"file_search"`

        - `"web_search_preview"`

        - `"computer"`

        - `"computer_use_preview"`

        - `"computer_use"`

        - `"web_search_preview_2025_03_11"`

        - `"image_generation"`

        - `"code_interpreter"`

    - `BetaToolChoiceFunction`

      Use this option to force the model to call a specific function.

      - `name: string`

        The name of the function to call.

      - `type: "function"`

        For function calling, the type is always `function`.

        - `"function"`

    - `BetaToolChoiceMcp`

      Use this option to force the model to call a specific tool on a remote MCP server.

      - `server_label: string`

        The label of the MCP server to use.

      - `type: "mcp"`

        For MCP tools, the type is always `mcp`.

        - `"mcp"`

      - `name?: string | null`

        The name of the tool to call on the server.

    - `BetaToolChoiceCustom`

      Use this option to force the model to call a specific custom tool.

      - `name: string`

        The name of the custom tool to call.

      - `type: "custom"`

        For custom tool calling, the type is always `custom`.

        - `"custom"`

    - `BetaSpecificProgrammaticToolCallingParam`

      - `type: "programmatic_tool_calling"`

        The tool to call. Always `programmatic_tool_calling`.

        - `"programmatic_tool_calling"`

    - `BetaToolChoiceApplyPatch`

      Forces the model to call the apply_patch tool when executing a tool call.

      - `type: "apply_patch"`

        The tool to call. Always `apply_patch`.

        - `"apply_patch"`

    - `BetaToolChoiceShell`

      Forces the model to call the shell tool when a tool call is required.

      - `type: "shell"`

        The tool to call. Always `shell`.

        - `"shell"`

  - `tools: Array<BetaTool>`

    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.

    - `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).

    - `Mcp`

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

    - `CodeInterpreter`

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

    - `ProgrammaticToolCalling`

    - `ImageGeneration`

      A tool that generates images using the GPT image models.

    - `LocalShell`

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

    - `BetaFunctionShellTool`

      A tool that allows the model to execute shell commands.

    - `BetaCustomTool`

      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)

    - `BetaNamespaceTool`

      Groups function/custom tools under a shared namespace.

    - `BetaToolSearchTool`

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

    - `BetaApplyPatchTool`

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

  - `top_p: number | null`

    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.

  - `background?: boolean | null`

    Whether to run the model response in the background.
    [Learn more](https://platform.openai.com/docs/guides/background).

  - `completed_at?: number | null`

    Unix timestamp (in seconds) of when this Response was completed.
    Only present when the status is `completed`.

  - `conversation?: Conversation | null`

    The conversation that this response belonged to. Input items and output items from this response were automatically added to this conversation.

    - `id: string`

      The unique ID of the conversation that this response was associated with.

  - `max_output_tokens?: number | null`

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

  - `max_tool_calls?: number | null`

    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.

  - `moderation?: Moderation | null`

    Moderation results for the response input and output, if moderated completions were requested.

    - `input: ModerationResult | Error`

      Moderation for the response input.

      - `ModerationResult`

        A moderation result produced for the response input or output.

        - `categories: Record<string, boolean>`

          A dictionary of moderation categories to booleans, True if the input is flagged under this category.

        - `category_applied_input_types: Record<string, Array<"text" | "image">>`

          Which modalities of input are reflected by the score for each category.

          - `"text"`

          - `"image"`

        - `category_scores: Record<string, number>`

          A dictionary of moderation categories to scores.

        - `flagged: boolean`

          A boolean indicating whether the content was flagged by any category.

        - `model: string`

          The moderation model that produced this result.

        - `type: "moderation_result"`

          The object type, which was always `moderation_result` for successful moderation results.

          - `"moderation_result"`

      - `Error`

        An error produced while attempting moderation for the response input or output.

        - `code: string`

          The error code.

        - `message: string`

          The error message.

        - `type: "error"`

          The object type, which was always `error` for moderation failures.

          - `"error"`

    - `output: ModerationResult | Error`

      Moderation for the response output.

      - `ModerationResult`

        A moderation result produced for the response input or output.

        - `categories: Record<string, boolean>`

          A dictionary of moderation categories to booleans, True if the input is flagged under this category.

        - `category_applied_input_types: Record<string, Array<"text" | "image">>`

          Which modalities of input are reflected by the score for each category.

          - `"text"`

          - `"image"`

        - `category_scores: Record<string, number>`

          A dictionary of moderation categories to scores.

        - `flagged: boolean`

          A boolean indicating whether the content was flagged by any category.

        - `model: string`

          The moderation model that produced this result.

        - `type: "moderation_result"`

          The object type, which was always `moderation_result` for successful moderation results.

          - `"moderation_result"`

      - `Error`

        An error produced while attempting moderation for the response input or output.

        - `code: string`

          The error code.

        - `message: string`

          The error message.

        - `type: "error"`

          The object type, which was always `error` for moderation failures.

          - `"error"`

  - `previous_response_id?: string | null`

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

  - `prompt?: BetaResponsePrompt | null`

    Reference to a prompt template and its variables.
    [Learn more](https://platform.openai.com/docs/guides/text?api-mode=responses#reusable-prompts).

    - `id: string`

      The unique identifier of the prompt template to use.

    - `variables?: Record<string, string | BetaResponseInputText | BetaResponseInputImage | BetaResponseInputFile> | null`

      Optional map of values to substitute in for variables in your
      prompt. The substitution values can either be strings, or other
      Response input types like images or files.

      - `string`

      - `BetaResponseInputText`

        A text input to the model.

      - `BetaResponseInputImage`

        An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision).

      - `BetaResponseInputFile`

        A file input to the model.

    - `version?: string | null`

      Optional version of the prompt template.

  - `prompt_cache_key?: string | null`

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

  - `prompt_cache_options?: PromptCacheOptions`

    The prompt-caching options that were applied to the response. Supported for `gpt-5.6` and later models.

    - `mode: "implicit" | "explicit"`

      Whether implicit prompt-cache breakpoints were enabled.

      - `"implicit"`

      - `"explicit"`

    - `ttl: "30m"`

      The minimum lifetime applied to each cache breakpoint.

      - `"30m"`

  - `prompt_cache_retention?: "in_memory" | "24h" | null`

    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.

    - `"in_memory"`

    - `"24h"`

  - `reasoning?: Reasoning | null`

    **gpt-5 and o-series models only**

    Configuration options for
    [reasoning models](https://platform.openai.com/docs/guides/reasoning).

    - `context?: "auto" | "current_turn" | "all_turns" | null`

      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.

      - `"auto"`

      - `"current_turn"`

      - `"all_turns"`

    - `effort?: "none" | "minimal" | "low" | 4 more | null`

      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.

      - `"none"`

      - `"minimal"`

      - `"low"`

      - `"medium"`

      - `"high"`

      - `"xhigh"`

      - `"max"`

    - `generate_summary?: "auto" | "concise" | "detailed" | null`

      **Deprecated:** use `summary` instead.

      A summary of the reasoning performed by the model. This can be
      useful for debugging and understanding the model's reasoning process.
      One of `auto`, `concise`, or `detailed`.

      - `"auto"`

      - `"concise"`

      - `"detailed"`

    - `mode?: (string & {}) | "standard" | "pro"`

      Controls the reasoning execution mode for the request.

      When returned on a response, this is the effective execution mode.

      - `(string & {})`

      - `"standard" | "pro"`

        - `"standard"`

        - `"pro"`

    - `summary?: "auto" | "concise" | "detailed" | null`

      A summary of the reasoning performed by the model. This can be
      useful for debugging and understanding the model's reasoning process.
      One of `auto`, `concise`, or `detailed`.

      `concise` is supported for `computer-use-preview` models and all reasoning models after `gpt-5`.

      - `"auto"`

      - `"concise"`

      - `"detailed"`

  - `safety_identifier?: string | null`

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

  - `service_tier?: BetaServiceTier | null`

    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.
    - If set to 'ultrafast', then the request will be processed with the access-controlled Ultrafast Processing service tier. This tier is currently available for `gpt-5.6-sol`; a response served through it will show `service_tier=ultrafast`.
    - When not set, the default behavior is 'auto'.

    When the `service_tier` parameter is set, the response body will include the `service_tier` value based on the processing mode actually used to serve the request. This response value may be different from the value set in the parameter.

    - `"auto"`

    - `"default"`

    - `"flex"`

    - `"scale"`

    - `"priority"`

    - `"fast"`

    - `"ultrafast"`

  - `status?: BetaResponseStatus`

    The status of the response generation. One of `completed`, `failed`,
    `in_progress`, `cancelled`, `queued`, or `incomplete`.

    - `"completed"`

    - `"failed"`

    - `"in_progress"`

    - `"cancelled"`

    - `"queued"`

    - `"incomplete"`

  - `text?: BetaResponseTextConfig`

    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?: BetaResponseFormatTextConfig`

      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.

      - `Text`

        Default response format. Used to generate text responses.

        - `type: "text"`

          The type of response format being defined. Always `text`.

          - `"text"`

      - `BetaResponseFormatTextJSONSchemaConfig`

        JSON Schema response format. Used to generate structured JSON responses.
        Learn more about [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs).

        - `name: string`

          The name of the response format. Must be a-z, A-Z, 0-9, or contain
          underscores and dashes, with a maximum length of 64.

        - `schema: Record<string, unknown>`

          The schema for the response format, described as a JSON Schema object.
          Learn how to build JSON schemas [here](https://json-schema.org/).

        - `type: "json_schema"`

          The type of response format being defined. Always `json_schema`.

          - `"json_schema"`

        - `description?: string`

          A description of what the response format is for, used by the model to
          determine how to respond in the format.

        - `strict?: boolean | null`

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

      - `JSONObject`

        JSON object response format. An older method of generating JSON responses.
        Using `json_schema` is recommended for models that support it. Note that the
        model will not generate JSON without a system or user message instructing it
        to do so.

        - `type: "json_object"`

          The type of response format being defined. Always `json_object`.

          - `"json_object"`

    - `verbosity?: "low" | "medium" | "high" | null`

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

      - `"low"`

      - `"medium"`

      - `"high"`

  - `top_logprobs?: number | null`

    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.

  - `truncation?: "auto" | "disabled" | null`

    The truncation strategy to use for the model response.

    - `auto`: If the input to this Response exceeds
      the model's context window size, the model will truncate the
      response to fit the context window by dropping items from the beginning of the conversation.
    - `disabled` (default): If the input size will exceed the context window
      size for a model, the request will fail with a 400 error.

    - `"auto"`

    - `"disabled"`

  - `usage?: BetaResponseUsage`

    Represents token usage details including input tokens, output tokens,
    a breakdown of output tokens, and the total tokens used.

    - `input_tokens: number`

      The number of input tokens.

    - `input_tokens_details: InputTokensDetails`

      A detailed breakdown of the input tokens.

      - `cache_write_tokens: number`

        The number of input tokens that were written to the cache.

      - `cached_tokens: number`

        The number of tokens that were retrieved from the cache.
        [More on prompt caching](https://platform.openai.com/docs/guides/prompt-caching).

    - `output_tokens: number`

      The number of output tokens.

    - `output_tokens_details: OutputTokensDetails`

      A detailed breakdown of the output tokens.

      - `reasoning_tokens: number`

        The number of reasoning tokens.

    - `total_tokens: number`

      The total number of tokens used.

  - `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).

### Example

```typescript
import OpenAI from 'openai';

const client = new OpenAI({
  apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
});

const betaResponse = await client.beta.responses.retrieve('resp_677efb5139a88190b512bc3fef8e535d');

console.log(betaResponse.id);
```

#### Response

```json
{
  "id": "id",
  "created_at": 0,
  "error": {
    "code": "server_error",
    "message": "message"
  },
  "incomplete_details": {
    "reason": "max_output_tokens"
  },
  "instructions": "string",
  "metadata": {
    "foo": "string"
  },
  "model": "gpt-5.1",
  "object": "response",
  "output": [
    {
      "id": "id",
      "content": [
        {
          "annotations": [
            {
              "file_id": "file_id",
              "filename": "filename",
              "index": 0,
              "type": "file_citation"
            }
          ],
          "text": "text",
          "type": "output_text",
          "logprobs": [
            {
              "token": "token",
              "bytes": [
                0
              ],
              "logprob": 0,
              "top_logprobs": [
                {
                  "token": "token",
                  "bytes": [
                    0
                  ],
                  "logprob": 0
                }
              ]
            }
          ]
        }
      ],
      "role": "assistant",
      "status": "in_progress",
      "type": "message",
      "agent": {
        "agent_name": "agent_name"
      },
      "phase": "commentary"
    }
  ],
  "parallel_tool_calls": true,
  "temperature": 1,
  "tool_choice": "none",
  "tools": [
    {
      "name": "name",
      "parameters": {
        "foo": "bar"
      },
      "strict": true,
      "type": "function",
      "allowed_callers": [
        "direct"
      ],
      "defer_loading": true,
      "description": "description",
      "output_schema": {
        "foo": "bar"
      }
    }
  ],
  "top_p": 1,
  "background": true,
  "completed_at": 0,
  "conversation": {
    "id": "id"
  },
  "max_output_tokens": 0,
  "max_tool_calls": 0,
  "moderation": {
    "input": {
      "categories": {
        "foo": true
      },
      "category_applied_input_types": {
        "foo": [
          "text"
        ]
      },
      "category_scores": {
        "foo": 0
      },
      "flagged": true,
      "model": "model",
      "type": "moderation_result"
    },
    "output": {
      "categories": {
        "foo": true
      },
      "category_applied_input_types": {
        "foo": [
          "text"
        ]
      },
      "category_scores": {
        "foo": 0
      },
      "flagged": true,
      "model": "model",
      "type": "moderation_result"
    }
  },
  "output_text": "output_text",
  "previous_response_id": "previous_response_id",
  "prompt": {
    "id": "id",
    "variables": {
      "foo": "string"
    },
    "version": "version"
  },
  "prompt_cache_key": "prompt-cache-key-1234",
  "prompt_cache_options": {
    "mode": "implicit",
    "ttl": "30m"
  },
  "prompt_cache_retention": "in_memory",
  "reasoning": {
    "context": "auto",
    "effort": "none",
    "generate_summary": "auto",
    "mode": "standard",
    "summary": "auto"
  },
  "safety_identifier": "safety-identifier-1234",
  "service_tier": "auto",
  "status": "completed",
  "text": {
    "format": {
      "type": "text"
    },
    "verbosity": "low"
  },
  "top_logprobs": 0,
  "truncation": "auto",
  "usage": {
    "input_tokens": 0,
    "input_tokens_details": {
      "cache_write_tokens": 0,
      "cached_tokens": 0
    },
    "output_tokens": 0,
    "output_tokens_details": {
      "reasoning_tokens": 0
    },
    "total_tokens": 0
  },
  "user": "user-1234"
}
```

### Example

```typescript
import OpenAI from "openai";
const client = new OpenAI();

const response = await client.responses.retrieve("resp_123");
console.log(response);
```

#### Response

```json
{
  "id": "resp_67cb71b351908190a308f3859487620d06981a8637e6bc44",
  "object": "response",
  "created_at": 1741386163,
  "status": "completed",
  "completed_at": 1741386164,
  "error": null,
  "incomplete_details": null,
  "instructions": null,
  "max_output_tokens": null,
  "model": "gpt-4o-2024-08-06",
  "output": [
    {
      "type": "message",
      "id": "msg_67cb71b3c2b0819084d481baaaf148f206981a8637e6bc44",
      "status": "completed",
      "role": "assistant",
      "content": [
        {
          "type": "output_text",
          "text": "Silent circuits hum,  \nThoughts emerge in data streams—  \nDigital dawn breaks.",
          "annotations": []
        }
      ]
    }
  ],
  "parallel_tool_calls": true,
  "previous_response_id": null,
  "reasoning": {
    "effort": null,
    "summary": null
  },
  "store": true,
  "temperature": 1.0,
  "text": {
    "format": {
      "type": "text"
    }
  },
  "tool_choice": "auto",
  "tools": [],
  "top_p": 1.0,
  "truncation": "disabled",
  "usage": {
    "input_tokens": 32,
    "input_tokens_details": {
      "cached_tokens": 0,
      "cache_write_tokens": 0
    },
    "output_tokens": 18,
    "output_tokens_details": {
      "reasoning_tokens": 0
    },
    "total_tokens": 50
  },
  "user": null,
  "metadata": {}
}
```

## Domain Types

### Beta Apply Patch Tool

- `BetaApplyPatchTool`

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

  - `type: "apply_patch"`

    The type of the tool. Always `apply_patch`.

    - `"apply_patch"`

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

    The tool invocation context(s).

    - `"direct"`

    - `"programmatic"`

### Beta Compacted Response

- `BetaCompactedResponse`

  - `id: string`

    The unique identifier for the compacted response.

  - `created_at: number`

    Unix timestamp (in seconds) when the compacted conversation was created.

  - `object: "response.compaction"`

    The object type. Always `response.compaction`.

    - `"response.compaction"`

  - `output: Array<BetaResponseOutputItem>`

    The compacted list of output items. This is a list of all user messages, followed by a single compaction item.

    - `BetaResponseOutputMessage`

      An output message from the model.

      - `id: string`

        The unique ID of the output message.

      - `content: Array<BetaResponseOutputText | BetaResponseOutputRefusal>`

        The content of the output message.

        - `BetaResponseOutputText`

          A text output from the model.

          - `annotations: Array<FileCitation | URLCitation | ContainerFileCitation | FilePath>`

            The annotations of the text output.

            - `FileCitation`

              A citation to a file.

              - `file_id: string`

                The ID of the file.

              - `filename: string`

                The filename of the file cited.

              - `index: number`

                The index of the file in the list of files.

              - `type: "file_citation"`

                The type of the file citation. Always `file_citation`.

                - `"file_citation"`

            - `URLCitation`

              A citation for a web resource used to generate a model response.

              - `end_index: number`

                The index of the last character of the URL citation in the message.

              - `start_index: number`

                The index of the first character of the URL citation in the message.

              - `title: string`

                The title of the web resource.

              - `type: "url_citation"`

                The type of the URL citation. Always `url_citation`.

                - `"url_citation"`

              - `url: string`

                The URL of the web resource.

            - `ContainerFileCitation`

              A citation for a container file used to generate a model response.

              - `container_id: string`

                The ID of the container file.

              - `end_index: number`

                The index of the last character of the container file citation in the message.

              - `file_id: string`

                The ID of the file.

              - `filename: string`

                The filename of the container file cited.

              - `start_index: number`

                The index of the first character of the container file citation in the message.

              - `type: "container_file_citation"`

                The type of the container file citation. Always `container_file_citation`.

                - `"container_file_citation"`

            - `FilePath`

              A path to a file.

              - `file_id: string`

                The ID of the file.

              - `index: number`

                The index of the file in the list of files.

              - `type: "file_path"`

                The type of the file path. Always `file_path`.

                - `"file_path"`

          - `text: string`

            The text output from the model.

          - `type: "output_text"`

            The type of the output text. Always `output_text`.

            - `"output_text"`

          - `logprobs?: Array<Logprob>`

            - `token: string`

            - `bytes: Array<number>`

            - `logprob: number`

            - `top_logprobs: Array<TopLogprob>`

              - `token: string`

              - `bytes: Array<number>`

              - `logprob: number`

        - `BetaResponseOutputRefusal`

          A refusal from the model.

          - `refusal: string`

            The refusal explanation from the model.

          - `type: "refusal"`

            The type of the refusal. Always `refusal`.

            - `"refusal"`

      - `role: "assistant"`

        The role of the output message. Always `assistant`.

        - `"assistant"`

      - `status: "in_progress" | "completed" | "incomplete"`

        The status of the message input. One of `in_progress`, `completed`, or
        `incomplete`. Populated when input items are returned via API.

        - `"in_progress"`

        - `"completed"`

        - `"incomplete"`

      - `type: "message"`

        The type of the output message. Always `message`.

        - `"message"`

      - `agent?: Agent | null`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

      - `phase?: "commentary" | "final_answer" | null`

        Labels an `assistant` message as intermediate commentary (`commentary`) or the final answer (`final_answer`).
        For models like `gpt-5.3-codex` and beyond, when sending follow-up requests, preserve and resend
        phase on all assistant messages — dropping it can degrade performance. Not used for user messages.

        - `"commentary"`

        - `"final_answer"`

    - `BetaResponseFileSearchToolCall`

      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.

      - `id: string`

        The unique ID of the file search tool call.

      - `queries: Array<string>`

        The queries used to search for files.

      - `status: "in_progress" | "searching" | "completed" | 2 more`

        The status of the file search tool call. One of `in_progress`,
        `searching`, `incomplete` or `failed`,

        - `"in_progress"`

        - `"searching"`

        - `"completed"`

        - `"incomplete"`

        - `"failed"`

      - `type: "file_search_call"`

        The type of the file search tool call. Always `file_search_call`.

        - `"file_search_call"`

      - `agent?: Agent | null`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

      - `results?: Array<Result> | null`

        The results of the file search tool call.

        - `attributes?: Record<string, string | number | boolean> | null`

          Set of 16 key-value pairs that can be attached to an object. This can be
          useful for storing additional information about the object in a structured
          format, and querying for objects via API or the dashboard. Keys are strings
          with a maximum length of 64 characters. Values are strings with a maximum
          length of 512 characters, booleans, or numbers.

          - `string`

          - `number`

          - `boolean`

        - `file_id?: string`

          The unique ID of the file.

        - `filename?: string`

          The name of the file.

        - `score?: number`

          The relevance score of the file - a value between 0 and 1.

        - `text?: string`

          The text that was retrieved from the file.

    - `BetaResponseFunctionToolCall`

      A tool call to run a function. See the
      [function calling guide](https://platform.openai.com/docs/guides/function-calling) for more information.

      - `arguments: string`

        A JSON string of the arguments to pass to the function.

      - `call_id: string`

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

      - `name: string`

        The name of the function to run.

      - `type: "function_call"`

        The type of the function tool call. Always `function_call`.

        - `"function_call"`

      - `id?: string`

        The unique ID of the function tool call.

      - `agent?: Agent | null`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

      - `caller?: Direct | Program | null`

        The execution context that produced this tool call.

        - `Direct`

          - `type: "direct"`

            - `"direct"`

        - `Program`

          - `caller_id: string`

            The call ID of the program item that produced this tool call.

          - `type: "program"`

            - `"program"`

      - `namespace?: string`

        The namespace of the function to run.

      - `status?: "in_progress" | "completed" | "incomplete"`

        The status of the item. One of `in_progress`, `completed`, or
        `incomplete`. Populated when items are returned via API.

        - `"in_progress"`

        - `"completed"`

        - `"incomplete"`

    - `BetaResponseFunctionToolCallOutputItem`

      - `id: string`

        The unique ID of the function call tool output.

      - `call_id: string`

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

      - `output: string | Array<BetaResponseInputText | BetaResponseInputImage | BetaResponseInputFile>`

        The output from the function call generated by your code.
        Can be a string or an list of output content.

        - `string`

        - `Array<BetaResponseInputText | BetaResponseInputImage | BetaResponseInputFile>`

          - `BetaResponseInputText`

            A text input to the model.

            - `text: string`

              The text input to the model.

            - `type: "input_text"`

              The type of the input item. Always `input_text`.

              - `"input_text"`

            - `prompt_cache_breakpoint?: PromptCacheBreakpoint`

              Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.

              - `mode: "explicit"`

                The breakpoint mode. Always `explicit`.

                - `"explicit"`

          - `BetaResponseInputImage`

            An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision).

            - `detail: BetaImageDetail`

              The detail level of the image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`.

              - `"low"`

              - `"high"`

              - `"auto"`

              - `"original"`

            - `type: "input_image"`

              The type of the input item. Always `input_image`.

              - `"input_image"`

            - `file_id?: string | null`

              The ID of the file to be sent to the model.

            - `image_url?: string | null`

              The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.

            - `prompt_cache_breakpoint?: PromptCacheBreakpoint`

              Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.

              - `mode: "explicit"`

                The breakpoint mode. Always `explicit`.

                - `"explicit"`

          - `BetaResponseInputFile`

            A file input to the model.

            - `type: "input_file"`

              The type of the input item. Always `input_file`.

              - `"input_file"`

            - `detail?: "auto" | "low" | "high"`

              The detail level of the file to be sent to the model. Use `auto` to let the system select the detail level; for GPT-5.6 and later models, `auto` uses high-quality rendering, which may increase input token usage. Use `low` for lower-cost rendering, or `high` to render the file at higher quality. Defaults to `auto`.

              - `"auto"`

              - `"low"`

              - `"high"`

            - `file_data?: string`

              The content of the file to be sent to the model.

            - `file_id?: string | null`

              The ID of the file to be sent to the model.

            - `file_url?: string`

              The URL of the file to be sent to the model.

            - `filename?: string`

              The name of the file to be sent to the model.

            - `prompt_cache_breakpoint?: PromptCacheBreakpoint`

              Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.

              - `mode: "explicit"`

                The breakpoint mode. Always `explicit`.

                - `"explicit"`

      - `status: "in_progress" | "completed" | "incomplete"`

        The status of the item. One of `in_progress`, `completed`, or
        `incomplete`. Populated when items are returned via API.

        - `"in_progress"`

        - `"completed"`

        - `"incomplete"`

      - `type: "function_call_output"`

        The type of the function tool call output. Always `function_call_output`.

        - `"function_call_output"`

      - `agent?: Agent | null`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

      - `caller?: Direct | Program | null`

        The execution context that produced this tool call.

        - `Direct`

          - `type: "direct"`

            The caller type. Always `direct`.

            - `"direct"`

        - `Program`

          - `caller_id: string`

            The call ID of the program item that produced this tool call.

          - `type: "program"`

            The caller type. Always `program`.

            - `"program"`

      - `created_by?: string`

        The identifier of the actor that created the item.

      - `name?: string`

        The name of the tool that produced the output.

      - `namespace?: string`

        The namespace of the tool that produced the output.

    - `AgentMessage`

      - `id: string`

        The unique ID of the agent message.

      - `author: string`

        The sending agent identity.

      - `content: Array<BetaResponseInputText | BetaResponseOutputText | Text | 7 more>`

        Encrypted content sent between agents.

        - `BetaResponseInputText`

          A text input to the model.

        - `BetaResponseOutputText`

          A text output from the model.

        - `Text`

          A text content.

          - `text: string`

          - `type: "text"`

            - `"text"`

        - `SummaryText`

          A summary text from the model.

          - `text: string`

            A summary of the reasoning output from the model so far.

          - `type: "summary_text"`

            The type of the object. Always `summary_text`.

            - `"summary_text"`

        - `ReasoningText`

          Reasoning text from the model.

          - `text: string`

            The reasoning text from the model.

          - `type: "reasoning_text"`

            The type of the reasoning text. Always `reasoning_text`.

            - `"reasoning_text"`

        - `BetaResponseOutputRefusal`

          A refusal from the model.

        - `BetaResponseInputImage`

          An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision).

        - `ComputerScreenshot`

          A screenshot of a computer.

          - `detail: BetaImageDetail`

            The detail level of the screenshot image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`.

          - `file_id: string | null`

            The identifier of an uploaded file that contains the screenshot.

          - `image_url: string | null`

            The URL of the screenshot image.

          - `type: "computer_screenshot"`

            Specifies the event type. For a computer screenshot, this property is always set to `computer_screenshot`.

            - `"computer_screenshot"`

          - `prompt_cache_breakpoint?: PromptCacheBreakpoint`

            Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.

            - `mode: "explicit"`

              The breakpoint mode. Always `explicit`.

              - `"explicit"`

        - `BetaResponseInputFile`

          A file input to the model.

        - `EncryptedContent`

          Opaque encrypted content that Responses API decrypts inside trusted model execution.

          - `encrypted_content: string`

            Opaque encrypted content.

          - `type: "encrypted_content"`

            The type of the input item. Always `encrypted_content`.

            - `"encrypted_content"`

      - `recipient: string`

        The destination agent identity.

      - `type: "agent_message"`

        The type of the item. Always `agent_message`.

        - `"agent_message"`

      - `agent?: Agent`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

    - `MultiAgentCall`

      - `id: string`

        The unique ID of the multi-agent call item.

      - `action: "spawn_agent" | "interrupt_agent" | "list_agents" | 3 more`

        The multi-agent action to execute.

        - `"spawn_agent"`

        - `"interrupt_agent"`

        - `"list_agents"`

        - `"send_message"`

        - `"followup_task"`

        - `"wait_agent"`

      - `arguments: string`

        The JSON string of arguments generated for the action.

      - `call_id: string`

        The unique ID linking this call to its output.

      - `type: "multi_agent_call"`

        The type of the multi-agent call. Always `multi_agent_call`.

        - `"multi_agent_call"`

      - `agent?: Agent`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

    - `MultiAgentCallOutput`

      - `id: string`

        The unique ID of the multi-agent call output item.

      - `action: "spawn_agent" | "interrupt_agent" | "list_agents" | 3 more`

        The multi-agent action that produced this result.

        - `"spawn_agent"`

        - `"interrupt_agent"`

        - `"list_agents"`

        - `"send_message"`

        - `"followup_task"`

        - `"wait_agent"`

      - `call_id: string`

        The unique ID of the multi-agent call.

      - `output: Array<BetaResponseOutputText>`

        Text output returned by the multi-agent action.

        - `annotations: Array<FileCitation | URLCitation | ContainerFileCitation | FilePath>`

          The annotations of the text output.

        - `text: string`

          The text output from the model.

        - `type: "output_text"`

          The type of the output text. Always `output_text`.

        - `logprobs?: Array<Logprob>`

      - `type: "multi_agent_call_output"`

        The type of the multi-agent result. Always `multi_agent_call_output`.

        - `"multi_agent_call_output"`

      - `agent?: Agent`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

    - `BetaResponseFunctionWebSearch`

      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.

      - `id: string`

        The unique ID of the web search tool call.

      - `action: Search | OpenPage | FindInPage`

        An object describing the specific action taken in this web search call.
        Includes details on how the model used the web (search, open_page, find_in_page).

        - `Search`

          Action type "search" - Performs a web search query.

          - `type: "search"`

            The action type.

            - `"search"`

          - `queries?: Array<string>`

            The search queries.

          - `query?: string`

            The search query.

          - `sources?: Array<Source>`

            The sources used in the search.

            - `type: "url"`

              The type of source. Always `url`.

              - `"url"`

            - `url: string`

              The URL of the source.

        - `OpenPage`

          Action type "open_page" - Opens a specific URL from search results.

          - `type: "open_page"`

            The action type.

            - `"open_page"`

          - `url?: string | null`

            The URL opened by the model.

        - `FindInPage`

          Action type "find_in_page": Searches for a pattern within a loaded page.

          - `pattern: string`

            The pattern or text to search for within the page.

          - `type: "find_in_page"`

            The action type.

            - `"find_in_page"`

          - `url: string`

            The URL of the page searched for the pattern.

      - `status: "in_progress" | "searching" | "completed" | "failed"`

        The status of the web search tool call.

        - `"in_progress"`

        - `"searching"`

        - `"completed"`

        - `"failed"`

      - `type: "web_search_call"`

        The type of the web search tool call. Always `web_search_call`.

        - `"web_search_call"`

      - `agent?: Agent | null`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

    - `BetaResponseComputerToolCall`

      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.

      - `id: string`

        The unique ID of the computer call.

      - `call_id: string`

        An identifier used when responding to the tool call with output.

      - `pending_safety_checks: Array<PendingSafetyCheck>`

        The pending safety checks for the computer call.

        - `id: string`

          The ID of the pending safety check.

        - `code?: string | null`

          The type of the pending safety check.

        - `message?: string | null`

          Details about the pending safety check.

      - `status: "in_progress" | "completed" | "incomplete"`

        The status of the item. One of `in_progress`, `completed`, or
        `incomplete`. Populated when items are returned via API.

        - `"in_progress"`

        - `"completed"`

        - `"incomplete"`

      - `type: "computer_call"`

        The type of the computer call. Always `computer_call`.

        - `"computer_call"`

      - `action?: BetaComputerAction`

        A click action.

        - `Click`

          A click action.

          - `button: "left" | "right" | "wheel" | 2 more`

            Indicates which mouse button was pressed during the click. One of `left`, `right`, `wheel`, `back`, or `forward`.

            - `"left"`

            - `"right"`

            - `"wheel"`

            - `"back"`

            - `"forward"`

          - `type: "click"`

            Specifies the event type. For a click action, this property is always `click`.

            - `"click"`

          - `x: number`

            The x-coordinate where the click occurred.

          - `y: number`

            The y-coordinate where the click occurred.

          - `keys?: Array<string> | null`

            The keys being held while clicking.

        - `DoubleClick`

          A double click action.

          - `keys: Array<string> | null`

            The keys being held while double-clicking.

          - `type: "double_click"`

            Specifies the event type. For a double click action, this property is always set to `double_click`.

            - `"double_click"`

          - `x: number`

            The x-coordinate where the double click occurred.

          - `y: number`

            The y-coordinate where the double click occurred.

        - `Drag`

          A drag action.

          - `path: Array<Path>`

            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 }
            ]
            ```

            - `x: number`

              The x-coordinate.

            - `y: number`

              The y-coordinate.

          - `type: "drag"`

            Specifies the event type. For a drag action, this property is always set to `drag`.

            - `"drag"`

          - `keys?: Array<string> | null`

            The keys being held while dragging the mouse.

        - `Keypress`

          A collection of keypresses the model would like to perform.

          - `keys: Array<string>`

            The combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key.

          - `type: "keypress"`

            Specifies the event type. For a keypress action, this property is always set to `keypress`.

            - `"keypress"`

        - `Move`

          A mouse move action.

          - `type: "move"`

            Specifies the event type. For a move action, this property is always set to `move`.

            - `"move"`

          - `x: number`

            The x-coordinate to move to.

          - `y: number`

            The y-coordinate to move to.

          - `keys?: Array<string> | null`

            The keys being held while moving the mouse.

        - `Screenshot`

          A screenshot action.

          - `type: "screenshot"`

            Specifies the event type. For a screenshot action, this property is always set to `screenshot`.

            - `"screenshot"`

        - `Scroll`

          A scroll action.

          - `scroll_x: number`

            The horizontal scroll distance.

          - `scroll_y: number`

            The vertical scroll distance.

          - `type: "scroll"`

            Specifies the event type. For a scroll action, this property is always set to `scroll`.

            - `"scroll"`

          - `x: number`

            The x-coordinate where the scroll occurred.

          - `y: number`

            The y-coordinate where the scroll occurred.

          - `keys?: Array<string> | null`

            The keys being held while scrolling.

        - `Type`

          An action to type in text.

          - `text: string`

            The text to type.

          - `type: "type"`

            Specifies the event type. For a type action, this property is always set to `type`.

            - `"type"`

        - `Wait`

          A wait action.

          - `type: "wait"`

            Specifies the event type. For a wait action, this property is always set to `wait`.

            - `"wait"`

      - `actions?: BetaComputerActionList`

        Flattened batched actions for `computer_use`. Each action includes an
        `type` discriminator and action-specific fields.

        - `Click`

          A click action.

        - `DoubleClick`

          A double click action.

        - `Drag`

          A drag action.

        - `Keypress`

          A collection of keypresses the model would like to perform.

        - `Move`

          A mouse move action.

        - `Screenshot`

          A screenshot action.

        - `Scroll`

          A scroll action.

        - `Type`

          An action to type in text.

        - `Wait`

          A wait action.

      - `agent?: Agent | null`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

    - `BetaResponseComputerToolCallOutputItem`

      - `id: string`

        The unique ID of the computer call tool output.

      - `call_id: string`

        The ID of the computer tool call that produced the output.

      - `output: BetaResponseComputerToolCallOutputScreenshot`

        A computer screenshot image used with the computer use tool.

        - `type: "computer_screenshot"`

          Specifies the event type. For a computer screenshot, this property is
          always set to `computer_screenshot`.

          - `"computer_screenshot"`

        - `file_id?: string`

          The identifier of an uploaded file that contains the screenshot.

        - `image_url?: string`

          The URL of the screenshot image.

      - `status: "completed" | "incomplete" | "failed" | "in_progress"`

        The status of the message input. One of `in_progress`, `completed`, or
        `incomplete`. Populated when input items are returned via API.

        - `"completed"`

        - `"incomplete"`

        - `"failed"`

        - `"in_progress"`

      - `type: "computer_call_output"`

        The type of the computer tool call output. Always `computer_call_output`.

        - `"computer_call_output"`

      - `acknowledged_safety_checks?: Array<AcknowledgedSafetyCheck>`

        The safety checks reported by the API that have been acknowledged by the
        developer.

        - `id: string`

          The ID of the pending safety check.

        - `code?: string | null`

          The type of the pending safety check.

        - `message?: string | null`

          Details about the pending safety check.

      - `agent?: Agent | null`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

      - `created_by?: string`

        The identifier of the actor that created the item.

    - `BetaResponseReasoningItem`

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

      - `id: string`

        The unique identifier of the reasoning content.

      - `summary: Array<Summary>`

        Reasoning summary content.

        - `text: string`

          A summary of the reasoning output from the model so far.

        - `type: "summary_text"`

          The type of the object. Always `summary_text`.

          - `"summary_text"`

      - `type: "reasoning"`

        The type of the object. Always `reasoning`.

        - `"reasoning"`

      - `agent?: Agent | null`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

      - `content?: Array<Content>`

        Reasoning text content.

        - `text: string`

          The reasoning text from the model.

        - `type: "reasoning_text"`

          The type of the reasoning text. Always `reasoning_text`.

          - `"reasoning_text"`

      - `encrypted_content?: string | null`

        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.

        When streaming, use the completed reasoning item and its
        `encrypted_content` from the `response.output_item.done` event in
        subsequent requests. The `encrypted_content` in
        `response.output_item.added` may be incomplete. This is especially
        important when `store` is `false` or when using Zero Data Retention.

      - `status?: "in_progress" | "completed" | "incomplete"`

        The status of the item. One of `in_progress`, `completed`, or
        `incomplete`. Populated when items are returned via API.

        - `"in_progress"`

        - `"completed"`

        - `"incomplete"`

    - `Program`

      - `id: string`

        The unique ID of the program item.

      - `call_id: string`

        The stable call ID of the program item.

      - `code: string`

        The JavaScript source executed by programmatic tool calling.

      - `fingerprint: string`

        Opaque program replay fingerprint that must be round-tripped.

      - `type: "program"`

        The type of the item. Always `program`.

        - `"program"`

      - `agent?: Agent`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

    - `ProgramOutput`

      - `id: string`

        The unique ID of the program output item.

      - `call_id: string`

        The call ID of the program item.

      - `result: string`

        The result produced by the program item.

      - `status: "completed" | "incomplete"`

        The terminal status of the program output item.

        - `"completed"`

        - `"incomplete"`

      - `type: "program_output"`

        The type of the item. Always `program_output`.

        - `"program_output"`

      - `agent?: Agent`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

    - `BetaResponseToolSearchCall`

      - `id: string`

        The unique ID of the tool search call item.

      - `arguments: unknown`

        Arguments used for the tool search call.

      - `call_id: string | null`

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

      - `execution: "server" | "client"`

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

        - `"server"`

        - `"client"`

      - `status: "in_progress" | "completed" | "incomplete"`

        The status of the tool search call item that was recorded.

        - `"in_progress"`

        - `"completed"`

        - `"incomplete"`

      - `type: "tool_search_call"`

        The type of the item. Always `tool_search_call`.

        - `"tool_search_call"`

      - `agent?: Agent`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

      - `created_by?: string`

        The identifier of the actor that created the item.

    - `BetaResponseToolSearchOutputItem`

      - `id: string`

        The unique ID of the tool search output item.

      - `call_id: string | null`

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

      - `execution: "server" | "client"`

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

        - `"server"`

        - `"client"`

      - `status: "in_progress" | "completed" | "incomplete"`

        The status of the tool search output item that was recorded.

        - `"in_progress"`

        - `"completed"`

        - `"incomplete"`

      - `tools: Array<BetaTool>`

        The loaded tool definitions returned by tool search.

        - `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).

          - `name: string`

            The name of the function to call.

          - `parameters: Record<string, unknown> | null`

            A JSON schema object describing the parameters of the function.

          - `strict: boolean | null`

            Whether strict parameter validation is enforced for this function tool.

          - `type: "function"`

            The type of the function tool. Always `function`.

            - `"function"`

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

            The tool invocation context(s).

            - `"direct"`

            - `"programmatic"`

          - `defer_loading?: boolean`

            Whether this function is deferred and loaded via tool search.

          - `description?: string | null`

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

          - `output_schema?: Record<string, unknown> | null`

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

        - `BetaFileSearchTool`

          A tool that searches for relevant content from uploaded files. Learn more about the [file search tool](https://platform.openai.com/docs/guides/tools-file-search).

          - `type: "file_search"`

            The type of the file search tool. Always `file_search`.

            - `"file_search"`

          - `vector_store_ids: Array<string>`

            The IDs of the vector stores to search.

          - `filters?: ComparisonFilter | CompoundFilter | null`

            A filter to apply.

            - `ComparisonFilter`

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

              - `key: string`

                The key to compare against the value.

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

                Specifies the comparison operator: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`, `in`, `nin`.

                - `eq`: equals
                - `ne`: not equal
                - `gt`: greater than
                - `gte`: greater than or equal
                - `lt`: less than
                - `lte`: less than or equal
                - `in`: in
                - `nin`: not in

                - `"eq"`

                - `"ne"`

                - `"gt"`

                - `"gte"`

                - `"lt"`

                - `"lte"`

                - `"in"`

                - `"nin"`

              - `value: string | number | boolean | Array<string | number>`

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

                - `string`

                - `number`

                - `boolean`

                - `Array<string | number>`

                  - `string`

                  - `number`

            - `CompoundFilter`

              Combine multiple filters using `and` or `or`.

              - `filters: Array<ComparisonFilter | unknown>`

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

                - `ComparisonFilter`

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

                  - `key: string`

                    The key to compare against the value.

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

                    Specifies the comparison operator: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`, `in`, `nin`.

                    - `eq`: equals
                    - `ne`: not equal
                    - `gt`: greater than
                    - `gte`: greater than or equal
                    - `lt`: less than
                    - `lte`: less than or equal
                    - `in`: in
                    - `nin`: not in

                    - `"eq"`

                    - `"ne"`

                    - `"gt"`

                    - `"gte"`

                    - `"lt"`

                    - `"lte"`

                    - `"in"`

                    - `"nin"`

                  - `value: string | number | boolean | Array<string | number>`

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

                    - `string`

                    - `number`

                    - `boolean`

                    - `Array<string | number>`

                      - `string`

                      - `number`

                - `unknown`

              - `type: "and" | "or"`

                Type of operation: `and` or `or`.

                - `"and"`

                - `"or"`

          - `max_num_results?: number`

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

          - `ranking_options?: RankingOptions`

            Ranking options for search.

            - `hybrid_search?: HybridSearch`

              Weights that control how reciprocal rank fusion balances semantic embedding matches versus sparse keyword matches when hybrid search is enabled.

              - `embedding_weight: number`

                The weight of the embedding in the reciprocal ranking fusion.

              - `text_weight: number`

                The weight of the text in the reciprocal ranking fusion.

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

              The ranker to use for the file search.

              - `"auto"`

              - `"default-2024-11-15"`

            - `score_threshold?: number`

              The score threshold for the file search, a number between 0 and 1. Numbers closer to 1 will attempt to return only the most relevant results, but may return fewer results.

        - `BetaComputerTool`

          A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use).

          - `type: "computer"`

            The type of the computer tool. Always `computer`.

            - `"computer"`

        - `BetaComputerUsePreviewTool`

          A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use).

          - `display_height: number`

            The height of the computer display.

          - `display_width: number`

            The width of the computer display.

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

            The type of computer environment to control.

            - `"windows"`

            - `"mac"`

            - `"linux"`

            - `"ubuntu"`

            - `"browser"`

          - `type: "computer_use_preview"`

            The type of the computer use tool. Always `computer_use_preview`.

            - `"computer_use_preview"`

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

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

            - `"web_search"`

            - `"web_search_2025_08_26"`

          - `external_web_access?: boolean`

            Allow live internet access for web search. Defaults to true when omitted. When false, the web search tool runs in offline/cache-only mode and will not fetch new external content.

          - `filters?: Filters | null`

            Filters for the search.

            - `allowed_domains?: Array<string> | null`

              Allowed domains for the search. If not provided, all domains are allowed.
              Subdomains of the provided domains are allowed as well.

              Example: `["pubmed.ncbi.nlm.nih.gov"]`

          - `search_context_size?: "low" | "medium" | "high"`

            High level guidance for the amount of context window space to use for the search. One of `low`, `medium`, or `high`. `medium` is the default.

            - `"low"`

            - `"medium"`

            - `"high"`

          - `user_location?: UserLocation | null`

            The approximate location of the user.

            - `city?: string | null`

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

            - `country?: string | null`

              The two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of the user, e.g. `US`.

            - `region?: string | null`

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

            - `timezone?: string | null`

              The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of the user, e.g. `America/Los_Angeles`.

            - `type?: "approximate"`

              The type of location approximation. Always `approximate`.

              - `"approximate"`

        - `Mcp`

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

          - `server_label: string`

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

          - `type: "mcp"`

            The type of the MCP tool. Always `mcp`.

            - `"mcp"`

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

            The tool invocation context(s).

            - `"direct"`

            - `"programmatic"`

          - `allowed_tools?: Array<string> | McpToolFilter | null`

            List of allowed tool names or a filter object.

            - `Array<string>`

            - `McpToolFilter`

              A filter object to specify which tools are allowed.

              - `read_only?: boolean`

                Indicates whether or not a tool modifies data or is read-only. If an
                MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint),
                it will match this filter.

              - `tool_names?: Array<string>`

                List of allowed tool names.

          - `authorization?: string`

            An OAuth access token that can be used with a remote MCP server, either
            with a custom MCP server URL or a service connector. Your application
            must handle the OAuth authorization flow and provide the token here.

          - `connector_id?: "connector_dropbox" | "connector_gmail" | "connector_googlecalendar" | 5 more`

            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`

            - `"connector_dropbox"`

            - `"connector_gmail"`

            - `"connector_googlecalendar"`

            - `"connector_googledrive"`

            - `"connector_microsoftteams"`

            - `"connector_outlookcalendar"`

            - `"connector_outlookemail"`

            - `"connector_sharepoint"`

          - `defer_loading?: boolean`

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

          - `headers?: Record<string, string> | null`

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

          - `require_approval?: McpToolApprovalFilter | "always" | "never" | null`

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

            - `McpToolApprovalFilter`

              Specify which of the MCP server's tools require approval. Can be
              `always`, `never`, or a filter object associated with tools
              that require approval.

              - `always?: Always`

                A filter object to specify which tools are allowed.

                - `read_only?: boolean`

                  Indicates whether or not a tool modifies data or is read-only. If an
                  MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint),
                  it will match this filter.

                - `tool_names?: Array<string>`

                  List of allowed tool names.

              - `never?: Never`

                A filter object to specify which tools are allowed.

                - `read_only?: boolean`

                  Indicates whether or not a tool modifies data or is read-only. If an
                  MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint),
                  it will match this filter.

                - `tool_names?: Array<string>`

                  List of allowed tool names.

            - `"always" | "never"`

              - `"always"`

              - `"never"`

          - `server_description?: string`

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

          - `server_url?: string`

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

          - `tunnel_id?: string`

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

        - `CodeInterpreter`

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

          - `container: string | CodeInterpreterToolAuto`

            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`

            - `CodeInterpreterToolAuto`

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

              - `type: "auto"`

                Always `auto`.

                - `"auto"`

              - `file_ids?: Array<string>`

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

              - `memory_limit?: "1g" | "4g" | "16g" | "64g" | null`

                The memory limit for the code interpreter container.

                - `"1g"`

                - `"4g"`

                - `"16g"`

                - `"64g"`

              - `network_policy?: BetaContainerNetworkPolicyDisabled | BetaContainerNetworkPolicyAllowlist`

                Network access policy for the container.

                - `BetaContainerNetworkPolicyDisabled`

                  - `type: "disabled"`

                    Disable outbound network access. Always `disabled`.

                    - `"disabled"`

                - `BetaContainerNetworkPolicyAllowlist`

                  - `allowed_domains: Array<string>`

                    A list of allowed domains when type is `allowlist`.

                  - `type: "allowlist"`

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

                    - `"allowlist"`

                  - `domain_secrets?: Array<BetaContainerNetworkPolicyDomainSecret>`

                    Optional domain-scoped secrets for allowlisted domains.

                    - `domain: string`

                      The domain associated with the secret.

                    - `name: string`

                      The name of the secret to inject for the domain.

                    - `value: string`

                      The secret value to inject for the domain.

          - `type: "code_interpreter"`

            The type of the code interpreter tool. Always `code_interpreter`.

            - `"code_interpreter"`

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

            The tool invocation context(s).

            - `"direct"`

            - `"programmatic"`

        - `ProgrammaticToolCalling`

          - `type: "programmatic_tool_calling"`

            The type of the tool. Always `programmatic_tool_calling`.

            - `"programmatic_tool_calling"`

        - `ImageGeneration`

          A tool that generates images using the GPT image models.

          - `type: "image_generation"`

            The type of the image generation tool. Always `image_generation`.

            - `"image_generation"`

          - `action?: "generate" | "edit" | "auto"`

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

            - `"generate"`

            - `"edit"`

            - `"auto"`

          - `background?: "transparent" | "opaque" | "auto"`

            Allows to set transparency for the background of the generated image(s).
            Must be one of `transparent`, `opaque`, or `auto` (default value). When
            `auto` is used, the model will automatically determine the best
            background for the image.

            Transparent backgrounds are available for supported GPT Image models.
            For `gpt-image-2` and `gpt-image-2-2026-04-21`, this support is in
            preview. When using `transparent`, set the output format to `png` or
            `webp`.

            - `"transparent"`

            - `"opaque"`

            - `"auto"`

          - `input_fidelity?: "high" | "low" | null`

            Control how much effort the model will exert to match the style and features, especially facial features, of input images. This parameter is only supported for `gpt-image-1` and `gpt-image-1.5` and later models, unsupported for `gpt-image-1-mini`. Supports `high` and `low`. Defaults to `low`.

            - `"high"`

            - `"low"`

          - `input_image_mask?: InputImageMask`

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

            - `file_id?: string`

              File ID for the mask image.

            - `image_url?: string`

              Base64-encoded mask image.

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

            The image generation model to use. One of `gpt-image-1`,
            `gpt-image-1-mini`, `gpt-image-1.5`, `gpt-image-2`,
            `gpt-image-2-2026-04-21`, or `chatgpt-image-latest`. Default:
            `gpt-image-1`.

            - `(string & {})`

            - `"gpt-image-1" | "gpt-image-1-mini" | "gpt-image-2" | 3 more`

              - `"gpt-image-1"`

              - `"gpt-image-1-mini"`

              - `"gpt-image-2"`

              - `"gpt-image-2-2026-04-21"`

              - `"gpt-image-1.5"`

              - `"chatgpt-image-latest"`

          - `moderation?: "auto" | "low"`

            Moderation level for the generated image. Default: `auto`.

            - `"auto"`

            - `"low"`

          - `output_compression?: number`

            Compression level for the output image. Default: 100.

          - `output_format?: "png" | "webp" | "jpeg"`

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

            - `"png"`

            - `"webp"`

            - `"jpeg"`

          - `partial_images?: number`

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

          - `quality?: "low" | "medium" | "high" | "auto"`

            The quality of the generated image. One of `low`, `medium`, `high`,
            or `auto`. Default: `auto`.

            - `"low"`

            - `"medium"`

            - `"high"`

            - `"auto"`

          - `size?: (string & {}) | "1024x1024" | "1024x1536" | "1536x1024" | "auto"`

            The size of the generated images. For `gpt-image-2` and `gpt-image-2-2026-04-21`, arbitrary resolutions are supported as `WIDTHxHEIGHT` strings, for example `1536x864`. Width and height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above `2560x1440` are experimental, and the maximum supported resolution is `3840x2160`. The requested size must also satisfy the model's current pixel and edge limits. The standard sizes `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models; `auto` is supported for models that allow automatic sizing. For `dall-e-2`, use one of `256x256`, `512x512`, or `1024x1024`. For `dall-e-3`, use one of `1024x1024`, `1792x1024`, or `1024x1792`.

            - `(string & {})`

            - `"1024x1024" | "1024x1536" | "1536x1024" | "auto"`

              - `"1024x1024"`

              - `"1024x1536"`

              - `"1536x1024"`

              - `"auto"`

        - `LocalShell`

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

          - `type: "local_shell"`

            The type of the local shell tool. Always `local_shell`.

            - `"local_shell"`

        - `BetaFunctionShellTool`

          A tool that allows the model to execute shell commands.

          - `type: "shell"`

            The type of the shell tool. Always `shell`.

            - `"shell"`

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

            The tool invocation context(s).

            - `"direct"`

            - `"programmatic"`

          - `environment?: BetaContainerAuto | BetaLocalEnvironment | BetaContainerReference | null`

            - `BetaContainerAuto`

              - `type: "container_auto"`

                Automatically creates a container for this request

                - `"container_auto"`

              - `file_ids?: Array<string>`

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

              - `memory_limit?: "1g" | "4g" | "16g" | "64g" | null`

                The memory limit for the container.

                - `"1g"`

                - `"4g"`

                - `"16g"`

                - `"64g"`

              - `network_policy?: BetaContainerNetworkPolicyDisabled | BetaContainerNetworkPolicyAllowlist`

                Network access policy for the container.

                - `BetaContainerNetworkPolicyDisabled`

                - `BetaContainerNetworkPolicyAllowlist`

              - `skills?: Array<BetaSkillReference | BetaInlineSkill>`

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

                - `BetaSkillReference`

                  - `skill_id: string`

                    The ID of the referenced skill.

                  - `type: "skill_reference"`

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

                    - `"skill_reference"`

                  - `version?: string`

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

                - `BetaInlineSkill`

                  - `description: string`

                    The description of the skill.

                  - `name: string`

                    The name of the skill.

                  - `source: BetaInlineSkillSource`

                    Inline skill payload

                    - `data: string`

                      Base64-encoded skill zip bundle.

                    - `media_type: "application/zip"`

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

                      - `"application/zip"`

                    - `type: "base64"`

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

                      - `"base64"`

                  - `type: "inline"`

                    Defines an inline skill for this request.

                    - `"inline"`

            - `BetaLocalEnvironment`

              - `type: "local"`

                Use a local computer environment.

                - `"local"`

              - `skills?: Array<BetaLocalSkill>`

                An optional list of skills.

                - `description: string`

                  The description of the skill.

                - `name: string`

                  The name of the skill.

                - `path: string`

                  The path to the directory containing the skill.

            - `BetaContainerReference`

              - `container_id: string`

                The ID of the referenced container.

              - `type: "container_reference"`

                References a container created with the /v1/containers endpoint

                - `"container_reference"`

        - `BetaCustomTool`

          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)

          - `name: string`

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

          - `type: "custom"`

            The type of the custom tool. Always `custom`.

            - `"custom"`

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

            The tool invocation context(s).

            - `"direct"`

            - `"programmatic"`

          - `defer_loading?: boolean`

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

          - `description?: string`

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

          - `format?: Text | Grammar`

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

            - `Text`

              Unconstrained free-form text.

              - `type: "text"`

                Unconstrained text format. Always `text`.

                - `"text"`

            - `Grammar`

              A grammar defined by the user.

              - `definition: string`

                The grammar definition.

              - `syntax: "lark" | "regex"`

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

                - `"lark"`

                - `"regex"`

              - `type: "grammar"`

                Grammar format. Always `grammar`.

                - `"grammar"`

        - `BetaNamespaceTool`

          Groups function/custom tools under a shared namespace.

          - `description: string`

            A description of the namespace shown to the model.

          - `name: string`

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

          - `tools: Array<Function | BetaCustomTool>`

            The function/custom tools available inside this namespace.

            - `Function`

              - `name: string`

              - `type: "function"`

                - `"function"`

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

                The tool invocation context(s).

                - `"direct"`

                - `"programmatic"`

              - `defer_loading?: boolean`

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

              - `description?: string | null`

              - `output_schema?: Record<string, unknown> | null`

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

              - `parameters?: unknown`

              - `strict?: boolean | null`

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

            - `BetaCustomTool`

              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: "namespace"`

            The type of the tool. Always `namespace`.

            - `"namespace"`

        - `BetaToolSearchTool`

          Hosted or BYOT tool search configuration for deferred tools.

          - `type: "tool_search"`

            The type of the tool. Always `tool_search`.

            - `"tool_search"`

          - `description?: string | null`

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

          - `execution?: "server" | "client"`

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

            - `"server"`

            - `"client"`

          - `parameters?: unknown`

            Parameter schema for a client-executed tool search tool.

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

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

            - `"web_search_preview"`

            - `"web_search_preview_2025_03_11"`

          - `search_content_types?: Array<"text" | "image">`

            - `"text"`

            - `"image"`

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

            - `"low"`

            - `"medium"`

            - `"high"`

          - `user_location?: UserLocation | null`

            The user's location.

            - `type: "approximate"`

              The type of location approximation. Always `approximate`.

              - `"approximate"`

            - `city?: string | null`

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

            - `country?: string | null`

              The two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of the user, e.g. `US`.

            - `region?: string | null`

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

            - `timezone?: string | null`

              The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of the user, e.g. `America/Los_Angeles`.

        - `BetaApplyPatchTool`

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

          - `type: "apply_patch"`

            The type of the tool. Always `apply_patch`.

            - `"apply_patch"`

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

            The tool invocation context(s).

            - `"direct"`

            - `"programmatic"`

      - `type: "tool_search_output"`

        The type of the item. Always `tool_search_output`.

        - `"tool_search_output"`

      - `agent?: Agent`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

      - `created_by?: string`

        The identifier of the actor that created the item.

    - `AdditionalTools`

      - `id: string`

        The unique ID of the additional tools item.

      - `role: "unknown" | "user" | "assistant" | 5 more`

        The role that provided the additional tools.

        - `"unknown"`

        - `"user"`

        - `"assistant"`

        - `"system"`

        - `"critic"`

        - `"discriminator"`

        - `"developer"`

        - `"tool"`

      - `tools: Array<BetaTool>`

        The additional tool definitions made available at this item.

        - `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).

        - `Mcp`

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

        - `CodeInterpreter`

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

        - `ProgrammaticToolCalling`

        - `ImageGeneration`

          A tool that generates images using the GPT image models.

        - `LocalShell`

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

        - `BetaFunctionShellTool`

          A tool that allows the model to execute shell commands.

        - `BetaCustomTool`

          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)

        - `BetaNamespaceTool`

          Groups function/custom tools under a shared namespace.

        - `BetaToolSearchTool`

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

        - `BetaApplyPatchTool`

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

      - `type: "additional_tools"`

        The type of the item. Always `additional_tools`.

        - `"additional_tools"`

      - `agent?: Agent`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

    - `BetaResponseCompactionItem`

      A compaction item generated by the [`v1/responses/compact` API](https://platform.openai.com/docs/api-reference/responses/compact).

      - `id: string`

        The unique ID of the compaction item.

      - `encrypted_content: string`

        The encrypted content that was produced by compaction.

      - `type: "compaction"`

        The type of the item. Always `compaction`.

        - `"compaction"`

      - `agent?: Agent`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

      - `created_by?: string`

        The identifier of the actor that created the item.

    - `ImageGenerationCall`

      An image generation request made by the model.

      - `id: string`

        The unique ID of the image generation call.

      - `result: string | null`

        The generated image encoded in base64.

      - `status: "in_progress" | "completed" | "generating" | "failed"`

        The status of the image generation call.

        - `"in_progress"`

        - `"completed"`

        - `"generating"`

        - `"failed"`

      - `type: "image_generation_call"`

        The type of the image generation call. Always `image_generation_call`.

        - `"image_generation_call"`

      - `agent?: Agent | null`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

    - `BetaResponseCodeInterpreterToolCall`

      A tool call to run code.

      - `id: string`

        The unique ID of the code interpreter tool call.

      - `code: string | null`

        The code to run, or null if not available.

      - `container_id: string`

        The ID of the container used to run the code.

      - `outputs: Array<Logs | Image> | null`

        The outputs generated by the code interpreter, such as logs or images.
        Can be null if no outputs are available.

        - `Logs`

          The logs output from the code interpreter.

          - `logs: string`

            The logs output from the code interpreter.

          - `type: "logs"`

            The type of the output. Always `logs`.

            - `"logs"`

        - `Image`

          The image output from the code interpreter.

          - `type: "image"`

            The type of the output. Always `image`.

            - `"image"`

          - `url: string`

            The URL of the image output from the code interpreter.

      - `status: "in_progress" | "completed" | "incomplete" | 2 more`

        The status of the code interpreter tool call. Valid values are `in_progress`, `completed`, `incomplete`, `interpreting`, and `failed`.

        - `"in_progress"`

        - `"completed"`

        - `"incomplete"`

        - `"interpreting"`

        - `"failed"`

      - `type: "code_interpreter_call"`

        The type of the code interpreter tool call. Always `code_interpreter_call`.

        - `"code_interpreter_call"`

      - `agent?: Agent | null`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

    - `LocalShellCall`

      A tool call to run a command on the local shell.

      - `id: string`

        The unique ID of the local shell call.

      - `action: Action`

        Execute a shell command on the server.

        - `command: Array<string>`

          The command to run.

        - `env: Record<string, string>`

          Environment variables to set for the command.

        - `type: "exec"`

          The type of the local shell action. Always `exec`.

          - `"exec"`

        - `timeout_ms?: number | null`

          Optional timeout in milliseconds for the command.

        - `user?: string | null`

          Optional user to run the command as.

        - `working_directory?: string | null`

          Optional working directory to run the command in.

      - `call_id: string`

        The unique ID of the local shell tool call generated by the model.

      - `status: "in_progress" | "completed" | "incomplete"`

        The status of the local shell call.

        - `"in_progress"`

        - `"completed"`

        - `"incomplete"`

      - `type: "local_shell_call"`

        The type of the local shell call. Always `local_shell_call`.

        - `"local_shell_call"`

      - `agent?: Agent | null`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

    - `LocalShellCallOutput`

      The output of a local shell tool call.

      - `id: string`

        The unique ID of the local shell tool call generated by the model.

      - `output: string`

        A JSON string of the output of the local shell tool call.

      - `type: "local_shell_call_output"`

        The type of the local shell tool call output. Always `local_shell_call_output`.

        - `"local_shell_call_output"`

      - `agent?: Agent | null`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

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

        The status of the item. One of `in_progress`, `completed`, or `incomplete`.

        - `"in_progress"`

        - `"completed"`

        - `"incomplete"`

    - `BetaResponseFunctionShellToolCall`

      A tool call that executes one or more shell commands in a managed environment.

      - `id: string`

        The unique ID of the shell tool call. Populated when this item is returned via API.

      - `action: Action`

        The shell commands and limits that describe how to run the tool call.

        - `commands: Array<string>`

        - `max_output_length: number | null`

          Optional maximum number of characters to return from each command.

        - `timeout_ms: number | null`

          Optional timeout in milliseconds for the commands.

      - `call_id: string`

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

      - `environment: BetaResponseLocalEnvironment | BetaResponseContainerReference | null`

        Represents the use of a local environment to perform shell actions.

        - `BetaResponseLocalEnvironment`

          Represents the use of a local environment to perform shell actions.

          - `type: "local"`

            The environment type. Always `local`.

            - `"local"`

        - `BetaResponseContainerReference`

          Represents a container created with /v1/containers.

          - `container_id: string`

          - `type: "container_reference"`

            The environment type. Always `container_reference`.

            - `"container_reference"`

      - `status: "in_progress" | "completed" | "incomplete"`

        The status of the shell call. One of `in_progress`, `completed`, or `incomplete`.

        - `"in_progress"`

        - `"completed"`

        - `"incomplete"`

      - `type: "shell_call"`

        The type of the item. Always `shell_call`.

        - `"shell_call"`

      - `agent?: Agent`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

      - `caller?: Direct | Program | null`

        The execution context that produced this tool call.

        - `Direct`

          - `type: "direct"`

            - `"direct"`

        - `Program`

          - `caller_id: string`

            The call ID of the program item that produced this tool call.

          - `type: "program"`

            - `"program"`

      - `created_by?: string`

        The ID of the entity that created this tool call.

    - `BetaResponseFunctionShellToolCallOutput`

      The output of a shell tool call that was emitted.

      - `id: string`

        The unique ID of the shell call output. Populated when this item is returned via API.

      - `call_id: string`

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

      - `max_output_length: number | null`

        The maximum length of the shell command output. This is generated by the model and should be passed back with the raw output.

      - `output: Array<Output>`

        An array of shell call output contents

        - `outcome: Timeout | Exit`

          Represents either an exit outcome (with an exit code) or a timeout outcome for a shell call output chunk.

          - `Timeout`

            Indicates that the shell call exceeded its configured time limit.

            - `type: "timeout"`

              The outcome type. Always `timeout`.

              - `"timeout"`

          - `Exit`

            Indicates that the shell commands finished and returned an exit code.

            - `exit_code: number`

              Exit code from the shell process.

            - `type: "exit"`

              The outcome type. Always `exit`.

              - `"exit"`

        - `stderr: string`

          The standard error output that was captured.

        - `stdout: string`

          The standard output that was captured.

        - `created_by?: string`

          The identifier of the actor that created the item.

      - `status: "in_progress" | "completed" | "incomplete"`

        The status of the shell call output. One of `in_progress`, `completed`, or `incomplete`.

        - `"in_progress"`

        - `"completed"`

        - `"incomplete"`

      - `type: "shell_call_output"`

        The type of the shell call output. Always `shell_call_output`.

        - `"shell_call_output"`

      - `agent?: Agent`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

      - `caller?: Direct | Program | null`

        The execution context that produced this tool call.

        - `Direct`

          - `type: "direct"`

            - `"direct"`

        - `Program`

          - `caller_id: string`

            The call ID of the program item that produced this tool call.

          - `type: "program"`

            - `"program"`

      - `created_by?: string`

        The identifier of the actor that created the item.

    - `BetaResponseApplyPatchToolCall`

      A tool call that applies file diffs by creating, deleting, or updating files.

      - `id: string`

        The unique ID of the apply patch tool call. Populated when this item is returned via API.

      - `call_id: string`

        The unique ID of the apply patch tool call generated by the model.

      - `operation: CreateFile | DeleteFile | UpdateFile`

        One of the create_file, delete_file, or update_file operations applied via apply_patch.

        - `CreateFile`

          Instruction describing how to create a file via the apply_patch tool.

          - `diff: string`

            Diff to apply.

          - `path: string`

            Path of the file to create.

          - `type: "create_file"`

            Create a new file with the provided diff.

            - `"create_file"`

        - `DeleteFile`

          Instruction describing how to delete a file via the apply_patch tool.

          - `path: string`

            Path of the file to delete.

          - `type: "delete_file"`

            Delete the specified file.

            - `"delete_file"`

        - `UpdateFile`

          Instruction describing how to update a file via the apply_patch tool.

          - `diff: string`

            Diff to apply.

          - `path: string`

            Path of the file to update.

          - `type: "update_file"`

            Update an existing file with the provided diff.

            - `"update_file"`

      - `status: "in_progress" | "completed"`

        The status of the apply patch tool call. One of `in_progress` or `completed`.

        - `"in_progress"`

        - `"completed"`

      - `type: "apply_patch_call"`

        The type of the item. Always `apply_patch_call`.

        - `"apply_patch_call"`

      - `agent?: Agent`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

      - `caller?: Direct | Program | null`

        The execution context that produced this tool call.

        - `Direct`

          - `type: "direct"`

            - `"direct"`

        - `Program`

          - `caller_id: string`

            The call ID of the program item that produced this tool call.

          - `type: "program"`

            - `"program"`

      - `created_by?: string`

        The ID of the entity that created this tool call.

    - `BetaResponseApplyPatchToolCallOutput`

      The output emitted by an apply patch tool call.

      - `id: string`

        The unique ID of the apply patch tool call output. Populated when this item is returned via API.

      - `call_id: string`

        The unique ID of the apply patch tool call generated by the model.

      - `status: "completed" | "failed"`

        The status of the apply patch tool call output. One of `completed` or `failed`.

        - `"completed"`

        - `"failed"`

      - `type: "apply_patch_call_output"`

        The type of the item. Always `apply_patch_call_output`.

        - `"apply_patch_call_output"`

      - `agent?: Agent`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

      - `caller?: Direct | Program | null`

        The execution context that produced this tool call.

        - `Direct`

          - `type: "direct"`

            - `"direct"`

        - `Program`

          - `caller_id: string`

            The call ID of the program item that produced this tool call.

          - `type: "program"`

            - `"program"`

      - `created_by?: string`

        The ID of the entity that created this tool call output.

      - `output?: string | null`

        Optional textual output returned by the apply patch tool.

    - `McpCall`

      An invocation of a tool on an MCP server.

      - `id: string`

        The unique ID of the tool call.

      - `arguments: string`

        A JSON string of the arguments passed to the tool.

      - `name: string`

        The name of the tool that was run.

      - `server_label: string`

        The label of the MCP server running the tool.

      - `type: "mcp_call"`

        The type of the item. Always `mcp_call`.

        - `"mcp_call"`

      - `agent?: Agent | null`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

      - `approval_request_id?: string | null`

        Unique identifier for the MCP tool call approval request.
        Include this value in a subsequent `mcp_approval_response` input to approve or reject the corresponding tool call.

      - `error?: BetaMcpToolCallError | null`

        The error from the tool call, if any.

        - `McpProtocolError`

          - `code: number`

          - `message: string`

          - `type: "mcp_protocol_error"`

            - `"mcp_protocol_error"`

        - `McpToolExecutionError`

          - `content: unknown`

          - `type: "mcp_tool_execution_error"`

            - `"mcp_tool_execution_error"`

        - `HTTPError`

          - `code: number`

          - `message: string`

          - `type: "http_error"`

            - `"http_error"`

      - `output?: string | null`

        The output from the tool call.

      - `status?: "in_progress" | "completed" | "incomplete" | 2 more`

        The status of the tool call. One of `in_progress`, `completed`, `incomplete`, `calling`, or `failed`.

        - `"in_progress"`

        - `"completed"`

        - `"incomplete"`

        - `"calling"`

        - `"failed"`

    - `McpListTools`

      A list of tools available on an MCP server.

      - `id: string`

        The unique ID of the list.

      - `server_label: string`

        The label of the MCP server.

      - `tools: Array<Tool>`

        The tools available on the server.

        - `input_schema: unknown`

          The JSON schema describing the tool's input.

        - `name: string`

          The name of the tool.

        - `annotations?: unknown`

          Additional annotations about the tool.

        - `description?: string | null`

          The description of the tool.

      - `type: "mcp_list_tools"`

        The type of the item. Always `mcp_list_tools`.

        - `"mcp_list_tools"`

      - `agent?: Agent | null`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

      - `error?: string | null`

        Error message if the server could not list tools.

    - `McpApprovalRequest`

      A request for human approval of a tool invocation.

      - `id: string`

        The unique ID of the approval request.

      - `arguments: string`

        A JSON string of arguments for the tool.

      - `name: string`

        The name of the tool to run.

      - `server_label: string`

        The label of the MCP server making the request.

      - `type: "mcp_approval_request"`

        The type of the item. Always `mcp_approval_request`.

        - `"mcp_approval_request"`

      - `agent?: Agent | null`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

    - `McpApprovalResponse`

      A response to an MCP approval request.

      - `id: string`

        The unique ID of the approval response

      - `approval_request_id: string`

        The ID of the approval request being answered.

      - `approve: boolean`

        Whether the request was approved.

      - `type: "mcp_approval_response"`

        The type of the item. Always `mcp_approval_response`.

        - `"mcp_approval_response"`

      - `agent?: Agent | null`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

      - `reason?: string | null`

        Optional reason for the decision.

    - `BetaResponseCustomToolCall`

      A call to a custom tool created by the model.

      - `call_id: string`

        An identifier used to map this custom tool call to a tool call output.

      - `input: string`

        The input for the custom tool call generated by the model.

      - `name: string`

        The name of the custom tool being called.

      - `type: "custom_tool_call"`

        The type of the custom tool call. Always `custom_tool_call`.

        - `"custom_tool_call"`

      - `id?: string`

        The unique ID of the custom tool call in the OpenAI platform.

      - `agent?: Agent | null`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

      - `caller?: Direct | Program | null`

        The execution context that produced this tool call.

        - `Direct`

          - `type: "direct"`

            - `"direct"`

        - `Program`

          - `caller_id: string`

            The call ID of the program item that produced this tool call.

          - `type: "program"`

            - `"program"`

      - `namespace?: string`

        The namespace of the custom tool being called.

    - `BetaResponseCustomToolCallOutputItem extends BetaResponseCustomToolCallOutput`

      The output of a custom tool call from your code, being sent back to the model.

      - `id: string`

        The unique ID of the custom tool call output item.

      - `status: "in_progress" | "completed" | "incomplete"`

        The status of the item. One of `in_progress`, `completed`, or
        `incomplete`. Populated when items are returned via API.

        - `"in_progress"`

        - `"completed"`

        - `"incomplete"`

      - `created_by?: string`

        The identifier of the actor that created the item.

  - `usage: BetaResponseUsage`

    Token accounting for the compaction pass, including cached, reasoning, and total tokens.

    - `input_tokens: number`

      The number of input tokens.

    - `input_tokens_details: InputTokensDetails`

      A detailed breakdown of the input tokens.

      - `cache_write_tokens: number`

        The number of input tokens that were written to the cache.

      - `cached_tokens: number`

        The number of tokens that were retrieved from the cache.
        [More on prompt caching](https://platform.openai.com/docs/guides/prompt-caching).

    - `output_tokens: number`

      The number of output tokens.

    - `output_tokens_details: OutputTokensDetails`

      A detailed breakdown of the output tokens.

      - `reasoning_tokens: number`

        The number of reasoning tokens.

    - `total_tokens: number`

      The total number of tokens used.

### Beta Computer Action

- `BetaComputerAction = Click | DoubleClick | Drag | 6 more`

  A click action.

  - `Click`

    A click action.

    - `button: "left" | "right" | "wheel" | 2 more`

      Indicates which mouse button was pressed during the click. One of `left`, `right`, `wheel`, `back`, or `forward`.

      - `"left"`

      - `"right"`

      - `"wheel"`

      - `"back"`

      - `"forward"`

    - `type: "click"`

      Specifies the event type. For a click action, this property is always `click`.

      - `"click"`

    - `x: number`

      The x-coordinate where the click occurred.

    - `y: number`

      The y-coordinate where the click occurred.

    - `keys?: Array<string> | null`

      The keys being held while clicking.

  - `DoubleClick`

    A double click action.

    - `keys: Array<string> | null`

      The keys being held while double-clicking.

    - `type: "double_click"`

      Specifies the event type. For a double click action, this property is always set to `double_click`.

      - `"double_click"`

    - `x: number`

      The x-coordinate where the double click occurred.

    - `y: number`

      The y-coordinate where the double click occurred.

  - `Drag`

    A drag action.

    - `path: Array<Path>`

      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 }
      ]
      ```

      - `x: number`

        The x-coordinate.

      - `y: number`

        The y-coordinate.

    - `type: "drag"`

      Specifies the event type. For a drag action, this property is always set to `drag`.

      - `"drag"`

    - `keys?: Array<string> | null`

      The keys being held while dragging the mouse.

  - `Keypress`

    A collection of keypresses the model would like to perform.

    - `keys: Array<string>`

      The combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key.

    - `type: "keypress"`

      Specifies the event type. For a keypress action, this property is always set to `keypress`.

      - `"keypress"`

  - `Move`

    A mouse move action.

    - `type: "move"`

      Specifies the event type. For a move action, this property is always set to `move`.

      - `"move"`

    - `x: number`

      The x-coordinate to move to.

    - `y: number`

      The y-coordinate to move to.

    - `keys?: Array<string> | null`

      The keys being held while moving the mouse.

  - `Screenshot`

    A screenshot action.

    - `type: "screenshot"`

      Specifies the event type. For a screenshot action, this property is always set to `screenshot`.

      - `"screenshot"`

  - `Scroll`

    A scroll action.

    - `scroll_x: number`

      The horizontal scroll distance.

    - `scroll_y: number`

      The vertical scroll distance.

    - `type: "scroll"`

      Specifies the event type. For a scroll action, this property is always set to `scroll`.

      - `"scroll"`

    - `x: number`

      The x-coordinate where the scroll occurred.

    - `y: number`

      The y-coordinate where the scroll occurred.

    - `keys?: Array<string> | null`

      The keys being held while scrolling.

  - `Type`

    An action to type in text.

    - `text: string`

      The text to type.

    - `type: "type"`

      Specifies the event type. For a type action, this property is always set to `type`.

      - `"type"`

  - `Wait`

    A wait action.

    - `type: "wait"`

      Specifies the event type. For a wait action, this property is always set to `wait`.

      - `"wait"`

### Beta Computer Action List

- `BetaComputerActionList = Array<BetaComputerAction>`

  Flattened batched actions for `computer_use`. Each action includes an
  `type` discriminator and action-specific fields.

  - `Click`

    A click action.

    - `button: "left" | "right" | "wheel" | 2 more`

      Indicates which mouse button was pressed during the click. One of `left`, `right`, `wheel`, `back`, or `forward`.

      - `"left"`

      - `"right"`

      - `"wheel"`

      - `"back"`

      - `"forward"`

    - `type: "click"`

      Specifies the event type. For a click action, this property is always `click`.

      - `"click"`

    - `x: number`

      The x-coordinate where the click occurred.

    - `y: number`

      The y-coordinate where the click occurred.

    - `keys?: Array<string> | null`

      The keys being held while clicking.

  - `DoubleClick`

    A double click action.

    - `keys: Array<string> | null`

      The keys being held while double-clicking.

    - `type: "double_click"`

      Specifies the event type. For a double click action, this property is always set to `double_click`.

      - `"double_click"`

    - `x: number`

      The x-coordinate where the double click occurred.

    - `y: number`

      The y-coordinate where the double click occurred.

  - `Drag`

    A drag action.

    - `path: Array<Path>`

      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 }
      ]
      ```

      - `x: number`

        The x-coordinate.

      - `y: number`

        The y-coordinate.

    - `type: "drag"`

      Specifies the event type. For a drag action, this property is always set to `drag`.

      - `"drag"`

    - `keys?: Array<string> | null`

      The keys being held while dragging the mouse.

  - `Keypress`

    A collection of keypresses the model would like to perform.

    - `keys: Array<string>`

      The combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key.

    - `type: "keypress"`

      Specifies the event type. For a keypress action, this property is always set to `keypress`.

      - `"keypress"`

  - `Move`

    A mouse move action.

    - `type: "move"`

      Specifies the event type. For a move action, this property is always set to `move`.

      - `"move"`

    - `x: number`

      The x-coordinate to move to.

    - `y: number`

      The y-coordinate to move to.

    - `keys?: Array<string> | null`

      The keys being held while moving the mouse.

  - `Screenshot`

    A screenshot action.

    - `type: "screenshot"`

      Specifies the event type. For a screenshot action, this property is always set to `screenshot`.

      - `"screenshot"`

  - `Scroll`

    A scroll action.

    - `scroll_x: number`

      The horizontal scroll distance.

    - `scroll_y: number`

      The vertical scroll distance.

    - `type: "scroll"`

      Specifies the event type. For a scroll action, this property is always set to `scroll`.

      - `"scroll"`

    - `x: number`

      The x-coordinate where the scroll occurred.

    - `y: number`

      The y-coordinate where the scroll occurred.

    - `keys?: Array<string> | null`

      The keys being held while scrolling.

  - `Type`

    An action to type in text.

    - `text: string`

      The text to type.

    - `type: "type"`

      Specifies the event type. For a type action, this property is always set to `type`.

      - `"type"`

  - `Wait`

    A wait action.

    - `type: "wait"`

      Specifies the event type. For a wait action, this property is always set to `wait`.

      - `"wait"`

### Beta Computer Tool

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

    The type of the computer tool. Always `computer`.

    - `"computer"`

### Beta Computer Use Preview Tool

- `BetaComputerUsePreviewTool`

  A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use).

  - `display_height: number`

    The height of the computer display.

  - `display_width: number`

    The width of the computer display.

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

    The type of computer environment to control.

    - `"windows"`

    - `"mac"`

    - `"linux"`

    - `"ubuntu"`

    - `"browser"`

  - `type: "computer_use_preview"`

    The type of the computer use tool. Always `computer_use_preview`.

    - `"computer_use_preview"`

### Beta Container Auto

- `BetaContainerAuto`

  - `type: "container_auto"`

    Automatically creates a container for this request

    - `"container_auto"`

  - `file_ids?: Array<string>`

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

  - `memory_limit?: "1g" | "4g" | "16g" | "64g" | null`

    The memory limit for the container.

    - `"1g"`

    - `"4g"`

    - `"16g"`

    - `"64g"`

  - `network_policy?: BetaContainerNetworkPolicyDisabled | BetaContainerNetworkPolicyAllowlist`

    Network access policy for the container.

    - `BetaContainerNetworkPolicyDisabled`

      - `type: "disabled"`

        Disable outbound network access. Always `disabled`.

        - `"disabled"`

    - `BetaContainerNetworkPolicyAllowlist`

      - `allowed_domains: Array<string>`

        A list of allowed domains when type is `allowlist`.

      - `type: "allowlist"`

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

        - `"allowlist"`

      - `domain_secrets?: Array<BetaContainerNetworkPolicyDomainSecret>`

        Optional domain-scoped secrets for allowlisted domains.

        - `domain: string`

          The domain associated with the secret.

        - `name: string`

          The name of the secret to inject for the domain.

        - `value: string`

          The secret value to inject for the domain.

  - `skills?: Array<BetaSkillReference | BetaInlineSkill>`

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

    - `BetaSkillReference`

      - `skill_id: string`

        The ID of the referenced skill.

      - `type: "skill_reference"`

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

        - `"skill_reference"`

      - `version?: string`

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

    - `BetaInlineSkill`

      - `description: string`

        The description of the skill.

      - `name: string`

        The name of the skill.

      - `source: BetaInlineSkillSource`

        Inline skill payload

        - `data: string`

          Base64-encoded skill zip bundle.

        - `media_type: "application/zip"`

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

          - `"application/zip"`

        - `type: "base64"`

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

          - `"base64"`

      - `type: "inline"`

        Defines an inline skill for this request.

        - `"inline"`

### Beta Container Network Policy Allowlist

- `BetaContainerNetworkPolicyAllowlist`

  - `allowed_domains: Array<string>`

    A list of allowed domains when type is `allowlist`.

  - `type: "allowlist"`

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

    - `"allowlist"`

  - `domain_secrets?: Array<BetaContainerNetworkPolicyDomainSecret>`

    Optional domain-scoped secrets for allowlisted domains.

    - `domain: string`

      The domain associated with the secret.

    - `name: string`

      The name of the secret to inject for the domain.

    - `value: string`

      The secret value to inject for the domain.

### Beta Container Network Policy Disabled

- `BetaContainerNetworkPolicyDisabled`

  - `type: "disabled"`

    Disable outbound network access. Always `disabled`.

    - `"disabled"`

### Beta Container Network Policy Domain Secret

- `BetaContainerNetworkPolicyDomainSecret`

  - `domain: string`

    The domain associated with the secret.

  - `name: string`

    The name of the secret to inject for the domain.

  - `value: string`

    The secret value to inject for the domain.

### Beta Container Reference

- `BetaContainerReference`

  - `container_id: string`

    The ID of the referenced container.

  - `type: "container_reference"`

    References a container created with the /v1/containers endpoint

    - `"container_reference"`

### Beta Custom Tool

- `BetaCustomTool`

  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)

  - `name: string`

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

  - `type: "custom"`

    The type of the custom tool. Always `custom`.

    - `"custom"`

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

    The tool invocation context(s).

    - `"direct"`

    - `"programmatic"`

  - `defer_loading?: boolean`

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

  - `description?: string`

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

  - `format?: Text | Grammar`

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

    - `Text`

      Unconstrained free-form text.

      - `type: "text"`

        Unconstrained text format. Always `text`.

        - `"text"`

    - `Grammar`

      A grammar defined by the user.

      - `definition: string`

        The grammar definition.

      - `syntax: "lark" | "regex"`

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

        - `"lark"`

        - `"regex"`

      - `type: "grammar"`

        Grammar format. Always `grammar`.

        - `"grammar"`

### Beta Easy Input Message

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

  - `content: string | BetaResponseInputMessageContentList`

    Text, image, or audio input to the model, used to generate a response.
    Can also contain previous assistant responses.

    - `string`

    - `BetaResponseInputMessageContentList = Array<BetaResponseInputContent>`

      A list of one or many input items to the model, containing different content
      types.

      - `BetaResponseInputText`

        A text input to the model.

        - `text: string`

          The text input to the model.

        - `type: "input_text"`

          The type of the input item. Always `input_text`.

          - `"input_text"`

        - `prompt_cache_breakpoint?: PromptCacheBreakpoint`

          Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.

          - `mode: "explicit"`

            The breakpoint mode. Always `explicit`.

            - `"explicit"`

      - `BetaResponseInputImage`

        An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision).

        - `detail: BetaImageDetail`

          The detail level of the image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`.

          - `"low"`

          - `"high"`

          - `"auto"`

          - `"original"`

        - `type: "input_image"`

          The type of the input item. Always `input_image`.

          - `"input_image"`

        - `file_id?: string | null`

          The ID of the file to be sent to the model.

        - `image_url?: string | null`

          The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.

        - `prompt_cache_breakpoint?: PromptCacheBreakpoint`

          Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.

          - `mode: "explicit"`

            The breakpoint mode. Always `explicit`.

            - `"explicit"`

      - `BetaResponseInputFile`

        A file input to the model.

        - `type: "input_file"`

          The type of the input item. Always `input_file`.

          - `"input_file"`

        - `detail?: "auto" | "low" | "high"`

          The detail level of the file to be sent to the model. Use `auto` to let the system select the detail level; for GPT-5.6 and later models, `auto` uses high-quality rendering, which may increase input token usage. Use `low` for lower-cost rendering, or `high` to render the file at higher quality. Defaults to `auto`.

          - `"auto"`

          - `"low"`

          - `"high"`

        - `file_data?: string`

          The content of the file to be sent to the model.

        - `file_id?: string | null`

          The ID of the file to be sent to the model.

        - `file_url?: string`

          The URL of the file to be sent to the model.

        - `filename?: string`

          The name of the file to be sent to the model.

        - `prompt_cache_breakpoint?: PromptCacheBreakpoint`

          Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.

          - `mode: "explicit"`

            The breakpoint mode. Always `explicit`.

            - `"explicit"`

  - `role: "user" | "assistant" | "system" | "developer"`

    The role of the message input. One of `user`, `assistant`, `system`, or
    `developer`.

    - `"user"`

    - `"assistant"`

    - `"system"`

    - `"developer"`

  - `phase?: "commentary" | "final_answer" | null`

    Labels an `assistant` message as intermediate commentary (`commentary`) or the final answer (`final_answer`).
    For models like `gpt-5.3-codex` and beyond, when sending follow-up requests, preserve and resend
    phase on all assistant messages — dropping it can degrade performance. Not used for user messages.

    - `"commentary"`

    - `"final_answer"`

  - `type?: "message"`

    The type of the message input. Always `message`.

    - `"message"`

### Beta File Search Tool

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

    The type of the file search tool. Always `file_search`.

    - `"file_search"`

  - `vector_store_ids: Array<string>`

    The IDs of the vector stores to search.

  - `filters?: ComparisonFilter | CompoundFilter | null`

    A filter to apply.

    - `ComparisonFilter`

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

      - `key: string`

        The key to compare against the value.

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

        Specifies the comparison operator: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`, `in`, `nin`.

        - `eq`: equals
        - `ne`: not equal
        - `gt`: greater than
        - `gte`: greater than or equal
        - `lt`: less than
        - `lte`: less than or equal
        - `in`: in
        - `nin`: not in

        - `"eq"`

        - `"ne"`

        - `"gt"`

        - `"gte"`

        - `"lt"`

        - `"lte"`

        - `"in"`

        - `"nin"`

      - `value: string | number | boolean | Array<string | number>`

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

        - `string`

        - `number`

        - `boolean`

        - `Array<string | number>`

          - `string`

          - `number`

    - `CompoundFilter`

      Combine multiple filters using `and` or `or`.

      - `filters: Array<ComparisonFilter | unknown>`

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

        - `ComparisonFilter`

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

          - `key: string`

            The key to compare against the value.

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

            Specifies the comparison operator: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`, `in`, `nin`.

            - `eq`: equals
            - `ne`: not equal
            - `gt`: greater than
            - `gte`: greater than or equal
            - `lt`: less than
            - `lte`: less than or equal
            - `in`: in
            - `nin`: not in

            - `"eq"`

            - `"ne"`

            - `"gt"`

            - `"gte"`

            - `"lt"`

            - `"lte"`

            - `"in"`

            - `"nin"`

          - `value: string | number | boolean | Array<string | number>`

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

            - `string`

            - `number`

            - `boolean`

            - `Array<string | number>`

              - `string`

              - `number`

        - `unknown`

      - `type: "and" | "or"`

        Type of operation: `and` or `or`.

        - `"and"`

        - `"or"`

  - `max_num_results?: number`

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

  - `ranking_options?: RankingOptions`

    Ranking options for search.

    - `hybrid_search?: HybridSearch`

      Weights that control how reciprocal rank fusion balances semantic embedding matches versus sparse keyword matches when hybrid search is enabled.

      - `embedding_weight: number`

        The weight of the embedding in the reciprocal ranking fusion.

      - `text_weight: number`

        The weight of the text in the reciprocal ranking fusion.

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

      The ranker to use for the file search.

      - `"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.

### Beta Function Shell Tool

- `BetaFunctionShellTool`

  A tool that allows the model to execute shell commands.

  - `type: "shell"`

    The type of the shell tool. Always `shell`.

    - `"shell"`

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

    The tool invocation context(s).

    - `"direct"`

    - `"programmatic"`

  - `environment?: BetaContainerAuto | BetaLocalEnvironment | BetaContainerReference | null`

    - `BetaContainerAuto`

      - `type: "container_auto"`

        Automatically creates a container for this request

        - `"container_auto"`

      - `file_ids?: Array<string>`

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

      - `memory_limit?: "1g" | "4g" | "16g" | "64g" | null`

        The memory limit for the container.

        - `"1g"`

        - `"4g"`

        - `"16g"`

        - `"64g"`

      - `network_policy?: BetaContainerNetworkPolicyDisabled | BetaContainerNetworkPolicyAllowlist`

        Network access policy for the container.

        - `BetaContainerNetworkPolicyDisabled`

          - `type: "disabled"`

            Disable outbound network access. Always `disabled`.

            - `"disabled"`

        - `BetaContainerNetworkPolicyAllowlist`

          - `allowed_domains: Array<string>`

            A list of allowed domains when type is `allowlist`.

          - `type: "allowlist"`

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

            - `"allowlist"`

          - `domain_secrets?: Array<BetaContainerNetworkPolicyDomainSecret>`

            Optional domain-scoped secrets for allowlisted domains.

            - `domain: string`

              The domain associated with the secret.

            - `name: string`

              The name of the secret to inject for the domain.

            - `value: string`

              The secret value to inject for the domain.

      - `skills?: Array<BetaSkillReference | BetaInlineSkill>`

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

        - `BetaSkillReference`

          - `skill_id: string`

            The ID of the referenced skill.

          - `type: "skill_reference"`

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

            - `"skill_reference"`

          - `version?: string`

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

        - `BetaInlineSkill`

          - `description: string`

            The description of the skill.

          - `name: string`

            The name of the skill.

          - `source: BetaInlineSkillSource`

            Inline skill payload

            - `data: string`

              Base64-encoded skill zip bundle.

            - `media_type: "application/zip"`

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

              - `"application/zip"`

            - `type: "base64"`

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

              - `"base64"`

          - `type: "inline"`

            Defines an inline skill for this request.

            - `"inline"`

    - `BetaLocalEnvironment`

      - `type: "local"`

        Use a local computer environment.

        - `"local"`

      - `skills?: Array<BetaLocalSkill>`

        An optional list of skills.

        - `description: string`

          The description of the skill.

        - `name: string`

          The name of the skill.

        - `path: string`

          The path to the directory containing the skill.

    - `BetaContainerReference`

      - `container_id: string`

        The ID of the referenced container.

      - `type: "container_reference"`

        References a container created with the /v1/containers endpoint

        - `"container_reference"`

### Beta Function Tool

- `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).

  - `name: string`

    The name of the function to call.

  - `parameters: Record<string, unknown> | null`

    A JSON schema object describing the parameters of the function.

  - `strict: boolean | null`

    Whether strict parameter validation is enforced for this function tool.

  - `type: "function"`

    The type of the function tool. Always `function`.

    - `"function"`

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

    The tool invocation context(s).

    - `"direct"`

    - `"programmatic"`

  - `defer_loading?: boolean`

    Whether this function is deferred and loaded via tool search.

  - `description?: string | null`

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

  - `output_schema?: Record<string, unknown> | null`

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

### Beta Image Detail

- `BetaImageDetail = "low" | "high" | "auto" | "original"`

  - `"low"`

  - `"high"`

  - `"auto"`

  - `"original"`

### Beta Inline Skill

- `BetaInlineSkill`

  - `description: string`

    The description of the skill.

  - `name: string`

    The name of the skill.

  - `source: BetaInlineSkillSource`

    Inline skill payload

    - `data: string`

      Base64-encoded skill zip bundle.

    - `media_type: "application/zip"`

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

      - `"application/zip"`

    - `type: "base64"`

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

      - `"base64"`

  - `type: "inline"`

    Defines an inline skill for this request.

    - `"inline"`

### Beta Inline Skill Source

- `BetaInlineSkillSource`

  Inline skill payload

  - `data: string`

    Base64-encoded skill zip bundle.

  - `media_type: "application/zip"`

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

    - `"application/zip"`

  - `type: "base64"`

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

    - `"base64"`

### Beta Local Environment

- `BetaLocalEnvironment`

  - `type: "local"`

    Use a local computer environment.

    - `"local"`

  - `skills?: Array<BetaLocalSkill>`

    An optional list of skills.

    - `description: string`

      The description of the skill.

    - `name: string`

      The name of the skill.

    - `path: string`

      The path to the directory containing the skill.

### Beta Local Skill

- `BetaLocalSkill`

  - `description: string`

    The description of the skill.

  - `name: string`

    The name of the skill.

  - `path: string`

    The path to the directory containing the skill.

### Beta Mcp Tool Call Error

- `BetaMcpToolCallError = McpProtocolError | McpToolExecutionError | HTTPError`

  - `McpProtocolError`

    - `code: number`

    - `message: string`

    - `type: "mcp_protocol_error"`

      - `"mcp_protocol_error"`

  - `McpToolExecutionError`

    - `content: unknown`

    - `type: "mcp_tool_execution_error"`

      - `"mcp_tool_execution_error"`

  - `HTTPError`

    - `code: number`

    - `message: string`

    - `type: "http_error"`

      - `"http_error"`

### Beta Namespace Tool

- `BetaNamespaceTool`

  Groups function/custom tools under a shared namespace.

  - `description: string`

    A description of the namespace shown to the model.

  - `name: string`

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

  - `tools: Array<Function | BetaCustomTool>`

    The function/custom tools available inside this namespace.

    - `Function`

      - `name: string`

      - `type: "function"`

        - `"function"`

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

        The tool invocation context(s).

        - `"direct"`

        - `"programmatic"`

      - `defer_loading?: boolean`

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

      - `description?: string | null`

      - `output_schema?: Record<string, unknown> | null`

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

      - `parameters?: unknown`

      - `strict?: boolean | null`

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

    - `BetaCustomTool`

      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)

      - `name: string`

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

      - `type: "custom"`

        The type of the custom tool. Always `custom`.

        - `"custom"`

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

        The tool invocation context(s).

        - `"direct"`

        - `"programmatic"`

      - `defer_loading?: boolean`

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

      - `description?: string`

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

      - `format?: Text | Grammar`

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

        - `Text`

          Unconstrained free-form text.

          - `type: "text"`

            Unconstrained text format. Always `text`.

            - `"text"`

        - `Grammar`

          A grammar defined by the user.

          - `definition: string`

            The grammar definition.

          - `syntax: "lark" | "regex"`

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

            - `"lark"`

            - `"regex"`

          - `type: "grammar"`

            Grammar format. Always `grammar`.

            - `"grammar"`

  - `type: "namespace"`

    The type of the tool. Always `namespace`.

    - `"namespace"`

### Beta Response

- `BetaResponse`

  - `id: string`

    Unique identifier for this Response.

  - `created_at: number`

    Unix timestamp (in seconds) of when this Response was created.

  - `error: BetaResponseError | null`

    An error object returned when the model fails to generate a Response.

    - `code: "server_error" | "rate_limit_exceeded" | "invalid_prompt" | 17 more`

      The error code for the response.

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

    - `message: string`

      A human-readable description of the error.

  - `incomplete_details: IncompleteDetails | null`

    Details about why the response is incomplete.

    - `reason?: "max_output_tokens" | "content_filter"`

      The reason why the response is incomplete.

      - `"max_output_tokens"`

      - `"content_filter"`

  - `instructions: string | Array<BetaResponseInputItem> | null`

    A system (or developer) message inserted into the model's context.

    When using along with `previous_response_id`, the instructions from a previous
    response will not be carried over to the next response. This makes it simple
    to swap out system (or developer) messages in new responses.

    - `string`

    - `Array<BetaResponseInputItem>`

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

        - `content: string | BetaResponseInputMessageContentList`

          Text, image, or audio input to the model, used to generate a response.
          Can also contain previous assistant responses.

          - `string`

          - `BetaResponseInputMessageContentList = Array<BetaResponseInputContent>`

            A list of one or many input items to the model, containing different content
            types.

            - `BetaResponseInputText`

              A text input to the model.

              - `text: string`

                The text input to the model.

              - `type: "input_text"`

                The type of the input item. Always `input_text`.

                - `"input_text"`

              - `prompt_cache_breakpoint?: PromptCacheBreakpoint`

                Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.

                - `mode: "explicit"`

                  The breakpoint mode. Always `explicit`.

                  - `"explicit"`

            - `BetaResponseInputImage`

              An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision).

              - `detail: BetaImageDetail`

                The detail level of the image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`.

                - `"low"`

                - `"high"`

                - `"auto"`

                - `"original"`

              - `type: "input_image"`

                The type of the input item. Always `input_image`.

                - `"input_image"`

              - `file_id?: string | null`

                The ID of the file to be sent to the model.

              - `image_url?: string | null`

                The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.

              - `prompt_cache_breakpoint?: PromptCacheBreakpoint`

                Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.

                - `mode: "explicit"`

                  The breakpoint mode. Always `explicit`.

                  - `"explicit"`

            - `BetaResponseInputFile`

              A file input to the model.

              - `type: "input_file"`

                The type of the input item. Always `input_file`.

                - `"input_file"`

              - `detail?: "auto" | "low" | "high"`

                The detail level of the file to be sent to the model. Use `auto` to let the system select the detail level; for GPT-5.6 and later models, `auto` uses high-quality rendering, which may increase input token usage. Use `low` for lower-cost rendering, or `high` to render the file at higher quality. Defaults to `auto`.

                - `"auto"`

                - `"low"`

                - `"high"`

              - `file_data?: string`

                The content of the file to be sent to the model.

              - `file_id?: string | null`

                The ID of the file to be sent to the model.

              - `file_url?: string`

                The URL of the file to be sent to the model.

              - `filename?: string`

                The name of the file to be sent to the model.

              - `prompt_cache_breakpoint?: PromptCacheBreakpoint`

                Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.

                - `mode: "explicit"`

                  The breakpoint mode. Always `explicit`.

                  - `"explicit"`

        - `role: "user" | "assistant" | "system" | "developer"`

          The role of the message input. One of `user`, `assistant`, `system`, or
          `developer`.

          - `"user"`

          - `"assistant"`

          - `"system"`

          - `"developer"`

        - `phase?: "commentary" | "final_answer" | null`

          Labels an `assistant` message as intermediate commentary (`commentary`) or the final answer (`final_answer`).
          For models like `gpt-5.3-codex` and beyond, when sending follow-up requests, preserve and resend
          phase on all assistant messages — dropping it can degrade performance. Not used for user messages.

          - `"commentary"`

          - `"final_answer"`

        - `type?: "message"`

          The type of the message input. Always `message`.

          - `"message"`

      - `Message`

        A message input to the model with a role indicating instruction following
        hierarchy. Instructions given with the `developer` or `system` role take
        precedence over instructions given with the `user` role.

        - `content: BetaResponseInputMessageContentList`

          A list of one or many input items to the model, containing different content
          types.

        - `role: "user" | "system" | "developer"`

          The role of the message input. One of `user`, `system`, or `developer`.

          - `"user"`

          - `"system"`

          - `"developer"`

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `status?: "in_progress" | "completed" | "incomplete"`

          The status of item. One of `in_progress`, `completed`, or
          `incomplete`. Populated when items are returned via API.

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

        - `type?: "message"`

          The type of the message input. Always set to `message`.

          - `"message"`

      - `BetaResponseOutputMessage`

        An output message from the model.

        - `id: string`

          The unique ID of the output message.

        - `content: Array<BetaResponseOutputText | BetaResponseOutputRefusal>`

          The content of the output message.

          - `BetaResponseOutputText`

            A text output from the model.

            - `annotations: Array<FileCitation | URLCitation | ContainerFileCitation | FilePath>`

              The annotations of the text output.

              - `FileCitation`

                A citation to a file.

                - `file_id: string`

                  The ID of the file.

                - `filename: string`

                  The filename of the file cited.

                - `index: number`

                  The index of the file in the list of files.

                - `type: "file_citation"`

                  The type of the file citation. Always `file_citation`.

                  - `"file_citation"`

              - `URLCitation`

                A citation for a web resource used to generate a model response.

                - `end_index: number`

                  The index of the last character of the URL citation in the message.

                - `start_index: number`

                  The index of the first character of the URL citation in the message.

                - `title: string`

                  The title of the web resource.

                - `type: "url_citation"`

                  The type of the URL citation. Always `url_citation`.

                  - `"url_citation"`

                - `url: string`

                  The URL of the web resource.

              - `ContainerFileCitation`

                A citation for a container file used to generate a model response.

                - `container_id: string`

                  The ID of the container file.

                - `end_index: number`

                  The index of the last character of the container file citation in the message.

                - `file_id: string`

                  The ID of the file.

                - `filename: string`

                  The filename of the container file cited.

                - `start_index: number`

                  The index of the first character of the container file citation in the message.

                - `type: "container_file_citation"`

                  The type of the container file citation. Always `container_file_citation`.

                  - `"container_file_citation"`

              - `FilePath`

                A path to a file.

                - `file_id: string`

                  The ID of the file.

                - `index: number`

                  The index of the file in the list of files.

                - `type: "file_path"`

                  The type of the file path. Always `file_path`.

                  - `"file_path"`

            - `text: string`

              The text output from the model.

            - `type: "output_text"`

              The type of the output text. Always `output_text`.

              - `"output_text"`

            - `logprobs?: Array<Logprob>`

              - `token: string`

              - `bytes: Array<number>`

              - `logprob: number`

              - `top_logprobs: Array<TopLogprob>`

                - `token: string`

                - `bytes: Array<number>`

                - `logprob: number`

          - `BetaResponseOutputRefusal`

            A refusal from the model.

            - `refusal: string`

              The refusal explanation from the model.

            - `type: "refusal"`

              The type of the refusal. Always `refusal`.

              - `"refusal"`

        - `role: "assistant"`

          The role of the output message. Always `assistant`.

          - `"assistant"`

        - `status: "in_progress" | "completed" | "incomplete"`

          The status of the message input. One of `in_progress`, `completed`, or
          `incomplete`. Populated when input items are returned via API.

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

        - `type: "message"`

          The type of the output message. Always `message`.

          - `"message"`

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `phase?: "commentary" | "final_answer" | null`

          Labels an `assistant` message as intermediate commentary (`commentary`) or the final answer (`final_answer`).
          For models like `gpt-5.3-codex` and beyond, when sending follow-up requests, preserve and resend
          phase on all assistant messages — dropping it can degrade performance. Not used for user messages.

          - `"commentary"`

          - `"final_answer"`

      - `BetaResponseFileSearchToolCall`

        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.

        - `id: string`

          The unique ID of the file search tool call.

        - `queries: Array<string>`

          The queries used to search for files.

        - `status: "in_progress" | "searching" | "completed" | 2 more`

          The status of the file search tool call. One of `in_progress`,
          `searching`, `incomplete` or `failed`,

          - `"in_progress"`

          - `"searching"`

          - `"completed"`

          - `"incomplete"`

          - `"failed"`

        - `type: "file_search_call"`

          The type of the file search tool call. Always `file_search_call`.

          - `"file_search_call"`

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `results?: Array<Result> | null`

          The results of the file search tool call.

          - `attributes?: Record<string, string | number | boolean> | null`

            Set of 16 key-value pairs that can be attached to an object. This can be
            useful for storing additional information about the object in a structured
            format, and querying for objects via API or the dashboard. Keys are strings
            with a maximum length of 64 characters. Values are strings with a maximum
            length of 512 characters, booleans, or numbers.

            - `string`

            - `number`

            - `boolean`

          - `file_id?: string`

            The unique ID of the file.

          - `filename?: string`

            The name of the file.

          - `score?: number`

            The relevance score of the file - a value between 0 and 1.

          - `text?: string`

            The text that was retrieved from the file.

      - `BetaResponseComputerToolCall`

        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.

        - `id: string`

          The unique ID of the computer call.

        - `call_id: string`

          An identifier used when responding to the tool call with output.

        - `pending_safety_checks: Array<PendingSafetyCheck>`

          The pending safety checks for the computer call.

          - `id: string`

            The ID of the pending safety check.

          - `code?: string | null`

            The type of the pending safety check.

          - `message?: string | null`

            Details about the pending safety check.

        - `status: "in_progress" | "completed" | "incomplete"`

          The status of the item. One of `in_progress`, `completed`, or
          `incomplete`. Populated when items are returned via API.

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

        - `type: "computer_call"`

          The type of the computer call. Always `computer_call`.

          - `"computer_call"`

        - `action?: BetaComputerAction`

          A click action.

          - `Click`

            A click action.

            - `button: "left" | "right" | "wheel" | 2 more`

              Indicates which mouse button was pressed during the click. One of `left`, `right`, `wheel`, `back`, or `forward`.

              - `"left"`

              - `"right"`

              - `"wheel"`

              - `"back"`

              - `"forward"`

            - `type: "click"`

              Specifies the event type. For a click action, this property is always `click`.

              - `"click"`

            - `x: number`

              The x-coordinate where the click occurred.

            - `y: number`

              The y-coordinate where the click occurred.

            - `keys?: Array<string> | null`

              The keys being held while clicking.

          - `DoubleClick`

            A double click action.

            - `keys: Array<string> | null`

              The keys being held while double-clicking.

            - `type: "double_click"`

              Specifies the event type. For a double click action, this property is always set to `double_click`.

              - `"double_click"`

            - `x: number`

              The x-coordinate where the double click occurred.

            - `y: number`

              The y-coordinate where the double click occurred.

          - `Drag`

            A drag action.

            - `path: Array<Path>`

              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 }
              ]
              ```

              - `x: number`

                The x-coordinate.

              - `y: number`

                The y-coordinate.

            - `type: "drag"`

              Specifies the event type. For a drag action, this property is always set to `drag`.

              - `"drag"`

            - `keys?: Array<string> | null`

              The keys being held while dragging the mouse.

          - `Keypress`

            A collection of keypresses the model would like to perform.

            - `keys: Array<string>`

              The combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key.

            - `type: "keypress"`

              Specifies the event type. For a keypress action, this property is always set to `keypress`.

              - `"keypress"`

          - `Move`

            A mouse move action.

            - `type: "move"`

              Specifies the event type. For a move action, this property is always set to `move`.

              - `"move"`

            - `x: number`

              The x-coordinate to move to.

            - `y: number`

              The y-coordinate to move to.

            - `keys?: Array<string> | null`

              The keys being held while moving the mouse.

          - `Screenshot`

            A screenshot action.

            - `type: "screenshot"`

              Specifies the event type. For a screenshot action, this property is always set to `screenshot`.

              - `"screenshot"`

          - `Scroll`

            A scroll action.

            - `scroll_x: number`

              The horizontal scroll distance.

            - `scroll_y: number`

              The vertical scroll distance.

            - `type: "scroll"`

              Specifies the event type. For a scroll action, this property is always set to `scroll`.

              - `"scroll"`

            - `x: number`

              The x-coordinate where the scroll occurred.

            - `y: number`

              The y-coordinate where the scroll occurred.

            - `keys?: Array<string> | null`

              The keys being held while scrolling.

          - `Type`

            An action to type in text.

            - `text: string`

              The text to type.

            - `type: "type"`

              Specifies the event type. For a type action, this property is always set to `type`.

              - `"type"`

          - `Wait`

            A wait action.

            - `type: "wait"`

              Specifies the event type. For a wait action, this property is always set to `wait`.

              - `"wait"`

        - `actions?: BetaComputerActionList`

          Flattened batched actions for `computer_use`. Each action includes an
          `type` discriminator and action-specific fields.

          - `Click`

            A click action.

          - `DoubleClick`

            A double click action.

          - `Drag`

            A drag action.

          - `Keypress`

            A collection of keypresses the model would like to perform.

          - `Move`

            A mouse move action.

          - `Screenshot`

            A screenshot action.

          - `Scroll`

            A scroll action.

          - `Type`

            An action to type in text.

          - `Wait`

            A wait action.

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

      - `ComputerCallOutput`

        The output of a computer tool call.

        - `call_id: string`

          The ID of the computer tool call that produced the output.

        - `output: BetaResponseComputerToolCallOutputScreenshot`

          A computer screenshot image used with the computer use tool.

          - `type: "computer_screenshot"`

            Specifies the event type. For a computer screenshot, this property is
            always set to `computer_screenshot`.

            - `"computer_screenshot"`

          - `file_id?: string`

            The identifier of an uploaded file that contains the screenshot.

          - `image_url?: string`

            The URL of the screenshot image.

        - `type: "computer_call_output"`

          The type of the computer tool call output. Always `computer_call_output`.

          - `"computer_call_output"`

        - `id?: string | null`

          The ID of the computer tool call output.

        - `acknowledged_safety_checks?: Array<AcknowledgedSafetyCheck> | null`

          The safety checks reported by the API that have been acknowledged by the developer.

          - `id: string`

            The ID of the pending safety check.

          - `code?: string | null`

            The type of the pending safety check.

          - `message?: string | null`

            Details about the pending safety check.

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

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

          The status of the message input. One of `in_progress`, `completed`, or `incomplete`. Populated when input items are returned via API.

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

      - `BetaResponseFunctionWebSearch`

        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.

        - `id: string`

          The unique ID of the web search tool call.

        - `action: Search | OpenPage | FindInPage`

          An object describing the specific action taken in this web search call.
          Includes details on how the model used the web (search, open_page, find_in_page).

          - `Search`

            Action type "search" - Performs a web search query.

            - `type: "search"`

              The action type.

              - `"search"`

            - `queries?: Array<string>`

              The search queries.

            - `query?: string`

              The search query.

            - `sources?: Array<Source>`

              The sources used in the search.

              - `type: "url"`

                The type of source. Always `url`.

                - `"url"`

              - `url: string`

                The URL of the source.

          - `OpenPage`

            Action type "open_page" - Opens a specific URL from search results.

            - `type: "open_page"`

              The action type.

              - `"open_page"`

            - `url?: string | null`

              The URL opened by the model.

          - `FindInPage`

            Action type "find_in_page": Searches for a pattern within a loaded page.

            - `pattern: string`

              The pattern or text to search for within the page.

            - `type: "find_in_page"`

              The action type.

              - `"find_in_page"`

            - `url: string`

              The URL of the page searched for the pattern.

        - `status: "in_progress" | "searching" | "completed" | "failed"`

          The status of the web search tool call.

          - `"in_progress"`

          - `"searching"`

          - `"completed"`

          - `"failed"`

        - `type: "web_search_call"`

          The type of the web search tool call. Always `web_search_call`.

          - `"web_search_call"`

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

      - `BetaResponseFunctionToolCall`

        A tool call to run a function. See the
        [function calling guide](https://platform.openai.com/docs/guides/function-calling) for more information.

        - `arguments: string`

          A JSON string of the arguments to pass to the function.

        - `call_id: string`

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

        - `name: string`

          The name of the function to run.

        - `type: "function_call"`

          The type of the function tool call. Always `function_call`.

          - `"function_call"`

        - `id?: string`

          The unique ID of the function tool call.

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `caller?: Direct | Program | null`

          The execution context that produced this tool call.

          - `Direct`

            - `type: "direct"`

              - `"direct"`

          - `Program`

            - `caller_id: string`

              The call ID of the program item that produced this tool call.

            - `type: "program"`

              - `"program"`

        - `namespace?: string`

          The namespace of the function to run.

        - `status?: "in_progress" | "completed" | "incomplete"`

          The status of the item. One of `in_progress`, `completed`, or
          `incomplete`. Populated when items are returned via API.

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

      - `FunctionCallOutput`

        The output of a function tool call.

        - `call_id: string`

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

        - `output: string | BetaResponseFunctionCallOutputItemList`

          Text, image, or file output of the function tool call.

          - `string`

          - `BetaResponseFunctionCallOutputItemList = Array<BetaResponseFunctionCallOutputItem>`

            An array of content outputs (text, image, file) for the function tool call.

            - `BetaResponseInputTextContent`

              A text input to the model.

              - `text: string`

                The text input to the model.

              - `type: "input_text"`

                The type of the input item. Always `input_text`.

                - `"input_text"`

              - `prompt_cache_breakpoint?: PromptCacheBreakpoint | null`

                Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.

                - `mode: "explicit"`

                  The breakpoint mode. Always `explicit`.

                  - `"explicit"`

            - `BetaResponseInputImageContent`

              An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision)

              - `type: "input_image"`

                The type of the input item. Always `input_image`.

                - `"input_image"`

              - `detail?: BetaImageDetail | null`

                The detail level of the image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`.

              - `file_id?: string | null`

                The ID of the file to be sent to the model.

              - `image_url?: string | null`

                The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.

              - `prompt_cache_breakpoint?: PromptCacheBreakpoint | null`

                Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.

                - `mode: "explicit"`

                  The breakpoint mode. Always `explicit`.

                  - `"explicit"`

            - `BetaResponseInputFileContent`

              A file input to the model.

              - `type: "input_file"`

                The type of the input item. Always `input_file`.

                - `"input_file"`

              - `detail?: "auto" | "low" | "high"`

                The detail level of the file to be sent to the model. Use `auto` to let the system select the detail level; for GPT-5.6 and later models, `auto` uses high-quality rendering, which may increase input token usage. Use `low` for lower-cost rendering, or `high` to render the file at higher quality. Defaults to `auto`.

                - `"auto"`

                - `"low"`

                - `"high"`

              - `file_data?: string | null`

                The base64-encoded data of the file to be sent to the model.

              - `file_id?: string | null`

                The ID of the file to be sent to the model.

              - `file_url?: string | null`

                The URL of the file to be sent to the model.

              - `filename?: string | null`

                The name of the file to be sent to the model.

              - `prompt_cache_breakpoint?: PromptCacheBreakpoint | null`

                Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.

                - `mode: "explicit"`

                  The breakpoint mode. Always `explicit`.

                  - `"explicit"`

        - `type: "function_call_output"`

          The type of the function tool call output. Always `function_call_output`.

          - `"function_call_output"`

        - `id?: string | null`

          The unique ID of the function tool call output. Populated when this item is returned via API.

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `caller?: Direct | Program | null`

          The execution context that produced this tool call.

          - `Direct`

            - `type: "direct"`

              The caller type. Always `direct`.

              - `"direct"`

          - `Program`

            - `caller_id: string`

              The call ID of the program item that produced this tool call.

            - `type: "program"`

              The caller type. Always `program`.

              - `"program"`

        - `name?: string | null`

          The name of the tool that produced the output.

        - `namespace?: string | null`

          The namespace of the tool that produced the output.

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

          The status of the item. One of `in_progress`, `completed`, or `incomplete`. Populated when items are returned via API.

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

      - `AgentMessage`

        A message routed between agents.

        - `author: string`

          The sending agent identity.

        - `content: Array<BetaResponseInputTextContent | BetaResponseInputImageContent | EncryptedContent>`

          Plaintext, image, or encrypted content sent between agents.

          - `BetaResponseInputTextContent`

            A text input to the model.

          - `BetaResponseInputImageContent`

            An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision)

          - `EncryptedContent`

            Opaque encrypted content that Responses API decrypts inside trusted model execution.

            - `encrypted_content: string`

              Opaque encrypted content.

            - `type: "encrypted_content"`

              The type of the input item. Always `encrypted_content`.

              - `"encrypted_content"`

        - `recipient: string`

          The destination agent identity.

        - `type: "agent_message"`

          The item type. Always `agent_message`.

          - `"agent_message"`

        - `id?: string | null`

          The unique ID of this agent message item.

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

      - `MultiAgentCall`

        - `action: "spawn_agent" | "interrupt_agent" | "list_agents" | 3 more`

          The multi-agent action that was executed.

          - `"spawn_agent"`

          - `"interrupt_agent"`

          - `"list_agents"`

          - `"send_message"`

          - `"followup_task"`

          - `"wait_agent"`

        - `arguments: string`

          The action arguments as a JSON string.

        - `call_id: string`

          The unique ID linking this call to its output.

        - `type: "multi_agent_call"`

          The item type. Always `multi_agent_call`.

          - `"multi_agent_call"`

        - `id?: string | null`

          The unique ID of this multi-agent call.

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

      - `MultiAgentCallOutput`

        - `action: "spawn_agent" | "interrupt_agent" | "list_agents" | 3 more`

          The multi-agent action that produced this result.

          - `"spawn_agent"`

          - `"interrupt_agent"`

          - `"list_agents"`

          - `"send_message"`

          - `"followup_task"`

          - `"wait_agent"`

        - `call_id: string`

          The unique ID of the multi-agent call.

        - `output: Array<Output>`

          Text output returned by the multi-agent action.

          - `text: string`

            The text content.

          - `type: "output_text"`

            The content type. Always `output_text`.

            - `"output_text"`

          - `annotations?: Array<FileCitation | URLCitation | ContainerFileCitation>`

            Citations associated with the text content.

            - `FileCitation`

              - `file_id: string`

                The ID of the file.

              - `filename: string`

                The filename of the file cited.

              - `index: number`

                The index of the file in the list of files.

              - `type: "file_citation"`

                The citation type. Always `file_citation`.

                - `"file_citation"`

            - `URLCitation`

              - `end_index: number`

                The index of the last character of the citation in the message.

              - `start_index: number`

                The index of the first character of the citation in the message.

              - `title: string`

                The title of the cited resource.

              - `type: "url_citation"`

                The citation type. Always `url_citation`.

                - `"url_citation"`

              - `url: string`

                The URL of the cited resource.

            - `ContainerFileCitation`

              - `container_id: string`

                The ID of the container.

              - `end_index: number`

                The index of the last character of the citation in the message.

              - `file_id: string`

                The ID of the container file.

              - `filename: string`

                The filename of the container file cited.

              - `start_index: number`

                The index of the first character of the citation in the message.

              - `type: "container_file_citation"`

                The citation type. Always `container_file_citation`.

                - `"container_file_citation"`

        - `type: "multi_agent_call_output"`

          The item type. Always `multi_agent_call_output`.

          - `"multi_agent_call_output"`

        - `id?: string | null`

          The unique ID of this multi-agent call output.

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

      - `ToolSearchCall`

        - `arguments: unknown`

          The arguments supplied to the tool search call.

        - `type: "tool_search_call"`

          The item type. Always `tool_search_call`.

          - `"tool_search_call"`

        - `id?: string | null`

          The unique ID of this tool search call.

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `call_id?: string | null`

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

        - `execution?: "server" | "client"`

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

          - `"server"`

          - `"client"`

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

          The status of the tool search call.

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

      - `BetaResponseToolSearchOutputItemParam`

        - `tools: Array<BetaTool>`

          The loaded tool definitions returned by the tool search output.

          - `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).

            - `name: string`

              The name of the function to call.

            - `parameters: Record<string, unknown> | null`

              A JSON schema object describing the parameters of the function.

            - `strict: boolean | null`

              Whether strict parameter validation is enforced for this function tool.

            - `type: "function"`

              The type of the function tool. Always `function`.

              - `"function"`

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

              The tool invocation context(s).

              - `"direct"`

              - `"programmatic"`

            - `defer_loading?: boolean`

              Whether this function is deferred and loaded via tool search.

            - `description?: string | null`

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

            - `output_schema?: Record<string, unknown> | null`

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

          - `BetaFileSearchTool`

            A tool that searches for relevant content from uploaded files. Learn more about the [file search tool](https://platform.openai.com/docs/guides/tools-file-search).

            - `type: "file_search"`

              The type of the file search tool. Always `file_search`.

              - `"file_search"`

            - `vector_store_ids: Array<string>`

              The IDs of the vector stores to search.

            - `filters?: ComparisonFilter | CompoundFilter | null`

              A filter to apply.

              - `ComparisonFilter`

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

                - `key: string`

                  The key to compare against the value.

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

                  Specifies the comparison operator: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`, `in`, `nin`.

                  - `eq`: equals
                  - `ne`: not equal
                  - `gt`: greater than
                  - `gte`: greater than or equal
                  - `lt`: less than
                  - `lte`: less than or equal
                  - `in`: in
                  - `nin`: not in

                  - `"eq"`

                  - `"ne"`

                  - `"gt"`

                  - `"gte"`

                  - `"lt"`

                  - `"lte"`

                  - `"in"`

                  - `"nin"`

                - `value: string | number | boolean | Array<string | number>`

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

                  - `string`

                  - `number`

                  - `boolean`

                  - `Array<string | number>`

                    - `string`

                    - `number`

              - `CompoundFilter`

                Combine multiple filters using `and` or `or`.

                - `filters: Array<ComparisonFilter | unknown>`

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

                  - `ComparisonFilter`

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

                    - `key: string`

                      The key to compare against the value.

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

                      Specifies the comparison operator: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`, `in`, `nin`.

                      - `eq`: equals
                      - `ne`: not equal
                      - `gt`: greater than
                      - `gte`: greater than or equal
                      - `lt`: less than
                      - `lte`: less than or equal
                      - `in`: in
                      - `nin`: not in

                      - `"eq"`

                      - `"ne"`

                      - `"gt"`

                      - `"gte"`

                      - `"lt"`

                      - `"lte"`

                      - `"in"`

                      - `"nin"`

                    - `value: string | number | boolean | Array<string | number>`

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

                      - `string`

                      - `number`

                      - `boolean`

                      - `Array<string | number>`

                        - `string`

                        - `number`

                  - `unknown`

                - `type: "and" | "or"`

                  Type of operation: `and` or `or`.

                  - `"and"`

                  - `"or"`

            - `max_num_results?: number`

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

            - `ranking_options?: RankingOptions`

              Ranking options for search.

              - `hybrid_search?: HybridSearch`

                Weights that control how reciprocal rank fusion balances semantic embedding matches versus sparse keyword matches when hybrid search is enabled.

                - `embedding_weight: number`

                  The weight of the embedding in the reciprocal ranking fusion.

                - `text_weight: number`

                  The weight of the text in the reciprocal ranking fusion.

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

                The ranker to use for the file search.

                - `"auto"`

                - `"default-2024-11-15"`

              - `score_threshold?: number`

                The score threshold for the file search, a number between 0 and 1. Numbers closer to 1 will attempt to return only the most relevant results, but may return fewer results.

          - `BetaComputerTool`

            A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use).

            - `type: "computer"`

              The type of the computer tool. Always `computer`.

              - `"computer"`

          - `BetaComputerUsePreviewTool`

            A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use).

            - `display_height: number`

              The height of the computer display.

            - `display_width: number`

              The width of the computer display.

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

              The type of computer environment to control.

              - `"windows"`

              - `"mac"`

              - `"linux"`

              - `"ubuntu"`

              - `"browser"`

            - `type: "computer_use_preview"`

              The type of the computer use tool. Always `computer_use_preview`.

              - `"computer_use_preview"`

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

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

              - `"web_search"`

              - `"web_search_2025_08_26"`

            - `external_web_access?: boolean`

              Allow live internet access for web search. Defaults to true when omitted. When false, the web search tool runs in offline/cache-only mode and will not fetch new external content.

            - `filters?: Filters | null`

              Filters for the search.

              - `allowed_domains?: Array<string> | null`

                Allowed domains for the search. If not provided, all domains are allowed.
                Subdomains of the provided domains are allowed as well.

                Example: `["pubmed.ncbi.nlm.nih.gov"]`

            - `search_context_size?: "low" | "medium" | "high"`

              High level guidance for the amount of context window space to use for the search. One of `low`, `medium`, or `high`. `medium` is the default.

              - `"low"`

              - `"medium"`

              - `"high"`

            - `user_location?: UserLocation | null`

              The approximate location of the user.

              - `city?: string | null`

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

              - `country?: string | null`

                The two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of the user, e.g. `US`.

              - `region?: string | null`

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

              - `timezone?: string | null`

                The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of the user, e.g. `America/Los_Angeles`.

              - `type?: "approximate"`

                The type of location approximation. Always `approximate`.

                - `"approximate"`

          - `Mcp`

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

            - `server_label: string`

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

            - `type: "mcp"`

              The type of the MCP tool. Always `mcp`.

              - `"mcp"`

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

              The tool invocation context(s).

              - `"direct"`

              - `"programmatic"`

            - `allowed_tools?: Array<string> | McpToolFilter | null`

              List of allowed tool names or a filter object.

              - `Array<string>`

              - `McpToolFilter`

                A filter object to specify which tools are allowed.

                - `read_only?: boolean`

                  Indicates whether or not a tool modifies data or is read-only. If an
                  MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint),
                  it will match this filter.

                - `tool_names?: Array<string>`

                  List of allowed tool names.

            - `authorization?: string`

              An OAuth access token that can be used with a remote MCP server, either
              with a custom MCP server URL or a service connector. Your application
              must handle the OAuth authorization flow and provide the token here.

            - `connector_id?: "connector_dropbox" | "connector_gmail" | "connector_googlecalendar" | 5 more`

              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`

              - `"connector_dropbox"`

              - `"connector_gmail"`

              - `"connector_googlecalendar"`

              - `"connector_googledrive"`

              - `"connector_microsoftteams"`

              - `"connector_outlookcalendar"`

              - `"connector_outlookemail"`

              - `"connector_sharepoint"`

            - `defer_loading?: boolean`

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

            - `headers?: Record<string, string> | null`

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

            - `require_approval?: McpToolApprovalFilter | "always" | "never" | null`

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

              - `McpToolApprovalFilter`

                Specify which of the MCP server's tools require approval. Can be
                `always`, `never`, or a filter object associated with tools
                that require approval.

                - `always?: Always`

                  A filter object to specify which tools are allowed.

                  - `read_only?: boolean`

                    Indicates whether or not a tool modifies data or is read-only. If an
                    MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint),
                    it will match this filter.

                  - `tool_names?: Array<string>`

                    List of allowed tool names.

                - `never?: Never`

                  A filter object to specify which tools are allowed.

                  - `read_only?: boolean`

                    Indicates whether or not a tool modifies data or is read-only. If an
                    MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint),
                    it will match this filter.

                  - `tool_names?: Array<string>`

                    List of allowed tool names.

              - `"always" | "never"`

                - `"always"`

                - `"never"`

            - `server_description?: string`

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

            - `server_url?: string`

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

            - `tunnel_id?: string`

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

          - `CodeInterpreter`

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

            - `container: string | CodeInterpreterToolAuto`

              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`

              - `CodeInterpreterToolAuto`

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

                - `type: "auto"`

                  Always `auto`.

                  - `"auto"`

                - `file_ids?: Array<string>`

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

                - `memory_limit?: "1g" | "4g" | "16g" | "64g" | null`

                  The memory limit for the code interpreter container.

                  - `"1g"`

                  - `"4g"`

                  - `"16g"`

                  - `"64g"`

                - `network_policy?: BetaContainerNetworkPolicyDisabled | BetaContainerNetworkPolicyAllowlist`

                  Network access policy for the container.

                  - `BetaContainerNetworkPolicyDisabled`

                    - `type: "disabled"`

                      Disable outbound network access. Always `disabled`.

                      - `"disabled"`

                  - `BetaContainerNetworkPolicyAllowlist`

                    - `allowed_domains: Array<string>`

                      A list of allowed domains when type is `allowlist`.

                    - `type: "allowlist"`

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

                      - `"allowlist"`

                    - `domain_secrets?: Array<BetaContainerNetworkPolicyDomainSecret>`

                      Optional domain-scoped secrets for allowlisted domains.

                      - `domain: string`

                        The domain associated with the secret.

                      - `name: string`

                        The name of the secret to inject for the domain.

                      - `value: string`

                        The secret value to inject for the domain.

            - `type: "code_interpreter"`

              The type of the code interpreter tool. Always `code_interpreter`.

              - `"code_interpreter"`

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

              The tool invocation context(s).

              - `"direct"`

              - `"programmatic"`

          - `ProgrammaticToolCalling`

            - `type: "programmatic_tool_calling"`

              The type of the tool. Always `programmatic_tool_calling`.

              - `"programmatic_tool_calling"`

          - `ImageGeneration`

            A tool that generates images using the GPT image models.

            - `type: "image_generation"`

              The type of the image generation tool. Always `image_generation`.

              - `"image_generation"`

            - `action?: "generate" | "edit" | "auto"`

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

              - `"generate"`

              - `"edit"`

              - `"auto"`

            - `background?: "transparent" | "opaque" | "auto"`

              Allows to set transparency for the background of the generated image(s).
              Must be one of `transparent`, `opaque`, or `auto` (default value). When
              `auto` is used, the model will automatically determine the best
              background for the image.

              Transparent backgrounds are available for supported GPT Image models.
              For `gpt-image-2` and `gpt-image-2-2026-04-21`, this support is in
              preview. When using `transparent`, set the output format to `png` or
              `webp`.

              - `"transparent"`

              - `"opaque"`

              - `"auto"`

            - `input_fidelity?: "high" | "low" | null`

              Control how much effort the model will exert to match the style and features, especially facial features, of input images. This parameter is only supported for `gpt-image-1` and `gpt-image-1.5` and later models, unsupported for `gpt-image-1-mini`. Supports `high` and `low`. Defaults to `low`.

              - `"high"`

              - `"low"`

            - `input_image_mask?: InputImageMask`

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

              - `file_id?: string`

                File ID for the mask image.

              - `image_url?: string`

                Base64-encoded mask image.

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

              The image generation model to use. One of `gpt-image-1`,
              `gpt-image-1-mini`, `gpt-image-1.5`, `gpt-image-2`,
              `gpt-image-2-2026-04-21`, or `chatgpt-image-latest`. Default:
              `gpt-image-1`.

              - `(string & {})`

              - `"gpt-image-1" | "gpt-image-1-mini" | "gpt-image-2" | 3 more`

                - `"gpt-image-1"`

                - `"gpt-image-1-mini"`

                - `"gpt-image-2"`

                - `"gpt-image-2-2026-04-21"`

                - `"gpt-image-1.5"`

                - `"chatgpt-image-latest"`

            - `moderation?: "auto" | "low"`

              Moderation level for the generated image. Default: `auto`.

              - `"auto"`

              - `"low"`

            - `output_compression?: number`

              Compression level for the output image. Default: 100.

            - `output_format?: "png" | "webp" | "jpeg"`

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

              - `"png"`

              - `"webp"`

              - `"jpeg"`

            - `partial_images?: number`

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

            - `quality?: "low" | "medium" | "high" | "auto"`

              The quality of the generated image. One of `low`, `medium`, `high`,
              or `auto`. Default: `auto`.

              - `"low"`

              - `"medium"`

              - `"high"`

              - `"auto"`

            - `size?: (string & {}) | "1024x1024" | "1024x1536" | "1536x1024" | "auto"`

              The size of the generated images. For `gpt-image-2` and `gpt-image-2-2026-04-21`, arbitrary resolutions are supported as `WIDTHxHEIGHT` strings, for example `1536x864`. Width and height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above `2560x1440` are experimental, and the maximum supported resolution is `3840x2160`. The requested size must also satisfy the model's current pixel and edge limits. The standard sizes `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models; `auto` is supported for models that allow automatic sizing. For `dall-e-2`, use one of `256x256`, `512x512`, or `1024x1024`. For `dall-e-3`, use one of `1024x1024`, `1792x1024`, or `1024x1792`.

              - `(string & {})`

              - `"1024x1024" | "1024x1536" | "1536x1024" | "auto"`

                - `"1024x1024"`

                - `"1024x1536"`

                - `"1536x1024"`

                - `"auto"`

          - `LocalShell`

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

            - `type: "local_shell"`

              The type of the local shell tool. Always `local_shell`.

              - `"local_shell"`

          - `BetaFunctionShellTool`

            A tool that allows the model to execute shell commands.

            - `type: "shell"`

              The type of the shell tool. Always `shell`.

              - `"shell"`

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

              The tool invocation context(s).

              - `"direct"`

              - `"programmatic"`

            - `environment?: BetaContainerAuto | BetaLocalEnvironment | BetaContainerReference | null`

              - `BetaContainerAuto`

                - `type: "container_auto"`

                  Automatically creates a container for this request

                  - `"container_auto"`

                - `file_ids?: Array<string>`

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

                - `memory_limit?: "1g" | "4g" | "16g" | "64g" | null`

                  The memory limit for the container.

                  - `"1g"`

                  - `"4g"`

                  - `"16g"`

                  - `"64g"`

                - `network_policy?: BetaContainerNetworkPolicyDisabled | BetaContainerNetworkPolicyAllowlist`

                  Network access policy for the container.

                  - `BetaContainerNetworkPolicyDisabled`

                  - `BetaContainerNetworkPolicyAllowlist`

                - `skills?: Array<BetaSkillReference | BetaInlineSkill>`

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

                  - `BetaSkillReference`

                    - `skill_id: string`

                      The ID of the referenced skill.

                    - `type: "skill_reference"`

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

                      - `"skill_reference"`

                    - `version?: string`

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

                  - `BetaInlineSkill`

                    - `description: string`

                      The description of the skill.

                    - `name: string`

                      The name of the skill.

                    - `source: BetaInlineSkillSource`

                      Inline skill payload

                      - `data: string`

                        Base64-encoded skill zip bundle.

                      - `media_type: "application/zip"`

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

                        - `"application/zip"`

                      - `type: "base64"`

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

                        - `"base64"`

                    - `type: "inline"`

                      Defines an inline skill for this request.

                      - `"inline"`

              - `BetaLocalEnvironment`

                - `type: "local"`

                  Use a local computer environment.

                  - `"local"`

                - `skills?: Array<BetaLocalSkill>`

                  An optional list of skills.

                  - `description: string`

                    The description of the skill.

                  - `name: string`

                    The name of the skill.

                  - `path: string`

                    The path to the directory containing the skill.

              - `BetaContainerReference`

                - `container_id: string`

                  The ID of the referenced container.

                - `type: "container_reference"`

                  References a container created with the /v1/containers endpoint

                  - `"container_reference"`

          - `BetaCustomTool`

            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)

            - `name: string`

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

            - `type: "custom"`

              The type of the custom tool. Always `custom`.

              - `"custom"`

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

              The tool invocation context(s).

              - `"direct"`

              - `"programmatic"`

            - `defer_loading?: boolean`

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

            - `description?: string`

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

            - `format?: Text | Grammar`

              The input format for the custom tool. Default is unconstrained text.

              - `Text`

                Unconstrained free-form text.

                - `type: "text"`

                  Unconstrained text format. Always `text`.

                  - `"text"`

              - `Grammar`

                A grammar defined by the user.

                - `definition: string`

                  The grammar definition.

                - `syntax: "lark" | "regex"`

                  The syntax of the grammar definition. One of `lark` or `regex`.

                  - `"lark"`

                  - `"regex"`

                - `type: "grammar"`

                  Grammar format. Always `grammar`.

                  - `"grammar"`

          - `BetaNamespaceTool`

            Groups function/custom tools under a shared namespace.

            - `description: string`

              A description of the namespace shown to the model.

            - `name: string`

              The namespace name used in tool calls (for example, `crm`).

            - `tools: Array<Function | BetaCustomTool>`

              The function/custom tools available inside this namespace.

              - `Function`

                - `name: string`

                - `type: "function"`

                  - `"function"`

                - `allowed_callers?: Array<"direct" | "programmatic"> | null`

                  The tool invocation context(s).

                  - `"direct"`

                  - `"programmatic"`

                - `defer_loading?: boolean`

                  Whether this function should be deferred and discovered via tool search.

                - `description?: string | null`

                - `output_schema?: Record<string, unknown> | null`

                  A JSON Schema describing the JSON value encoded in string outputs for this function tool. This does not describe content-array outputs.

                - `parameters?: unknown`

                - `strict?: boolean | null`

                  Whether to enforce strict parameter validation. If omitted, Responses attempts to use strict validation when the schema is compatible, and falls back to non-strict validation otherwise.

              - `BetaCustomTool`

                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: "namespace"`

              The type of the tool. Always `namespace`.

              - `"namespace"`

          - `BetaToolSearchTool`

            Hosted or BYOT tool search configuration for deferred tools.

            - `type: "tool_search"`

              The type of the tool. Always `tool_search`.

              - `"tool_search"`

            - `description?: string | null`

              Description shown to the model for a client-executed tool search tool.

            - `execution?: "server" | "client"`

              Whether tool search is executed by the server or by the client.

              - `"server"`

              - `"client"`

            - `parameters?: unknown`

              Parameter schema for a client-executed tool search tool.

          - `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"`

              The type of the web search tool. One of `web_search_preview` or `web_search_preview_2025_03_11`.

              - `"web_search_preview"`

              - `"web_search_preview_2025_03_11"`

            - `search_content_types?: Array<"text" | "image">`

              - `"text"`

              - `"image"`

            - `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.

              - `"low"`

              - `"medium"`

              - `"high"`

            - `user_location?: UserLocation | null`

              The user's location.

              - `type: "approximate"`

                The type of location approximation. Always `approximate`.

                - `"approximate"`

              - `city?: string | null`

                Free text input for the city of the user, e.g. `San Francisco`.

              - `country?: string | null`

                The two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of the user, e.g. `US`.

              - `region?: string | null`

                Free text input for the region of the user, e.g. `California`.

              - `timezone?: string | null`

                The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of the user, e.g. `America/Los_Angeles`.

          - `BetaApplyPatchTool`

            Allows the assistant to create, delete, or update files using unified diffs.

            - `type: "apply_patch"`

              The type of the tool. Always `apply_patch`.

              - `"apply_patch"`

            - `allowed_callers?: Array<"direct" | "programmatic"> | null`

              The tool invocation context(s).

              - `"direct"`

              - `"programmatic"`

        - `type: "tool_search_output"`

          The item type. Always `tool_search_output`.

          - `"tool_search_output"`

        - `id?: string | null`

          The unique ID of this tool search output.

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `call_id?: string | null`

          The unique ID of the tool search call generated by the model.

        - `execution?: "server" | "client"`

          Whether tool search was executed by the server or by the client.

          - `"server"`

          - `"client"`

        - `status?: "in_progress" | "completed" | "incomplete" | null`

          The status of the tool search output.

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

      - `AdditionalTools`

        - `role: "developer"`

          The role that provided the additional tools. Only `developer` is supported.

          - `"developer"`

        - `tools: Array<BetaTool>`

          A list of additional tools made available at this item.

          - `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).

          - `Mcp`

            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).

          - `CodeInterpreter`

            A tool that runs Python code to help generate a response to a prompt.

          - `ProgrammaticToolCalling`

          - `ImageGeneration`

            A tool that generates images using the GPT image models.

          - `LocalShell`

            A tool that allows the model to execute shell commands in a local environment.

          - `BetaFunctionShellTool`

            A tool that allows the model to execute shell commands.

          - `BetaCustomTool`

            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)

          - `BetaNamespaceTool`

            Groups function/custom tools under a shared namespace.

          - `BetaToolSearchTool`

            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).

          - `BetaApplyPatchTool`

            Allows the assistant to create, delete, or update files using unified diffs.

        - `type: "additional_tools"`

          The item type. Always `additional_tools`.

          - `"additional_tools"`

        - `id?: string | null`

          The unique ID of this additional tools item.

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

      - `BetaResponseReasoningItem`

        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).

        - `id: string`

          The unique identifier of the reasoning content.

        - `summary: Array<Summary>`

          Reasoning summary content.

          - `text: string`

            A summary of the reasoning output from the model so far.

          - `type: "summary_text"`

            The type of the object. Always `summary_text`.

            - `"summary_text"`

        - `type: "reasoning"`

          The type of the object. Always `reasoning`.

          - `"reasoning"`

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `content?: Array<Content>`

          Reasoning text content.

          - `text: string`

            The reasoning text from the model.

          - `type: "reasoning_text"`

            The type of the reasoning text. Always `reasoning_text`.

            - `"reasoning_text"`

        - `encrypted_content?: string | null`

          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.

          When streaming, use the completed reasoning item and its
          `encrypted_content` from the `response.output_item.done` event in
          subsequent requests. The `encrypted_content` in
          `response.output_item.added` may be incomplete. This is especially
          important when `store` is `false` or when using Zero Data Retention.

        - `status?: "in_progress" | "completed" | "incomplete"`

          The status of the item. One of `in_progress`, `completed`, or
          `incomplete`. Populated when items are returned via API.

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

      - `BetaResponseCompactionItemParam`

        A compaction item generated by the [`v1/responses/compact` API](https://platform.openai.com/docs/api-reference/responses/compact).

        - `encrypted_content: string`

          The encrypted content of the compaction summary.

        - `type: "compaction"`

          The type of the item. Always `compaction`.

          - `"compaction"`

        - `id?: string | null`

          The ID of the compaction item.

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

      - `ImageGenerationCall`

        An image generation request made by the model.

        - `id: string`

          The unique ID of the image generation call.

        - `result: string | null`

          The generated image encoded in base64.

        - `status: "in_progress" | "completed" | "generating" | "failed"`

          The status of the image generation call.

          - `"in_progress"`

          - `"completed"`

          - `"generating"`

          - `"failed"`

        - `type: "image_generation_call"`

          The type of the image generation call. Always `image_generation_call`.

          - `"image_generation_call"`

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

      - `BetaResponseCodeInterpreterToolCall`

        A tool call to run code.

        - `id: string`

          The unique ID of the code interpreter tool call.

        - `code: string | null`

          The code to run, or null if not available.

        - `container_id: string`

          The ID of the container used to run the code.

        - `outputs: Array<Logs | Image> | null`

          The outputs generated by the code interpreter, such as logs or images.
          Can be null if no outputs are available.

          - `Logs`

            The logs output from the code interpreter.

            - `logs: string`

              The logs output from the code interpreter.

            - `type: "logs"`

              The type of the output. Always `logs`.

              - `"logs"`

          - `Image`

            The image output from the code interpreter.

            - `type: "image"`

              The type of the output. Always `image`.

              - `"image"`

            - `url: string`

              The URL of the image output from the code interpreter.

        - `status: "in_progress" | "completed" | "incomplete" | 2 more`

          The status of the code interpreter tool call. Valid values are `in_progress`, `completed`, `incomplete`, `interpreting`, and `failed`.

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

          - `"interpreting"`

          - `"failed"`

        - `type: "code_interpreter_call"`

          The type of the code interpreter tool call. Always `code_interpreter_call`.

          - `"code_interpreter_call"`

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

      - `LocalShellCall`

        A tool call to run a command on the local shell.

        - `id: string`

          The unique ID of the local shell call.

        - `action: Action`

          Execute a shell command on the server.

          - `command: Array<string>`

            The command to run.

          - `env: Record<string, string>`

            Environment variables to set for the command.

          - `type: "exec"`

            The type of the local shell action. Always `exec`.

            - `"exec"`

          - `timeout_ms?: number | null`

            Optional timeout in milliseconds for the command.

          - `user?: string | null`

            Optional user to run the command as.

          - `working_directory?: string | null`

            Optional working directory to run the command in.

        - `call_id: string`

          The unique ID of the local shell tool call generated by the model.

        - `status: "in_progress" | "completed" | "incomplete"`

          The status of the local shell call.

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

        - `type: "local_shell_call"`

          The type of the local shell call. Always `local_shell_call`.

          - `"local_shell_call"`

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

      - `LocalShellCallOutput`

        The output of a local shell tool call.

        - `id: string`

          The unique ID of the local shell tool call generated by the model.

        - `output: string`

          A JSON string of the output of the local shell tool call.

        - `type: "local_shell_call_output"`

          The type of the local shell tool call output. Always `local_shell_call_output`.

          - `"local_shell_call_output"`

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `status?: "in_progress" | "completed" | "incomplete" | null`

          The status of the item. One of `in_progress`, `completed`, or `incomplete`.

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

      - `ShellCall`

        A tool representing a request to execute one or more shell commands.

        - `action: Action`

          The shell commands and limits that describe how to run the tool call.

          - `commands: Array<string>`

            Ordered shell commands for the execution environment to run.

          - `max_output_length?: number | null`

            Maximum number of UTF-8 characters to capture from combined stdout and stderr output.

          - `timeout_ms?: number | null`

            Maximum wall-clock time in milliseconds to allow the shell commands to run.

        - `call_id: string`

          The unique ID of the shell tool call generated by the model.

        - `type: "shell_call"`

          The type of the item. Always `shell_call`.

          - `"shell_call"`

        - `id?: string | null`

          The unique ID of the shell tool call. Populated when this item is returned via API.

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `caller?: Direct | Program | null`

          The execution context that produced this tool call.

          - `Direct`

            - `type: "direct"`

              The caller type. Always `direct`.

              - `"direct"`

          - `Program`

            - `caller_id: string`

              The call ID of the program item that produced this tool call.

            - `type: "program"`

              The caller type. Always `program`.

              - `"program"`

        - `environment?: BetaLocalEnvironment | BetaContainerReference | null`

          The environment to execute the shell commands in.

          - `BetaLocalEnvironment`

          - `BetaContainerReference`

        - `status?: "in_progress" | "completed" | "incomplete" | null`

          The status of the shell call. One of `in_progress`, `completed`, or `incomplete`.

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

      - `ShellCallOutput`

        The streamed output items emitted by a shell tool call.

        - `call_id: string`

          The unique ID of the shell tool call generated by the model.

        - `output: Array<BetaResponseFunctionShellCallOutputContent>`

          Captured chunks of stdout and stderr output, along with their associated outcomes.

          - `outcome: Timeout | Exit`

            The exit or timeout outcome associated with this shell call.

            - `Timeout`

              Indicates that the shell call exceeded its configured time limit.

              - `type: "timeout"`

                The outcome type. Always `timeout`.

                - `"timeout"`

            - `Exit`

              Indicates that the shell commands finished and returned an exit code.

              - `exit_code: number`

                The exit code returned by the shell process.

              - `type: "exit"`

                The outcome type. Always `exit`.

                - `"exit"`

          - `stderr: string`

            Captured stderr output for the shell call.

          - `stdout: string`

            Captured stdout output for the shell call.

        - `type: "shell_call_output"`

          The type of the item. Always `shell_call_output`.

          - `"shell_call_output"`

        - `id?: string | null`

          The unique ID of the shell tool call output. Populated when this item is returned via API.

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `caller?: Direct | Program | null`

          The execution context that produced this tool call.

          - `Direct`

            - `type: "direct"`

              The caller type. Always `direct`.

              - `"direct"`

          - `Program`

            - `caller_id: string`

              The call ID of the program item that produced this tool call.

            - `type: "program"`

              The caller type. Always `program`.

              - `"program"`

        - `max_output_length?: number | null`

          The maximum number of UTF-8 characters captured for this shell call's combined output.

        - `status?: "in_progress" | "completed" | "incomplete" | null`

          The status of the shell call output.

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

      - `ApplyPatchCall`

        A tool call representing a request to create, delete, or update files using diff patches.

        - `call_id: string`

          The unique ID of the apply patch tool call generated by the model.

        - `operation: CreateFile | DeleteFile | UpdateFile`

          The specific create, delete, or update instruction for the apply_patch tool call.

          - `CreateFile`

            Instruction for creating a new file via the apply_patch tool.

            - `diff: string`

              Unified diff content to apply when creating the file.

            - `path: string`

              Path of the file to create relative to the workspace root.

            - `type: "create_file"`

              The operation type. Always `create_file`.

              - `"create_file"`

          - `DeleteFile`

            Instruction for deleting an existing file via the apply_patch tool.

            - `path: string`

              Path of the file to delete relative to the workspace root.

            - `type: "delete_file"`

              The operation type. Always `delete_file`.

              - `"delete_file"`

          - `UpdateFile`

            Instruction for updating an existing file via the apply_patch tool.

            - `diff: string`

              Unified diff content to apply to the existing file.

            - `path: string`

              Path of the file to update relative to the workspace root.

            - `type: "update_file"`

              The operation type. Always `update_file`.

              - `"update_file"`

        - `status: "in_progress" | "completed"`

          The status of the apply patch tool call. One of `in_progress` or `completed`.

          - `"in_progress"`

          - `"completed"`

        - `type: "apply_patch_call"`

          The type of the item. Always `apply_patch_call`.

          - `"apply_patch_call"`

        - `id?: string | null`

          The unique ID of the apply patch tool call. Populated when this item is returned via API.

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `caller?: Direct | Program | null`

          The execution context that produced this tool call.

          - `Direct`

            - `type: "direct"`

              The caller type. Always `direct`.

              - `"direct"`

          - `Program`

            - `caller_id: string`

              The call ID of the program item that produced this tool call.

            - `type: "program"`

              The caller type. Always `program`.

              - `"program"`

      - `ApplyPatchCallOutput`

        The streamed output emitted by an apply patch tool call.

        - `call_id: string`

          The unique ID of the apply patch tool call generated by the model.

        - `status: "completed" | "failed"`

          The status of the apply patch tool call output. One of `completed` or `failed`.

          - `"completed"`

          - `"failed"`

        - `type: "apply_patch_call_output"`

          The type of the item. Always `apply_patch_call_output`.

          - `"apply_patch_call_output"`

        - `id?: string | null`

          The unique ID of the apply patch tool call output. Populated when this item is returned via API.

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `caller?: Direct | Program | null`

          The execution context that produced this tool call.

          - `Direct`

            - `type: "direct"`

              The caller type. Always `direct`.

              - `"direct"`

          - `Program`

            - `caller_id: string`

              The call ID of the program item that produced this tool call.

            - `type: "program"`

              The caller type. Always `program`.

              - `"program"`

        - `output?: string | null`

          Optional human-readable log text from the apply patch tool (e.g., patch results or errors).

      - `McpListTools`

        A list of tools available on an MCP server.

        - `id: string`

          The unique ID of the list.

        - `server_label: string`

          The label of the MCP server.

        - `tools: Array<Tool>`

          The tools available on the server.

          - `input_schema: unknown`

            The JSON schema describing the tool's input.

          - `name: string`

            The name of the tool.

          - `annotations?: unknown`

            Additional annotations about the tool.

          - `description?: string | null`

            The description of the tool.

        - `type: "mcp_list_tools"`

          The type of the item. Always `mcp_list_tools`.

          - `"mcp_list_tools"`

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `error?: string | null`

          Error message if the server could not list tools.

      - `McpApprovalRequest`

        A request for human approval of a tool invocation.

        - `id: string`

          The unique ID of the approval request.

        - `arguments: string`

          A JSON string of arguments for the tool.

        - `name: string`

          The name of the tool to run.

        - `server_label: string`

          The label of the MCP server making the request.

        - `type: "mcp_approval_request"`

          The type of the item. Always `mcp_approval_request`.

          - `"mcp_approval_request"`

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

      - `McpApprovalResponse`

        A response to an MCP approval request.

        - `approval_request_id: string`

          The ID of the approval request being answered.

        - `approve: boolean`

          Whether the request was approved.

        - `type: "mcp_approval_response"`

          The type of the item. Always `mcp_approval_response`.

          - `"mcp_approval_response"`

        - `id?: string | null`

          The unique ID of the approval response

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `reason?: string | null`

          Optional reason for the decision.

      - `McpCall`

        An invocation of a tool on an MCP server.

        - `id: string`

          The unique ID of the tool call.

        - `arguments: string`

          A JSON string of the arguments passed to the tool.

        - `name: string`

          The name of the tool that was run.

        - `server_label: string`

          The label of the MCP server running the tool.

        - `type: "mcp_call"`

          The type of the item. Always `mcp_call`.

          - `"mcp_call"`

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `approval_request_id?: string | null`

          Unique identifier for the MCP tool call approval request.
          Include this value in a subsequent `mcp_approval_response` input to approve or reject the corresponding tool call.

        - `error?: BetaMcpToolCallError | null`

          The error from the tool call, if any.

          - `McpProtocolError`

            - `code: number`

            - `message: string`

            - `type: "mcp_protocol_error"`

              - `"mcp_protocol_error"`

          - `McpToolExecutionError`

            - `content: unknown`

            - `type: "mcp_tool_execution_error"`

              - `"mcp_tool_execution_error"`

          - `HTTPError`

            - `code: number`

            - `message: string`

            - `type: "http_error"`

              - `"http_error"`

        - `output?: string | null`

          The output from the tool call.

        - `status?: "in_progress" | "completed" | "incomplete" | 2 more`

          The status of the tool call. One of `in_progress`, `completed`, `incomplete`, `calling`, or `failed`.

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

          - `"calling"`

          - `"failed"`

      - `BetaResponseCustomToolCallOutput`

        The output of a custom tool call from your code, being sent back to the model.

        - `call_id: string`

          The call ID, used to map this custom tool call output to a custom tool call.

        - `output: string | Array<BetaResponseInputText | BetaResponseInputImage | BetaResponseInputFile>`

          The output from the custom tool call generated by your code.
          Can be a string or an list of output content.

          - `string`

          - `Array<BetaResponseInputText | BetaResponseInputImage | BetaResponseInputFile>`

            - `BetaResponseInputText`

              A text input to the model.

            - `BetaResponseInputImage`

              An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision).

            - `BetaResponseInputFile`

              A file input to the model.

        - `type: "custom_tool_call_output"`

          The type of the custom tool call output. Always `custom_tool_call_output`.

          - `"custom_tool_call_output"`

        - `id?: string`

          The unique ID of the custom tool call output in the OpenAI platform.

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `caller?: Direct | Program | null`

          The execution context that produced this tool call.

          - `Direct`

            - `type: "direct"`

              The caller type. Always `direct`.

              - `"direct"`

          - `Program`

            - `caller_id: string`

              The call ID of the program item that produced this tool call.

            - `type: "program"`

              The caller type. Always `program`.

              - `"program"`

      - `BetaResponseCustomToolCall`

        A call to a custom tool created by the model.

        - `call_id: string`

          An identifier used to map this custom tool call to a tool call output.

        - `input: string`

          The input for the custom tool call generated by the model.

        - `name: string`

          The name of the custom tool being called.

        - `type: "custom_tool_call"`

          The type of the custom tool call. Always `custom_tool_call`.

          - `"custom_tool_call"`

        - `id?: string`

          The unique ID of the custom tool call in the OpenAI platform.

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `caller?: Direct | Program | null`

          The execution context that produced this tool call.

          - `Direct`

            - `type: "direct"`

              - `"direct"`

          - `Program`

            - `caller_id: string`

              The call ID of the program item that produced this tool call.

            - `type: "program"`

              - `"program"`

        - `namespace?: string`

          The namespace of the custom tool being called.

      - `CompactionTrigger`

        Compacts the current context. Must be the final input item.

        - `type: "compaction_trigger"`

          The type of the item. Always `compaction_trigger`.

          - `"compaction_trigger"`

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

      - `ItemReference`

        An internal identifier for an item to reference.

        - `id: string`

          The ID of the item to reference.

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `type?: "item_reference" | null`

          The type of item to reference. Always `item_reference`.

          - `"item_reference"`

      - `Program`

        - `id: string`

          The unique ID of this program item.

        - `call_id: string`

          The stable call ID of the program item.

        - `code: string`

          The JavaScript source executed by programmatic tool calling.

        - `fingerprint: string`

          Opaque program replay fingerprint that must be round-tripped.

        - `type: "program"`

          The item type. Always `program`.

          - `"program"`

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

      - `ProgramOutput`

        - `id: string`

          The unique ID of this program output item.

        - `call_id: string`

          The call ID of the program item.

        - `result: string`

          The result produced by the program item.

        - `status: "completed" | "incomplete"`

          The terminal status of the program output.

          - `"completed"`

          - `"incomplete"`

        - `type: "program_output"`

          The item type. Always `program_output`.

          - `"program_output"`

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

  - `metadata: Record<string, string> | null`

    Set of 16 key-value pairs that can be attached to an object. This can be
    useful for storing additional information about the object in a structured
    format, and querying for objects via API or the dashboard.

    Keys are strings with a maximum length of 64 characters. Values are strings
    with a maximum length of 512 characters.

  - `model: "gpt-5.6-sol" | "gpt-5.6-terra" | "gpt-5.6-luna" | 99 more | (string & {})`

    Model ID used to generate the response, like `gpt-4o` or `o3`. OpenAI
    offers a wide range of models with different capabilities, performance
    characteristics, and price points. Refer to the [model guide](https://platform.openai.com/docs/models)
    to browse and compare available models.

    - `"gpt-5.6-sol" | "gpt-5.6-terra" | "gpt-5.6-luna" | 99 more`

      - `"gpt-5.6-sol"`

      - `"gpt-5.6-terra"`

      - `"gpt-5.6-luna"`

      - `"gpt-5.5"`

      - `"gpt-5.5-2026-04-23"`

      - `"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.5-pro"`

      - `"gpt-5.5-pro-2026-04-23"`

      - `"gpt-5-codex"`

      - `"gpt-5-pro"`

      - `"gpt-5-pro-2025-10-06"`

      - `"gpt-5.1-codex-max"`

      - `"gpt-daybreak-blue-latest"`

      - `"gpt-daybreak-red-latest"`

      - `"gpt-5.6-cyber"`

    - `(string & {})`

  - `object: "response"`

    The object type of this resource - always set to `response`.

    - `"response"`

  - `output: Array<BetaResponseOutputItem>`

    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.

    - `BetaResponseOutputMessage`

      An output message from the model.

    - `BetaResponseFileSearchToolCall`

      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.

    - `BetaResponseFunctionToolCall`

      A tool call to run a function. See the
      [function calling guide](https://platform.openai.com/docs/guides/function-calling) for more information.

    - `BetaResponseFunctionToolCallOutputItem`

      - `id: string`

        The unique ID of the function call tool output.

      - `call_id: string`

        The unique ID of the function tool call generated by the model.

      - `output: string | Array<BetaResponseInputText | BetaResponseInputImage | BetaResponseInputFile>`

        The output from the function call generated by your code.
        Can be a string or an list of output content.

        - `string`

        - `Array<BetaResponseInputText | BetaResponseInputImage | BetaResponseInputFile>`

          - `BetaResponseInputText`

            A text input to the model.

          - `BetaResponseInputImage`

            An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision).

          - `BetaResponseInputFile`

            A file input to 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.

        - `"in_progress"`

        - `"completed"`

        - `"incomplete"`

      - `type: "function_call_output"`

        The type of the function tool call output. Always `function_call_output`.

        - `"function_call_output"`

      - `agent?: Agent | null`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

      - `caller?: Direct | Program | null`

        The execution context that produced this tool call.

        - `Direct`

          - `type: "direct"`

            The caller type. Always `direct`.

            - `"direct"`

        - `Program`

          - `caller_id: string`

            The call ID of the program item that produced this tool call.

          - `type: "program"`

            The caller type. Always `program`.

            - `"program"`

      - `created_by?: string`

        The identifier of the actor that created the item.

      - `name?: string`

        The name of the tool that produced the output.

      - `namespace?: string`

        The namespace of the tool that produced the output.

    - `AgentMessage`

      - `id: string`

        The unique ID of the agent message.

      - `author: string`

        The sending agent identity.

      - `content: Array<BetaResponseInputText | BetaResponseOutputText | Text | 7 more>`

        Encrypted content sent between agents.

        - `BetaResponseInputText`

          A text input to the model.

        - `BetaResponseOutputText`

          A text output from the model.

        - `Text`

          A text content.

          - `text: string`

          - `type: "text"`

            - `"text"`

        - `SummaryText`

          A summary text from the model.

          - `text: string`

            A summary of the reasoning output from the model so far.

          - `type: "summary_text"`

            The type of the object. Always `summary_text`.

            - `"summary_text"`

        - `ReasoningText`

          Reasoning text from the model.

          - `text: string`

            The reasoning text from the model.

          - `type: "reasoning_text"`

            The type of the reasoning text. Always `reasoning_text`.

            - `"reasoning_text"`

        - `BetaResponseOutputRefusal`

          A refusal from the model.

        - `BetaResponseInputImage`

          An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision).

        - `ComputerScreenshot`

          A screenshot of a computer.

          - `detail: BetaImageDetail`

            The detail level of the screenshot image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`.

          - `file_id: string | null`

            The identifier of an uploaded file that contains the screenshot.

          - `image_url: string | null`

            The URL of the screenshot image.

          - `type: "computer_screenshot"`

            Specifies the event type. For a computer screenshot, this property is always set to `computer_screenshot`.

            - `"computer_screenshot"`

          - `prompt_cache_breakpoint?: PromptCacheBreakpoint`

            Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.

            - `mode: "explicit"`

              The breakpoint mode. Always `explicit`.

              - `"explicit"`

        - `BetaResponseInputFile`

          A file input to the model.

        - `EncryptedContent`

          Opaque encrypted content that Responses API decrypts inside trusted model execution.

          - `encrypted_content: string`

            Opaque encrypted content.

          - `type: "encrypted_content"`

            The type of the input item. Always `encrypted_content`.

            - `"encrypted_content"`

      - `recipient: string`

        The destination agent identity.

      - `type: "agent_message"`

        The type of the item. Always `agent_message`.

        - `"agent_message"`

      - `agent?: Agent`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

    - `MultiAgentCall`

      - `id: string`

        The unique ID of the multi-agent call item.

      - `action: "spawn_agent" | "interrupt_agent" | "list_agents" | 3 more`

        The multi-agent action to execute.

        - `"spawn_agent"`

        - `"interrupt_agent"`

        - `"list_agents"`

        - `"send_message"`

        - `"followup_task"`

        - `"wait_agent"`

      - `arguments: string`

        The JSON string of arguments generated for the action.

      - `call_id: string`

        The unique ID linking this call to its output.

      - `type: "multi_agent_call"`

        The type of the multi-agent call. Always `multi_agent_call`.

        - `"multi_agent_call"`

      - `agent?: Agent`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

    - `MultiAgentCallOutput`

      - `id: string`

        The unique ID of the multi-agent call output item.

      - `action: "spawn_agent" | "interrupt_agent" | "list_agents" | 3 more`

        The multi-agent action that produced this result.

        - `"spawn_agent"`

        - `"interrupt_agent"`

        - `"list_agents"`

        - `"send_message"`

        - `"followup_task"`

        - `"wait_agent"`

      - `call_id: string`

        The unique ID of the multi-agent call.

      - `output: Array<BetaResponseOutputText>`

        Text output returned by the multi-agent action.

        - `annotations: Array<FileCitation | URLCitation | ContainerFileCitation | FilePath>`

          The annotations of the text output.

        - `text: string`

          The text output from the model.

        - `type: "output_text"`

          The type of the output text. Always `output_text`.

        - `logprobs?: Array<Logprob>`

      - `type: "multi_agent_call_output"`

        The type of the multi-agent result. Always `multi_agent_call_output`.

        - `"multi_agent_call_output"`

      - `agent?: Agent`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

    - `BetaResponseFunctionWebSearch`

      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.

    - `BetaResponseComputerToolCall`

      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.

    - `BetaResponseComputerToolCallOutputItem`

      - `id: string`

        The unique ID of the computer call tool output.

      - `call_id: string`

        The ID of the computer tool call that produced the output.

      - `output: BetaResponseComputerToolCallOutputScreenshot`

        A computer screenshot image used with the computer use tool.

      - `status: "completed" | "incomplete" | "failed" | "in_progress"`

        The status of the message input. One of `in_progress`, `completed`, or
        `incomplete`. Populated when input items are returned via API.

        - `"completed"`

        - `"incomplete"`

        - `"failed"`

        - `"in_progress"`

      - `type: "computer_call_output"`

        The type of the computer tool call output. Always `computer_call_output`.

        - `"computer_call_output"`

      - `acknowledged_safety_checks?: Array<AcknowledgedSafetyCheck>`

        The safety checks reported by the API that have been acknowledged by the
        developer.

        - `id: string`

          The ID of the pending safety check.

        - `code?: string | null`

          The type of the pending safety check.

        - `message?: string | null`

          Details about the pending safety check.

      - `agent?: Agent | null`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

      - `created_by?: string`

        The identifier of the actor that created the item.

    - `BetaResponseReasoningItem`

      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).

    - `Program`

      - `id: string`

        The unique ID of the program item.

      - `call_id: string`

        The stable call ID of the program item.

      - `code: string`

        The JavaScript source executed by programmatic tool calling.

      - `fingerprint: string`

        Opaque program replay fingerprint that must be round-tripped.

      - `type: "program"`

        The type of the item. Always `program`.

        - `"program"`

      - `agent?: Agent`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

    - `ProgramOutput`

      - `id: string`

        The unique ID of the program output item.

      - `call_id: string`

        The call ID of the program item.

      - `result: string`

        The result produced by the program item.

      - `status: "completed" | "incomplete"`

        The terminal status of the program output item.

        - `"completed"`

        - `"incomplete"`

      - `type: "program_output"`

        The type of the item. Always `program_output`.

        - `"program_output"`

      - `agent?: Agent`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

    - `BetaResponseToolSearchCall`

      - `id: string`

        The unique ID of the tool search call item.

      - `arguments: unknown`

        Arguments used for the tool search call.

      - `call_id: string | null`

        The unique ID of the tool search call generated by the model.

      - `execution: "server" | "client"`

        Whether tool search was executed by the server or by the client.

        - `"server"`

        - `"client"`

      - `status: "in_progress" | "completed" | "incomplete"`

        The status of the tool search call item that was recorded.

        - `"in_progress"`

        - `"completed"`

        - `"incomplete"`

      - `type: "tool_search_call"`

        The type of the item. Always `tool_search_call`.

        - `"tool_search_call"`

      - `agent?: Agent`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

      - `created_by?: string`

        The identifier of the actor that created the item.

    - `BetaResponseToolSearchOutputItem`

      - `id: string`

        The unique ID of the tool search output item.

      - `call_id: string | null`

        The unique ID of the tool search call generated by the model.

      - `execution: "server" | "client"`

        Whether tool search was executed by the server or by the client.

        - `"server"`

        - `"client"`

      - `status: "in_progress" | "completed" | "incomplete"`

        The status of the tool search output item that was recorded.

        - `"in_progress"`

        - `"completed"`

        - `"incomplete"`

      - `tools: Array<BetaTool>`

        The loaded tool definitions returned by tool search.

        - `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).

        - `Mcp`

          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).

        - `CodeInterpreter`

          A tool that runs Python code to help generate a response to a prompt.

        - `ProgrammaticToolCalling`

        - `ImageGeneration`

          A tool that generates images using the GPT image models.

        - `LocalShell`

          A tool that allows the model to execute shell commands in a local environment.

        - `BetaFunctionShellTool`

          A tool that allows the model to execute shell commands.

        - `BetaCustomTool`

          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)

        - `BetaNamespaceTool`

          Groups function/custom tools under a shared namespace.

        - `BetaToolSearchTool`

          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).

        - `BetaApplyPatchTool`

          Allows the assistant to create, delete, or update files using unified diffs.

      - `type: "tool_search_output"`

        The type of the item. Always `tool_search_output`.

        - `"tool_search_output"`

      - `agent?: Agent`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

      - `created_by?: string`

        The identifier of the actor that created the item.

    - `AdditionalTools`

      - `id: string`

        The unique ID of the additional tools item.

      - `role: "unknown" | "user" | "assistant" | 5 more`

        The role that provided the additional tools.

        - `"unknown"`

        - `"user"`

        - `"assistant"`

        - `"system"`

        - `"critic"`

        - `"discriminator"`

        - `"developer"`

        - `"tool"`

      - `tools: Array<BetaTool>`

        The additional tool definitions made available at this item.

        - `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).

        - `Mcp`

          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).

        - `CodeInterpreter`

          A tool that runs Python code to help generate a response to a prompt.

        - `ProgrammaticToolCalling`

        - `ImageGeneration`

          A tool that generates images using the GPT image models.

        - `LocalShell`

          A tool that allows the model to execute shell commands in a local environment.

        - `BetaFunctionShellTool`

          A tool that allows the model to execute shell commands.

        - `BetaCustomTool`

          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)

        - `BetaNamespaceTool`

          Groups function/custom tools under a shared namespace.

        - `BetaToolSearchTool`

          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).

        - `BetaApplyPatchTool`

          Allows the assistant to create, delete, or update files using unified diffs.

      - `type: "additional_tools"`

        The type of the item. Always `additional_tools`.

        - `"additional_tools"`

      - `agent?: Agent`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

    - `BetaResponseCompactionItem`

      A compaction item generated by the [`v1/responses/compact` API](https://platform.openai.com/docs/api-reference/responses/compact).

      - `id: string`

        The unique ID of the compaction item.

      - `encrypted_content: string`

        The encrypted content that was produced by compaction.

      - `type: "compaction"`

        The type of the item. Always `compaction`.

        - `"compaction"`

      - `agent?: Agent`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

      - `created_by?: string`

        The identifier of the actor that created the item.

    - `ImageGenerationCall`

      An image generation request made by the model.

      - `id: string`

        The unique ID of the image generation call.

      - `result: string | null`

        The generated image encoded in base64.

      - `status: "in_progress" | "completed" | "generating" | "failed"`

        The status of the image generation call.

        - `"in_progress"`

        - `"completed"`

        - `"generating"`

        - `"failed"`

      - `type: "image_generation_call"`

        The type of the image generation call. Always `image_generation_call`.

        - `"image_generation_call"`

      - `agent?: Agent | null`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

    - `BetaResponseCodeInterpreterToolCall`

      A tool call to run code.

    - `LocalShellCall`

      A tool call to run a command on the local shell.

      - `id: string`

        The unique ID of the local shell call.

      - `action: Action`

        Execute a shell command on the server.

        - `command: Array<string>`

          The command to run.

        - `env: Record<string, string>`

          Environment variables to set for the command.

        - `type: "exec"`

          The type of the local shell action. Always `exec`.

          - `"exec"`

        - `timeout_ms?: number | null`

          Optional timeout in milliseconds for the command.

        - `user?: string | null`

          Optional user to run the command as.

        - `working_directory?: string | null`

          Optional working directory to run the command in.

      - `call_id: string`

        The unique ID of the local shell tool call generated by the model.

      - `status: "in_progress" | "completed" | "incomplete"`

        The status of the local shell call.

        - `"in_progress"`

        - `"completed"`

        - `"incomplete"`

      - `type: "local_shell_call"`

        The type of the local shell call. Always `local_shell_call`.

        - `"local_shell_call"`

      - `agent?: Agent | null`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

    - `LocalShellCallOutput`

      The output of a local shell tool call.

      - `id: string`

        The unique ID of the local shell tool call generated by the model.

      - `output: string`

        A JSON string of the output of the local shell tool call.

      - `type: "local_shell_call_output"`

        The type of the local shell tool call output. Always `local_shell_call_output`.

        - `"local_shell_call_output"`

      - `agent?: Agent | null`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

      - `status?: "in_progress" | "completed" | "incomplete" | null`

        The status of the item. One of `in_progress`, `completed`, or `incomplete`.

        - `"in_progress"`

        - `"completed"`

        - `"incomplete"`

    - `BetaResponseFunctionShellToolCall`

      A tool call that executes one or more shell commands in a managed environment.

      - `id: string`

        The unique ID of the shell tool call. Populated when this item is returned via API.

      - `action: Action`

        The shell commands and limits that describe how to run the tool call.

        - `commands: Array<string>`

        - `max_output_length: number | null`

          Optional maximum number of characters to return from each command.

        - `timeout_ms: number | null`

          Optional timeout in milliseconds for the commands.

      - `call_id: string`

        The unique ID of the shell tool call generated by the model.

      - `environment: BetaResponseLocalEnvironment | BetaResponseContainerReference | null`

        Represents the use of a local environment to perform shell actions.

        - `BetaResponseLocalEnvironment`

          Represents the use of a local environment to perform shell actions.

          - `type: "local"`

            The environment type. Always `local`.

            - `"local"`

        - `BetaResponseContainerReference`

          Represents a container created with /v1/containers.

          - `container_id: string`

          - `type: "container_reference"`

            The environment type. Always `container_reference`.

            - `"container_reference"`

      - `status: "in_progress" | "completed" | "incomplete"`

        The status of the shell call. One of `in_progress`, `completed`, or `incomplete`.

        - `"in_progress"`

        - `"completed"`

        - `"incomplete"`

      - `type: "shell_call"`

        The type of the item. Always `shell_call`.

        - `"shell_call"`

      - `agent?: Agent`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

      - `caller?: Direct | Program | null`

        The execution context that produced this tool call.

        - `Direct`

          - `type: "direct"`

            - `"direct"`

        - `Program`

          - `caller_id: string`

            The call ID of the program item that produced this tool call.

          - `type: "program"`

            - `"program"`

      - `created_by?: string`

        The ID of the entity that created this tool call.

    - `BetaResponseFunctionShellToolCallOutput`

      The output of a shell tool call that was emitted.

      - `id: string`

        The unique ID of the shell call output. Populated when this item is returned via API.

      - `call_id: string`

        The unique ID of the shell tool call generated by the model.

      - `max_output_length: number | null`

        The maximum length of the shell command output. This is generated by the model and should be passed back with the raw output.

      - `output: Array<Output>`

        An array of shell call output contents

        - `outcome: Timeout | Exit`

          Represents either an exit outcome (with an exit code) or a timeout outcome for a shell call output chunk.

          - `Timeout`

            Indicates that the shell call exceeded its configured time limit.

            - `type: "timeout"`

              The outcome type. Always `timeout`.

              - `"timeout"`

          - `Exit`

            Indicates that the shell commands finished and returned an exit code.

            - `exit_code: number`

              Exit code from the shell process.

            - `type: "exit"`

              The outcome type. Always `exit`.

              - `"exit"`

        - `stderr: string`

          The standard error output that was captured.

        - `stdout: string`

          The standard output that was captured.

        - `created_by?: string`

          The identifier of the actor that created the item.

      - `status: "in_progress" | "completed" | "incomplete"`

        The status of the shell call output. One of `in_progress`, `completed`, or `incomplete`.

        - `"in_progress"`

        - `"completed"`

        - `"incomplete"`

      - `type: "shell_call_output"`

        The type of the shell call output. Always `shell_call_output`.

        - `"shell_call_output"`

      - `agent?: Agent`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

      - `caller?: Direct | Program | null`

        The execution context that produced this tool call.

        - `Direct`

          - `type: "direct"`

            - `"direct"`

        - `Program`

          - `caller_id: string`

            The call ID of the program item that produced this tool call.

          - `type: "program"`

            - `"program"`

      - `created_by?: string`

        The identifier of the actor that created the item.

    - `BetaResponseApplyPatchToolCall`

      A tool call that applies file diffs by creating, deleting, or updating files.

      - `id: string`

        The unique ID of the apply patch tool call. Populated when this item is returned via API.

      - `call_id: string`

        The unique ID of the apply patch tool call generated by the model.

      - `operation: CreateFile | DeleteFile | UpdateFile`

        One of the create_file, delete_file, or update_file operations applied via apply_patch.

        - `CreateFile`

          Instruction describing how to create a file via the apply_patch tool.

          - `diff: string`

            Diff to apply.

          - `path: string`

            Path of the file to create.

          - `type: "create_file"`

            Create a new file with the provided diff.

            - `"create_file"`

        - `DeleteFile`

          Instruction describing how to delete a file via the apply_patch tool.

          - `path: string`

            Path of the file to delete.

          - `type: "delete_file"`

            Delete the specified file.

            - `"delete_file"`

        - `UpdateFile`

          Instruction describing how to update a file via the apply_patch tool.

          - `diff: string`

            Diff to apply.

          - `path: string`

            Path of the file to update.

          - `type: "update_file"`

            Update an existing file with the provided diff.

            - `"update_file"`

      - `status: "in_progress" | "completed"`

        The status of the apply patch tool call. One of `in_progress` or `completed`.

        - `"in_progress"`

        - `"completed"`

      - `type: "apply_patch_call"`

        The type of the item. Always `apply_patch_call`.

        - `"apply_patch_call"`

      - `agent?: Agent`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

      - `caller?: Direct | Program | null`

        The execution context that produced this tool call.

        - `Direct`

          - `type: "direct"`

            - `"direct"`

        - `Program`

          - `caller_id: string`

            The call ID of the program item that produced this tool call.

          - `type: "program"`

            - `"program"`

      - `created_by?: string`

        The ID of the entity that created this tool call.

    - `BetaResponseApplyPatchToolCallOutput`

      The output emitted by an apply patch tool call.

      - `id: string`

        The unique ID of the apply patch tool call output. Populated when this item is returned via API.

      - `call_id: string`

        The unique ID of the apply patch tool call generated by the model.

      - `status: "completed" | "failed"`

        The status of the apply patch tool call output. One of `completed` or `failed`.

        - `"completed"`

        - `"failed"`

      - `type: "apply_patch_call_output"`

        The type of the item. Always `apply_patch_call_output`.

        - `"apply_patch_call_output"`

      - `agent?: Agent`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

      - `caller?: Direct | Program | null`

        The execution context that produced this tool call.

        - `Direct`

          - `type: "direct"`

            - `"direct"`

        - `Program`

          - `caller_id: string`

            The call ID of the program item that produced this tool call.

          - `type: "program"`

            - `"program"`

      - `created_by?: string`

        The ID of the entity that created this tool call output.

      - `output?: string | null`

        Optional textual output returned by the apply patch tool.

    - `McpCall`

      An invocation of a tool on an MCP server.

      - `id: string`

        The unique ID of the tool call.

      - `arguments: string`

        A JSON string of the arguments passed to the tool.

      - `name: string`

        The name of the tool that was run.

      - `server_label: string`

        The label of the MCP server running the tool.

      - `type: "mcp_call"`

        The type of the item. Always `mcp_call`.

        - `"mcp_call"`

      - `agent?: Agent | null`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

      - `approval_request_id?: string | null`

        Unique identifier for the MCP tool call approval request.
        Include this value in a subsequent `mcp_approval_response` input to approve or reject the corresponding tool call.

      - `error?: BetaMcpToolCallError | null`

        The error from the tool call, if any.

      - `output?: string | null`

        The output from the tool call.

      - `status?: "in_progress" | "completed" | "incomplete" | 2 more`

        The status of the tool call. One of `in_progress`, `completed`, `incomplete`, `calling`, or `failed`.

        - `"in_progress"`

        - `"completed"`

        - `"incomplete"`

        - `"calling"`

        - `"failed"`

    - `McpListTools`

      A list of tools available on an MCP server.

      - `id: string`

        The unique ID of the list.

      - `server_label: string`

        The label of the MCP server.

      - `tools: Array<Tool>`

        The tools available on the server.

        - `input_schema: unknown`

          The JSON schema describing the tool's input.

        - `name: string`

          The name of the tool.

        - `annotations?: unknown`

          Additional annotations about the tool.

        - `description?: string | null`

          The description of the tool.

      - `type: "mcp_list_tools"`

        The type of the item. Always `mcp_list_tools`.

        - `"mcp_list_tools"`

      - `agent?: Agent | null`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

      - `error?: string | null`

        Error message if the server could not list tools.

    - `McpApprovalRequest`

      A request for human approval of a tool invocation.

      - `id: string`

        The unique ID of the approval request.

      - `arguments: string`

        A JSON string of arguments for the tool.

      - `name: string`

        The name of the tool to run.

      - `server_label: string`

        The label of the MCP server making the request.

      - `type: "mcp_approval_request"`

        The type of the item. Always `mcp_approval_request`.

        - `"mcp_approval_request"`

      - `agent?: Agent | null`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

    - `McpApprovalResponse`

      A response to an MCP approval request.

      - `id: string`

        The unique ID of the approval response

      - `approval_request_id: string`

        The ID of the approval request being answered.

      - `approve: boolean`

        Whether the request was approved.

      - `type: "mcp_approval_response"`

        The type of the item. Always `mcp_approval_response`.

        - `"mcp_approval_response"`

      - `agent?: Agent | null`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

      - `reason?: string | null`

        Optional reason for the decision.

    - `BetaResponseCustomToolCall`

      A call to a custom tool created by the model.

    - `BetaResponseCustomToolCallOutputItem extends BetaResponseCustomToolCallOutput`

      The output of a custom tool call from your code, being sent back to the model.

      - `id: string`

        The unique ID of the custom tool call output item.

      - `status: "in_progress" | "completed" | "incomplete"`

        The status of the item. One of `in_progress`, `completed`, or
        `incomplete`. Populated when items are returned via API.

        - `"in_progress"`

        - `"completed"`

        - `"incomplete"`

      - `created_by?: string`

        The identifier of the actor that created the item.

  - `parallel_tool_calls: boolean`

    Whether to allow the model to run tool calls in parallel.

  - `temperature: number | null`

    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.

  - `tool_choice: BetaToolChoiceOptions | BetaToolChoiceAllowed | BetaToolChoiceTypes | 6 more`

    How the model should select which tool (or tools) to use when generating
    a response. See the `tools` parameter to see how to specify which tools
    the model can call.

    - `BetaToolChoiceOptions = "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.

      - `"none"`

      - `"auto"`

      - `"required"`

    - `BetaToolChoiceAllowed`

      Constrains the tools available to the model to a pre-defined set.

      - `mode: "auto" | "required"`

        Constrains the tools available to the model to a pre-defined set.

        `auto` allows the model to pick from among the allowed tools and generate a
        message.

        `required` requires the model to call one or more of the allowed tools.

        - `"auto"`

        - `"required"`

      - `tools: Array<Record<string, unknown>>`

        A list of tool definitions that the model should be allowed to call.

        For the Responses API, the list of tool definitions might look like:

        ```json
        [
          { "type": "function", "name": "get_weather" },
          { "type": "mcp", "server_label": "deepwiki" },
          { "type": "image_generation" }
        ]
        ```

      - `type: "allowed_tools"`

        Allowed tool configuration type. Always `allowed_tools`.

        - `"allowed_tools"`

    - `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" | 5 more`

        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`

        - `"file_search"`

        - `"web_search_preview"`

        - `"computer"`

        - `"computer_use_preview"`

        - `"computer_use"`

        - `"web_search_preview_2025_03_11"`

        - `"image_generation"`

        - `"code_interpreter"`

    - `BetaToolChoiceFunction`

      Use this option to force the model to call a specific function.

      - `name: string`

        The name of the function to call.

      - `type: "function"`

        For function calling, the type is always `function`.

        - `"function"`

    - `BetaToolChoiceMcp`

      Use this option to force the model to call a specific tool on a remote MCP server.

      - `server_label: string`

        The label of the MCP server to use.

      - `type: "mcp"`

        For MCP tools, the type is always `mcp`.

        - `"mcp"`

      - `name?: string | null`

        The name of the tool to call on the server.

    - `BetaToolChoiceCustom`

      Use this option to force the model to call a specific custom tool.

      - `name: string`

        The name of the custom tool to call.

      - `type: "custom"`

        For custom tool calling, the type is always `custom`.

        - `"custom"`

    - `BetaSpecificProgrammaticToolCallingParam`

      - `type: "programmatic_tool_calling"`

        The tool to call. Always `programmatic_tool_calling`.

        - `"programmatic_tool_calling"`

    - `BetaToolChoiceApplyPatch`

      Forces the model to call the apply_patch tool when executing a tool call.

      - `type: "apply_patch"`

        The tool to call. Always `apply_patch`.

        - `"apply_patch"`

    - `BetaToolChoiceShell`

      Forces the model to call the shell tool when a tool call is required.

      - `type: "shell"`

        The tool to call. Always `shell`.

        - `"shell"`

  - `tools: Array<BetaTool>`

    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.

    - `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).

    - `Mcp`

      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).

    - `CodeInterpreter`

      A tool that runs Python code to help generate a response to a prompt.

    - `ProgrammaticToolCalling`

    - `ImageGeneration`

      A tool that generates images using the GPT image models.

    - `LocalShell`

      A tool that allows the model to execute shell commands in a local environment.

    - `BetaFunctionShellTool`

      A tool that allows the model to execute shell commands.

    - `BetaCustomTool`

      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)

    - `BetaNamespaceTool`

      Groups function/custom tools under a shared namespace.

    - `BetaToolSearchTool`

      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).

    - `BetaApplyPatchTool`

      Allows the assistant to create, delete, or update files using unified diffs.

  - `top_p: number | null`

    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.

  - `background?: boolean | null`

    Whether to run the model response in the background.
    [Learn more](https://platform.openai.com/docs/guides/background).

  - `completed_at?: number | null`

    Unix timestamp (in seconds) of when this Response was completed.
    Only present when the status is `completed`.

  - `conversation?: Conversation | null`

    The conversation that this response belonged to. Input items and output items from this response were automatically added to this conversation.

    - `id: string`

      The unique ID of the conversation that this response was associated with.

  - `max_output_tokens?: number | null`

    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).

  - `max_tool_calls?: number | null`

    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.

  - `moderation?: Moderation | null`

    Moderation results for the response input and output, if moderated completions were requested.

    - `input: ModerationResult | Error`

      Moderation for the response input.

      - `ModerationResult`

        A moderation result produced for the response input or output.

        - `categories: Record<string, boolean>`

          A dictionary of moderation categories to booleans, True if the input is flagged under this category.

        - `category_applied_input_types: Record<string, Array<"text" | "image">>`

          Which modalities of input are reflected by the score for each category.

          - `"text"`

          - `"image"`

        - `category_scores: Record<string, number>`

          A dictionary of moderation categories to scores.

        - `flagged: boolean`

          A boolean indicating whether the content was flagged by any category.

        - `model: string`

          The moderation model that produced this result.

        - `type: "moderation_result"`

          The object type, which was always `moderation_result` for successful moderation results.

          - `"moderation_result"`

      - `Error`

        An error produced while attempting moderation for the response input or output.

        - `code: string`

          The error code.

        - `message: string`

          The error message.

        - `type: "error"`

          The object type, which was always `error` for moderation failures.

          - `"error"`

    - `output: ModerationResult | Error`

      Moderation for the response output.

      - `ModerationResult`

        A moderation result produced for the response input or output.

        - `categories: Record<string, boolean>`

          A dictionary of moderation categories to booleans, True if the input is flagged under this category.

        - `category_applied_input_types: Record<string, Array<"text" | "image">>`

          Which modalities of input are reflected by the score for each category.

          - `"text"`

          - `"image"`

        - `category_scores: Record<string, number>`

          A dictionary of moderation categories to scores.

        - `flagged: boolean`

          A boolean indicating whether the content was flagged by any category.

        - `model: string`

          The moderation model that produced this result.

        - `type: "moderation_result"`

          The object type, which was always `moderation_result` for successful moderation results.

          - `"moderation_result"`

      - `Error`

        An error produced while attempting moderation for the response input or output.

        - `code: string`

          The error code.

        - `message: string`

          The error message.

        - `type: "error"`

          The object type, which was always `error` for moderation failures.

          - `"error"`

  - `previous_response_id?: string | null`

    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`.

  - `prompt?: BetaResponsePrompt | null`

    Reference to a prompt template and its variables.
    [Learn more](https://platform.openai.com/docs/guides/text?api-mode=responses#reusable-prompts).

    - `id: string`

      The unique identifier of the prompt template to use.

    - `variables?: Record<string, string | BetaResponseInputText | BetaResponseInputImage | BetaResponseInputFile> | null`

      Optional map of values to substitute in for variables in your
      prompt. The substitution values can either be strings, or other
      Response input types like images or files.

      - `string`

      - `BetaResponseInputText`

        A text input to the model.

      - `BetaResponseInputImage`

        An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision).

      - `BetaResponseInputFile`

        A file input to the model.

    - `version?: string | null`

      Optional version of the prompt template.

  - `prompt_cache_key?: string | null`

    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).

  - `prompt_cache_options?: PromptCacheOptions`

    The prompt-caching options that were applied to the response. Supported for `gpt-5.6` and later models.

    - `mode: "implicit" | "explicit"`

      Whether implicit prompt-cache breakpoints were enabled.

      - `"implicit"`

      - `"explicit"`

    - `ttl: "30m"`

      The minimum lifetime applied to each cache breakpoint.

      - `"30m"`

  - `prompt_cache_retention?: "in_memory" | "24h" | null`

    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.

    - `"in_memory"`

    - `"24h"`

  - `reasoning?: Reasoning | null`

    **gpt-5 and o-series models only**

    Configuration options for
    [reasoning models](https://platform.openai.com/docs/guides/reasoning).

    - `context?: "auto" | "current_turn" | "all_turns" | null`

      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.

      - `"auto"`

      - `"current_turn"`

      - `"all_turns"`

    - `effort?: "none" | "minimal" | "low" | 4 more | null`

      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.

      - `"none"`

      - `"minimal"`

      - `"low"`

      - `"medium"`

      - `"high"`

      - `"xhigh"`

      - `"max"`

    - `generate_summary?: "auto" | "concise" | "detailed" | null`

      **Deprecated:** use `summary` instead.

      A summary of the reasoning performed by the model. This can be
      useful for debugging and understanding the model's reasoning process.
      One of `auto`, `concise`, or `detailed`.

      - `"auto"`

      - `"concise"`

      - `"detailed"`

    - `mode?: (string & {}) | "standard" | "pro"`

      Controls the reasoning execution mode for the request.

      When returned on a response, this is the effective execution mode.

      - `(string & {})`

      - `"standard" | "pro"`

        - `"standard"`

        - `"pro"`

    - `summary?: "auto" | "concise" | "detailed" | null`

      A summary of the reasoning performed by the model. This can be
      useful for debugging and understanding the model's reasoning process.
      One of `auto`, `concise`, or `detailed`.

      `concise` is supported for `computer-use-preview` models and all reasoning models after `gpt-5`.

      - `"auto"`

      - `"concise"`

      - `"detailed"`

  - `safety_identifier?: string | null`

    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).

  - `service_tier?: BetaServiceTier | null`

    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.
    - If set to 'ultrafast', then the request will be processed with the access-controlled Ultrafast Processing service tier. This tier is currently available for `gpt-5.6-sol`; a response served through it will show `service_tier=ultrafast`.
    - When not set, the default behavior is 'auto'.

    When the `service_tier` parameter is set, the response body will include the `service_tier` value based on the processing mode actually used to serve the request. This response value may be different from the value set in the parameter.

    - `"auto"`

    - `"default"`

    - `"flex"`

    - `"scale"`

    - `"priority"`

    - `"fast"`

    - `"ultrafast"`

  - `status?: BetaResponseStatus`

    The status of the response generation. One of `completed`, `failed`,
    `in_progress`, `cancelled`, `queued`, or `incomplete`.

    - `"completed"`

    - `"failed"`

    - `"in_progress"`

    - `"cancelled"`

    - `"queued"`

    - `"incomplete"`

  - `text?: BetaResponseTextConfig`

    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?: BetaResponseFormatTextConfig`

      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.

      - `Text`

        Default response format. Used to generate text responses.

        - `type: "text"`

          The type of response format being defined. Always `text`.

          - `"text"`

      - `BetaResponseFormatTextJSONSchemaConfig`

        JSON Schema response format. Used to generate structured JSON responses.
        Learn more about [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs).

        - `name: string`

          The name of the response format. Must be a-z, A-Z, 0-9, or contain
          underscores and dashes, with a maximum length of 64.

        - `schema: Record<string, unknown>`

          The schema for the response format, described as a JSON Schema object.
          Learn how to build JSON schemas [here](https://json-schema.org/).

        - `type: "json_schema"`

          The type of response format being defined. Always `json_schema`.

          - `"json_schema"`

        - `description?: string`

          A description of what the response format is for, used by the model to
          determine how to respond in the format.

        - `strict?: boolean | null`

          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).

      - `JSONObject`

        JSON object response format. An older method of generating JSON responses.
        Using `json_schema` is recommended for models that support it. Note that the
        model will not generate JSON without a system or user message instructing it
        to do so.

        - `type: "json_object"`

          The type of response format being defined. Always `json_object`.

          - `"json_object"`

    - `verbosity?: "low" | "medium" | "high" | null`

      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`.

      - `"low"`

      - `"medium"`

      - `"high"`

  - `top_logprobs?: number | null`

    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.

  - `truncation?: "auto" | "disabled" | null`

    The truncation strategy to use for the model response.

    - `auto`: If the input to this Response exceeds
      the model's context window size, the model will truncate the
      response to fit the context window by dropping items from the beginning of the conversation.
    - `disabled` (default): If the input size will exceed the context window
      size for a model, the request will fail with a 400 error.

    - `"auto"`

    - `"disabled"`

  - `usage?: BetaResponseUsage`

    Represents token usage details including input tokens, output tokens,
    a breakdown of output tokens, and the total tokens used.

    - `input_tokens: number`

      The number of input tokens.

    - `input_tokens_details: InputTokensDetails`

      A detailed breakdown of the input tokens.

      - `cache_write_tokens: number`

        The number of input tokens that were written to the cache.

      - `cached_tokens: number`

        The number of tokens that were retrieved from the cache.
        [More on prompt caching](https://platform.openai.com/docs/guides/prompt-caching).

    - `output_tokens: number`

      The number of output tokens.

    - `output_tokens_details: OutputTokensDetails`

      A detailed breakdown of the output tokens.

      - `reasoning_tokens: number`

        The number of reasoning tokens.

    - `total_tokens: number`

      The total number of tokens used.

  - `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).

### Beta Response Apply Patch Tool Call

- `BetaResponseApplyPatchToolCall`

  A tool call that applies file diffs by creating, deleting, or updating files.

  - `id: string`

    The unique ID of the apply patch tool call. Populated when this item is returned via API.

  - `call_id: string`

    The unique ID of the apply patch tool call generated by the model.

  - `operation: CreateFile | DeleteFile | UpdateFile`

    One of the create_file, delete_file, or update_file operations applied via apply_patch.

    - `CreateFile`

      Instruction describing how to create a file via the apply_patch tool.

      - `diff: string`

        Diff to apply.

      - `path: string`

        Path of the file to create.

      - `type: "create_file"`

        Create a new file with the provided diff.

        - `"create_file"`

    - `DeleteFile`

      Instruction describing how to delete a file via the apply_patch tool.

      - `path: string`

        Path of the file to delete.

      - `type: "delete_file"`

        Delete the specified file.

        - `"delete_file"`

    - `UpdateFile`

      Instruction describing how to update a file via the apply_patch tool.

      - `diff: string`

        Diff to apply.

      - `path: string`

        Path of the file to update.

      - `type: "update_file"`

        Update an existing file with the provided diff.

        - `"update_file"`

  - `status: "in_progress" | "completed"`

    The status of the apply patch tool call. One of `in_progress` or `completed`.

    - `"in_progress"`

    - `"completed"`

  - `type: "apply_patch_call"`

    The type of the item. Always `apply_patch_call`.

    - `"apply_patch_call"`

  - `agent?: Agent`

    The agent that produced this item.

    - `agent_name: string`

      The canonical name of the agent that produced this item.

  - `caller?: Direct | Program | null`

    The execution context that produced this tool call.

    - `Direct`

      - `type: "direct"`

        - `"direct"`

    - `Program`

      - `caller_id: string`

        The call ID of the program item that produced this tool call.

      - `type: "program"`

        - `"program"`

  - `created_by?: string`

    The ID of the entity that created this tool call.

### Beta Response Apply Patch Tool Call Output

- `BetaResponseApplyPatchToolCallOutput`

  The output emitted by an apply patch tool call.

  - `id: string`

    The unique ID of the apply patch tool call output. Populated when this item is returned via API.

  - `call_id: string`

    The unique ID of the apply patch tool call generated by the model.

  - `status: "completed" | "failed"`

    The status of the apply patch tool call output. One of `completed` or `failed`.

    - `"completed"`

    - `"failed"`

  - `type: "apply_patch_call_output"`

    The type of the item. Always `apply_patch_call_output`.

    - `"apply_patch_call_output"`

  - `agent?: Agent`

    The agent that produced this item.

    - `agent_name: string`

      The canonical name of the agent that produced this item.

  - `caller?: Direct | Program | null`

    The execution context that produced this tool call.

    - `Direct`

      - `type: "direct"`

        - `"direct"`

    - `Program`

      - `caller_id: string`

        The call ID of the program item that produced this tool call.

      - `type: "program"`

        - `"program"`

  - `created_by?: string`

    The ID of the entity that created this tool call output.

  - `output?: string | null`

    Optional textual output returned by the apply patch tool.

### Beta Response Audio Delta Event

- `BetaResponseAudioDeltaEvent`

  Emitted when there is a partial audio response.

  - `delta: string`

    A chunk of Base64 encoded response audio bytes.

  - `sequence_number: number`

    A sequence number for this chunk of the stream response.

  - `type: "response.audio.delta"`

    The type of the event. Always `response.audio.delta`.

    - `"response.audio.delta"`

  - `agent?: Agent | null`

    The agent that owns this multi-agent streaming event.

    - `agent_name: string`

      The canonical name of the agent that produced this item.

### Beta Response Audio Done Event

- `BetaResponseAudioDoneEvent`

  Emitted when the audio response is complete.

  - `sequence_number: number`

    The sequence number of the delta.

  - `type: "response.audio.done"`

    The type of the event. Always `response.audio.done`.

    - `"response.audio.done"`

  - `agent?: Agent | null`

    The agent that owns this multi-agent streaming event.

    - `agent_name: string`

      The canonical name of the agent that produced this item.

### Beta Response Audio Transcript Delta Event

- `BetaResponseAudioTranscriptDeltaEvent`

  Emitted when there is a partial transcript of audio.

  - `delta: string`

    The partial transcript of the audio response.

  - `sequence_number: number`

    The sequence number of this event.

  - `type: "response.audio.transcript.delta"`

    The type of the event. Always `response.audio.transcript.delta`.

    - `"response.audio.transcript.delta"`

  - `agent?: Agent | null`

    The agent that owns this multi-agent streaming event.

    - `agent_name: string`

      The canonical name of the agent that produced this item.

### Beta Response Audio Transcript Done Event

- `BetaResponseAudioTranscriptDoneEvent`

  Emitted when the full audio transcript is completed.

  - `sequence_number: number`

    The sequence number of this event.

  - `type: "response.audio.transcript.done"`

    The type of the event. Always `response.audio.transcript.done`.

    - `"response.audio.transcript.done"`

  - `agent?: Agent | null`

    The agent that owns this multi-agent streaming event.

    - `agent_name: string`

      The canonical name of the agent that produced this item.

### Beta Response Code Interpreter Call Code Delta Event

- `BetaResponseCodeInterpreterCallCodeDeltaEvent`

  Emitted when a partial code snippet is streamed by the code interpreter.

  - `delta: string`

    The partial code snippet being streamed by the code interpreter.

  - `item_id: string`

    The unique identifier of the code interpreter tool call item.

  - `output_index: number`

    The index of the output item in the response for which the code is being streamed.

  - `sequence_number: number`

    The sequence number of this event, used to order streaming events.

  - `type: "response.code_interpreter_call_code.delta"`

    The type of the event. Always `response.code_interpreter_call_code.delta`.

    - `"response.code_interpreter_call_code.delta"`

  - `agent?: Agent | null`

    The agent that owns this multi-agent streaming event.

    - `agent_name: string`

      The canonical name of the agent that produced this item.

### Beta Response Code Interpreter Call Code Done Event

- `BetaResponseCodeInterpreterCallCodeDoneEvent`

  Emitted when the code snippet is finalized by the code interpreter.

  - `code: string`

    The final code snippet output by the code interpreter.

  - `item_id: string`

    The unique identifier of the code interpreter tool call item.

  - `output_index: number`

    The index of the output item in the response for which the code is finalized.

  - `sequence_number: number`

    The sequence number of this event, used to order streaming events.

  - `type: "response.code_interpreter_call_code.done"`

    The type of the event. Always `response.code_interpreter_call_code.done`.

    - `"response.code_interpreter_call_code.done"`

  - `agent?: Agent | null`

    The agent that owns this multi-agent streaming event.

    - `agent_name: string`

      The canonical name of the agent that produced this item.

### Beta Response Code Interpreter Call Completed Event

- `BetaResponseCodeInterpreterCallCompletedEvent`

  Emitted when the code interpreter call is completed.

  - `item_id: string`

    The unique identifier of the code interpreter tool call item.

  - `output_index: number`

    The index of the output item in the response for which the code interpreter call is completed.

  - `sequence_number: number`

    The sequence number of this event, used to order streaming events.

  - `type: "response.code_interpreter_call.completed"`

    The type of the event. Always `response.code_interpreter_call.completed`.

    - `"response.code_interpreter_call.completed"`

  - `agent?: Agent | null`

    The agent that owns this multi-agent streaming event.

    - `agent_name: string`

      The canonical name of the agent that produced this item.

### Beta Response Code Interpreter Call In Progress Event

- `BetaResponseCodeInterpreterCallInProgressEvent`

  Emitted when a code interpreter call is in progress.

  - `item_id: string`

    The unique identifier of the code interpreter tool call item.

  - `output_index: number`

    The index of the output item in the response for which the code interpreter call is in progress.

  - `sequence_number: number`

    The sequence number of this event, used to order streaming events.

  - `type: "response.code_interpreter_call.in_progress"`

    The type of the event. Always `response.code_interpreter_call.in_progress`.

    - `"response.code_interpreter_call.in_progress"`

  - `agent?: Agent | null`

    The agent that owns this multi-agent streaming event.

    - `agent_name: string`

      The canonical name of the agent that produced this item.

### Beta Response Code Interpreter Call Interpreting Event

- `BetaResponseCodeInterpreterCallInterpretingEvent`

  Emitted when the code interpreter is actively interpreting the code snippet.

  - `item_id: string`

    The unique identifier of the code interpreter tool call item.

  - `output_index: number`

    The index of the output item in the response for which the code interpreter is interpreting code.

  - `sequence_number: number`

    The sequence number of this event, used to order streaming events.

  - `type: "response.code_interpreter_call.interpreting"`

    The type of the event. Always `response.code_interpreter_call.interpreting`.

    - `"response.code_interpreter_call.interpreting"`

  - `agent?: Agent | null`

    The agent that owns this multi-agent streaming event.

    - `agent_name: string`

      The canonical name of the agent that produced this item.

### Beta Response Code Interpreter Tool Call

- `BetaResponseCodeInterpreterToolCall`

  A tool call to run code.

  - `id: string`

    The unique ID of the code interpreter tool call.

  - `code: string | null`

    The code to run, or null if not available.

  - `container_id: string`

    The ID of the container used to run the code.

  - `outputs: Array<Logs | Image> | null`

    The outputs generated by the code interpreter, such as logs or images.
    Can be null if no outputs are available.

    - `Logs`

      The logs output from the code interpreter.

      - `logs: string`

        The logs output from the code interpreter.

      - `type: "logs"`

        The type of the output. Always `logs`.

        - `"logs"`

    - `Image`

      The image output from the code interpreter.

      - `type: "image"`

        The type of the output. Always `image`.

        - `"image"`

      - `url: string`

        The URL of the image output from the code interpreter.

  - `status: "in_progress" | "completed" | "incomplete" | 2 more`

    The status of the code interpreter tool call. Valid values are `in_progress`, `completed`, `incomplete`, `interpreting`, and `failed`.

    - `"in_progress"`

    - `"completed"`

    - `"incomplete"`

    - `"interpreting"`

    - `"failed"`

  - `type: "code_interpreter_call"`

    The type of the code interpreter tool call. Always `code_interpreter_call`.

    - `"code_interpreter_call"`

  - `agent?: Agent | null`

    The agent that produced this item.

    - `agent_name: string`

      The canonical name of the agent that produced this item.

### Beta Response Compaction Item

- `BetaResponseCompactionItem`

  A compaction item generated by the [`v1/responses/compact` API](https://platform.openai.com/docs/api-reference/responses/compact).

  - `id: string`

    The unique ID of the compaction item.

  - `encrypted_content: string`

    The encrypted content that was produced by compaction.

  - `type: "compaction"`

    The type of the item. Always `compaction`.

    - `"compaction"`

  - `agent?: Agent`

    The agent that produced this item.

    - `agent_name: string`

      The canonical name of the agent that produced this item.

  - `created_by?: string`

    The identifier of the actor that created the item.

### Beta Response Compaction Item Param

- `BetaResponseCompactionItemParam`

  A compaction item generated by the [`v1/responses/compact` API](https://platform.openai.com/docs/api-reference/responses/compact).

  - `encrypted_content: string`

    The encrypted content of the compaction summary.

  - `type: "compaction"`

    The type of the item. Always `compaction`.

    - `"compaction"`

  - `id?: string | null`

    The ID of the compaction item.

  - `agent?: Agent | null`

    The agent that produced this item.

    - `agent_name: string`

      The canonical name of the agent that produced this item.

### Beta Response Completed Event

- `BetaResponseCompletedEvent`

  Emitted when the model response is complete.

  - `response: BetaResponse`

    Properties of the completed response.

    - `id: string`

      Unique identifier for this Response.

    - `created_at: number`

      Unix timestamp (in seconds) of when this Response was created.

    - `error: BetaResponseError | null`

      An error object returned when the model fails to generate a Response.

      - `code: "server_error" | "rate_limit_exceeded" | "invalid_prompt" | 17 more`

        The error code for the response.

        - `"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"`

      - `message: string`

        A human-readable description of the error.

    - `incomplete_details: IncompleteDetails | null`

      Details about why the response is incomplete.

      - `reason?: "max_output_tokens" | "content_filter"`

        The reason why the response is incomplete.

        - `"max_output_tokens"`

        - `"content_filter"`

    - `instructions: string | Array<BetaResponseInputItem> | null`

      A system (or developer) message inserted into the model's context.

      When using along with `previous_response_id`, the instructions from a previous
      response will not be carried over to the next response. This makes it simple
      to swap out system (or developer) messages in new responses.

      - `string`

      - `Array<BetaResponseInputItem>`

        - `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.

          - `content: string | BetaResponseInputMessageContentList`

            Text, image, or audio input to the model, used to generate a response.
            Can also contain previous assistant responses.

            - `string`

            - `BetaResponseInputMessageContentList = Array<BetaResponseInputContent>`

              A list of one or many input items to the model, containing different content
              types.

              - `BetaResponseInputText`

                A text input to the model.

                - `text: string`

                  The text input to the model.

                - `type: "input_text"`

                  The type of the input item. Always `input_text`.

                  - `"input_text"`

                - `prompt_cache_breakpoint?: PromptCacheBreakpoint`

                  Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.

                  - `mode: "explicit"`

                    The breakpoint mode. Always `explicit`.

                    - `"explicit"`

              - `BetaResponseInputImage`

                An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision).

                - `detail: BetaImageDetail`

                  The detail level of the image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`.

                  - `"low"`

                  - `"high"`

                  - `"auto"`

                  - `"original"`

                - `type: "input_image"`

                  The type of the input item. Always `input_image`.

                  - `"input_image"`

                - `file_id?: string | null`

                  The ID of the file to be sent to the model.

                - `image_url?: string | null`

                  The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.

                - `prompt_cache_breakpoint?: PromptCacheBreakpoint`

                  Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.

                  - `mode: "explicit"`

                    The breakpoint mode. Always `explicit`.

                    - `"explicit"`

              - `BetaResponseInputFile`

                A file input to the model.

                - `type: "input_file"`

                  The type of the input item. Always `input_file`.

                  - `"input_file"`

                - `detail?: "auto" | "low" | "high"`

                  The detail level of the file to be sent to the model. Use `auto` to let the system select the detail level; for GPT-5.6 and later models, `auto` uses high-quality rendering, which may increase input token usage. Use `low` for lower-cost rendering, or `high` to render the file at higher quality. Defaults to `auto`.

                  - `"auto"`

                  - `"low"`

                  - `"high"`

                - `file_data?: string`

                  The content of the file to be sent to the model.

                - `file_id?: string | null`

                  The ID of the file to be sent to the model.

                - `file_url?: string`

                  The URL of the file to be sent to the model.

                - `filename?: string`

                  The name of the file to be sent to the model.

                - `prompt_cache_breakpoint?: PromptCacheBreakpoint`

                  Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.

                  - `mode: "explicit"`

                    The breakpoint mode. Always `explicit`.

                    - `"explicit"`

          - `role: "user" | "assistant" | "system" | "developer"`

            The role of the message input. One of `user`, `assistant`, `system`, or
            `developer`.

            - `"user"`

            - `"assistant"`

            - `"system"`

            - `"developer"`

          - `phase?: "commentary" | "final_answer" | null`

            Labels an `assistant` message as intermediate commentary (`commentary`) or the final answer (`final_answer`).
            For models like `gpt-5.3-codex` and beyond, when sending follow-up requests, preserve and resend
            phase on all assistant messages — dropping it can degrade performance. Not used for user messages.

            - `"commentary"`

            - `"final_answer"`

          - `type?: "message"`

            The type of the message input. Always `message`.

            - `"message"`

        - `Message`

          A message input to the model with a role indicating instruction following
          hierarchy. Instructions given with the `developer` or `system` role take
          precedence over instructions given with the `user` role.

          - `content: BetaResponseInputMessageContentList`

            A list of one or many input items to the model, containing different content
            types.

          - `role: "user" | "system" | "developer"`

            The role of the message input. One of `user`, `system`, or `developer`.

            - `"user"`

            - `"system"`

            - `"developer"`

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

          - `status?: "in_progress" | "completed" | "incomplete"`

            The status of item. One of `in_progress`, `completed`, or
            `incomplete`. Populated when items are returned via API.

            - `"in_progress"`

            - `"completed"`

            - `"incomplete"`

          - `type?: "message"`

            The type of the message input. Always set to `message`.

            - `"message"`

        - `BetaResponseOutputMessage`

          An output message from the model.

          - `id: string`

            The unique ID of the output message.

          - `content: Array<BetaResponseOutputText | BetaResponseOutputRefusal>`

            The content of the output message.

            - `BetaResponseOutputText`

              A text output from the model.

              - `annotations: Array<FileCitation | URLCitation | ContainerFileCitation | FilePath>`

                The annotations of the text output.

                - `FileCitation`

                  A citation to a file.

                  - `file_id: string`

                    The ID of the file.

                  - `filename: string`

                    The filename of the file cited.

                  - `index: number`

                    The index of the file in the list of files.

                  - `type: "file_citation"`

                    The type of the file citation. Always `file_citation`.

                    - `"file_citation"`

                - `URLCitation`

                  A citation for a web resource used to generate a model response.

                  - `end_index: number`

                    The index of the last character of the URL citation in the message.

                  - `start_index: number`

                    The index of the first character of the URL citation in the message.

                  - `title: string`

                    The title of the web resource.

                  - `type: "url_citation"`

                    The type of the URL citation. Always `url_citation`.

                    - `"url_citation"`

                  - `url: string`

                    The URL of the web resource.

                - `ContainerFileCitation`

                  A citation for a container file used to generate a model response.

                  - `container_id: string`

                    The ID of the container file.

                  - `end_index: number`

                    The index of the last character of the container file citation in the message.

                  - `file_id: string`

                    The ID of the file.

                  - `filename: string`

                    The filename of the container file cited.

                  - `start_index: number`

                    The index of the first character of the container file citation in the message.

                  - `type: "container_file_citation"`

                    The type of the container file citation. Always `container_file_citation`.

                    - `"container_file_citation"`

                - `FilePath`

                  A path to a file.

                  - `file_id: string`

                    The ID of the file.

                  - `index: number`

                    The index of the file in the list of files.

                  - `type: "file_path"`

                    The type of the file path. Always `file_path`.

                    - `"file_path"`

              - `text: string`

                The text output from the model.

              - `type: "output_text"`

                The type of the output text. Always `output_text`.

                - `"output_text"`

              - `logprobs?: Array<Logprob>`

                - `token: string`

                - `bytes: Array<number>`

                - `logprob: number`

                - `top_logprobs: Array<TopLogprob>`

                  - `token: string`

                  - `bytes: Array<number>`

                  - `logprob: number`

            - `BetaResponseOutputRefusal`

              A refusal from the model.

              - `refusal: string`

                The refusal explanation from the model.

              - `type: "refusal"`

                The type of the refusal. Always `refusal`.

                - `"refusal"`

          - `role: "assistant"`

            The role of the output message. Always `assistant`.

            - `"assistant"`

          - `status: "in_progress" | "completed" | "incomplete"`

            The status of the message input. One of `in_progress`, `completed`, or
            `incomplete`. Populated when input items are returned via API.

            - `"in_progress"`

            - `"completed"`

            - `"incomplete"`

          - `type: "message"`

            The type of the output message. Always `message`.

            - `"message"`

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

          - `phase?: "commentary" | "final_answer" | null`

            Labels an `assistant` message as intermediate commentary (`commentary`) or the final answer (`final_answer`).
            For models like `gpt-5.3-codex` and beyond, when sending follow-up requests, preserve and resend
            phase on all assistant messages — dropping it can degrade performance. Not used for user messages.

            - `"commentary"`

            - `"final_answer"`

        - `BetaResponseFileSearchToolCall`

          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.

          - `id: string`

            The unique ID of the file search tool call.

          - `queries: Array<string>`

            The queries used to search for files.

          - `status: "in_progress" | "searching" | "completed" | 2 more`

            The status of the file search tool call. One of `in_progress`,
            `searching`, `incomplete` or `failed`,

            - `"in_progress"`

            - `"searching"`

            - `"completed"`

            - `"incomplete"`

            - `"failed"`

          - `type: "file_search_call"`

            The type of the file search tool call. Always `file_search_call`.

            - `"file_search_call"`

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

          - `results?: Array<Result> | null`

            The results of the file search tool call.

            - `attributes?: Record<string, string | number | boolean> | null`

              Set of 16 key-value pairs that can be attached to an object. This can be
              useful for storing additional information about the object in a structured
              format, and querying for objects via API or the dashboard. Keys are strings
              with a maximum length of 64 characters. Values are strings with a maximum
              length of 512 characters, booleans, or numbers.

              - `string`

              - `number`

              - `boolean`

            - `file_id?: string`

              The unique ID of the file.

            - `filename?: string`

              The name of the file.

            - `score?: number`

              The relevance score of the file - a value between 0 and 1.

            - `text?: string`

              The text that was retrieved from the file.

        - `BetaResponseComputerToolCall`

          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.

          - `id: string`

            The unique ID of the computer call.

          - `call_id: string`

            An identifier used when responding to the tool call with output.

          - `pending_safety_checks: Array<PendingSafetyCheck>`

            The pending safety checks for the computer call.

            - `id: string`

              The ID of the pending safety check.

            - `code?: string | null`

              The type of the pending safety check.

            - `message?: string | null`

              Details about the pending safety check.

          - `status: "in_progress" | "completed" | "incomplete"`

            The status of the item. One of `in_progress`, `completed`, or
            `incomplete`. Populated when items are returned via API.

            - `"in_progress"`

            - `"completed"`

            - `"incomplete"`

          - `type: "computer_call"`

            The type of the computer call. Always `computer_call`.

            - `"computer_call"`

          - `action?: BetaComputerAction`

            A click action.

            - `Click`

              A click action.

              - `button: "left" | "right" | "wheel" | 2 more`

                Indicates which mouse button was pressed during the click. One of `left`, `right`, `wheel`, `back`, or `forward`.

                - `"left"`

                - `"right"`

                - `"wheel"`

                - `"back"`

                - `"forward"`

              - `type: "click"`

                Specifies the event type. For a click action, this property is always `click`.

                - `"click"`

              - `x: number`

                The x-coordinate where the click occurred.

              - `y: number`

                The y-coordinate where the click occurred.

              - `keys?: Array<string> | null`

                The keys being held while clicking.

            - `DoubleClick`

              A double click action.

              - `keys: Array<string> | null`

                The keys being held while double-clicking.

              - `type: "double_click"`

                Specifies the event type. For a double click action, this property is always set to `double_click`.

                - `"double_click"`

              - `x: number`

                The x-coordinate where the double click occurred.

              - `y: number`

                The y-coordinate where the double click occurred.

            - `Drag`

              A drag action.

              - `path: Array<Path>`

                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 }
                ]
                ```

                - `x: number`

                  The x-coordinate.

                - `y: number`

                  The y-coordinate.

              - `type: "drag"`

                Specifies the event type. For a drag action, this property is always set to `drag`.

                - `"drag"`

              - `keys?: Array<string> | null`

                The keys being held while dragging the mouse.

            - `Keypress`

              A collection of keypresses the model would like to perform.

              - `keys: Array<string>`

                The combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key.

              - `type: "keypress"`

                Specifies the event type. For a keypress action, this property is always set to `keypress`.

                - `"keypress"`

            - `Move`

              A mouse move action.

              - `type: "move"`

                Specifies the event type. For a move action, this property is always set to `move`.

                - `"move"`

              - `x: number`

                The x-coordinate to move to.

              - `y: number`

                The y-coordinate to move to.

              - `keys?: Array<string> | null`

                The keys being held while moving the mouse.

            - `Screenshot`

              A screenshot action.

              - `type: "screenshot"`

                Specifies the event type. For a screenshot action, this property is always set to `screenshot`.

                - `"screenshot"`

            - `Scroll`

              A scroll action.

              - `scroll_x: number`

                The horizontal scroll distance.

              - `scroll_y: number`

                The vertical scroll distance.

              - `type: "scroll"`

                Specifies the event type. For a scroll action, this property is always set to `scroll`.

                - `"scroll"`

              - `x: number`

                The x-coordinate where the scroll occurred.

              - `y: number`

                The y-coordinate where the scroll occurred.

              - `keys?: Array<string> | null`

                The keys being held while scrolling.

            - `Type`

              An action to type in text.

              - `text: string`

                The text to type.

              - `type: "type"`

                Specifies the event type. For a type action, this property is always set to `type`.

                - `"type"`

            - `Wait`

              A wait action.

              - `type: "wait"`

                Specifies the event type. For a wait action, this property is always set to `wait`.

                - `"wait"`

          - `actions?: BetaComputerActionList`

            Flattened batched actions for `computer_use`. Each action includes an
            `type` discriminator and action-specific fields.

            - `Click`

              A click action.

            - `DoubleClick`

              A double click action.

            - `Drag`

              A drag action.

            - `Keypress`

              A collection of keypresses the model would like to perform.

            - `Move`

              A mouse move action.

            - `Screenshot`

              A screenshot action.

            - `Scroll`

              A scroll action.

            - `Type`

              An action to type in text.

            - `Wait`

              A wait action.

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

        - `ComputerCallOutput`

          The output of a computer tool call.

          - `call_id: string`

            The ID of the computer tool call that produced the output.

          - `output: BetaResponseComputerToolCallOutputScreenshot`

            A computer screenshot image used with the computer use tool.

            - `type: "computer_screenshot"`

              Specifies the event type. For a computer screenshot, this property is
              always set to `computer_screenshot`.

              - `"computer_screenshot"`

            - `file_id?: string`

              The identifier of an uploaded file that contains the screenshot.

            - `image_url?: string`

              The URL of the screenshot image.

          - `type: "computer_call_output"`

            The type of the computer tool call output. Always `computer_call_output`.

            - `"computer_call_output"`

          - `id?: string | null`

            The ID of the computer tool call output.

          - `acknowledged_safety_checks?: Array<AcknowledgedSafetyCheck> | null`

            The safety checks reported by the API that have been acknowledged by the developer.

            - `id: string`

              The ID of the pending safety check.

            - `code?: string | null`

              The type of the pending safety check.

            - `message?: string | null`

              Details about the pending safety check.

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

          - `status?: "in_progress" | "completed" | "incomplete" | null`

            The status of the message input. One of `in_progress`, `completed`, or `incomplete`. Populated when input items are returned via API.

            - `"in_progress"`

            - `"completed"`

            - `"incomplete"`

        - `BetaResponseFunctionWebSearch`

          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.

          - `id: string`

            The unique ID of the web search tool call.

          - `action: Search | OpenPage | FindInPage`

            An object describing the specific action taken in this web search call.
            Includes details on how the model used the web (search, open_page, find_in_page).

            - `Search`

              Action type "search" - Performs a web search query.

              - `type: "search"`

                The action type.

                - `"search"`

              - `queries?: Array<string>`

                The search queries.

              - `query?: string`

                The search query.

              - `sources?: Array<Source>`

                The sources used in the search.

                - `type: "url"`

                  The type of source. Always `url`.

                  - `"url"`

                - `url: string`

                  The URL of the source.

            - `OpenPage`

              Action type "open_page" - Opens a specific URL from search results.

              - `type: "open_page"`

                The action type.

                - `"open_page"`

              - `url?: string | null`

                The URL opened by the model.

            - `FindInPage`

              Action type "find_in_page": Searches for a pattern within a loaded page.

              - `pattern: string`

                The pattern or text to search for within the page.

              - `type: "find_in_page"`

                The action type.

                - `"find_in_page"`

              - `url: string`

                The URL of the page searched for the pattern.

          - `status: "in_progress" | "searching" | "completed" | "failed"`

            The status of the web search tool call.

            - `"in_progress"`

            - `"searching"`

            - `"completed"`

            - `"failed"`

          - `type: "web_search_call"`

            The type of the web search tool call. Always `web_search_call`.

            - `"web_search_call"`

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

        - `BetaResponseFunctionToolCall`

          A tool call to run a function. See the
          [function calling guide](https://platform.openai.com/docs/guides/function-calling) for more information.

          - `arguments: string`

            A JSON string of the arguments to pass to the function.

          - `call_id: string`

            The unique ID of the function tool call generated by the model.

          - `name: string`

            The name of the function to run.

          - `type: "function_call"`

            The type of the function tool call. Always `function_call`.

            - `"function_call"`

          - `id?: string`

            The unique ID of the function tool call.

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

          - `caller?: Direct | Program | null`

            The execution context that produced this tool call.

            - `Direct`

              - `type: "direct"`

                - `"direct"`

            - `Program`

              - `caller_id: string`

                The call ID of the program item that produced this tool call.

              - `type: "program"`

                - `"program"`

          - `namespace?: string`

            The namespace of the function to run.

          - `status?: "in_progress" | "completed" | "incomplete"`

            The status of the item. One of `in_progress`, `completed`, or
            `incomplete`. Populated when items are returned via API.

            - `"in_progress"`

            - `"completed"`

            - `"incomplete"`

        - `FunctionCallOutput`

          The output of a function tool call.

          - `call_id: string`

            The unique ID of the function tool call generated by the model.

          - `output: string | BetaResponseFunctionCallOutputItemList`

            Text, image, or file output of the function tool call.

            - `string`

            - `BetaResponseFunctionCallOutputItemList = Array<BetaResponseFunctionCallOutputItem>`

              An array of content outputs (text, image, file) for the function tool call.

              - `BetaResponseInputTextContent`

                A text input to the model.

                - `text: string`

                  The text input to the model.

                - `type: "input_text"`

                  The type of the input item. Always `input_text`.

                  - `"input_text"`

                - `prompt_cache_breakpoint?: PromptCacheBreakpoint | null`

                  Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.

                  - `mode: "explicit"`

                    The breakpoint mode. Always `explicit`.

                    - `"explicit"`

              - `BetaResponseInputImageContent`

                An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision)

                - `type: "input_image"`

                  The type of the input item. Always `input_image`.

                  - `"input_image"`

                - `detail?: BetaImageDetail | null`

                  The detail level of the image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`.

                - `file_id?: string | null`

                  The ID of the file to be sent to the model.

                - `image_url?: string | null`

                  The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.

                - `prompt_cache_breakpoint?: PromptCacheBreakpoint | null`

                  Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.

                  - `mode: "explicit"`

                    The breakpoint mode. Always `explicit`.

                    - `"explicit"`

              - `BetaResponseInputFileContent`

                A file input to the model.

                - `type: "input_file"`

                  The type of the input item. Always `input_file`.

                  - `"input_file"`

                - `detail?: "auto" | "low" | "high"`

                  The detail level of the file to be sent to the model. Use `auto` to let the system select the detail level; for GPT-5.6 and later models, `auto` uses high-quality rendering, which may increase input token usage. Use `low` for lower-cost rendering, or `high` to render the file at higher quality. Defaults to `auto`.

                  - `"auto"`

                  - `"low"`

                  - `"high"`

                - `file_data?: string | null`

                  The base64-encoded data of the file to be sent to the model.

                - `file_id?: string | null`

                  The ID of the file to be sent to the model.

                - `file_url?: string | null`

                  The URL of the file to be sent to the model.

                - `filename?: string | null`

                  The name of the file to be sent to the model.

                - `prompt_cache_breakpoint?: PromptCacheBreakpoint | null`

                  Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.

                  - `mode: "explicit"`

                    The breakpoint mode. Always `explicit`.

                    - `"explicit"`

          - `type: "function_call_output"`

            The type of the function tool call output. Always `function_call_output`.

            - `"function_call_output"`

          - `id?: string | null`

            The unique ID of the function tool call output. Populated when this item is returned via API.

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

          - `caller?: Direct | Program | null`

            The execution context that produced this tool call.

            - `Direct`

              - `type: "direct"`

                The caller type. Always `direct`.

                - `"direct"`

            - `Program`

              - `caller_id: string`

                The call ID of the program item that produced this tool call.

              - `type: "program"`

                The caller type. Always `program`.

                - `"program"`

          - `name?: string | null`

            The name of the tool that produced the output.

          - `namespace?: string | null`

            The namespace of the tool that produced the output.

          - `status?: "in_progress" | "completed" | "incomplete" | null`

            The status of the item. One of `in_progress`, `completed`, or `incomplete`. Populated when items are returned via API.

            - `"in_progress"`

            - `"completed"`

            - `"incomplete"`

        - `AgentMessage`

          A message routed between agents.

          - `author: string`

            The sending agent identity.

          - `content: Array<BetaResponseInputTextContent | BetaResponseInputImageContent | EncryptedContent>`

            Plaintext, image, or encrypted content sent between agents.

            - `BetaResponseInputTextContent`

              A text input to the model.

            - `BetaResponseInputImageContent`

              An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision)

            - `EncryptedContent`

              Opaque encrypted content that Responses API decrypts inside trusted model execution.

              - `encrypted_content: string`

                Opaque encrypted content.

              - `type: "encrypted_content"`

                The type of the input item. Always `encrypted_content`.

                - `"encrypted_content"`

          - `recipient: string`

            The destination agent identity.

          - `type: "agent_message"`

            The item type. Always `agent_message`.

            - `"agent_message"`

          - `id?: string | null`

            The unique ID of this agent message item.

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

        - `MultiAgentCall`

          - `action: "spawn_agent" | "interrupt_agent" | "list_agents" | 3 more`

            The multi-agent action that was executed.

            - `"spawn_agent"`

            - `"interrupt_agent"`

            - `"list_agents"`

            - `"send_message"`

            - `"followup_task"`

            - `"wait_agent"`

          - `arguments: string`

            The action arguments as a JSON string.

          - `call_id: string`

            The unique ID linking this call to its output.

          - `type: "multi_agent_call"`

            The item type. Always `multi_agent_call`.

            - `"multi_agent_call"`

          - `id?: string | null`

            The unique ID of this multi-agent call.

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

        - `MultiAgentCallOutput`

          - `action: "spawn_agent" | "interrupt_agent" | "list_agents" | 3 more`

            The multi-agent action that produced this result.

            - `"spawn_agent"`

            - `"interrupt_agent"`

            - `"list_agents"`

            - `"send_message"`

            - `"followup_task"`

            - `"wait_agent"`

          - `call_id: string`

            The unique ID of the multi-agent call.

          - `output: Array<Output>`

            Text output returned by the multi-agent action.

            - `text: string`

              The text content.

            - `type: "output_text"`

              The content type. Always `output_text`.

              - `"output_text"`

            - `annotations?: Array<FileCitation | URLCitation | ContainerFileCitation>`

              Citations associated with the text content.

              - `FileCitation`

                - `file_id: string`

                  The ID of the file.

                - `filename: string`

                  The filename of the file cited.

                - `index: number`

                  The index of the file in the list of files.

                - `type: "file_citation"`

                  The citation type. Always `file_citation`.

                  - `"file_citation"`

              - `URLCitation`

                - `end_index: number`

                  The index of the last character of the citation in the message.

                - `start_index: number`

                  The index of the first character of the citation in the message.

                - `title: string`

                  The title of the cited resource.

                - `type: "url_citation"`

                  The citation type. Always `url_citation`.

                  - `"url_citation"`

                - `url: string`

                  The URL of the cited resource.

              - `ContainerFileCitation`

                - `container_id: string`

                  The ID of the container.

                - `end_index: number`

                  The index of the last character of the citation in the message.

                - `file_id: string`

                  The ID of the container file.

                - `filename: string`

                  The filename of the container file cited.

                - `start_index: number`

                  The index of the first character of the citation in the message.

                - `type: "container_file_citation"`

                  The citation type. Always `container_file_citation`.

                  - `"container_file_citation"`

          - `type: "multi_agent_call_output"`

            The item type. Always `multi_agent_call_output`.

            - `"multi_agent_call_output"`

          - `id?: string | null`

            The unique ID of this multi-agent call output.

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

        - `ToolSearchCall`

          - `arguments: unknown`

            The arguments supplied to the tool search call.

          - `type: "tool_search_call"`

            The item type. Always `tool_search_call`.

            - `"tool_search_call"`

          - `id?: string | null`

            The unique ID of this tool search call.

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

          - `call_id?: string | null`

            The unique ID of the tool search call generated by the model.

          - `execution?: "server" | "client"`

            Whether tool search was executed by the server or by the client.

            - `"server"`

            - `"client"`

          - `status?: "in_progress" | "completed" | "incomplete" | null`

            The status of the tool search call.

            - `"in_progress"`

            - `"completed"`

            - `"incomplete"`

        - `BetaResponseToolSearchOutputItemParam`

          - `tools: Array<BetaTool>`

            The loaded tool definitions returned by the tool search output.

            - `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).

              - `name: string`

                The name of the function to call.

              - `parameters: Record<string, unknown> | null`

                A JSON schema object describing the parameters of the function.

              - `strict: boolean | null`

                Whether strict parameter validation is enforced for this function tool.

              - `type: "function"`

                The type of the function tool. Always `function`.

                - `"function"`

              - `allowed_callers?: Array<"direct" | "programmatic"> | null`

                The tool invocation context(s).

                - `"direct"`

                - `"programmatic"`

              - `defer_loading?: boolean`

                Whether this function is deferred and loaded via tool search.

              - `description?: string | null`

                A description of the function. Used by the model to determine whether or not to call the function.

              - `output_schema?: Record<string, unknown> | null`

                A JSON schema object describing the JSON value encoded in string outputs for this function.

            - `BetaFileSearchTool`

              A tool that searches for relevant content from uploaded files. Learn more about the [file search tool](https://platform.openai.com/docs/guides/tools-file-search).

              - `type: "file_search"`

                The type of the file search tool. Always `file_search`.

                - `"file_search"`

              - `vector_store_ids: Array<string>`

                The IDs of the vector stores to search.

              - `filters?: ComparisonFilter | CompoundFilter | null`

                A filter to apply.

                - `ComparisonFilter`

                  A filter used to compare a specified attribute key to a given value using a defined comparison operation.

                  - `key: string`

                    The key to compare against the value.

                  - `type: "eq" | "ne" | "gt" | 5 more`

                    Specifies the comparison operator: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`, `in`, `nin`.

                    - `eq`: equals
                    - `ne`: not equal
                    - `gt`: greater than
                    - `gte`: greater than or equal
                    - `lt`: less than
                    - `lte`: less than or equal
                    - `in`: in
                    - `nin`: not in

                    - `"eq"`

                    - `"ne"`

                    - `"gt"`

                    - `"gte"`

                    - `"lt"`

                    - `"lte"`

                    - `"in"`

                    - `"nin"`

                  - `value: string | number | boolean | Array<string | number>`

                    The value to compare against the attribute key; supports string, number, or boolean types.

                    - `string`

                    - `number`

                    - `boolean`

                    - `Array<string | number>`

                      - `string`

                      - `number`

                - `CompoundFilter`

                  Combine multiple filters using `and` or `or`.

                  - `filters: Array<ComparisonFilter | unknown>`

                    Array of filters to combine. Items can be `ComparisonFilter` or `CompoundFilter`.

                    - `ComparisonFilter`

                      A filter used to compare a specified attribute key to a given value using a defined comparison operation.

                      - `key: string`

                        The key to compare against the value.

                      - `type: "eq" | "ne" | "gt" | 5 more`

                        Specifies the comparison operator: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`, `in`, `nin`.

                        - `eq`: equals
                        - `ne`: not equal
                        - `gt`: greater than
                        - `gte`: greater than or equal
                        - `lt`: less than
                        - `lte`: less than or equal
                        - `in`: in
                        - `nin`: not in

                        - `"eq"`

                        - `"ne"`

                        - `"gt"`

                        - `"gte"`

                        - `"lt"`

                        - `"lte"`

                        - `"in"`

                        - `"nin"`

                      - `value: string | number | boolean | Array<string | number>`

                        The value to compare against the attribute key; supports string, number, or boolean types.

                        - `string`

                        - `number`

                        - `boolean`

                        - `Array<string | number>`

                          - `string`

                          - `number`

                    - `unknown`

                  - `type: "and" | "or"`

                    Type of operation: `and` or `or`.

                    - `"and"`

                    - `"or"`

              - `max_num_results?: number`

                The maximum number of results to return. This number should be between 1 and 50 inclusive.

              - `ranking_options?: RankingOptions`

                Ranking options for search.

                - `hybrid_search?: HybridSearch`

                  Weights that control how reciprocal rank fusion balances semantic embedding matches versus sparse keyword matches when hybrid search is enabled.

                  - `embedding_weight: number`

                    The weight of the embedding in the reciprocal ranking fusion.

                  - `text_weight: number`

                    The weight of the text in the reciprocal ranking fusion.

                - `ranker?: "auto" | "default-2024-11-15"`

                  The ranker to use for the file search.

                  - `"auto"`

                  - `"default-2024-11-15"`

                - `score_threshold?: number`

                  The score threshold for the file search, a number between 0 and 1. Numbers closer to 1 will attempt to return only the most relevant results, but may return fewer results.

            - `BetaComputerTool`

              A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use).

              - `type: "computer"`

                The type of the computer tool. Always `computer`.

                - `"computer"`

            - `BetaComputerUsePreviewTool`

              A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use).

              - `display_height: number`

                The height of the computer display.

              - `display_width: number`

                The width of the computer display.

              - `environment: "windows" | "mac" | "linux" | 2 more`

                The type of computer environment to control.

                - `"windows"`

                - `"mac"`

                - `"linux"`

                - `"ubuntu"`

                - `"browser"`

              - `type: "computer_use_preview"`

                The type of the computer use tool. Always `computer_use_preview`.

                - `"computer_use_preview"`

            - `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"`

                The type of the web search tool. One of `web_search` or `web_search_2025_08_26`.

                - `"web_search"`

                - `"web_search_2025_08_26"`

              - `external_web_access?: boolean`

                Allow live internet access for web search. Defaults to true when omitted. When false, the web search tool runs in offline/cache-only mode and will not fetch new external content.

              - `filters?: Filters | null`

                Filters for the search.

                - `allowed_domains?: Array<string> | null`

                  Allowed domains for the search. If not provided, all domains are allowed.
                  Subdomains of the provided domains are allowed as well.

                  Example: `["pubmed.ncbi.nlm.nih.gov"]`

              - `search_context_size?: "low" | "medium" | "high"`

                High level guidance for the amount of context window space to use for the search. One of `low`, `medium`, or `high`. `medium` is the default.

                - `"low"`

                - `"medium"`

                - `"high"`

              - `user_location?: UserLocation | null`

                The approximate location of the user.

                - `city?: string | null`

                  Free text input for the city of the user, e.g. `San Francisco`.

                - `country?: string | null`

                  The two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of the user, e.g. `US`.

                - `region?: string | null`

                  Free text input for the region of the user, e.g. `California`.

                - `timezone?: string | null`

                  The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of the user, e.g. `America/Los_Angeles`.

                - `type?: "approximate"`

                  The type of location approximation. Always `approximate`.

                  - `"approximate"`

            - `Mcp`

              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).

              - `server_label: string`

                A label for this MCP server, used to identify it in tool calls.

              - `type: "mcp"`

                The type of the MCP tool. Always `mcp`.

                - `"mcp"`

              - `allowed_callers?: Array<"direct" | "programmatic"> | null`

                The tool invocation context(s).

                - `"direct"`

                - `"programmatic"`

              - `allowed_tools?: Array<string> | McpToolFilter | null`

                List of allowed tool names or a filter object.

                - `Array<string>`

                - `McpToolFilter`

                  A filter object to specify which tools are allowed.

                  - `read_only?: boolean`

                    Indicates whether or not a tool modifies data or is read-only. If an
                    MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint),
                    it will match this filter.

                  - `tool_names?: Array<string>`

                    List of allowed tool names.

              - `authorization?: string`

                An OAuth access token that can be used with a remote MCP server, either
                with a custom MCP server URL or a service connector. Your application
                must handle the OAuth authorization flow and provide the token here.

              - `connector_id?: "connector_dropbox" | "connector_gmail" | "connector_googlecalendar" | 5 more`

                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`

                - `"connector_dropbox"`

                - `"connector_gmail"`

                - `"connector_googlecalendar"`

                - `"connector_googledrive"`

                - `"connector_microsoftteams"`

                - `"connector_outlookcalendar"`

                - `"connector_outlookemail"`

                - `"connector_sharepoint"`

              - `defer_loading?: boolean`

                Whether this MCP tool is deferred and discovered via tool search.

              - `headers?: Record<string, string> | null`

                Optional HTTP headers to send to the MCP server. Use for authentication
                or other purposes.

              - `require_approval?: McpToolApprovalFilter | "always" | "never" | null`

                Specify which of the MCP server's tools require approval.

                - `McpToolApprovalFilter`

                  Specify which of the MCP server's tools require approval. Can be
                  `always`, `never`, or a filter object associated with tools
                  that require approval.

                  - `always?: Always`

                    A filter object to specify which tools are allowed.

                    - `read_only?: boolean`

                      Indicates whether or not a tool modifies data or is read-only. If an
                      MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint),
                      it will match this filter.

                    - `tool_names?: Array<string>`

                      List of allowed tool names.

                  - `never?: Never`

                    A filter object to specify which tools are allowed.

                    - `read_only?: boolean`

                      Indicates whether or not a tool modifies data or is read-only. If an
                      MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint),
                      it will match this filter.

                    - `tool_names?: Array<string>`

                      List of allowed tool names.

                - `"always" | "never"`

                  - `"always"`

                  - `"never"`

              - `server_description?: string`

                Optional description of the MCP server, used to provide more context.

              - `server_url?: string`

                The URL for the MCP server. One of `server_url`, `connector_id`, or
                `tunnel_id` must be provided.

              - `tunnel_id?: string`

                The Secure MCP Tunnel ID to use instead of a direct server URL. One of
                `server_url`, `connector_id`, or `tunnel_id` must be provided.

            - `CodeInterpreter`

              A tool that runs Python code to help generate a response to a prompt.

              - `container: string | CodeInterpreterToolAuto`

                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`

                - `CodeInterpreterToolAuto`

                  Configuration for a code interpreter container. Optionally specify the IDs of the files to run the code on.

                  - `type: "auto"`

                    Always `auto`.

                    - `"auto"`

                  - `file_ids?: Array<string>`

                    An optional list of uploaded files to make available to your code.

                  - `memory_limit?: "1g" | "4g" | "16g" | "64g" | null`

                    The memory limit for the code interpreter container.

                    - `"1g"`

                    - `"4g"`

                    - `"16g"`

                    - `"64g"`

                  - `network_policy?: BetaContainerNetworkPolicyDisabled | BetaContainerNetworkPolicyAllowlist`

                    Network access policy for the container.

                    - `BetaContainerNetworkPolicyDisabled`

                      - `type: "disabled"`

                        Disable outbound network access. Always `disabled`.

                        - `"disabled"`

                    - `BetaContainerNetworkPolicyAllowlist`

                      - `allowed_domains: Array<string>`

                        A list of allowed domains when type is `allowlist`.

                      - `type: "allowlist"`

                        Allow outbound network access only to specified domains. Always `allowlist`.

                        - `"allowlist"`

                      - `domain_secrets?: Array<BetaContainerNetworkPolicyDomainSecret>`

                        Optional domain-scoped secrets for allowlisted domains.

                        - `domain: string`

                          The domain associated with the secret.

                        - `name: string`

                          The name of the secret to inject for the domain.

                        - `value: string`

                          The secret value to inject for the domain.

              - `type: "code_interpreter"`

                The type of the code interpreter tool. Always `code_interpreter`.

                - `"code_interpreter"`

              - `allowed_callers?: Array<"direct" | "programmatic"> | null`

                The tool invocation context(s).

                - `"direct"`

                - `"programmatic"`

            - `ProgrammaticToolCalling`

              - `type: "programmatic_tool_calling"`

                The type of the tool. Always `programmatic_tool_calling`.

                - `"programmatic_tool_calling"`

            - `ImageGeneration`

              A tool that generates images using the GPT image models.

              - `type: "image_generation"`

                The type of the image generation tool. Always `image_generation`.

                - `"image_generation"`

              - `action?: "generate" | "edit" | "auto"`

                Whether to generate a new image or edit an existing image. Default: `auto`.

                - `"generate"`

                - `"edit"`

                - `"auto"`

              - `background?: "transparent" | "opaque" | "auto"`

                Allows to set transparency for the background of the generated image(s).
                Must be one of `transparent`, `opaque`, or `auto` (default value). When
                `auto` is used, the model will automatically determine the best
                background for the image.

                Transparent backgrounds are available for supported GPT Image models.
                For `gpt-image-2` and `gpt-image-2-2026-04-21`, this support is in
                preview. When using `transparent`, set the output format to `png` or
                `webp`.

                - `"transparent"`

                - `"opaque"`

                - `"auto"`

              - `input_fidelity?: "high" | "low" | null`

                Control how much effort the model will exert to match the style and features, especially facial features, of input images. This parameter is only supported for `gpt-image-1` and `gpt-image-1.5` and later models, unsupported for `gpt-image-1-mini`. Supports `high` and `low`. Defaults to `low`.

                - `"high"`

                - `"low"`

              - `input_image_mask?: InputImageMask`

                Optional mask for inpainting. Contains `image_url`
                (string, optional) and `file_id` (string, optional).

                - `file_id?: string`

                  File ID for the mask image.

                - `image_url?: string`

                  Base64-encoded mask image.

              - `model?: (string & {}) | "gpt-image-1" | "gpt-image-1-mini" | "gpt-image-2" | 3 more`

                The image generation model to use. One of `gpt-image-1`,
                `gpt-image-1-mini`, `gpt-image-1.5`, `gpt-image-2`,
                `gpt-image-2-2026-04-21`, or `chatgpt-image-latest`. Default:
                `gpt-image-1`.

                - `(string & {})`

                - `"gpt-image-1" | "gpt-image-1-mini" | "gpt-image-2" | 3 more`

                  - `"gpt-image-1"`

                  - `"gpt-image-1-mini"`

                  - `"gpt-image-2"`

                  - `"gpt-image-2-2026-04-21"`

                  - `"gpt-image-1.5"`

                  - `"chatgpt-image-latest"`

              - `moderation?: "auto" | "low"`

                Moderation level for the generated image. Default: `auto`.

                - `"auto"`

                - `"low"`

              - `output_compression?: number`

                Compression level for the output image. Default: 100.

              - `output_format?: "png" | "webp" | "jpeg"`

                The output format of the generated image. One of `png`, `webp`, or
                `jpeg`. Default: `png`.

                - `"png"`

                - `"webp"`

                - `"jpeg"`

              - `partial_images?: number`

                Number of partial images to generate in streaming mode, from 0 (default value) to 3.

              - `quality?: "low" | "medium" | "high" | "auto"`

                The quality of the generated image. One of `low`, `medium`, `high`,
                or `auto`. Default: `auto`.

                - `"low"`

                - `"medium"`

                - `"high"`

                - `"auto"`

              - `size?: (string & {}) | "1024x1024" | "1024x1536" | "1536x1024" | "auto"`

                The size of the generated images. For `gpt-image-2` and `gpt-image-2-2026-04-21`, arbitrary resolutions are supported as `WIDTHxHEIGHT` strings, for example `1536x864`. Width and height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above `2560x1440` are experimental, and the maximum supported resolution is `3840x2160`. The requested size must also satisfy the model's current pixel and edge limits. The standard sizes `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models; `auto` is supported for models that allow automatic sizing. For `dall-e-2`, use one of `256x256`, `512x512`, or `1024x1024`. For `dall-e-3`, use one of `1024x1024`, `1792x1024`, or `1024x1792`.

                - `(string & {})`

                - `"1024x1024" | "1024x1536" | "1536x1024" | "auto"`

                  - `"1024x1024"`

                  - `"1024x1536"`

                  - `"1536x1024"`

                  - `"auto"`

            - `LocalShell`

              A tool that allows the model to execute shell commands in a local environment.

              - `type: "local_shell"`

                The type of the local shell tool. Always `local_shell`.

                - `"local_shell"`

            - `BetaFunctionShellTool`

              A tool that allows the model to execute shell commands.

              - `type: "shell"`

                The type of the shell tool. Always `shell`.

                - `"shell"`

              - `allowed_callers?: Array<"direct" | "programmatic"> | null`

                The tool invocation context(s).

                - `"direct"`

                - `"programmatic"`

              - `environment?: BetaContainerAuto | BetaLocalEnvironment | BetaContainerReference | null`

                - `BetaContainerAuto`

                  - `type: "container_auto"`

                    Automatically creates a container for this request

                    - `"container_auto"`

                  - `file_ids?: Array<string>`

                    An optional list of uploaded files to make available to your code.

                  - `memory_limit?: "1g" | "4g" | "16g" | "64g" | null`

                    The memory limit for the container.

                    - `"1g"`

                    - `"4g"`

                    - `"16g"`

                    - `"64g"`

                  - `network_policy?: BetaContainerNetworkPolicyDisabled | BetaContainerNetworkPolicyAllowlist`

                    Network access policy for the container.

                    - `BetaContainerNetworkPolicyDisabled`

                    - `BetaContainerNetworkPolicyAllowlist`

                  - `skills?: Array<BetaSkillReference | BetaInlineSkill>`

                    An optional list of skills referenced by id or inline data.

                    - `BetaSkillReference`

                      - `skill_id: string`

                        The ID of the referenced skill.

                      - `type: "skill_reference"`

                        References a skill created with the /v1/skills endpoint.

                        - `"skill_reference"`

                      - `version?: string`

                        Optional skill version. Use a positive integer or 'latest'. Omit for default.

                    - `BetaInlineSkill`

                      - `description: string`

                        The description of the skill.

                      - `name: string`

                        The name of the skill.

                      - `source: BetaInlineSkillSource`

                        Inline skill payload

                        - `data: string`

                          Base64-encoded skill zip bundle.

                        - `media_type: "application/zip"`

                          The media type of the inline skill payload. Must be `application/zip`.

                          - `"application/zip"`

                        - `type: "base64"`

                          The type of the inline skill source. Must be `base64`.

                          - `"base64"`

                      - `type: "inline"`

                        Defines an inline skill for this request.

                        - `"inline"`

                - `BetaLocalEnvironment`

                  - `type: "local"`

                    Use a local computer environment.

                    - `"local"`

                  - `skills?: Array<BetaLocalSkill>`

                    An optional list of skills.

                    - `description: string`

                      The description of the skill.

                    - `name: string`

                      The name of the skill.

                    - `path: string`

                      The path to the directory containing the skill.

                - `BetaContainerReference`

                  - `container_id: string`

                    The ID of the referenced container.

                  - `type: "container_reference"`

                    References a container created with the /v1/containers endpoint

                    - `"container_reference"`

            - `BetaCustomTool`

              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)

              - `name: string`

                The name of the custom tool, used to identify it in tool calls.

              - `type: "custom"`

                The type of the custom tool. Always `custom`.

                - `"custom"`

              - `allowed_callers?: Array<"direct" | "programmatic"> | null`

                The tool invocation context(s).

                - `"direct"`

                - `"programmatic"`

              - `defer_loading?: boolean`

                Whether this tool should be deferred and discovered via tool search.

              - `description?: string`

                Optional description of the custom tool, used to provide more context.

              - `format?: Text | Grammar`

                The input format for the custom tool. Default is unconstrained text.

                - `Text`

                  Unconstrained free-form text.

                  - `type: "text"`

                    Unconstrained text format. Always `text`.

                    - `"text"`

                - `Grammar`

                  A grammar defined by the user.

                  - `definition: string`

                    The grammar definition.

                  - `syntax: "lark" | "regex"`

                    The syntax of the grammar definition. One of `lark` or `regex`.

                    - `"lark"`

                    - `"regex"`

                  - `type: "grammar"`

                    Grammar format. Always `grammar`.

                    - `"grammar"`

            - `BetaNamespaceTool`

              Groups function/custom tools under a shared namespace.

              - `description: string`

                A description of the namespace shown to the model.

              - `name: string`

                The namespace name used in tool calls (for example, `crm`).

              - `tools: Array<Function | BetaCustomTool>`

                The function/custom tools available inside this namespace.

                - `Function`

                  - `name: string`

                  - `type: "function"`

                    - `"function"`

                  - `allowed_callers?: Array<"direct" | "programmatic"> | null`

                    The tool invocation context(s).

                    - `"direct"`

                    - `"programmatic"`

                  - `defer_loading?: boolean`

                    Whether this function should be deferred and discovered via tool search.

                  - `description?: string | null`

                  - `output_schema?: Record<string, unknown> | null`

                    A JSON Schema describing the JSON value encoded in string outputs for this function tool. This does not describe content-array outputs.

                  - `parameters?: unknown`

                  - `strict?: boolean | null`

                    Whether to enforce strict parameter validation. If omitted, Responses attempts to use strict validation when the schema is compatible, and falls back to non-strict validation otherwise.

                - `BetaCustomTool`

                  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: "namespace"`

                The type of the tool. Always `namespace`.

                - `"namespace"`

            - `BetaToolSearchTool`

              Hosted or BYOT tool search configuration for deferred tools.

              - `type: "tool_search"`

                The type of the tool. Always `tool_search`.

                - `"tool_search"`

              - `description?: string | null`

                Description shown to the model for a client-executed tool search tool.

              - `execution?: "server" | "client"`

                Whether tool search is executed by the server or by the client.

                - `"server"`

                - `"client"`

              - `parameters?: unknown`

                Parameter schema for a client-executed tool search tool.

            - `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"`

                The type of the web search tool. One of `web_search_preview` or `web_search_preview_2025_03_11`.

                - `"web_search_preview"`

                - `"web_search_preview_2025_03_11"`

              - `search_content_types?: Array<"text" | "image">`

                - `"text"`

                - `"image"`

              - `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.

                - `"low"`

                - `"medium"`

                - `"high"`

              - `user_location?: UserLocation | null`

                The user's location.

                - `type: "approximate"`

                  The type of location approximation. Always `approximate`.

                  - `"approximate"`

                - `city?: string | null`

                  Free text input for the city of the user, e.g. `San Francisco`.

                - `country?: string | null`

                  The two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of the user, e.g. `US`.

                - `region?: string | null`

                  Free text input for the region of the user, e.g. `California`.

                - `timezone?: string | null`

                  The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of the user, e.g. `America/Los_Angeles`.

            - `BetaApplyPatchTool`

              Allows the assistant to create, delete, or update files using unified diffs.

              - `type: "apply_patch"`

                The type of the tool. Always `apply_patch`.

                - `"apply_patch"`

              - `allowed_callers?: Array<"direct" | "programmatic"> | null`

                The tool invocation context(s).

                - `"direct"`

                - `"programmatic"`

          - `type: "tool_search_output"`

            The item type. Always `tool_search_output`.

            - `"tool_search_output"`

          - `id?: string | null`

            The unique ID of this tool search output.

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

          - `call_id?: string | null`

            The unique ID of the tool search call generated by the model.

          - `execution?: "server" | "client"`

            Whether tool search was executed by the server or by the client.

            - `"server"`

            - `"client"`

          - `status?: "in_progress" | "completed" | "incomplete" | null`

            The status of the tool search output.

            - `"in_progress"`

            - `"completed"`

            - `"incomplete"`

        - `AdditionalTools`

          - `role: "developer"`

            The role that provided the additional tools. Only `developer` is supported.

            - `"developer"`

          - `tools: Array<BetaTool>`

            A list of additional tools made available at this item.

            - `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).

            - `Mcp`

              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).

            - `CodeInterpreter`

              A tool that runs Python code to help generate a response to a prompt.

            - `ProgrammaticToolCalling`

            - `ImageGeneration`

              A tool that generates images using the GPT image models.

            - `LocalShell`

              A tool that allows the model to execute shell commands in a local environment.

            - `BetaFunctionShellTool`

              A tool that allows the model to execute shell commands.

            - `BetaCustomTool`

              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)

            - `BetaNamespaceTool`

              Groups function/custom tools under a shared namespace.

            - `BetaToolSearchTool`

              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).

            - `BetaApplyPatchTool`

              Allows the assistant to create, delete, or update files using unified diffs.

          - `type: "additional_tools"`

            The item type. Always `additional_tools`.

            - `"additional_tools"`

          - `id?: string | null`

            The unique ID of this additional tools item.

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

        - `BetaResponseReasoningItem`

          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).

          - `id: string`

            The unique identifier of the reasoning content.

          - `summary: Array<Summary>`

            Reasoning summary content.

            - `text: string`

              A summary of the reasoning output from the model so far.

            - `type: "summary_text"`

              The type of the object. Always `summary_text`.

              - `"summary_text"`

          - `type: "reasoning"`

            The type of the object. Always `reasoning`.

            - `"reasoning"`

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

          - `content?: Array<Content>`

            Reasoning text content.

            - `text: string`

              The reasoning text from the model.

            - `type: "reasoning_text"`

              The type of the reasoning text. Always `reasoning_text`.

              - `"reasoning_text"`

          - `encrypted_content?: string | null`

            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.

            When streaming, use the completed reasoning item and its
            `encrypted_content` from the `response.output_item.done` event in
            subsequent requests. The `encrypted_content` in
            `response.output_item.added` may be incomplete. This is especially
            important when `store` is `false` or when using Zero Data Retention.

          - `status?: "in_progress" | "completed" | "incomplete"`

            The status of the item. One of `in_progress`, `completed`, or
            `incomplete`. Populated when items are returned via API.

            - `"in_progress"`

            - `"completed"`

            - `"incomplete"`

        - `BetaResponseCompactionItemParam`

          A compaction item generated by the [`v1/responses/compact` API](https://platform.openai.com/docs/api-reference/responses/compact).

          - `encrypted_content: string`

            The encrypted content of the compaction summary.

          - `type: "compaction"`

            The type of the item. Always `compaction`.

            - `"compaction"`

          - `id?: string | null`

            The ID of the compaction item.

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

        - `ImageGenerationCall`

          An image generation request made by the model.

          - `id: string`

            The unique ID of the image generation call.

          - `result: string | null`

            The generated image encoded in base64.

          - `status: "in_progress" | "completed" | "generating" | "failed"`

            The status of the image generation call.

            - `"in_progress"`

            - `"completed"`

            - `"generating"`

            - `"failed"`

          - `type: "image_generation_call"`

            The type of the image generation call. Always `image_generation_call`.

            - `"image_generation_call"`

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

        - `BetaResponseCodeInterpreterToolCall`

          A tool call to run code.

          - `id: string`

            The unique ID of the code interpreter tool call.

          - `code: string | null`

            The code to run, or null if not available.

          - `container_id: string`

            The ID of the container used to run the code.

          - `outputs: Array<Logs | Image> | null`

            The outputs generated by the code interpreter, such as logs or images.
            Can be null if no outputs are available.

            - `Logs`

              The logs output from the code interpreter.

              - `logs: string`

                The logs output from the code interpreter.

              - `type: "logs"`

                The type of the output. Always `logs`.

                - `"logs"`

            - `Image`

              The image output from the code interpreter.

              - `type: "image"`

                The type of the output. Always `image`.

                - `"image"`

              - `url: string`

                The URL of the image output from the code interpreter.

          - `status: "in_progress" | "completed" | "incomplete" | 2 more`

            The status of the code interpreter tool call. Valid values are `in_progress`, `completed`, `incomplete`, `interpreting`, and `failed`.

            - `"in_progress"`

            - `"completed"`

            - `"incomplete"`

            - `"interpreting"`

            - `"failed"`

          - `type: "code_interpreter_call"`

            The type of the code interpreter tool call. Always `code_interpreter_call`.

            - `"code_interpreter_call"`

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

        - `LocalShellCall`

          A tool call to run a command on the local shell.

          - `id: string`

            The unique ID of the local shell call.

          - `action: Action`

            Execute a shell command on the server.

            - `command: Array<string>`

              The command to run.

            - `env: Record<string, string>`

              Environment variables to set for the command.

            - `type: "exec"`

              The type of the local shell action. Always `exec`.

              - `"exec"`

            - `timeout_ms?: number | null`

              Optional timeout in milliseconds for the command.

            - `user?: string | null`

              Optional user to run the command as.

            - `working_directory?: string | null`

              Optional working directory to run the command in.

          - `call_id: string`

            The unique ID of the local shell tool call generated by the model.

          - `status: "in_progress" | "completed" | "incomplete"`

            The status of the local shell call.

            - `"in_progress"`

            - `"completed"`

            - `"incomplete"`

          - `type: "local_shell_call"`

            The type of the local shell call. Always `local_shell_call`.

            - `"local_shell_call"`

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

        - `LocalShellCallOutput`

          The output of a local shell tool call.

          - `id: string`

            The unique ID of the local shell tool call generated by the model.

          - `output: string`

            A JSON string of the output of the local shell tool call.

          - `type: "local_shell_call_output"`

            The type of the local shell tool call output. Always `local_shell_call_output`.

            - `"local_shell_call_output"`

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

          - `status?: "in_progress" | "completed" | "incomplete" | null`

            The status of the item. One of `in_progress`, `completed`, or `incomplete`.

            - `"in_progress"`

            - `"completed"`

            - `"incomplete"`

        - `ShellCall`

          A tool representing a request to execute one or more shell commands.

          - `action: Action`

            The shell commands and limits that describe how to run the tool call.

            - `commands: Array<string>`

              Ordered shell commands for the execution environment to run.

            - `max_output_length?: number | null`

              Maximum number of UTF-8 characters to capture from combined stdout and stderr output.

            - `timeout_ms?: number | null`

              Maximum wall-clock time in milliseconds to allow the shell commands to run.

          - `call_id: string`

            The unique ID of the shell tool call generated by the model.

          - `type: "shell_call"`

            The type of the item. Always `shell_call`.

            - `"shell_call"`

          - `id?: string | null`

            The unique ID of the shell tool call. Populated when this item is returned via API.

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

          - `caller?: Direct | Program | null`

            The execution context that produced this tool call.

            - `Direct`

              - `type: "direct"`

                The caller type. Always `direct`.

                - `"direct"`

            - `Program`

              - `caller_id: string`

                The call ID of the program item that produced this tool call.

              - `type: "program"`

                The caller type. Always `program`.

                - `"program"`

          - `environment?: BetaLocalEnvironment | BetaContainerReference | null`

            The environment to execute the shell commands in.

            - `BetaLocalEnvironment`

            - `BetaContainerReference`

          - `status?: "in_progress" | "completed" | "incomplete" | null`

            The status of the shell call. One of `in_progress`, `completed`, or `incomplete`.

            - `"in_progress"`

            - `"completed"`

            - `"incomplete"`

        - `ShellCallOutput`

          The streamed output items emitted by a shell tool call.

          - `call_id: string`

            The unique ID of the shell tool call generated by the model.

          - `output: Array<BetaResponseFunctionShellCallOutputContent>`

            Captured chunks of stdout and stderr output, along with their associated outcomes.

            - `outcome: Timeout | Exit`

              The exit or timeout outcome associated with this shell call.

              - `Timeout`

                Indicates that the shell call exceeded its configured time limit.

                - `type: "timeout"`

                  The outcome type. Always `timeout`.

                  - `"timeout"`

              - `Exit`

                Indicates that the shell commands finished and returned an exit code.

                - `exit_code: number`

                  The exit code returned by the shell process.

                - `type: "exit"`

                  The outcome type. Always `exit`.

                  - `"exit"`

            - `stderr: string`

              Captured stderr output for the shell call.

            - `stdout: string`

              Captured stdout output for the shell call.

          - `type: "shell_call_output"`

            The type of the item. Always `shell_call_output`.

            - `"shell_call_output"`

          - `id?: string | null`

            The unique ID of the shell tool call output. Populated when this item is returned via API.

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

          - `caller?: Direct | Program | null`

            The execution context that produced this tool call.

            - `Direct`

              - `type: "direct"`

                The caller type. Always `direct`.

                - `"direct"`

            - `Program`

              - `caller_id: string`

                The call ID of the program item that produced this tool call.

              - `type: "program"`

                The caller type. Always `program`.

                - `"program"`

          - `max_output_length?: number | null`

            The maximum number of UTF-8 characters captured for this shell call's combined output.

          - `status?: "in_progress" | "completed" | "incomplete" | null`

            The status of the shell call output.

            - `"in_progress"`

            - `"completed"`

            - `"incomplete"`

        - `ApplyPatchCall`

          A tool call representing a request to create, delete, or update files using diff patches.

          - `call_id: string`

            The unique ID of the apply patch tool call generated by the model.

          - `operation: CreateFile | DeleteFile | UpdateFile`

            The specific create, delete, or update instruction for the apply_patch tool call.

            - `CreateFile`

              Instruction for creating a new file via the apply_patch tool.

              - `diff: string`

                Unified diff content to apply when creating the file.

              - `path: string`

                Path of the file to create relative to the workspace root.

              - `type: "create_file"`

                The operation type. Always `create_file`.

                - `"create_file"`

            - `DeleteFile`

              Instruction for deleting an existing file via the apply_patch tool.

              - `path: string`

                Path of the file to delete relative to the workspace root.

              - `type: "delete_file"`

                The operation type. Always `delete_file`.

                - `"delete_file"`

            - `UpdateFile`

              Instruction for updating an existing file via the apply_patch tool.

              - `diff: string`

                Unified diff content to apply to the existing file.

              - `path: string`

                Path of the file to update relative to the workspace root.

              - `type: "update_file"`

                The operation type. Always `update_file`.

                - `"update_file"`

          - `status: "in_progress" | "completed"`

            The status of the apply patch tool call. One of `in_progress` or `completed`.

            - `"in_progress"`

            - `"completed"`

          - `type: "apply_patch_call"`

            The type of the item. Always `apply_patch_call`.

            - `"apply_patch_call"`

          - `id?: string | null`

            The unique ID of the apply patch tool call. Populated when this item is returned via API.

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

          - `caller?: Direct | Program | null`

            The execution context that produced this tool call.

            - `Direct`

              - `type: "direct"`

                The caller type. Always `direct`.

                - `"direct"`

            - `Program`

              - `caller_id: string`

                The call ID of the program item that produced this tool call.

              - `type: "program"`

                The caller type. Always `program`.

                - `"program"`

        - `ApplyPatchCallOutput`

          The streamed output emitted by an apply patch tool call.

          - `call_id: string`

            The unique ID of the apply patch tool call generated by the model.

          - `status: "completed" | "failed"`

            The status of the apply patch tool call output. One of `completed` or `failed`.

            - `"completed"`

            - `"failed"`

          - `type: "apply_patch_call_output"`

            The type of the item. Always `apply_patch_call_output`.

            - `"apply_patch_call_output"`

          - `id?: string | null`

            The unique ID of the apply patch tool call output. Populated when this item is returned via API.

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

          - `caller?: Direct | Program | null`

            The execution context that produced this tool call.

            - `Direct`

              - `type: "direct"`

                The caller type. Always `direct`.

                - `"direct"`

            - `Program`

              - `caller_id: string`

                The call ID of the program item that produced this tool call.

              - `type: "program"`

                The caller type. Always `program`.

                - `"program"`

          - `output?: string | null`

            Optional human-readable log text from the apply patch tool (e.g., patch results or errors).

        - `McpListTools`

          A list of tools available on an MCP server.

          - `id: string`

            The unique ID of the list.

          - `server_label: string`

            The label of the MCP server.

          - `tools: Array<Tool>`

            The tools available on the server.

            - `input_schema: unknown`

              The JSON schema describing the tool's input.

            - `name: string`

              The name of the tool.

            - `annotations?: unknown`

              Additional annotations about the tool.

            - `description?: string | null`

              The description of the tool.

          - `type: "mcp_list_tools"`

            The type of the item. Always `mcp_list_tools`.

            - `"mcp_list_tools"`

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

          - `error?: string | null`

            Error message if the server could not list tools.

        - `McpApprovalRequest`

          A request for human approval of a tool invocation.

          - `id: string`

            The unique ID of the approval request.

          - `arguments: string`

            A JSON string of arguments for the tool.

          - `name: string`

            The name of the tool to run.

          - `server_label: string`

            The label of the MCP server making the request.

          - `type: "mcp_approval_request"`

            The type of the item. Always `mcp_approval_request`.

            - `"mcp_approval_request"`

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

        - `McpApprovalResponse`

          A response to an MCP approval request.

          - `approval_request_id: string`

            The ID of the approval request being answered.

          - `approve: boolean`

            Whether the request was approved.

          - `type: "mcp_approval_response"`

            The type of the item. Always `mcp_approval_response`.

            - `"mcp_approval_response"`

          - `id?: string | null`

            The unique ID of the approval response

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

          - `reason?: string | null`

            Optional reason for the decision.

        - `McpCall`

          An invocation of a tool on an MCP server.

          - `id: string`

            The unique ID of the tool call.

          - `arguments: string`

            A JSON string of the arguments passed to the tool.

          - `name: string`

            The name of the tool that was run.

          - `server_label: string`

            The label of the MCP server running the tool.

          - `type: "mcp_call"`

            The type of the item. Always `mcp_call`.

            - `"mcp_call"`

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

          - `approval_request_id?: string | null`

            Unique identifier for the MCP tool call approval request.
            Include this value in a subsequent `mcp_approval_response` input to approve or reject the corresponding tool call.

          - `error?: BetaMcpToolCallError | null`

            The error from the tool call, if any.

            - `McpProtocolError`

              - `code: number`

              - `message: string`

              - `type: "mcp_protocol_error"`

                - `"mcp_protocol_error"`

            - `McpToolExecutionError`

              - `content: unknown`

              - `type: "mcp_tool_execution_error"`

                - `"mcp_tool_execution_error"`

            - `HTTPError`

              - `code: number`

              - `message: string`

              - `type: "http_error"`

                - `"http_error"`

          - `output?: string | null`

            The output from the tool call.

          - `status?: "in_progress" | "completed" | "incomplete" | 2 more`

            The status of the tool call. One of `in_progress`, `completed`, `incomplete`, `calling`, or `failed`.

            - `"in_progress"`

            - `"completed"`

            - `"incomplete"`

            - `"calling"`

            - `"failed"`

        - `BetaResponseCustomToolCallOutput`

          The output of a custom tool call from your code, being sent back to the model.

          - `call_id: string`

            The call ID, used to map this custom tool call output to a custom tool call.

          - `output: string | Array<BetaResponseInputText | BetaResponseInputImage | BetaResponseInputFile>`

            The output from the custom tool call generated by your code.
            Can be a string or an list of output content.

            - `string`

            - `Array<BetaResponseInputText | BetaResponseInputImage | BetaResponseInputFile>`

              - `BetaResponseInputText`

                A text input to the model.

              - `BetaResponseInputImage`

                An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision).

              - `BetaResponseInputFile`

                A file input to the model.

          - `type: "custom_tool_call_output"`

            The type of the custom tool call output. Always `custom_tool_call_output`.

            - `"custom_tool_call_output"`

          - `id?: string`

            The unique ID of the custom tool call output in the OpenAI platform.

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

          - `caller?: Direct | Program | null`

            The execution context that produced this tool call.

            - `Direct`

              - `type: "direct"`

                The caller type. Always `direct`.

                - `"direct"`

            - `Program`

              - `caller_id: string`

                The call ID of the program item that produced this tool call.

              - `type: "program"`

                The caller type. Always `program`.

                - `"program"`

        - `BetaResponseCustomToolCall`

          A call to a custom tool created by the model.

          - `call_id: string`

            An identifier used to map this custom tool call to a tool call output.

          - `input: string`

            The input for the custom tool call generated by the model.

          - `name: string`

            The name of the custom tool being called.

          - `type: "custom_tool_call"`

            The type of the custom tool call. Always `custom_tool_call`.

            - `"custom_tool_call"`

          - `id?: string`

            The unique ID of the custom tool call in the OpenAI platform.

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

          - `caller?: Direct | Program | null`

            The execution context that produced this tool call.

            - `Direct`

              - `type: "direct"`

                - `"direct"`

            - `Program`

              - `caller_id: string`

                The call ID of the program item that produced this tool call.

              - `type: "program"`

                - `"program"`

          - `namespace?: string`

            The namespace of the custom tool being called.

        - `CompactionTrigger`

          Compacts the current context. Must be the final input item.

          - `type: "compaction_trigger"`

            The type of the item. Always `compaction_trigger`.

            - `"compaction_trigger"`

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

        - `ItemReference`

          An internal identifier for an item to reference.

          - `id: string`

            The ID of the item to reference.

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

          - `type?: "item_reference" | null`

            The type of item to reference. Always `item_reference`.

            - `"item_reference"`

        - `Program`

          - `id: string`

            The unique ID of this program item.

          - `call_id: string`

            The stable call ID of the program item.

          - `code: string`

            The JavaScript source executed by programmatic tool calling.

          - `fingerprint: string`

            Opaque program replay fingerprint that must be round-tripped.

          - `type: "program"`

            The item type. Always `program`.

            - `"program"`

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

        - `ProgramOutput`

          - `id: string`

            The unique ID of this program output item.

          - `call_id: string`

            The call ID of the program item.

          - `result: string`

            The result produced by the program item.

          - `status: "completed" | "incomplete"`

            The terminal status of the program output.

            - `"completed"`

            - `"incomplete"`

          - `type: "program_output"`

            The item type. Always `program_output`.

            - `"program_output"`

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

    - `metadata: Record<string, string> | null`

      Set of 16 key-value pairs that can be attached to an object. This can be
      useful for storing additional information about the object in a structured
      format, and querying for objects via API or the dashboard.

      Keys are strings with a maximum length of 64 characters. Values are strings
      with a maximum length of 512 characters.

    - `model: "gpt-5.6-sol" | "gpt-5.6-terra" | "gpt-5.6-luna" | 99 more | (string & {})`

      Model ID used to generate the response, like `gpt-4o` or `o3`. OpenAI
      offers a wide range of models with different capabilities, performance
      characteristics, and price points. Refer to the [model guide](https://platform.openai.com/docs/models)
      to browse and compare available models.

      - `"gpt-5.6-sol" | "gpt-5.6-terra" | "gpt-5.6-luna" | 99 more`

        - `"gpt-5.6-sol"`

        - `"gpt-5.6-terra"`

        - `"gpt-5.6-luna"`

        - `"gpt-5.5"`

        - `"gpt-5.5-2026-04-23"`

        - `"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.5-pro"`

        - `"gpt-5.5-pro-2026-04-23"`

        - `"gpt-5-codex"`

        - `"gpt-5-pro"`

        - `"gpt-5-pro-2025-10-06"`

        - `"gpt-5.1-codex-max"`

        - `"gpt-daybreak-blue-latest"`

        - `"gpt-daybreak-red-latest"`

        - `"gpt-5.6-cyber"`

      - `(string & {})`

    - `object: "response"`

      The object type of this resource - always set to `response`.

      - `"response"`

    - `output: Array<BetaResponseOutputItem>`

      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.

      - `BetaResponseOutputMessage`

        An output message from the model.

      - `BetaResponseFileSearchToolCall`

        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.

      - `BetaResponseFunctionToolCall`

        A tool call to run a function. See the
        [function calling guide](https://platform.openai.com/docs/guides/function-calling) for more information.

      - `BetaResponseFunctionToolCallOutputItem`

        - `id: string`

          The unique ID of the function call tool output.

        - `call_id: string`

          The unique ID of the function tool call generated by the model.

        - `output: string | Array<BetaResponseInputText | BetaResponseInputImage | BetaResponseInputFile>`

          The output from the function call generated by your code.
          Can be a string or an list of output content.

          - `string`

          - `Array<BetaResponseInputText | BetaResponseInputImage | BetaResponseInputFile>`

            - `BetaResponseInputText`

              A text input to the model.

            - `BetaResponseInputImage`

              An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision).

            - `BetaResponseInputFile`

              A file input to 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.

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

        - `type: "function_call_output"`

          The type of the function tool call output. Always `function_call_output`.

          - `"function_call_output"`

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `caller?: Direct | Program | null`

          The execution context that produced this tool call.

          - `Direct`

            - `type: "direct"`

              The caller type. Always `direct`.

              - `"direct"`

          - `Program`

            - `caller_id: string`

              The call ID of the program item that produced this tool call.

            - `type: "program"`

              The caller type. Always `program`.

              - `"program"`

        - `created_by?: string`

          The identifier of the actor that created the item.

        - `name?: string`

          The name of the tool that produced the output.

        - `namespace?: string`

          The namespace of the tool that produced the output.

      - `AgentMessage`

        - `id: string`

          The unique ID of the agent message.

        - `author: string`

          The sending agent identity.

        - `content: Array<BetaResponseInputText | BetaResponseOutputText | Text | 7 more>`

          Encrypted content sent between agents.

          - `BetaResponseInputText`

            A text input to the model.

          - `BetaResponseOutputText`

            A text output from the model.

          - `Text`

            A text content.

            - `text: string`

            - `type: "text"`

              - `"text"`

          - `SummaryText`

            A summary text from the model.

            - `text: string`

              A summary of the reasoning output from the model so far.

            - `type: "summary_text"`

              The type of the object. Always `summary_text`.

              - `"summary_text"`

          - `ReasoningText`

            Reasoning text from the model.

            - `text: string`

              The reasoning text from the model.

            - `type: "reasoning_text"`

              The type of the reasoning text. Always `reasoning_text`.

              - `"reasoning_text"`

          - `BetaResponseOutputRefusal`

            A refusal from the model.

          - `BetaResponseInputImage`

            An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision).

          - `ComputerScreenshot`

            A screenshot of a computer.

            - `detail: BetaImageDetail`

              The detail level of the screenshot image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`.

            - `file_id: string | null`

              The identifier of an uploaded file that contains the screenshot.

            - `image_url: string | null`

              The URL of the screenshot image.

            - `type: "computer_screenshot"`

              Specifies the event type. For a computer screenshot, this property is always set to `computer_screenshot`.

              - `"computer_screenshot"`

            - `prompt_cache_breakpoint?: PromptCacheBreakpoint`

              Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.

              - `mode: "explicit"`

                The breakpoint mode. Always `explicit`.

                - `"explicit"`

          - `BetaResponseInputFile`

            A file input to the model.

          - `EncryptedContent`

            Opaque encrypted content that Responses API decrypts inside trusted model execution.

            - `encrypted_content: string`

              Opaque encrypted content.

            - `type: "encrypted_content"`

              The type of the input item. Always `encrypted_content`.

              - `"encrypted_content"`

        - `recipient: string`

          The destination agent identity.

        - `type: "agent_message"`

          The type of the item. Always `agent_message`.

          - `"agent_message"`

        - `agent?: Agent`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

      - `MultiAgentCall`

        - `id: string`

          The unique ID of the multi-agent call item.

        - `action: "spawn_agent" | "interrupt_agent" | "list_agents" | 3 more`

          The multi-agent action to execute.

          - `"spawn_agent"`

          - `"interrupt_agent"`

          - `"list_agents"`

          - `"send_message"`

          - `"followup_task"`

          - `"wait_agent"`

        - `arguments: string`

          The JSON string of arguments generated for the action.

        - `call_id: string`

          The unique ID linking this call to its output.

        - `type: "multi_agent_call"`

          The type of the multi-agent call. Always `multi_agent_call`.

          - `"multi_agent_call"`

        - `agent?: Agent`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

      - `MultiAgentCallOutput`

        - `id: string`

          The unique ID of the multi-agent call output item.

        - `action: "spawn_agent" | "interrupt_agent" | "list_agents" | 3 more`

          The multi-agent action that produced this result.

          - `"spawn_agent"`

          - `"interrupt_agent"`

          - `"list_agents"`

          - `"send_message"`

          - `"followup_task"`

          - `"wait_agent"`

        - `call_id: string`

          The unique ID of the multi-agent call.

        - `output: Array<BetaResponseOutputText>`

          Text output returned by the multi-agent action.

          - `annotations: Array<FileCitation | URLCitation | ContainerFileCitation | FilePath>`

            The annotations of the text output.

          - `text: string`

            The text output from the model.

          - `type: "output_text"`

            The type of the output text. Always `output_text`.

          - `logprobs?: Array<Logprob>`

        - `type: "multi_agent_call_output"`

          The type of the multi-agent result. Always `multi_agent_call_output`.

          - `"multi_agent_call_output"`

        - `agent?: Agent`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

      - `BetaResponseFunctionWebSearch`

        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.

      - `BetaResponseComputerToolCall`

        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.

      - `BetaResponseComputerToolCallOutputItem`

        - `id: string`

          The unique ID of the computer call tool output.

        - `call_id: string`

          The ID of the computer tool call that produced the output.

        - `output: BetaResponseComputerToolCallOutputScreenshot`

          A computer screenshot image used with the computer use tool.

        - `status: "completed" | "incomplete" | "failed" | "in_progress"`

          The status of the message input. One of `in_progress`, `completed`, or
          `incomplete`. Populated when input items are returned via API.

          - `"completed"`

          - `"incomplete"`

          - `"failed"`

          - `"in_progress"`

        - `type: "computer_call_output"`

          The type of the computer tool call output. Always `computer_call_output`.

          - `"computer_call_output"`

        - `acknowledged_safety_checks?: Array<AcknowledgedSafetyCheck>`

          The safety checks reported by the API that have been acknowledged by the
          developer.

          - `id: string`

            The ID of the pending safety check.

          - `code?: string | null`

            The type of the pending safety check.

          - `message?: string | null`

            Details about the pending safety check.

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `created_by?: string`

          The identifier of the actor that created the item.

      - `BetaResponseReasoningItem`

        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).

      - `Program`

        - `id: string`

          The unique ID of the program item.

        - `call_id: string`

          The stable call ID of the program item.

        - `code: string`

          The JavaScript source executed by programmatic tool calling.

        - `fingerprint: string`

          Opaque program replay fingerprint that must be round-tripped.

        - `type: "program"`

          The type of the item. Always `program`.

          - `"program"`

        - `agent?: Agent`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

      - `ProgramOutput`

        - `id: string`

          The unique ID of the program output item.

        - `call_id: string`

          The call ID of the program item.

        - `result: string`

          The result produced by the program item.

        - `status: "completed" | "incomplete"`

          The terminal status of the program output item.

          - `"completed"`

          - `"incomplete"`

        - `type: "program_output"`

          The type of the item. Always `program_output`.

          - `"program_output"`

        - `agent?: Agent`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

      - `BetaResponseToolSearchCall`

        - `id: string`

          The unique ID of the tool search call item.

        - `arguments: unknown`

          Arguments used for the tool search call.

        - `call_id: string | null`

          The unique ID of the tool search call generated by the model.

        - `execution: "server" | "client"`

          Whether tool search was executed by the server or by the client.

          - `"server"`

          - `"client"`

        - `status: "in_progress" | "completed" | "incomplete"`

          The status of the tool search call item that was recorded.

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

        - `type: "tool_search_call"`

          The type of the item. Always `tool_search_call`.

          - `"tool_search_call"`

        - `agent?: Agent`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `created_by?: string`

          The identifier of the actor that created the item.

      - `BetaResponseToolSearchOutputItem`

        - `id: string`

          The unique ID of the tool search output item.

        - `call_id: string | null`

          The unique ID of the tool search call generated by the model.

        - `execution: "server" | "client"`

          Whether tool search was executed by the server or by the client.

          - `"server"`

          - `"client"`

        - `status: "in_progress" | "completed" | "incomplete"`

          The status of the tool search output item that was recorded.

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

        - `tools: Array<BetaTool>`

          The loaded tool definitions returned by tool search.

          - `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).

          - `Mcp`

            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).

          - `CodeInterpreter`

            A tool that runs Python code to help generate a response to a prompt.

          - `ProgrammaticToolCalling`

          - `ImageGeneration`

            A tool that generates images using the GPT image models.

          - `LocalShell`

            A tool that allows the model to execute shell commands in a local environment.

          - `BetaFunctionShellTool`

            A tool that allows the model to execute shell commands.

          - `BetaCustomTool`

            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)

          - `BetaNamespaceTool`

            Groups function/custom tools under a shared namespace.

          - `BetaToolSearchTool`

            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).

          - `BetaApplyPatchTool`

            Allows the assistant to create, delete, or update files using unified diffs.

        - `type: "tool_search_output"`

          The type of the item. Always `tool_search_output`.

          - `"tool_search_output"`

        - `agent?: Agent`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `created_by?: string`

          The identifier of the actor that created the item.

      - `AdditionalTools`

        - `id: string`

          The unique ID of the additional tools item.

        - `role: "unknown" | "user" | "assistant" | 5 more`

          The role that provided the additional tools.

          - `"unknown"`

          - `"user"`

          - `"assistant"`

          - `"system"`

          - `"critic"`

          - `"discriminator"`

          - `"developer"`

          - `"tool"`

        - `tools: Array<BetaTool>`

          The additional tool definitions made available at this item.

          - `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).

          - `Mcp`

            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).

          - `CodeInterpreter`

            A tool that runs Python code to help generate a response to a prompt.

          - `ProgrammaticToolCalling`

          - `ImageGeneration`

            A tool that generates images using the GPT image models.

          - `LocalShell`

            A tool that allows the model to execute shell commands in a local environment.

          - `BetaFunctionShellTool`

            A tool that allows the model to execute shell commands.

          - `BetaCustomTool`

            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)

          - `BetaNamespaceTool`

            Groups function/custom tools under a shared namespace.

          - `BetaToolSearchTool`

            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).

          - `BetaApplyPatchTool`

            Allows the assistant to create, delete, or update files using unified diffs.

        - `type: "additional_tools"`

          The type of the item. Always `additional_tools`.

          - `"additional_tools"`

        - `agent?: Agent`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

      - `BetaResponseCompactionItem`

        A compaction item generated by the [`v1/responses/compact` API](https://platform.openai.com/docs/api-reference/responses/compact).

        - `id: string`

          The unique ID of the compaction item.

        - `encrypted_content: string`

          The encrypted content that was produced by compaction.

        - `type: "compaction"`

          The type of the item. Always `compaction`.

          - `"compaction"`

        - `agent?: Agent`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `created_by?: string`

          The identifier of the actor that created the item.

      - `ImageGenerationCall`

        An image generation request made by the model.

        - `id: string`

          The unique ID of the image generation call.

        - `result: string | null`

          The generated image encoded in base64.

        - `status: "in_progress" | "completed" | "generating" | "failed"`

          The status of the image generation call.

          - `"in_progress"`

          - `"completed"`

          - `"generating"`

          - `"failed"`

        - `type: "image_generation_call"`

          The type of the image generation call. Always `image_generation_call`.

          - `"image_generation_call"`

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

      - `BetaResponseCodeInterpreterToolCall`

        A tool call to run code.

      - `LocalShellCall`

        A tool call to run a command on the local shell.

        - `id: string`

          The unique ID of the local shell call.

        - `action: Action`

          Execute a shell command on the server.

          - `command: Array<string>`

            The command to run.

          - `env: Record<string, string>`

            Environment variables to set for the command.

          - `type: "exec"`

            The type of the local shell action. Always `exec`.

            - `"exec"`

          - `timeout_ms?: number | null`

            Optional timeout in milliseconds for the command.

          - `user?: string | null`

            Optional user to run the command as.

          - `working_directory?: string | null`

            Optional working directory to run the command in.

        - `call_id: string`

          The unique ID of the local shell tool call generated by the model.

        - `status: "in_progress" | "completed" | "incomplete"`

          The status of the local shell call.

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

        - `type: "local_shell_call"`

          The type of the local shell call. Always `local_shell_call`.

          - `"local_shell_call"`

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

      - `LocalShellCallOutput`

        The output of a local shell tool call.

        - `id: string`

          The unique ID of the local shell tool call generated by the model.

        - `output: string`

          A JSON string of the output of the local shell tool call.

        - `type: "local_shell_call_output"`

          The type of the local shell tool call output. Always `local_shell_call_output`.

          - `"local_shell_call_output"`

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `status?: "in_progress" | "completed" | "incomplete" | null`

          The status of the item. One of `in_progress`, `completed`, or `incomplete`.

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

      - `BetaResponseFunctionShellToolCall`

        A tool call that executes one or more shell commands in a managed environment.

        - `id: string`

          The unique ID of the shell tool call. Populated when this item is returned via API.

        - `action: Action`

          The shell commands and limits that describe how to run the tool call.

          - `commands: Array<string>`

          - `max_output_length: number | null`

            Optional maximum number of characters to return from each command.

          - `timeout_ms: number | null`

            Optional timeout in milliseconds for the commands.

        - `call_id: string`

          The unique ID of the shell tool call generated by the model.

        - `environment: BetaResponseLocalEnvironment | BetaResponseContainerReference | null`

          Represents the use of a local environment to perform shell actions.

          - `BetaResponseLocalEnvironment`

            Represents the use of a local environment to perform shell actions.

            - `type: "local"`

              The environment type. Always `local`.

              - `"local"`

          - `BetaResponseContainerReference`

            Represents a container created with /v1/containers.

            - `container_id: string`

            - `type: "container_reference"`

              The environment type. Always `container_reference`.

              - `"container_reference"`

        - `status: "in_progress" | "completed" | "incomplete"`

          The status of the shell call. One of `in_progress`, `completed`, or `incomplete`.

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

        - `type: "shell_call"`

          The type of the item. Always `shell_call`.

          - `"shell_call"`

        - `agent?: Agent`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `caller?: Direct | Program | null`

          The execution context that produced this tool call.

          - `Direct`

            - `type: "direct"`

              - `"direct"`

          - `Program`

            - `caller_id: string`

              The call ID of the program item that produced this tool call.

            - `type: "program"`

              - `"program"`

        - `created_by?: string`

          The ID of the entity that created this tool call.

      - `BetaResponseFunctionShellToolCallOutput`

        The output of a shell tool call that was emitted.

        - `id: string`

          The unique ID of the shell call output. Populated when this item is returned via API.

        - `call_id: string`

          The unique ID of the shell tool call generated by the model.

        - `max_output_length: number | null`

          The maximum length of the shell command output. This is generated by the model and should be passed back with the raw output.

        - `output: Array<Output>`

          An array of shell call output contents

          - `outcome: Timeout | Exit`

            Represents either an exit outcome (with an exit code) or a timeout outcome for a shell call output chunk.

            - `Timeout`

              Indicates that the shell call exceeded its configured time limit.

              - `type: "timeout"`

                The outcome type. Always `timeout`.

                - `"timeout"`

            - `Exit`

              Indicates that the shell commands finished and returned an exit code.

              - `exit_code: number`

                Exit code from the shell process.

              - `type: "exit"`

                The outcome type. Always `exit`.

                - `"exit"`

          - `stderr: string`

            The standard error output that was captured.

          - `stdout: string`

            The standard output that was captured.

          - `created_by?: string`

            The identifier of the actor that created the item.

        - `status: "in_progress" | "completed" | "incomplete"`

          The status of the shell call output. One of `in_progress`, `completed`, or `incomplete`.

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

        - `type: "shell_call_output"`

          The type of the shell call output. Always `shell_call_output`.

          - `"shell_call_output"`

        - `agent?: Agent`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `caller?: Direct | Program | null`

          The execution context that produced this tool call.

          - `Direct`

            - `type: "direct"`

              - `"direct"`

          - `Program`

            - `caller_id: string`

              The call ID of the program item that produced this tool call.

            - `type: "program"`

              - `"program"`

        - `created_by?: string`

          The identifier of the actor that created the item.

      - `BetaResponseApplyPatchToolCall`

        A tool call that applies file diffs by creating, deleting, or updating files.

        - `id: string`

          The unique ID of the apply patch tool call. Populated when this item is returned via API.

        - `call_id: string`

          The unique ID of the apply patch tool call generated by the model.

        - `operation: CreateFile | DeleteFile | UpdateFile`

          One of the create_file, delete_file, or update_file operations applied via apply_patch.

          - `CreateFile`

            Instruction describing how to create a file via the apply_patch tool.

            - `diff: string`

              Diff to apply.

            - `path: string`

              Path of the file to create.

            - `type: "create_file"`

              Create a new file with the provided diff.

              - `"create_file"`

          - `DeleteFile`

            Instruction describing how to delete a file via the apply_patch tool.

            - `path: string`

              Path of the file to delete.

            - `type: "delete_file"`

              Delete the specified file.

              - `"delete_file"`

          - `UpdateFile`

            Instruction describing how to update a file via the apply_patch tool.

            - `diff: string`

              Diff to apply.

            - `path: string`

              Path of the file to update.

            - `type: "update_file"`

              Update an existing file with the provided diff.

              - `"update_file"`

        - `status: "in_progress" | "completed"`

          The status of the apply patch tool call. One of `in_progress` or `completed`.

          - `"in_progress"`

          - `"completed"`

        - `type: "apply_patch_call"`

          The type of the item. Always `apply_patch_call`.

          - `"apply_patch_call"`

        - `agent?: Agent`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `caller?: Direct | Program | null`

          The execution context that produced this tool call.

          - `Direct`

            - `type: "direct"`

              - `"direct"`

          - `Program`

            - `caller_id: string`

              The call ID of the program item that produced this tool call.

            - `type: "program"`

              - `"program"`

        - `created_by?: string`

          The ID of the entity that created this tool call.

      - `BetaResponseApplyPatchToolCallOutput`

        The output emitted by an apply patch tool call.

        - `id: string`

          The unique ID of the apply patch tool call output. Populated when this item is returned via API.

        - `call_id: string`

          The unique ID of the apply patch tool call generated by the model.

        - `status: "completed" | "failed"`

          The status of the apply patch tool call output. One of `completed` or `failed`.

          - `"completed"`

          - `"failed"`

        - `type: "apply_patch_call_output"`

          The type of the item. Always `apply_patch_call_output`.

          - `"apply_patch_call_output"`

        - `agent?: Agent`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `caller?: Direct | Program | null`

          The execution context that produced this tool call.

          - `Direct`

            - `type: "direct"`

              - `"direct"`

          - `Program`

            - `caller_id: string`

              The call ID of the program item that produced this tool call.

            - `type: "program"`

              - `"program"`

        - `created_by?: string`

          The ID of the entity that created this tool call output.

        - `output?: string | null`

          Optional textual output returned by the apply patch tool.

      - `McpCall`

        An invocation of a tool on an MCP server.

        - `id: string`

          The unique ID of the tool call.

        - `arguments: string`

          A JSON string of the arguments passed to the tool.

        - `name: string`

          The name of the tool that was run.

        - `server_label: string`

          The label of the MCP server running the tool.

        - `type: "mcp_call"`

          The type of the item. Always `mcp_call`.

          - `"mcp_call"`

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `approval_request_id?: string | null`

          Unique identifier for the MCP tool call approval request.
          Include this value in a subsequent `mcp_approval_response` input to approve or reject the corresponding tool call.

        - `error?: BetaMcpToolCallError | null`

          The error from the tool call, if any.

        - `output?: string | null`

          The output from the tool call.

        - `status?: "in_progress" | "completed" | "incomplete" | 2 more`

          The status of the tool call. One of `in_progress`, `completed`, `incomplete`, `calling`, or `failed`.

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

          - `"calling"`

          - `"failed"`

      - `McpListTools`

        A list of tools available on an MCP server.

        - `id: string`

          The unique ID of the list.

        - `server_label: string`

          The label of the MCP server.

        - `tools: Array<Tool>`

          The tools available on the server.

          - `input_schema: unknown`

            The JSON schema describing the tool's input.

          - `name: string`

            The name of the tool.

          - `annotations?: unknown`

            Additional annotations about the tool.

          - `description?: string | null`

            The description of the tool.

        - `type: "mcp_list_tools"`

          The type of the item. Always `mcp_list_tools`.

          - `"mcp_list_tools"`

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `error?: string | null`

          Error message if the server could not list tools.

      - `McpApprovalRequest`

        A request for human approval of a tool invocation.

        - `id: string`

          The unique ID of the approval request.

        - `arguments: string`

          A JSON string of arguments for the tool.

        - `name: string`

          The name of the tool to run.

        - `server_label: string`

          The label of the MCP server making the request.

        - `type: "mcp_approval_request"`

          The type of the item. Always `mcp_approval_request`.

          - `"mcp_approval_request"`

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

      - `McpApprovalResponse`

        A response to an MCP approval request.

        - `id: string`

          The unique ID of the approval response

        - `approval_request_id: string`

          The ID of the approval request being answered.

        - `approve: boolean`

          Whether the request was approved.

        - `type: "mcp_approval_response"`

          The type of the item. Always `mcp_approval_response`.

          - `"mcp_approval_response"`

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `reason?: string | null`

          Optional reason for the decision.

      - `BetaResponseCustomToolCall`

        A call to a custom tool created by the model.

      - `BetaResponseCustomToolCallOutputItem extends BetaResponseCustomToolCallOutput`

        The output of a custom tool call from your code, being sent back to the model.

        - `id: string`

          The unique ID of the custom tool call output item.

        - `status: "in_progress" | "completed" | "incomplete"`

          The status of the item. One of `in_progress`, `completed`, or
          `incomplete`. Populated when items are returned via API.

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

        - `created_by?: string`

          The identifier of the actor that created the item.

    - `parallel_tool_calls: boolean`

      Whether to allow the model to run tool calls in parallel.

    - `temperature: number | null`

      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.

    - `tool_choice: BetaToolChoiceOptions | BetaToolChoiceAllowed | BetaToolChoiceTypes | 6 more`

      How the model should select which tool (or tools) to use when generating
      a response. See the `tools` parameter to see how to specify which tools
      the model can call.

      - `BetaToolChoiceOptions = "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.

        - `"none"`

        - `"auto"`

        - `"required"`

      - `BetaToolChoiceAllowed`

        Constrains the tools available to the model to a pre-defined set.

        - `mode: "auto" | "required"`

          Constrains the tools available to the model to a pre-defined set.

          `auto` allows the model to pick from among the allowed tools and generate a
          message.

          `required` requires the model to call one or more of the allowed tools.

          - `"auto"`

          - `"required"`

        - `tools: Array<Record<string, unknown>>`

          A list of tool definitions that the model should be allowed to call.

          For the Responses API, the list of tool definitions might look like:

          ```json
          [
            { "type": "function", "name": "get_weather" },
            { "type": "mcp", "server_label": "deepwiki" },
            { "type": "image_generation" }
          ]
          ```

        - `type: "allowed_tools"`

          Allowed tool configuration type. Always `allowed_tools`.

          - `"allowed_tools"`

      - `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" | 5 more`

          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`

          - `"file_search"`

          - `"web_search_preview"`

          - `"computer"`

          - `"computer_use_preview"`

          - `"computer_use"`

          - `"web_search_preview_2025_03_11"`

          - `"image_generation"`

          - `"code_interpreter"`

      - `BetaToolChoiceFunction`

        Use this option to force the model to call a specific function.

        - `name: string`

          The name of the function to call.

        - `type: "function"`

          For function calling, the type is always `function`.

          - `"function"`

      - `BetaToolChoiceMcp`

        Use this option to force the model to call a specific tool on a remote MCP server.

        - `server_label: string`

          The label of the MCP server to use.

        - `type: "mcp"`

          For MCP tools, the type is always `mcp`.

          - `"mcp"`

        - `name?: string | null`

          The name of the tool to call on the server.

      - `BetaToolChoiceCustom`

        Use this option to force the model to call a specific custom tool.

        - `name: string`

          The name of the custom tool to call.

        - `type: "custom"`

          For custom tool calling, the type is always `custom`.

          - `"custom"`

      - `BetaSpecificProgrammaticToolCallingParam`

        - `type: "programmatic_tool_calling"`

          The tool to call. Always `programmatic_tool_calling`.

          - `"programmatic_tool_calling"`

      - `BetaToolChoiceApplyPatch`

        Forces the model to call the apply_patch tool when executing a tool call.

        - `type: "apply_patch"`

          The tool to call. Always `apply_patch`.

          - `"apply_patch"`

      - `BetaToolChoiceShell`

        Forces the model to call the shell tool when a tool call is required.

        - `type: "shell"`

          The tool to call. Always `shell`.

          - `"shell"`

    - `tools: Array<BetaTool>`

      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.

      - `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).

      - `Mcp`

        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).

      - `CodeInterpreter`

        A tool that runs Python code to help generate a response to a prompt.

      - `ProgrammaticToolCalling`

      - `ImageGeneration`

        A tool that generates images using the GPT image models.

      - `LocalShell`

        A tool that allows the model to execute shell commands in a local environment.

      - `BetaFunctionShellTool`

        A tool that allows the model to execute shell commands.

      - `BetaCustomTool`

        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)

      - `BetaNamespaceTool`

        Groups function/custom tools under a shared namespace.

      - `BetaToolSearchTool`

        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).

      - `BetaApplyPatchTool`

        Allows the assistant to create, delete, or update files using unified diffs.

    - `top_p: number | null`

      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.

    - `background?: boolean | null`

      Whether to run the model response in the background.
      [Learn more](https://platform.openai.com/docs/guides/background).

    - `completed_at?: number | null`

      Unix timestamp (in seconds) of when this Response was completed.
      Only present when the status is `completed`.

    - `conversation?: Conversation | null`

      The conversation that this response belonged to. Input items and output items from this response were automatically added to this conversation.

      - `id: string`

        The unique ID of the conversation that this response was associated with.

    - `max_output_tokens?: number | null`

      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).

    - `max_tool_calls?: number | null`

      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.

    - `moderation?: Moderation | null`

      Moderation results for the response input and output, if moderated completions were requested.

      - `input: ModerationResult | Error`

        Moderation for the response input.

        - `ModerationResult`

          A moderation result produced for the response input or output.

          - `categories: Record<string, boolean>`

            A dictionary of moderation categories to booleans, True if the input is flagged under this category.

          - `category_applied_input_types: Record<string, Array<"text" | "image">>`

            Which modalities of input are reflected by the score for each category.

            - `"text"`

            - `"image"`

          - `category_scores: Record<string, number>`

            A dictionary of moderation categories to scores.

          - `flagged: boolean`

            A boolean indicating whether the content was flagged by any category.

          - `model: string`

            The moderation model that produced this result.

          - `type: "moderation_result"`

            The object type, which was always `moderation_result` for successful moderation results.

            - `"moderation_result"`

        - `Error`

          An error produced while attempting moderation for the response input or output.

          - `code: string`

            The error code.

          - `message: string`

            The error message.

          - `type: "error"`

            The object type, which was always `error` for moderation failures.

            - `"error"`

      - `output: ModerationResult | Error`

        Moderation for the response output.

        - `ModerationResult`

          A moderation result produced for the response input or output.

          - `categories: Record<string, boolean>`

            A dictionary of moderation categories to booleans, True if the input is flagged under this category.

          - `category_applied_input_types: Record<string, Array<"text" | "image">>`

            Which modalities of input are reflected by the score for each category.

            - `"text"`

            - `"image"`

          - `category_scores: Record<string, number>`

            A dictionary of moderation categories to scores.

          - `flagged: boolean`

            A boolean indicating whether the content was flagged by any category.

          - `model: string`

            The moderation model that produced this result.

          - `type: "moderation_result"`

            The object type, which was always `moderation_result` for successful moderation results.

            - `"moderation_result"`

        - `Error`

          An error produced while attempting moderation for the response input or output.

          - `code: string`

            The error code.

          - `message: string`

            The error message.

          - `type: "error"`

            The object type, which was always `error` for moderation failures.

            - `"error"`

    - `previous_response_id?: string | null`

      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`.

    - `prompt?: BetaResponsePrompt | null`

      Reference to a prompt template and its variables.
      [Learn more](https://platform.openai.com/docs/guides/text?api-mode=responses#reusable-prompts).

      - `id: string`

        The unique identifier of the prompt template to use.

      - `variables?: Record<string, string | BetaResponseInputText | BetaResponseInputImage | BetaResponseInputFile> | null`

        Optional map of values to substitute in for variables in your
        prompt. The substitution values can either be strings, or other
        Response input types like images or files.

        - `string`

        - `BetaResponseInputText`

          A text input to the model.

        - `BetaResponseInputImage`

          An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision).

        - `BetaResponseInputFile`

          A file input to the model.

      - `version?: string | null`

        Optional version of the prompt template.

    - `prompt_cache_key?: string | null`

      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).

    - `prompt_cache_options?: PromptCacheOptions`

      The prompt-caching options that were applied to the response. Supported for `gpt-5.6` and later models.

      - `mode: "implicit" | "explicit"`

        Whether implicit prompt-cache breakpoints were enabled.

        - `"implicit"`

        - `"explicit"`

      - `ttl: "30m"`

        The minimum lifetime applied to each cache breakpoint.

        - `"30m"`

    - `prompt_cache_retention?: "in_memory" | "24h" | null`

      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.

      - `"in_memory"`

      - `"24h"`

    - `reasoning?: Reasoning | null`

      **gpt-5 and o-series models only**

      Configuration options for
      [reasoning models](https://platform.openai.com/docs/guides/reasoning).

      - `context?: "auto" | "current_turn" | "all_turns" | null`

        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.

        - `"auto"`

        - `"current_turn"`

        - `"all_turns"`

      - `effort?: "none" | "minimal" | "low" | 4 more | null`

        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.

        - `"none"`

        - `"minimal"`

        - `"low"`

        - `"medium"`

        - `"high"`

        - `"xhigh"`

        - `"max"`

      - `generate_summary?: "auto" | "concise" | "detailed" | null`

        **Deprecated:** use `summary` instead.

        A summary of the reasoning performed by the model. This can be
        useful for debugging and understanding the model's reasoning process.
        One of `auto`, `concise`, or `detailed`.

        - `"auto"`

        - `"concise"`

        - `"detailed"`

      - `mode?: (string & {}) | "standard" | "pro"`

        Controls the reasoning execution mode for the request.

        When returned on a response, this is the effective execution mode.

        - `(string & {})`

        - `"standard" | "pro"`

          - `"standard"`

          - `"pro"`

      - `summary?: "auto" | "concise" | "detailed" | null`

        A summary of the reasoning performed by the model. This can be
        useful for debugging and understanding the model's reasoning process.
        One of `auto`, `concise`, or `detailed`.

        `concise` is supported for `computer-use-preview` models and all reasoning models after `gpt-5`.

        - `"auto"`

        - `"concise"`

        - `"detailed"`

    - `safety_identifier?: string | null`

      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).

    - `service_tier?: BetaServiceTier | null`

      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.
      - If set to 'ultrafast', then the request will be processed with the access-controlled Ultrafast Processing service tier. This tier is currently available for `gpt-5.6-sol`; a response served through it will show `service_tier=ultrafast`.
      - When not set, the default behavior is 'auto'.

      When the `service_tier` parameter is set, the response body will include the `service_tier` value based on the processing mode actually used to serve the request. This response value may be different from the value set in the parameter.

      - `"auto"`

      - `"default"`

      - `"flex"`

      - `"scale"`

      - `"priority"`

      - `"fast"`

      - `"ultrafast"`

    - `status?: BetaResponseStatus`

      The status of the response generation. One of `completed`, `failed`,
      `in_progress`, `cancelled`, `queued`, or `incomplete`.

      - `"completed"`

      - `"failed"`

      - `"in_progress"`

      - `"cancelled"`

      - `"queued"`

      - `"incomplete"`

    - `text?: BetaResponseTextConfig`

      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?: BetaResponseFormatTextConfig`

        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.

        - `Text`

          Default response format. Used to generate text responses.

          - `type: "text"`

            The type of response format being defined. Always `text`.

            - `"text"`

        - `BetaResponseFormatTextJSONSchemaConfig`

          JSON Schema response format. Used to generate structured JSON responses.
          Learn more about [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs).

          - `name: string`

            The name of the response format. Must be a-z, A-Z, 0-9, or contain
            underscores and dashes, with a maximum length of 64.

          - `schema: Record<string, unknown>`

            The schema for the response format, described as a JSON Schema object.
            Learn how to build JSON schemas [here](https://json-schema.org/).

          - `type: "json_schema"`

            The type of response format being defined. Always `json_schema`.

            - `"json_schema"`

          - `description?: string`

            A description of what the response format is for, used by the model to
            determine how to respond in the format.

          - `strict?: boolean | null`

            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).

        - `JSONObject`

          JSON object response format. An older method of generating JSON responses.
          Using `json_schema` is recommended for models that support it. Note that the
          model will not generate JSON without a system or user message instructing it
          to do so.

          - `type: "json_object"`

            The type of response format being defined. Always `json_object`.

            - `"json_object"`

      - `verbosity?: "low" | "medium" | "high" | null`

        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`.

        - `"low"`

        - `"medium"`

        - `"high"`

    - `top_logprobs?: number | null`

      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.

    - `truncation?: "auto" | "disabled" | null`

      The truncation strategy to use for the model response.

      - `auto`: If the input to this Response exceeds
        the model's context window size, the model will truncate the
        response to fit the context window by dropping items from the beginning of the conversation.
      - `disabled` (default): If the input size will exceed the context window
        size for a model, the request will fail with a 400 error.

      - `"auto"`

      - `"disabled"`

    - `usage?: BetaResponseUsage`

      Represents token usage details including input tokens, output tokens,
      a breakdown of output tokens, and the total tokens used.

      - `input_tokens: number`

        The number of input tokens.

      - `input_tokens_details: InputTokensDetails`

        A detailed breakdown of the input tokens.

        - `cache_write_tokens: number`

          The number of input tokens that were written to the cache.

        - `cached_tokens: number`

          The number of tokens that were retrieved from the cache.
          [More on prompt caching](https://platform.openai.com/docs/guides/prompt-caching).

      - `output_tokens: number`

        The number of output tokens.

      - `output_tokens_details: OutputTokensDetails`

        A detailed breakdown of the output tokens.

        - `reasoning_tokens: number`

          The number of reasoning tokens.

      - `total_tokens: number`

        The total number of tokens used.

    - `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).

  - `sequence_number: number`

    The sequence number for this event.

  - `type: "response.completed"`

    The type of the event. Always `response.completed`.

    - `"response.completed"`

  - `agent?: Agent | null`

    The agent that owns this multi-agent streaming event.

    - `agent_name: string`

      The canonical name of the agent that produced this item.

### Beta Response Computer Tool Call

- `BetaResponseComputerToolCall`

  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.

  - `id: string`

    The unique ID of the computer call.

  - `call_id: string`

    An identifier used when responding to the tool call with output.

  - `pending_safety_checks: Array<PendingSafetyCheck>`

    The pending safety checks for the computer call.

    - `id: string`

      The ID of the pending safety check.

    - `code?: string | null`

      The type of the pending safety check.

    - `message?: string | null`

      Details about the pending safety check.

  - `status: "in_progress" | "completed" | "incomplete"`

    The status of the item. One of `in_progress`, `completed`, or
    `incomplete`. Populated when items are returned via API.

    - `"in_progress"`

    - `"completed"`

    - `"incomplete"`

  - `type: "computer_call"`

    The type of the computer call. Always `computer_call`.

    - `"computer_call"`

  - `action?: BetaComputerAction`

    A click action.

    - `Click`

      A click action.

      - `button: "left" | "right" | "wheel" | 2 more`

        Indicates which mouse button was pressed during the click. One of `left`, `right`, `wheel`, `back`, or `forward`.

        - `"left"`

        - `"right"`

        - `"wheel"`

        - `"back"`

        - `"forward"`

      - `type: "click"`

        Specifies the event type. For a click action, this property is always `click`.

        - `"click"`

      - `x: number`

        The x-coordinate where the click occurred.

      - `y: number`

        The y-coordinate where the click occurred.

      - `keys?: Array<string> | null`

        The keys being held while clicking.

    - `DoubleClick`

      A double click action.

      - `keys: Array<string> | null`

        The keys being held while double-clicking.

      - `type: "double_click"`

        Specifies the event type. For a double click action, this property is always set to `double_click`.

        - `"double_click"`

      - `x: number`

        The x-coordinate where the double click occurred.

      - `y: number`

        The y-coordinate where the double click occurred.

    - `Drag`

      A drag action.

      - `path: Array<Path>`

        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 }
        ]
        ```

        - `x: number`

          The x-coordinate.

        - `y: number`

          The y-coordinate.

      - `type: "drag"`

        Specifies the event type. For a drag action, this property is always set to `drag`.

        - `"drag"`

      - `keys?: Array<string> | null`

        The keys being held while dragging the mouse.

    - `Keypress`

      A collection of keypresses the model would like to perform.

      - `keys: Array<string>`

        The combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key.

      - `type: "keypress"`

        Specifies the event type. For a keypress action, this property is always set to `keypress`.

        - `"keypress"`

    - `Move`

      A mouse move action.

      - `type: "move"`

        Specifies the event type. For a move action, this property is always set to `move`.

        - `"move"`

      - `x: number`

        The x-coordinate to move to.

      - `y: number`

        The y-coordinate to move to.

      - `keys?: Array<string> | null`

        The keys being held while moving the mouse.

    - `Screenshot`

      A screenshot action.

      - `type: "screenshot"`

        Specifies the event type. For a screenshot action, this property is always set to `screenshot`.

        - `"screenshot"`

    - `Scroll`

      A scroll action.

      - `scroll_x: number`

        The horizontal scroll distance.

      - `scroll_y: number`

        The vertical scroll distance.

      - `type: "scroll"`

        Specifies the event type. For a scroll action, this property is always set to `scroll`.

        - `"scroll"`

      - `x: number`

        The x-coordinate where the scroll occurred.

      - `y: number`

        The y-coordinate where the scroll occurred.

      - `keys?: Array<string> | null`

        The keys being held while scrolling.

    - `Type`

      An action to type in text.

      - `text: string`

        The text to type.

      - `type: "type"`

        Specifies the event type. For a type action, this property is always set to `type`.

        - `"type"`

    - `Wait`

      A wait action.

      - `type: "wait"`

        Specifies the event type. For a wait action, this property is always set to `wait`.

        - `"wait"`

  - `actions?: BetaComputerActionList`

    Flattened batched actions for `computer_use`. Each action includes an
    `type` discriminator and action-specific fields.

    - `Click`

      A click action.

    - `DoubleClick`

      A double click action.

    - `Drag`

      A drag action.

    - `Keypress`

      A collection of keypresses the model would like to perform.

    - `Move`

      A mouse move action.

    - `Screenshot`

      A screenshot action.

    - `Scroll`

      A scroll action.

    - `Type`

      An action to type in text.

    - `Wait`

      A wait action.

  - `agent?: Agent | null`

    The agent that produced this item.

    - `agent_name: string`

      The canonical name of the agent that produced this item.

### Beta Response Computer Tool Call Output Item

- `BetaResponseComputerToolCallOutputItem`

  - `id: string`

    The unique ID of the computer call tool output.

  - `call_id: string`

    The ID of the computer tool call that produced the output.

  - `output: BetaResponseComputerToolCallOutputScreenshot`

    A computer screenshot image used with the computer use tool.

    - `type: "computer_screenshot"`

      Specifies the event type. For a computer screenshot, this property is
      always set to `computer_screenshot`.

      - `"computer_screenshot"`

    - `file_id?: string`

      The identifier of an uploaded file that contains the screenshot.

    - `image_url?: string`

      The URL of the screenshot image.

  - `status: "completed" | "incomplete" | "failed" | "in_progress"`

    The status of the message input. One of `in_progress`, `completed`, or
    `incomplete`. Populated when input items are returned via API.

    - `"completed"`

    - `"incomplete"`

    - `"failed"`

    - `"in_progress"`

  - `type: "computer_call_output"`

    The type of the computer tool call output. Always `computer_call_output`.

    - `"computer_call_output"`

  - `acknowledged_safety_checks?: Array<AcknowledgedSafetyCheck>`

    The safety checks reported by the API that have been acknowledged by the
    developer.

    - `id: string`

      The ID of the pending safety check.

    - `code?: string | null`

      The type of the pending safety check.

    - `message?: string | null`

      Details about the pending safety check.

  - `agent?: Agent | null`

    The agent that produced this item.

    - `agent_name: string`

      The canonical name of the agent that produced this item.

  - `created_by?: string`

    The identifier of the actor that created the item.

### Beta Response Computer Tool Call Output Screenshot

- `BetaResponseComputerToolCallOutputScreenshot`

  A computer screenshot image used with the computer use tool.

  - `type: "computer_screenshot"`

    Specifies the event type. For a computer screenshot, this property is
    always set to `computer_screenshot`.

    - `"computer_screenshot"`

  - `file_id?: string`

    The identifier of an uploaded file that contains the screenshot.

  - `image_url?: string`

    The URL of the screenshot image.

### Beta Response Container Reference

- `BetaResponseContainerReference`

  Represents a container created with /v1/containers.

  - `container_id: string`

  - `type: "container_reference"`

    The environment type. Always `container_reference`.

    - `"container_reference"`

### Beta Response Content

- `BetaResponseContent = BetaResponseInputText | BetaResponseInputImage | BetaResponseInputFile | 3 more`

  Multi-modal input and output contents.

  - `BetaResponseInputText`

    A text input to the model.

    - `text: string`

      The text input to the model.

    - `type: "input_text"`

      The type of the input item. Always `input_text`.

      - `"input_text"`

    - `prompt_cache_breakpoint?: PromptCacheBreakpoint`

      Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.

      - `mode: "explicit"`

        The breakpoint mode. Always `explicit`.

        - `"explicit"`

  - `BetaResponseInputImage`

    An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision).

    - `detail: BetaImageDetail`

      The detail level of the image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`.

      - `"low"`

      - `"high"`

      - `"auto"`

      - `"original"`

    - `type: "input_image"`

      The type of the input item. Always `input_image`.

      - `"input_image"`

    - `file_id?: string | null`

      The ID of the file to be sent to the model.

    - `image_url?: string | null`

      The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.

    - `prompt_cache_breakpoint?: PromptCacheBreakpoint`

      Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.

      - `mode: "explicit"`

        The breakpoint mode. Always `explicit`.

        - `"explicit"`

  - `BetaResponseInputFile`

    A file input to the model.

    - `type: "input_file"`

      The type of the input item. Always `input_file`.

      - `"input_file"`

    - `detail?: "auto" | "low" | "high"`

      The detail level of the file to be sent to the model. Use `auto` to let the system select the detail level; for GPT-5.6 and later models, `auto` uses high-quality rendering, which may increase input token usage. Use `low` for lower-cost rendering, or `high` to render the file at higher quality. Defaults to `auto`.

      - `"auto"`

      - `"low"`

      - `"high"`

    - `file_data?: string`

      The content of the file to be sent to the model.

    - `file_id?: string | null`

      The ID of the file to be sent to the model.

    - `file_url?: string`

      The URL of the file to be sent to the model.

    - `filename?: string`

      The name of the file to be sent to the model.

    - `prompt_cache_breakpoint?: PromptCacheBreakpoint`

      Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.

      - `mode: "explicit"`

        The breakpoint mode. Always `explicit`.

        - `"explicit"`

  - `BetaResponseOutputText`

    A text output from the model.

    - `annotations: Array<FileCitation | URLCitation | ContainerFileCitation | FilePath>`

      The annotations of the text output.

      - `FileCitation`

        A citation to a file.

        - `file_id: string`

          The ID of the file.

        - `filename: string`

          The filename of the file cited.

        - `index: number`

          The index of the file in the list of files.

        - `type: "file_citation"`

          The type of the file citation. Always `file_citation`.

          - `"file_citation"`

      - `URLCitation`

        A citation for a web resource used to generate a model response.

        - `end_index: number`

          The index of the last character of the URL citation in the message.

        - `start_index: number`

          The index of the first character of the URL citation in the message.

        - `title: string`

          The title of the web resource.

        - `type: "url_citation"`

          The type of the URL citation. Always `url_citation`.

          - `"url_citation"`

        - `url: string`

          The URL of the web resource.

      - `ContainerFileCitation`

        A citation for a container file used to generate a model response.

        - `container_id: string`

          The ID of the container file.

        - `end_index: number`

          The index of the last character of the container file citation in the message.

        - `file_id: string`

          The ID of the file.

        - `filename: string`

          The filename of the container file cited.

        - `start_index: number`

          The index of the first character of the container file citation in the message.

        - `type: "container_file_citation"`

          The type of the container file citation. Always `container_file_citation`.

          - `"container_file_citation"`

      - `FilePath`

        A path to a file.

        - `file_id: string`

          The ID of the file.

        - `index: number`

          The index of the file in the list of files.

        - `type: "file_path"`

          The type of the file path. Always `file_path`.

          - `"file_path"`

    - `text: string`

      The text output from the model.

    - `type: "output_text"`

      The type of the output text. Always `output_text`.

      - `"output_text"`

    - `logprobs?: Array<Logprob>`

      - `token: string`

      - `bytes: Array<number>`

      - `logprob: number`

      - `top_logprobs: Array<TopLogprob>`

        - `token: string`

        - `bytes: Array<number>`

        - `logprob: number`

  - `BetaResponseOutputRefusal`

    A refusal from the model.

    - `refusal: string`

      The refusal explanation from the model.

    - `type: "refusal"`

      The type of the refusal. Always `refusal`.

      - `"refusal"`

  - `ReasoningText`

    Reasoning text from the model.

    - `text: string`

      The reasoning text from the model.

    - `type: "reasoning_text"`

      The type of the reasoning text. Always `reasoning_text`.

      - `"reasoning_text"`

### Beta Response Content Part Added Event

- `BetaResponseContentPartAddedEvent`

  Emitted when a new content part is added.

  - `content_index: number`

    The index of the content part that was added.

  - `item_id: string`

    The ID of the output item that the content part was added to.

  - `output_index: number`

    The index of the output item that the content part was added to.

  - `part: BetaResponseOutputText | BetaResponseOutputRefusal | ReasoningText`

    The content part that was added.

    - `BetaResponseOutputText`

      A text output from the model.

      - `annotations: Array<FileCitation | URLCitation | ContainerFileCitation | FilePath>`

        The annotations of the text output.

        - `FileCitation`

          A citation to a file.

          - `file_id: string`

            The ID of the file.

          - `filename: string`

            The filename of the file cited.

          - `index: number`

            The index of the file in the list of files.

          - `type: "file_citation"`

            The type of the file citation. Always `file_citation`.

            - `"file_citation"`

        - `URLCitation`

          A citation for a web resource used to generate a model response.

          - `end_index: number`

            The index of the last character of the URL citation in the message.

          - `start_index: number`

            The index of the first character of the URL citation in the message.

          - `title: string`

            The title of the web resource.

          - `type: "url_citation"`

            The type of the URL citation. Always `url_citation`.

            - `"url_citation"`

          - `url: string`

            The URL of the web resource.

        - `ContainerFileCitation`

          A citation for a container file used to generate a model response.

          - `container_id: string`

            The ID of the container file.

          - `end_index: number`

            The index of the last character of the container file citation in the message.

          - `file_id: string`

            The ID of the file.

          - `filename: string`

            The filename of the container file cited.

          - `start_index: number`

            The index of the first character of the container file citation in the message.

          - `type: "container_file_citation"`

            The type of the container file citation. Always `container_file_citation`.

            - `"container_file_citation"`

        - `FilePath`

          A path to a file.

          - `file_id: string`

            The ID of the file.

          - `index: number`

            The index of the file in the list of files.

          - `type: "file_path"`

            The type of the file path. Always `file_path`.

            - `"file_path"`

      - `text: string`

        The text output from the model.

      - `type: "output_text"`

        The type of the output text. Always `output_text`.

        - `"output_text"`

      - `logprobs?: Array<Logprob>`

        - `token: string`

        - `bytes: Array<number>`

        - `logprob: number`

        - `top_logprobs: Array<TopLogprob>`

          - `token: string`

          - `bytes: Array<number>`

          - `logprob: number`

    - `BetaResponseOutputRefusal`

      A refusal from the model.

      - `refusal: string`

        The refusal explanation from the model.

      - `type: "refusal"`

        The type of the refusal. Always `refusal`.

        - `"refusal"`

    - `ReasoningText`

      Reasoning text from the model.

      - `text: string`

        The reasoning text from the model.

      - `type: "reasoning_text"`

        The type of the reasoning text. Always `reasoning_text`.

        - `"reasoning_text"`

  - `sequence_number: number`

    The sequence number of this event.

  - `type: "response.content_part.added"`

    The type of the event. Always `response.content_part.added`.

    - `"response.content_part.added"`

  - `agent?: Agent | null`

    The agent that owns this multi-agent streaming event.

    - `agent_name: string`

      The canonical name of the agent that produced this item.

### Beta Response Content Part Done Event

- `BetaResponseContentPartDoneEvent`

  Emitted when a content part is done.

  - `content_index: number`

    The index of the content part that is done.

  - `item_id: string`

    The ID of the output item that the content part was added to.

  - `output_index: number`

    The index of the output item that the content part was added to.

  - `part: BetaResponseOutputText | BetaResponseOutputRefusal | ReasoningText`

    The content part that is done.

    - `BetaResponseOutputText`

      A text output from the model.

      - `annotations: Array<FileCitation | URLCitation | ContainerFileCitation | FilePath>`

        The annotations of the text output.

        - `FileCitation`

          A citation to a file.

          - `file_id: string`

            The ID of the file.

          - `filename: string`

            The filename of the file cited.

          - `index: number`

            The index of the file in the list of files.

          - `type: "file_citation"`

            The type of the file citation. Always `file_citation`.

            - `"file_citation"`

        - `URLCitation`

          A citation for a web resource used to generate a model response.

          - `end_index: number`

            The index of the last character of the URL citation in the message.

          - `start_index: number`

            The index of the first character of the URL citation in the message.

          - `title: string`

            The title of the web resource.

          - `type: "url_citation"`

            The type of the URL citation. Always `url_citation`.

            - `"url_citation"`

          - `url: string`

            The URL of the web resource.

        - `ContainerFileCitation`

          A citation for a container file used to generate a model response.

          - `container_id: string`

            The ID of the container file.

          - `end_index: number`

            The index of the last character of the container file citation in the message.

          - `file_id: string`

            The ID of the file.

          - `filename: string`

            The filename of the container file cited.

          - `start_index: number`

            The index of the first character of the container file citation in the message.

          - `type: "container_file_citation"`

            The type of the container file citation. Always `container_file_citation`.

            - `"container_file_citation"`

        - `FilePath`

          A path to a file.

          - `file_id: string`

            The ID of the file.

          - `index: number`

            The index of the file in the list of files.

          - `type: "file_path"`

            The type of the file path. Always `file_path`.

            - `"file_path"`

      - `text: string`

        The text output from the model.

      - `type: "output_text"`

        The type of the output text. Always `output_text`.

        - `"output_text"`

      - `logprobs?: Array<Logprob>`

        - `token: string`

        - `bytes: Array<number>`

        - `logprob: number`

        - `top_logprobs: Array<TopLogprob>`

          - `token: string`

          - `bytes: Array<number>`

          - `logprob: number`

    - `BetaResponseOutputRefusal`

      A refusal from the model.

      - `refusal: string`

        The refusal explanation from the model.

      - `type: "refusal"`

        The type of the refusal. Always `refusal`.

        - `"refusal"`

    - `ReasoningText`

      Reasoning text from the model.

      - `text: string`

        The reasoning text from the model.

      - `type: "reasoning_text"`

        The type of the reasoning text. Always `reasoning_text`.

        - `"reasoning_text"`

  - `sequence_number: number`

    The sequence number of this event.

  - `type: "response.content_part.done"`

    The type of the event. Always `response.content_part.done`.

    - `"response.content_part.done"`

  - `agent?: Agent | null`

    The agent that owns this multi-agent streaming event.

    - `agent_name: string`

      The canonical name of the agent that produced this item.

### Beta Response Conversation Param

- `BetaResponseConversationParam`

  The conversation that this response belongs to.

  - `id: string`

    The unique ID of the conversation.

### Beta Response Created Event

- `BetaResponseCreatedEvent`

  An event that is emitted when a response is created.

  - `response: BetaResponse`

    The response that was created.

    - `id: string`

      Unique identifier for this Response.

    - `created_at: number`

      Unix timestamp (in seconds) of when this Response was created.

    - `error: BetaResponseError | null`

      An error object returned when the model fails to generate a Response.

      - `code: "server_error" | "rate_limit_exceeded" | "invalid_prompt" | 17 more`

        The error code for the response.

        - `"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"`

      - `message: string`

        A human-readable description of the error.

    - `incomplete_details: IncompleteDetails | null`

      Details about why the response is incomplete.

      - `reason?: "max_output_tokens" | "content_filter"`

        The reason why the response is incomplete.

        - `"max_output_tokens"`

        - `"content_filter"`

    - `instructions: string | Array<BetaResponseInputItem> | null`

      A system (or developer) message inserted into the model's context.

      When using along with `previous_response_id`, the instructions from a previous
      response will not be carried over to the next response. This makes it simple
      to swap out system (or developer) messages in new responses.

      - `string`

      - `Array<BetaResponseInputItem>`

        - `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.

          - `content: string | BetaResponseInputMessageContentList`

            Text, image, or audio input to the model, used to generate a response.
            Can also contain previous assistant responses.

            - `string`

            - `BetaResponseInputMessageContentList = Array<BetaResponseInputContent>`

              A list of one or many input items to the model, containing different content
              types.

              - `BetaResponseInputText`

                A text input to the model.

                - `text: string`

                  The text input to the model.

                - `type: "input_text"`

                  The type of the input item. Always `input_text`.

                  - `"input_text"`

                - `prompt_cache_breakpoint?: PromptCacheBreakpoint`

                  Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.

                  - `mode: "explicit"`

                    The breakpoint mode. Always `explicit`.

                    - `"explicit"`

              - `BetaResponseInputImage`

                An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision).

                - `detail: BetaImageDetail`

                  The detail level of the image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`.

                  - `"low"`

                  - `"high"`

                  - `"auto"`

                  - `"original"`

                - `type: "input_image"`

                  The type of the input item. Always `input_image`.

                  - `"input_image"`

                - `file_id?: string | null`

                  The ID of the file to be sent to the model.

                - `image_url?: string | null`

                  The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.

                - `prompt_cache_breakpoint?: PromptCacheBreakpoint`

                  Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.

                  - `mode: "explicit"`

                    The breakpoint mode. Always `explicit`.

                    - `"explicit"`

              - `BetaResponseInputFile`

                A file input to the model.

                - `type: "input_file"`

                  The type of the input item. Always `input_file`.

                  - `"input_file"`

                - `detail?: "auto" | "low" | "high"`

                  The detail level of the file to be sent to the model. Use `auto` to let the system select the detail level; for GPT-5.6 and later models, `auto` uses high-quality rendering, which may increase input token usage. Use `low` for lower-cost rendering, or `high` to render the file at higher quality. Defaults to `auto`.

                  - `"auto"`

                  - `"low"`

                  - `"high"`

                - `file_data?: string`

                  The content of the file to be sent to the model.

                - `file_id?: string | null`

                  The ID of the file to be sent to the model.

                - `file_url?: string`

                  The URL of the file to be sent to the model.

                - `filename?: string`

                  The name of the file to be sent to the model.

                - `prompt_cache_breakpoint?: PromptCacheBreakpoint`

                  Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.

                  - `mode: "explicit"`

                    The breakpoint mode. Always `explicit`.

                    - `"explicit"`

          - `role: "user" | "assistant" | "system" | "developer"`

            The role of the message input. One of `user`, `assistant`, `system`, or
            `developer`.

            - `"user"`

            - `"assistant"`

            - `"system"`

            - `"developer"`

          - `phase?: "commentary" | "final_answer" | null`

            Labels an `assistant` message as intermediate commentary (`commentary`) or the final answer (`final_answer`).
            For models like `gpt-5.3-codex` and beyond, when sending follow-up requests, preserve and resend
            phase on all assistant messages — dropping it can degrade performance. Not used for user messages.

            - `"commentary"`

            - `"final_answer"`

          - `type?: "message"`

            The type of the message input. Always `message`.

            - `"message"`

        - `Message`

          A message input to the model with a role indicating instruction following
          hierarchy. Instructions given with the `developer` or `system` role take
          precedence over instructions given with the `user` role.

          - `content: BetaResponseInputMessageContentList`

            A list of one or many input items to the model, containing different content
            types.

          - `role: "user" | "system" | "developer"`

            The role of the message input. One of `user`, `system`, or `developer`.

            - `"user"`

            - `"system"`

            - `"developer"`

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

          - `status?: "in_progress" | "completed" | "incomplete"`

            The status of item. One of `in_progress`, `completed`, or
            `incomplete`. Populated when items are returned via API.

            - `"in_progress"`

            - `"completed"`

            - `"incomplete"`

          - `type?: "message"`

            The type of the message input. Always set to `message`.

            - `"message"`

        - `BetaResponseOutputMessage`

          An output message from the model.

          - `id: string`

            The unique ID of the output message.

          - `content: Array<BetaResponseOutputText | BetaResponseOutputRefusal>`

            The content of the output message.

            - `BetaResponseOutputText`

              A text output from the model.

              - `annotations: Array<FileCitation | URLCitation | ContainerFileCitation | FilePath>`

                The annotations of the text output.

                - `FileCitation`

                  A citation to a file.

                  - `file_id: string`

                    The ID of the file.

                  - `filename: string`

                    The filename of the file cited.

                  - `index: number`

                    The index of the file in the list of files.

                  - `type: "file_citation"`

                    The type of the file citation. Always `file_citation`.

                    - `"file_citation"`

                - `URLCitation`

                  A citation for a web resource used to generate a model response.

                  - `end_index: number`

                    The index of the last character of the URL citation in the message.

                  - `start_index: number`

                    The index of the first character of the URL citation in the message.

                  - `title: string`

                    The title of the web resource.

                  - `type: "url_citation"`

                    The type of the URL citation. Always `url_citation`.

                    - `"url_citation"`

                  - `url: string`

                    The URL of the web resource.

                - `ContainerFileCitation`

                  A citation for a container file used to generate a model response.

                  - `container_id: string`

                    The ID of the container file.

                  - `end_index: number`

                    The index of the last character of the container file citation in the message.

                  - `file_id: string`

                    The ID of the file.

                  - `filename: string`

                    The filename of the container file cited.

                  - `start_index: number`

                    The index of the first character of the container file citation in the message.

                  - `type: "container_file_citation"`

                    The type of the container file citation. Always `container_file_citation`.

                    - `"container_file_citation"`

                - `FilePath`

                  A path to a file.

                  - `file_id: string`

                    The ID of the file.

                  - `index: number`

                    The index of the file in the list of files.

                  - `type: "file_path"`

                    The type of the file path. Always `file_path`.

                    - `"file_path"`

              - `text: string`

                The text output from the model.

              - `type: "output_text"`

                The type of the output text. Always `output_text`.

                - `"output_text"`

              - `logprobs?: Array<Logprob>`

                - `token: string`

                - `bytes: Array<number>`

                - `logprob: number`

                - `top_logprobs: Array<TopLogprob>`

                  - `token: string`

                  - `bytes: Array<number>`

                  - `logprob: number`

            - `BetaResponseOutputRefusal`

              A refusal from the model.

              - `refusal: string`

                The refusal explanation from the model.

              - `type: "refusal"`

                The type of the refusal. Always `refusal`.

                - `"refusal"`

          - `role: "assistant"`

            The role of the output message. Always `assistant`.

            - `"assistant"`

          - `status: "in_progress" | "completed" | "incomplete"`

            The status of the message input. One of `in_progress`, `completed`, or
            `incomplete`. Populated when input items are returned via API.

            - `"in_progress"`

            - `"completed"`

            - `"incomplete"`

          - `type: "message"`

            The type of the output message. Always `message`.

            - `"message"`

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

          - `phase?: "commentary" | "final_answer" | null`

            Labels an `assistant` message as intermediate commentary (`commentary`) or the final answer (`final_answer`).
            For models like `gpt-5.3-codex` and beyond, when sending follow-up requests, preserve and resend
            phase on all assistant messages — dropping it can degrade performance. Not used for user messages.

            - `"commentary"`

            - `"final_answer"`

        - `BetaResponseFileSearchToolCall`

          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.

          - `id: string`

            The unique ID of the file search tool call.

          - `queries: Array<string>`

            The queries used to search for files.

          - `status: "in_progress" | "searching" | "completed" | 2 more`

            The status of the file search tool call. One of `in_progress`,
            `searching`, `incomplete` or `failed`,

            - `"in_progress"`

            - `"searching"`

            - `"completed"`

            - `"incomplete"`

            - `"failed"`

          - `type: "file_search_call"`

            The type of the file search tool call. Always `file_search_call`.

            - `"file_search_call"`

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

          - `results?: Array<Result> | null`

            The results of the file search tool call.

            - `attributes?: Record<string, string | number | boolean> | null`

              Set of 16 key-value pairs that can be attached to an object. This can be
              useful for storing additional information about the object in a structured
              format, and querying for objects via API or the dashboard. Keys are strings
              with a maximum length of 64 characters. Values are strings with a maximum
              length of 512 characters, booleans, or numbers.

              - `string`

              - `number`

              - `boolean`

            - `file_id?: string`

              The unique ID of the file.

            - `filename?: string`

              The name of the file.

            - `score?: number`

              The relevance score of the file - a value between 0 and 1.

            - `text?: string`

              The text that was retrieved from the file.

        - `BetaResponseComputerToolCall`

          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.

          - `id: string`

            The unique ID of the computer call.

          - `call_id: string`

            An identifier used when responding to the tool call with output.

          - `pending_safety_checks: Array<PendingSafetyCheck>`

            The pending safety checks for the computer call.

            - `id: string`

              The ID of the pending safety check.

            - `code?: string | null`

              The type of the pending safety check.

            - `message?: string | null`

              Details about the pending safety check.

          - `status: "in_progress" | "completed" | "incomplete"`

            The status of the item. One of `in_progress`, `completed`, or
            `incomplete`. Populated when items are returned via API.

            - `"in_progress"`

            - `"completed"`

            - `"incomplete"`

          - `type: "computer_call"`

            The type of the computer call. Always `computer_call`.

            - `"computer_call"`

          - `action?: BetaComputerAction`

            A click action.

            - `Click`

              A click action.

              - `button: "left" | "right" | "wheel" | 2 more`

                Indicates which mouse button was pressed during the click. One of `left`, `right`, `wheel`, `back`, or `forward`.

                - `"left"`

                - `"right"`

                - `"wheel"`

                - `"back"`

                - `"forward"`

              - `type: "click"`

                Specifies the event type. For a click action, this property is always `click`.

                - `"click"`

              - `x: number`

                The x-coordinate where the click occurred.

              - `y: number`

                The y-coordinate where the click occurred.

              - `keys?: Array<string> | null`

                The keys being held while clicking.

            - `DoubleClick`

              A double click action.

              - `keys: Array<string> | null`

                The keys being held while double-clicking.

              - `type: "double_click"`

                Specifies the event type. For a double click action, this property is always set to `double_click`.

                - `"double_click"`

              - `x: number`

                The x-coordinate where the double click occurred.

              - `y: number`

                The y-coordinate where the double click occurred.

            - `Drag`

              A drag action.

              - `path: Array<Path>`

                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 }
                ]
                ```

                - `x: number`

                  The x-coordinate.

                - `y: number`

                  The y-coordinate.

              - `type: "drag"`

                Specifies the event type. For a drag action, this property is always set to `drag`.

                - `"drag"`

              - `keys?: Array<string> | null`

                The keys being held while dragging the mouse.

            - `Keypress`

              A collection of keypresses the model would like to perform.

              - `keys: Array<string>`

                The combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key.

              - `type: "keypress"`

                Specifies the event type. For a keypress action, this property is always set to `keypress`.

                - `"keypress"`

            - `Move`

              A mouse move action.

              - `type: "move"`

                Specifies the event type. For a move action, this property is always set to `move`.

                - `"move"`

              - `x: number`

                The x-coordinate to move to.

              - `y: number`

                The y-coordinate to move to.

              - `keys?: Array<string> | null`

                The keys being held while moving the mouse.

            - `Screenshot`

              A screenshot action.

              - `type: "screenshot"`

                Specifies the event type. For a screenshot action, this property is always set to `screenshot`.

                - `"screenshot"`

            - `Scroll`

              A scroll action.

              - `scroll_x: number`

                The horizontal scroll distance.

              - `scroll_y: number`

                The vertical scroll distance.

              - `type: "scroll"`

                Specifies the event type. For a scroll action, this property is always set to `scroll`.

                - `"scroll"`

              - `x: number`

                The x-coordinate where the scroll occurred.

              - `y: number`

                The y-coordinate where the scroll occurred.

              - `keys?: Array<string> | null`

                The keys being held while scrolling.

            - `Type`

              An action to type in text.

              - `text: string`

                The text to type.

              - `type: "type"`

                Specifies the event type. For a type action, this property is always set to `type`.

                - `"type"`

            - `Wait`

              A wait action.

              - `type: "wait"`

                Specifies the event type. For a wait action, this property is always set to `wait`.

                - `"wait"`

          - `actions?: BetaComputerActionList`

            Flattened batched actions for `computer_use`. Each action includes an
            `type` discriminator and action-specific fields.

            - `Click`

              A click action.

            - `DoubleClick`

              A double click action.

            - `Drag`

              A drag action.

            - `Keypress`

              A collection of keypresses the model would like to perform.

            - `Move`

              A mouse move action.

            - `Screenshot`

              A screenshot action.

            - `Scroll`

              A scroll action.

            - `Type`

              An action to type in text.

            - `Wait`

              A wait action.

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

        - `ComputerCallOutput`

          The output of a computer tool call.

          - `call_id: string`

            The ID of the computer tool call that produced the output.

          - `output: BetaResponseComputerToolCallOutputScreenshot`

            A computer screenshot image used with the computer use tool.

            - `type: "computer_screenshot"`

              Specifies the event type. For a computer screenshot, this property is
              always set to `computer_screenshot`.

              - `"computer_screenshot"`

            - `file_id?: string`

              The identifier of an uploaded file that contains the screenshot.

            - `image_url?: string`

              The URL of the screenshot image.

          - `type: "computer_call_output"`

            The type of the computer tool call output. Always `computer_call_output`.

            - `"computer_call_output"`

          - `id?: string | null`

            The ID of the computer tool call output.

          - `acknowledged_safety_checks?: Array<AcknowledgedSafetyCheck> | null`

            The safety checks reported by the API that have been acknowledged by the developer.

            - `id: string`

              The ID of the pending safety check.

            - `code?: string | null`

              The type of the pending safety check.

            - `message?: string | null`

              Details about the pending safety check.

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

          - `status?: "in_progress" | "completed" | "incomplete" | null`

            The status of the message input. One of `in_progress`, `completed`, or `incomplete`. Populated when input items are returned via API.

            - `"in_progress"`

            - `"completed"`

            - `"incomplete"`

        - `BetaResponseFunctionWebSearch`

          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.

          - `id: string`

            The unique ID of the web search tool call.

          - `action: Search | OpenPage | FindInPage`

            An object describing the specific action taken in this web search call.
            Includes details on how the model used the web (search, open_page, find_in_page).

            - `Search`

              Action type "search" - Performs a web search query.

              - `type: "search"`

                The action type.

                - `"search"`

              - `queries?: Array<string>`

                The search queries.

              - `query?: string`

                The search query.

              - `sources?: Array<Source>`

                The sources used in the search.

                - `type: "url"`

                  The type of source. Always `url`.

                  - `"url"`

                - `url: string`

                  The URL of the source.

            - `OpenPage`

              Action type "open_page" - Opens a specific URL from search results.

              - `type: "open_page"`

                The action type.

                - `"open_page"`

              - `url?: string | null`

                The URL opened by the model.

            - `FindInPage`

              Action type "find_in_page": Searches for a pattern within a loaded page.

              - `pattern: string`

                The pattern or text to search for within the page.

              - `type: "find_in_page"`

                The action type.

                - `"find_in_page"`

              - `url: string`

                The URL of the page searched for the pattern.

          - `status: "in_progress" | "searching" | "completed" | "failed"`

            The status of the web search tool call.

            - `"in_progress"`

            - `"searching"`

            - `"completed"`

            - `"failed"`

          - `type: "web_search_call"`

            The type of the web search tool call. Always `web_search_call`.

            - `"web_search_call"`

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

        - `BetaResponseFunctionToolCall`

          A tool call to run a function. See the
          [function calling guide](https://platform.openai.com/docs/guides/function-calling) for more information.

          - `arguments: string`

            A JSON string of the arguments to pass to the function.

          - `call_id: string`

            The unique ID of the function tool call generated by the model.

          - `name: string`

            The name of the function to run.

          - `type: "function_call"`

            The type of the function tool call. Always `function_call`.

            - `"function_call"`

          - `id?: string`

            The unique ID of the function tool call.

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

          - `caller?: Direct | Program | null`

            The execution context that produced this tool call.

            - `Direct`

              - `type: "direct"`

                - `"direct"`

            - `Program`

              - `caller_id: string`

                The call ID of the program item that produced this tool call.

              - `type: "program"`

                - `"program"`

          - `namespace?: string`

            The namespace of the function to run.

          - `status?: "in_progress" | "completed" | "incomplete"`

            The status of the item. One of `in_progress`, `completed`, or
            `incomplete`. Populated when items are returned via API.

            - `"in_progress"`

            - `"completed"`

            - `"incomplete"`

        - `FunctionCallOutput`

          The output of a function tool call.

          - `call_id: string`

            The unique ID of the function tool call generated by the model.

          - `output: string | BetaResponseFunctionCallOutputItemList`

            Text, image, or file output of the function tool call.

            - `string`

            - `BetaResponseFunctionCallOutputItemList = Array<BetaResponseFunctionCallOutputItem>`

              An array of content outputs (text, image, file) for the function tool call.

              - `BetaResponseInputTextContent`

                A text input to the model.

                - `text: string`

                  The text input to the model.

                - `type: "input_text"`

                  The type of the input item. Always `input_text`.

                  - `"input_text"`

                - `prompt_cache_breakpoint?: PromptCacheBreakpoint | null`

                  Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.

                  - `mode: "explicit"`

                    The breakpoint mode. Always `explicit`.

                    - `"explicit"`

              - `BetaResponseInputImageContent`

                An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision)

                - `type: "input_image"`

                  The type of the input item. Always `input_image`.

                  - `"input_image"`

                - `detail?: BetaImageDetail | null`

                  The detail level of the image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`.

                - `file_id?: string | null`

                  The ID of the file to be sent to the model.

                - `image_url?: string | null`

                  The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.

                - `prompt_cache_breakpoint?: PromptCacheBreakpoint | null`

                  Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.

                  - `mode: "explicit"`

                    The breakpoint mode. Always `explicit`.

                    - `"explicit"`

              - `BetaResponseInputFileContent`

                A file input to the model.

                - `type: "input_file"`

                  The type of the input item. Always `input_file`.

                  - `"input_file"`

                - `detail?: "auto" | "low" | "high"`

                  The detail level of the file to be sent to the model. Use `auto` to let the system select the detail level; for GPT-5.6 and later models, `auto` uses high-quality rendering, which may increase input token usage. Use `low` for lower-cost rendering, or `high` to render the file at higher quality. Defaults to `auto`.

                  - `"auto"`

                  - `"low"`

                  - `"high"`

                - `file_data?: string | null`

                  The base64-encoded data of the file to be sent to the model.

                - `file_id?: string | null`

                  The ID of the file to be sent to the model.

                - `file_url?: string | null`

                  The URL of the file to be sent to the model.

                - `filename?: string | null`

                  The name of the file to be sent to the model.

                - `prompt_cache_breakpoint?: PromptCacheBreakpoint | null`

                  Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.

                  - `mode: "explicit"`

                    The breakpoint mode. Always `explicit`.

                    - `"explicit"`

          - `type: "function_call_output"`

            The type of the function tool call output. Always `function_call_output`.

            - `"function_call_output"`

          - `id?: string | null`

            The unique ID of the function tool call output. Populated when this item is returned via API.

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

          - `caller?: Direct | Program | null`

            The execution context that produced this tool call.

            - `Direct`

              - `type: "direct"`

                The caller type. Always `direct`.

                - `"direct"`

            - `Program`

              - `caller_id: string`

                The call ID of the program item that produced this tool call.

              - `type: "program"`

                The caller type. Always `program`.

                - `"program"`

          - `name?: string | null`

            The name of the tool that produced the output.

          - `namespace?: string | null`

            The namespace of the tool that produced the output.

          - `status?: "in_progress" | "completed" | "incomplete" | null`

            The status of the item. One of `in_progress`, `completed`, or `incomplete`. Populated when items are returned via API.

            - `"in_progress"`

            - `"completed"`

            - `"incomplete"`

        - `AgentMessage`

          A message routed between agents.

          - `author: string`

            The sending agent identity.

          - `content: Array<BetaResponseInputTextContent | BetaResponseInputImageContent | EncryptedContent>`

            Plaintext, image, or encrypted content sent between agents.

            - `BetaResponseInputTextContent`

              A text input to the model.

            - `BetaResponseInputImageContent`

              An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision)

            - `EncryptedContent`

              Opaque encrypted content that Responses API decrypts inside trusted model execution.

              - `encrypted_content: string`

                Opaque encrypted content.

              - `type: "encrypted_content"`

                The type of the input item. Always `encrypted_content`.

                - `"encrypted_content"`

          - `recipient: string`

            The destination agent identity.

          - `type: "agent_message"`

            The item type. Always `agent_message`.

            - `"agent_message"`

          - `id?: string | null`

            The unique ID of this agent message item.

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

        - `MultiAgentCall`

          - `action: "spawn_agent" | "interrupt_agent" | "list_agents" | 3 more`

            The multi-agent action that was executed.

            - `"spawn_agent"`

            - `"interrupt_agent"`

            - `"list_agents"`

            - `"send_message"`

            - `"followup_task"`

            - `"wait_agent"`

          - `arguments: string`

            The action arguments as a JSON string.

          - `call_id: string`

            The unique ID linking this call to its output.

          - `type: "multi_agent_call"`

            The item type. Always `multi_agent_call`.

            - `"multi_agent_call"`

          - `id?: string | null`

            The unique ID of this multi-agent call.

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

        - `MultiAgentCallOutput`

          - `action: "spawn_agent" | "interrupt_agent" | "list_agents" | 3 more`

            The multi-agent action that produced this result.

            - `"spawn_agent"`

            - `"interrupt_agent"`

            - `"list_agents"`

            - `"send_message"`

            - `"followup_task"`

            - `"wait_agent"`

          - `call_id: string`

            The unique ID of the multi-agent call.

          - `output: Array<Output>`

            Text output returned by the multi-agent action.

            - `text: string`

              The text content.

            - `type: "output_text"`

              The content type. Always `output_text`.

              - `"output_text"`

            - `annotations?: Array<FileCitation | URLCitation | ContainerFileCitation>`

              Citations associated with the text content.

              - `FileCitation`

                - `file_id: string`

                  The ID of the file.

                - `filename: string`

                  The filename of the file cited.

                - `index: number`

                  The index of the file in the list of files.

                - `type: "file_citation"`

                  The citation type. Always `file_citation`.

                  - `"file_citation"`

              - `URLCitation`

                - `end_index: number`

                  The index of the last character of the citation in the message.

                - `start_index: number`

                  The index of the first character of the citation in the message.

                - `title: string`

                  The title of the cited resource.

                - `type: "url_citation"`

                  The citation type. Always `url_citation`.

                  - `"url_citation"`

                - `url: string`

                  The URL of the cited resource.

              - `ContainerFileCitation`

                - `container_id: string`

                  The ID of the container.

                - `end_index: number`

                  The index of the last character of the citation in the message.

                - `file_id: string`

                  The ID of the container file.

                - `filename: string`

                  The filename of the container file cited.

                - `start_index: number`

                  The index of the first character of the citation in the message.

                - `type: "container_file_citation"`

                  The citation type. Always `container_file_citation`.

                  - `"container_file_citation"`

          - `type: "multi_agent_call_output"`

            The item type. Always `multi_agent_call_output`.

            - `"multi_agent_call_output"`

          - `id?: string | null`

            The unique ID of this multi-agent call output.

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

        - `ToolSearchCall`

          - `arguments: unknown`

            The arguments supplied to the tool search call.

          - `type: "tool_search_call"`

            The item type. Always `tool_search_call`.

            - `"tool_search_call"`

          - `id?: string | null`

            The unique ID of this tool search call.

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

          - `call_id?: string | null`

            The unique ID of the tool search call generated by the model.

          - `execution?: "server" | "client"`

            Whether tool search was executed by the server or by the client.

            - `"server"`

            - `"client"`

          - `status?: "in_progress" | "completed" | "incomplete" | null`

            The status of the tool search call.

            - `"in_progress"`

            - `"completed"`

            - `"incomplete"`

        - `BetaResponseToolSearchOutputItemParam`

          - `tools: Array<BetaTool>`

            The loaded tool definitions returned by the tool search output.

            - `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).

              - `name: string`

                The name of the function to call.

              - `parameters: Record<string, unknown> | null`

                A JSON schema object describing the parameters of the function.

              - `strict: boolean | null`

                Whether strict parameter validation is enforced for this function tool.

              - `type: "function"`

                The type of the function tool. Always `function`.

                - `"function"`

              - `allowed_callers?: Array<"direct" | "programmatic"> | null`

                The tool invocation context(s).

                - `"direct"`

                - `"programmatic"`

              - `defer_loading?: boolean`

                Whether this function is deferred and loaded via tool search.

              - `description?: string | null`

                A description of the function. Used by the model to determine whether or not to call the function.

              - `output_schema?: Record<string, unknown> | null`

                A JSON schema object describing the JSON value encoded in string outputs for this function.

            - `BetaFileSearchTool`

              A tool that searches for relevant content from uploaded files. Learn more about the [file search tool](https://platform.openai.com/docs/guides/tools-file-search).

              - `type: "file_search"`

                The type of the file search tool. Always `file_search`.

                - `"file_search"`

              - `vector_store_ids: Array<string>`

                The IDs of the vector stores to search.

              - `filters?: ComparisonFilter | CompoundFilter | null`

                A filter to apply.

                - `ComparisonFilter`

                  A filter used to compare a specified attribute key to a given value using a defined comparison operation.

                  - `key: string`

                    The key to compare against the value.

                  - `type: "eq" | "ne" | "gt" | 5 more`

                    Specifies the comparison operator: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`, `in`, `nin`.

                    - `eq`: equals
                    - `ne`: not equal
                    - `gt`: greater than
                    - `gte`: greater than or equal
                    - `lt`: less than
                    - `lte`: less than or equal
                    - `in`: in
                    - `nin`: not in

                    - `"eq"`

                    - `"ne"`

                    - `"gt"`

                    - `"gte"`

                    - `"lt"`

                    - `"lte"`

                    - `"in"`

                    - `"nin"`

                  - `value: string | number | boolean | Array<string | number>`

                    The value to compare against the attribute key; supports string, number, or boolean types.

                    - `string`

                    - `number`

                    - `boolean`

                    - `Array<string | number>`

                      - `string`

                      - `number`

                - `CompoundFilter`

                  Combine multiple filters using `and` or `or`.

                  - `filters: Array<ComparisonFilter | unknown>`

                    Array of filters to combine. Items can be `ComparisonFilter` or `CompoundFilter`.

                    - `ComparisonFilter`

                      A filter used to compare a specified attribute key to a given value using a defined comparison operation.

                      - `key: string`

                        The key to compare against the value.

                      - `type: "eq" | "ne" | "gt" | 5 more`

                        Specifies the comparison operator: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`, `in`, `nin`.

                        - `eq`: equals
                        - `ne`: not equal
                        - `gt`: greater than
                        - `gte`: greater than or equal
                        - `lt`: less than
                        - `lte`: less than or equal
                        - `in`: in
                        - `nin`: not in

                        - `"eq"`

                        - `"ne"`

                        - `"gt"`

                        - `"gte"`

                        - `"lt"`

                        - `"lte"`

                        - `"in"`

                        - `"nin"`

                      - `value: string | number | boolean | Array<string | number>`

                        The value to compare against the attribute key; supports string, number, or boolean types.

                        - `string`

                        - `number`

                        - `boolean`

                        - `Array<string | number>`

                          - `string`

                          - `number`

                    - `unknown`

                  - `type: "and" | "or"`

                    Type of operation: `and` or `or`.

                    - `"and"`

                    - `"or"`

              - `max_num_results?: number`

                The maximum number of results to return. This number should be between 1 and 50 inclusive.

              - `ranking_options?: RankingOptions`

                Ranking options for search.

                - `hybrid_search?: HybridSearch`

                  Weights that control how reciprocal rank fusion balances semantic embedding matches versus sparse keyword matches when hybrid search is enabled.

                  - `embedding_weight: number`

                    The weight of the embedding in the reciprocal ranking fusion.

                  - `text_weight: number`

                    The weight of the text in the reciprocal ranking fusion.

                - `ranker?: "auto" | "default-2024-11-15"`

                  The ranker to use for the file search.

                  - `"auto"`

                  - `"default-2024-11-15"`

                - `score_threshold?: number`

                  The score threshold for the file search, a number between 0 and 1. Numbers closer to 1 will attempt to return only the most relevant results, but may return fewer results.

            - `BetaComputerTool`

              A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use).

              - `type: "computer"`

                The type of the computer tool. Always `computer`.

                - `"computer"`

            - `BetaComputerUsePreviewTool`

              A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use).

              - `display_height: number`

                The height of the computer display.

              - `display_width: number`

                The width of the computer display.

              - `environment: "windows" | "mac" | "linux" | 2 more`

                The type of computer environment to control.

                - `"windows"`

                - `"mac"`

                - `"linux"`

                - `"ubuntu"`

                - `"browser"`

              - `type: "computer_use_preview"`

                The type of the computer use tool. Always `computer_use_preview`.

                - `"computer_use_preview"`

            - `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"`

                The type of the web search tool. One of `web_search` or `web_search_2025_08_26`.

                - `"web_search"`

                - `"web_search_2025_08_26"`

              - `external_web_access?: boolean`

                Allow live internet access for web search. Defaults to true when omitted. When false, the web search tool runs in offline/cache-only mode and will not fetch new external content.

              - `filters?: Filters | null`

                Filters for the search.

                - `allowed_domains?: Array<string> | null`

                  Allowed domains for the search. If not provided, all domains are allowed.
                  Subdomains of the provided domains are allowed as well.

                  Example: `["pubmed.ncbi.nlm.nih.gov"]`

              - `search_context_size?: "low" | "medium" | "high"`

                High level guidance for the amount of context window space to use for the search. One of `low`, `medium`, or `high`. `medium` is the default.

                - `"low"`

                - `"medium"`

                - `"high"`

              - `user_location?: UserLocation | null`

                The approximate location of the user.

                - `city?: string | null`

                  Free text input for the city of the user, e.g. `San Francisco`.

                - `country?: string | null`

                  The two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of the user, e.g. `US`.

                - `region?: string | null`

                  Free text input for the region of the user, e.g. `California`.

                - `timezone?: string | null`

                  The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of the user, e.g. `America/Los_Angeles`.

                - `type?: "approximate"`

                  The type of location approximation. Always `approximate`.

                  - `"approximate"`

            - `Mcp`

              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).

              - `server_label: string`

                A label for this MCP server, used to identify it in tool calls.

              - `type: "mcp"`

                The type of the MCP tool. Always `mcp`.

                - `"mcp"`

              - `allowed_callers?: Array<"direct" | "programmatic"> | null`

                The tool invocation context(s).

                - `"direct"`

                - `"programmatic"`

              - `allowed_tools?: Array<string> | McpToolFilter | null`

                List of allowed tool names or a filter object.

                - `Array<string>`

                - `McpToolFilter`

                  A filter object to specify which tools are allowed.

                  - `read_only?: boolean`

                    Indicates whether or not a tool modifies data or is read-only. If an
                    MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint),
                    it will match this filter.

                  - `tool_names?: Array<string>`

                    List of allowed tool names.

              - `authorization?: string`

                An OAuth access token that can be used with a remote MCP server, either
                with a custom MCP server URL or a service connector. Your application
                must handle the OAuth authorization flow and provide the token here.

              - `connector_id?: "connector_dropbox" | "connector_gmail" | "connector_googlecalendar" | 5 more`

                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`

                - `"connector_dropbox"`

                - `"connector_gmail"`

                - `"connector_googlecalendar"`

                - `"connector_googledrive"`

                - `"connector_microsoftteams"`

                - `"connector_outlookcalendar"`

                - `"connector_outlookemail"`

                - `"connector_sharepoint"`

              - `defer_loading?: boolean`

                Whether this MCP tool is deferred and discovered via tool search.

              - `headers?: Record<string, string> | null`

                Optional HTTP headers to send to the MCP server. Use for authentication
                or other purposes.

              - `require_approval?: McpToolApprovalFilter | "always" | "never" | null`

                Specify which of the MCP server's tools require approval.

                - `McpToolApprovalFilter`

                  Specify which of the MCP server's tools require approval. Can be
                  `always`, `never`, or a filter object associated with tools
                  that require approval.

                  - `always?: Always`

                    A filter object to specify which tools are allowed.

                    - `read_only?: boolean`

                      Indicates whether or not a tool modifies data or is read-only. If an
                      MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint),
                      it will match this filter.

                    - `tool_names?: Array<string>`

                      List of allowed tool names.

                  - `never?: Never`

                    A filter object to specify which tools are allowed.

                    - `read_only?: boolean`

                      Indicates whether or not a tool modifies data or is read-only. If an
                      MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint),
                      it will match this filter.

                    - `tool_names?: Array<string>`

                      List of allowed tool names.

                - `"always" | "never"`

                  - `"always"`

                  - `"never"`

              - `server_description?: string`

                Optional description of the MCP server, used to provide more context.

              - `server_url?: string`

                The URL for the MCP server. One of `server_url`, `connector_id`, or
                `tunnel_id` must be provided.

              - `tunnel_id?: string`

                The Secure MCP Tunnel ID to use instead of a direct server URL. One of
                `server_url`, `connector_id`, or `tunnel_id` must be provided.

            - `CodeInterpreter`

              A tool that runs Python code to help generate a response to a prompt.

              - `container: string | CodeInterpreterToolAuto`

                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`

                - `CodeInterpreterToolAuto`

                  Configuration for a code interpreter container. Optionally specify the IDs of the files to run the code on.

                  - `type: "auto"`

                    Always `auto`.

                    - `"auto"`

                  - `file_ids?: Array<string>`

                    An optional list of uploaded files to make available to your code.

                  - `memory_limit?: "1g" | "4g" | "16g" | "64g" | null`

                    The memory limit for the code interpreter container.

                    - `"1g"`

                    - `"4g"`

                    - `"16g"`

                    - `"64g"`

                  - `network_policy?: BetaContainerNetworkPolicyDisabled | BetaContainerNetworkPolicyAllowlist`

                    Network access policy for the container.

                    - `BetaContainerNetworkPolicyDisabled`

                      - `type: "disabled"`

                        Disable outbound network access. Always `disabled`.

                        - `"disabled"`

                    - `BetaContainerNetworkPolicyAllowlist`

                      - `allowed_domains: Array<string>`

                        A list of allowed domains when type is `allowlist`.

                      - `type: "allowlist"`

                        Allow outbound network access only to specified domains. Always `allowlist`.

                        - `"allowlist"`

                      - `domain_secrets?: Array<BetaContainerNetworkPolicyDomainSecret>`

                        Optional domain-scoped secrets for allowlisted domains.

                        - `domain: string`

                          The domain associated with the secret.

                        - `name: string`

                          The name of the secret to inject for the domain.

                        - `value: string`

                          The secret value to inject for the domain.

              - `type: "code_interpreter"`

                The type of the code interpreter tool. Always `code_interpreter`.

                - `"code_interpreter"`

              - `allowed_callers?: Array<"direct" | "programmatic"> | null`

                The tool invocation context(s).

                - `"direct"`

                - `"programmatic"`

            - `ProgrammaticToolCalling`

              - `type: "programmatic_tool_calling"`

                The type of the tool. Always `programmatic_tool_calling`.

                - `"programmatic_tool_calling"`

            - `ImageGeneration`

              A tool that generates images using the GPT image models.

              - `type: "image_generation"`

                The type of the image generation tool. Always `image_generation`.

                - `"image_generation"`

              - `action?: "generate" | "edit" | "auto"`

                Whether to generate a new image or edit an existing image. Default: `auto`.

                - `"generate"`

                - `"edit"`

                - `"auto"`

              - `background?: "transparent" | "opaque" | "auto"`

                Allows to set transparency for the background of the generated image(s).
                Must be one of `transparent`, `opaque`, or `auto` (default value). When
                `auto` is used, the model will automatically determine the best
                background for the image.

                Transparent backgrounds are available for supported GPT Image models.
                For `gpt-image-2` and `gpt-image-2-2026-04-21`, this support is in
                preview. When using `transparent`, set the output format to `png` or
                `webp`.

                - `"transparent"`

                - `"opaque"`

                - `"auto"`

              - `input_fidelity?: "high" | "low" | null`

                Control how much effort the model will exert to match the style and features, especially facial features, of input images. This parameter is only supported for `gpt-image-1` and `gpt-image-1.5` and later models, unsupported for `gpt-image-1-mini`. Supports `high` and `low`. Defaults to `low`.

                - `"high"`

                - `"low"`

              - `input_image_mask?: InputImageMask`

                Optional mask for inpainting. Contains `image_url`
                (string, optional) and `file_id` (string, optional).

                - `file_id?: string`

                  File ID for the mask image.

                - `image_url?: string`

                  Base64-encoded mask image.

              - `model?: (string & {}) | "gpt-image-1" | "gpt-image-1-mini" | "gpt-image-2" | 3 more`

                The image generation model to use. One of `gpt-image-1`,
                `gpt-image-1-mini`, `gpt-image-1.5`, `gpt-image-2`,
                `gpt-image-2-2026-04-21`, or `chatgpt-image-latest`. Default:
                `gpt-image-1`.

                - `(string & {})`

                - `"gpt-image-1" | "gpt-image-1-mini" | "gpt-image-2" | 3 more`

                  - `"gpt-image-1"`

                  - `"gpt-image-1-mini"`

                  - `"gpt-image-2"`

                  - `"gpt-image-2-2026-04-21"`

                  - `"gpt-image-1.5"`

                  - `"chatgpt-image-latest"`

              - `moderation?: "auto" | "low"`

                Moderation level for the generated image. Default: `auto`.

                - `"auto"`

                - `"low"`

              - `output_compression?: number`

                Compression level for the output image. Default: 100.

              - `output_format?: "png" | "webp" | "jpeg"`

                The output format of the generated image. One of `png`, `webp`, or
                `jpeg`. Default: `png`.

                - `"png"`

                - `"webp"`

                - `"jpeg"`

              - `partial_images?: number`

                Number of partial images to generate in streaming mode, from 0 (default value) to 3.

              - `quality?: "low" | "medium" | "high" | "auto"`

                The quality of the generated image. One of `low`, `medium`, `high`,
                or `auto`. Default: `auto`.

                - `"low"`

                - `"medium"`

                - `"high"`

                - `"auto"`

              - `size?: (string & {}) | "1024x1024" | "1024x1536" | "1536x1024" | "auto"`

                The size of the generated images. For `gpt-image-2` and `gpt-image-2-2026-04-21`, arbitrary resolutions are supported as `WIDTHxHEIGHT` strings, for example `1536x864`. Width and height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above `2560x1440` are experimental, and the maximum supported resolution is `3840x2160`. The requested size must also satisfy the model's current pixel and edge limits. The standard sizes `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models; `auto` is supported for models that allow automatic sizing. For `dall-e-2`, use one of `256x256`, `512x512`, or `1024x1024`. For `dall-e-3`, use one of `1024x1024`, `1792x1024`, or `1024x1792`.

                - `(string & {})`

                - `"1024x1024" | "1024x1536" | "1536x1024" | "auto"`

                  - `"1024x1024"`

                  - `"1024x1536"`

                  - `"1536x1024"`

                  - `"auto"`

            - `LocalShell`

              A tool that allows the model to execute shell commands in a local environment.

              - `type: "local_shell"`

                The type of the local shell tool. Always `local_shell`.

                - `"local_shell"`

            - `BetaFunctionShellTool`

              A tool that allows the model to execute shell commands.

              - `type: "shell"`

                The type of the shell tool. Always `shell`.

                - `"shell"`

              - `allowed_callers?: Array<"direct" | "programmatic"> | null`

                The tool invocation context(s).

                - `"direct"`

                - `"programmatic"`

              - `environment?: BetaContainerAuto | BetaLocalEnvironment | BetaContainerReference | null`

                - `BetaContainerAuto`

                  - `type: "container_auto"`

                    Automatically creates a container for this request

                    - `"container_auto"`

                  - `file_ids?: Array<string>`

                    An optional list of uploaded files to make available to your code.

                  - `memory_limit?: "1g" | "4g" | "16g" | "64g" | null`

                    The memory limit for the container.

                    - `"1g"`

                    - `"4g"`

                    - `"16g"`

                    - `"64g"`

                  - `network_policy?: BetaContainerNetworkPolicyDisabled | BetaContainerNetworkPolicyAllowlist`

                    Network access policy for the container.

                    - `BetaContainerNetworkPolicyDisabled`

                    - `BetaContainerNetworkPolicyAllowlist`

                  - `skills?: Array<BetaSkillReference | BetaInlineSkill>`

                    An optional list of skills referenced by id or inline data.

                    - `BetaSkillReference`

                      - `skill_id: string`

                        The ID of the referenced skill.

                      - `type: "skill_reference"`

                        References a skill created with the /v1/skills endpoint.

                        - `"skill_reference"`

                      - `version?: string`

                        Optional skill version. Use a positive integer or 'latest'. Omit for default.

                    - `BetaInlineSkill`

                      - `description: string`

                        The description of the skill.

                      - `name: string`

                        The name of the skill.

                      - `source: BetaInlineSkillSource`

                        Inline skill payload

                        - `data: string`

                          Base64-encoded skill zip bundle.

                        - `media_type: "application/zip"`

                          The media type of the inline skill payload. Must be `application/zip`.

                          - `"application/zip"`

                        - `type: "base64"`

                          The type of the inline skill source. Must be `base64`.

                          - `"base64"`

                      - `type: "inline"`

                        Defines an inline skill for this request.

                        - `"inline"`

                - `BetaLocalEnvironment`

                  - `type: "local"`

                    Use a local computer environment.

                    - `"local"`

                  - `skills?: Array<BetaLocalSkill>`

                    An optional list of skills.

                    - `description: string`

                      The description of the skill.

                    - `name: string`

                      The name of the skill.

                    - `path: string`

                      The path to the directory containing the skill.

                - `BetaContainerReference`

                  - `container_id: string`

                    The ID of the referenced container.

                  - `type: "container_reference"`

                    References a container created with the /v1/containers endpoint

                    - `"container_reference"`

            - `BetaCustomTool`

              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)

              - `name: string`

                The name of the custom tool, used to identify it in tool calls.

              - `type: "custom"`

                The type of the custom tool. Always `custom`.

                - `"custom"`

              - `allowed_callers?: Array<"direct" | "programmatic"> | null`

                The tool invocation context(s).

                - `"direct"`

                - `"programmatic"`

              - `defer_loading?: boolean`

                Whether this tool should be deferred and discovered via tool search.

              - `description?: string`

                Optional description of the custom tool, used to provide more context.

              - `format?: Text | Grammar`

                The input format for the custom tool. Default is unconstrained text.

                - `Text`

                  Unconstrained free-form text.

                  - `type: "text"`

                    Unconstrained text format. Always `text`.

                    - `"text"`

                - `Grammar`

                  A grammar defined by the user.

                  - `definition: string`

                    The grammar definition.

                  - `syntax: "lark" | "regex"`

                    The syntax of the grammar definition. One of `lark` or `regex`.

                    - `"lark"`

                    - `"regex"`

                  - `type: "grammar"`

                    Grammar format. Always `grammar`.

                    - `"grammar"`

            - `BetaNamespaceTool`

              Groups function/custom tools under a shared namespace.

              - `description: string`

                A description of the namespace shown to the model.

              - `name: string`

                The namespace name used in tool calls (for example, `crm`).

              - `tools: Array<Function | BetaCustomTool>`

                The function/custom tools available inside this namespace.

                - `Function`

                  - `name: string`

                  - `type: "function"`

                    - `"function"`

                  - `allowed_callers?: Array<"direct" | "programmatic"> | null`

                    The tool invocation context(s).

                    - `"direct"`

                    - `"programmatic"`

                  - `defer_loading?: boolean`

                    Whether this function should be deferred and discovered via tool search.

                  - `description?: string | null`

                  - `output_schema?: Record<string, unknown> | null`

                    A JSON Schema describing the JSON value encoded in string outputs for this function tool. This does not describe content-array outputs.

                  - `parameters?: unknown`

                  - `strict?: boolean | null`

                    Whether to enforce strict parameter validation. If omitted, Responses attempts to use strict validation when the schema is compatible, and falls back to non-strict validation otherwise.

                - `BetaCustomTool`

                  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: "namespace"`

                The type of the tool. Always `namespace`.

                - `"namespace"`

            - `BetaToolSearchTool`

              Hosted or BYOT tool search configuration for deferred tools.

              - `type: "tool_search"`

                The type of the tool. Always `tool_search`.

                - `"tool_search"`

              - `description?: string | null`

                Description shown to the model for a client-executed tool search tool.

              - `execution?: "server" | "client"`

                Whether tool search is executed by the server or by the client.

                - `"server"`

                - `"client"`

              - `parameters?: unknown`

                Parameter schema for a client-executed tool search tool.

            - `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"`

                The type of the web search tool. One of `web_search_preview` or `web_search_preview_2025_03_11`.

                - `"web_search_preview"`

                - `"web_search_preview_2025_03_11"`

              - `search_content_types?: Array<"text" | "image">`

                - `"text"`

                - `"image"`

              - `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.

                - `"low"`

                - `"medium"`

                - `"high"`

              - `user_location?: UserLocation | null`

                The user's location.

                - `type: "approximate"`

                  The type of location approximation. Always `approximate`.

                  - `"approximate"`

                - `city?: string | null`

                  Free text input for the city of the user, e.g. `San Francisco`.

                - `country?: string | null`

                  The two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of the user, e.g. `US`.

                - `region?: string | null`

                  Free text input for the region of the user, e.g. `California`.

                - `timezone?: string | null`

                  The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of the user, e.g. `America/Los_Angeles`.

            - `BetaApplyPatchTool`

              Allows the assistant to create, delete, or update files using unified diffs.

              - `type: "apply_patch"`

                The type of the tool. Always `apply_patch`.

                - `"apply_patch"`

              - `allowed_callers?: Array<"direct" | "programmatic"> | null`

                The tool invocation context(s).

                - `"direct"`

                - `"programmatic"`

          - `type: "tool_search_output"`

            The item type. Always `tool_search_output`.

            - `"tool_search_output"`

          - `id?: string | null`

            The unique ID of this tool search output.

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

          - `call_id?: string | null`

            The unique ID of the tool search call generated by the model.

          - `execution?: "server" | "client"`

            Whether tool search was executed by the server or by the client.

            - `"server"`

            - `"client"`

          - `status?: "in_progress" | "completed" | "incomplete" | null`

            The status of the tool search output.

            - `"in_progress"`

            - `"completed"`

            - `"incomplete"`

        - `AdditionalTools`

          - `role: "developer"`

            The role that provided the additional tools. Only `developer` is supported.

            - `"developer"`

          - `tools: Array<BetaTool>`

            A list of additional tools made available at this item.

            - `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).

            - `Mcp`

              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).

            - `CodeInterpreter`

              A tool that runs Python code to help generate a response to a prompt.

            - `ProgrammaticToolCalling`

            - `ImageGeneration`

              A tool that generates images using the GPT image models.

            - `LocalShell`

              A tool that allows the model to execute shell commands in a local environment.

            - `BetaFunctionShellTool`

              A tool that allows the model to execute shell commands.

            - `BetaCustomTool`

              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)

            - `BetaNamespaceTool`

              Groups function/custom tools under a shared namespace.

            - `BetaToolSearchTool`

              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).

            - `BetaApplyPatchTool`

              Allows the assistant to create, delete, or update files using unified diffs.

          - `type: "additional_tools"`

            The item type. Always `additional_tools`.

            - `"additional_tools"`

          - `id?: string | null`

            The unique ID of this additional tools item.

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

        - `BetaResponseReasoningItem`

          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).

          - `id: string`

            The unique identifier of the reasoning content.

          - `summary: Array<Summary>`

            Reasoning summary content.

            - `text: string`

              A summary of the reasoning output from the model so far.

            - `type: "summary_text"`

              The type of the object. Always `summary_text`.

              - `"summary_text"`

          - `type: "reasoning"`

            The type of the object. Always `reasoning`.

            - `"reasoning"`

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

          - `content?: Array<Content>`

            Reasoning text content.

            - `text: string`

              The reasoning text from the model.

            - `type: "reasoning_text"`

              The type of the reasoning text. Always `reasoning_text`.

              - `"reasoning_text"`

          - `encrypted_content?: string | null`

            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.

            When streaming, use the completed reasoning item and its
            `encrypted_content` from the `response.output_item.done` event in
            subsequent requests. The `encrypted_content` in
            `response.output_item.added` may be incomplete. This is especially
            important when `store` is `false` or when using Zero Data Retention.

          - `status?: "in_progress" | "completed" | "incomplete"`

            The status of the item. One of `in_progress`, `completed`, or
            `incomplete`. Populated when items are returned via API.

            - `"in_progress"`

            - `"completed"`

            - `"incomplete"`

        - `BetaResponseCompactionItemParam`

          A compaction item generated by the [`v1/responses/compact` API](https://platform.openai.com/docs/api-reference/responses/compact).

          - `encrypted_content: string`

            The encrypted content of the compaction summary.

          - `type: "compaction"`

            The type of the item. Always `compaction`.

            - `"compaction"`

          - `id?: string | null`

            The ID of the compaction item.

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

        - `ImageGenerationCall`

          An image generation request made by the model.

          - `id: string`

            The unique ID of the image generation call.

          - `result: string | null`

            The generated image encoded in base64.

          - `status: "in_progress" | "completed" | "generating" | "failed"`

            The status of the image generation call.

            - `"in_progress"`

            - `"completed"`

            - `"generating"`

            - `"failed"`

          - `type: "image_generation_call"`

            The type of the image generation call. Always `image_generation_call`.

            - `"image_generation_call"`

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

        - `BetaResponseCodeInterpreterToolCall`

          A tool call to run code.

          - `id: string`

            The unique ID of the code interpreter tool call.

          - `code: string | null`

            The code to run, or null if not available.

          - `container_id: string`

            The ID of the container used to run the code.

          - `outputs: Array<Logs | Image> | null`

            The outputs generated by the code interpreter, such as logs or images.
            Can be null if no outputs are available.

            - `Logs`

              The logs output from the code interpreter.

              - `logs: string`

                The logs output from the code interpreter.

              - `type: "logs"`

                The type of the output. Always `logs`.

                - `"logs"`

            - `Image`

              The image output from the code interpreter.

              - `type: "image"`

                The type of the output. Always `image`.

                - `"image"`

              - `url: string`

                The URL of the image output from the code interpreter.

          - `status: "in_progress" | "completed" | "incomplete" | 2 more`

            The status of the code interpreter tool call. Valid values are `in_progress`, `completed`, `incomplete`, `interpreting`, and `failed`.

            - `"in_progress"`

            - `"completed"`

            - `"incomplete"`

            - `"interpreting"`

            - `"failed"`

          - `type: "code_interpreter_call"`

            The type of the code interpreter tool call. Always `code_interpreter_call`.

            - `"code_interpreter_call"`

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

        - `LocalShellCall`

          A tool call to run a command on the local shell.

          - `id: string`

            The unique ID of the local shell call.

          - `action: Action`

            Execute a shell command on the server.

            - `command: Array<string>`

              The command to run.

            - `env: Record<string, string>`

              Environment variables to set for the command.

            - `type: "exec"`

              The type of the local shell action. Always `exec`.

              - `"exec"`

            - `timeout_ms?: number | null`

              Optional timeout in milliseconds for the command.

            - `user?: string | null`

              Optional user to run the command as.

            - `working_directory?: string | null`

              Optional working directory to run the command in.

          - `call_id: string`

            The unique ID of the local shell tool call generated by the model.

          - `status: "in_progress" | "completed" | "incomplete"`

            The status of the local shell call.

            - `"in_progress"`

            - `"completed"`

            - `"incomplete"`

          - `type: "local_shell_call"`

            The type of the local shell call. Always `local_shell_call`.

            - `"local_shell_call"`

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

        - `LocalShellCallOutput`

          The output of a local shell tool call.

          - `id: string`

            The unique ID of the local shell tool call generated by the model.

          - `output: string`

            A JSON string of the output of the local shell tool call.

          - `type: "local_shell_call_output"`

            The type of the local shell tool call output. Always `local_shell_call_output`.

            - `"local_shell_call_output"`

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

          - `status?: "in_progress" | "completed" | "incomplete" | null`

            The status of the item. One of `in_progress`, `completed`, or `incomplete`.

            - `"in_progress"`

            - `"completed"`

            - `"incomplete"`

        - `ShellCall`

          A tool representing a request to execute one or more shell commands.

          - `action: Action`

            The shell commands and limits that describe how to run the tool call.

            - `commands: Array<string>`

              Ordered shell commands for the execution environment to run.

            - `max_output_length?: number | null`

              Maximum number of UTF-8 characters to capture from combined stdout and stderr output.

            - `timeout_ms?: number | null`

              Maximum wall-clock time in milliseconds to allow the shell commands to run.

          - `call_id: string`

            The unique ID of the shell tool call generated by the model.

          - `type: "shell_call"`

            The type of the item. Always `shell_call`.

            - `"shell_call"`

          - `id?: string | null`

            The unique ID of the shell tool call. Populated when this item is returned via API.

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

          - `caller?: Direct | Program | null`

            The execution context that produced this tool call.

            - `Direct`

              - `type: "direct"`

                The caller type. Always `direct`.

                - `"direct"`

            - `Program`

              - `caller_id: string`

                The call ID of the program item that produced this tool call.

              - `type: "program"`

                The caller type. Always `program`.

                - `"program"`

          - `environment?: BetaLocalEnvironment | BetaContainerReference | null`

            The environment to execute the shell commands in.

            - `BetaLocalEnvironment`

            - `BetaContainerReference`

          - `status?: "in_progress" | "completed" | "incomplete" | null`

            The status of the shell call. One of `in_progress`, `completed`, or `incomplete`.

            - `"in_progress"`

            - `"completed"`

            - `"incomplete"`

        - `ShellCallOutput`

          The streamed output items emitted by a shell tool call.

          - `call_id: string`

            The unique ID of the shell tool call generated by the model.

          - `output: Array<BetaResponseFunctionShellCallOutputContent>`

            Captured chunks of stdout and stderr output, along with their associated outcomes.

            - `outcome: Timeout | Exit`

              The exit or timeout outcome associated with this shell call.

              - `Timeout`

                Indicates that the shell call exceeded its configured time limit.

                - `type: "timeout"`

                  The outcome type. Always `timeout`.

                  - `"timeout"`

              - `Exit`

                Indicates that the shell commands finished and returned an exit code.

                - `exit_code: number`

                  The exit code returned by the shell process.

                - `type: "exit"`

                  The outcome type. Always `exit`.

                  - `"exit"`

            - `stderr: string`

              Captured stderr output for the shell call.

            - `stdout: string`

              Captured stdout output for the shell call.

          - `type: "shell_call_output"`

            The type of the item. Always `shell_call_output`.

            - `"shell_call_output"`

          - `id?: string | null`

            The unique ID of the shell tool call output. Populated when this item is returned via API.

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

          - `caller?: Direct | Program | null`

            The execution context that produced this tool call.

            - `Direct`

              - `type: "direct"`

                The caller type. Always `direct`.

                - `"direct"`

            - `Program`

              - `caller_id: string`

                The call ID of the program item that produced this tool call.

              - `type: "program"`

                The caller type. Always `program`.

                - `"program"`

          - `max_output_length?: number | null`

            The maximum number of UTF-8 characters captured for this shell call's combined output.

          - `status?: "in_progress" | "completed" | "incomplete" | null`

            The status of the shell call output.

            - `"in_progress"`

            - `"completed"`

            - `"incomplete"`

        - `ApplyPatchCall`

          A tool call representing a request to create, delete, or update files using diff patches.

          - `call_id: string`

            The unique ID of the apply patch tool call generated by the model.

          - `operation: CreateFile | DeleteFile | UpdateFile`

            The specific create, delete, or update instruction for the apply_patch tool call.

            - `CreateFile`

              Instruction for creating a new file via the apply_patch tool.

              - `diff: string`

                Unified diff content to apply when creating the file.

              - `path: string`

                Path of the file to create relative to the workspace root.

              - `type: "create_file"`

                The operation type. Always `create_file`.

                - `"create_file"`

            - `DeleteFile`

              Instruction for deleting an existing file via the apply_patch tool.

              - `path: string`

                Path of the file to delete relative to the workspace root.

              - `type: "delete_file"`

                The operation type. Always `delete_file`.

                - `"delete_file"`

            - `UpdateFile`

              Instruction for updating an existing file via the apply_patch tool.

              - `diff: string`

                Unified diff content to apply to the existing file.

              - `path: string`

                Path of the file to update relative to the workspace root.

              - `type: "update_file"`

                The operation type. Always `update_file`.

                - `"update_file"`

          - `status: "in_progress" | "completed"`

            The status of the apply patch tool call. One of `in_progress` or `completed`.

            - `"in_progress"`

            - `"completed"`

          - `type: "apply_patch_call"`

            The type of the item. Always `apply_patch_call`.

            - `"apply_patch_call"`

          - `id?: string | null`

            The unique ID of the apply patch tool call. Populated when this item is returned via API.

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

          - `caller?: Direct | Program | null`

            The execution context that produced this tool call.

            - `Direct`

              - `type: "direct"`

                The caller type. Always `direct`.

                - `"direct"`

            - `Program`

              - `caller_id: string`

                The call ID of the program item that produced this tool call.

              - `type: "program"`

                The caller type. Always `program`.

                - `"program"`

        - `ApplyPatchCallOutput`

          The streamed output emitted by an apply patch tool call.

          - `call_id: string`

            The unique ID of the apply patch tool call generated by the model.

          - `status: "completed" | "failed"`

            The status of the apply patch tool call output. One of `completed` or `failed`.

            - `"completed"`

            - `"failed"`

          - `type: "apply_patch_call_output"`

            The type of the item. Always `apply_patch_call_output`.

            - `"apply_patch_call_output"`

          - `id?: string | null`

            The unique ID of the apply patch tool call output. Populated when this item is returned via API.

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

          - `caller?: Direct | Program | null`

            The execution context that produced this tool call.

            - `Direct`

              - `type: "direct"`

                The caller type. Always `direct`.

                - `"direct"`

            - `Program`

              - `caller_id: string`

                The call ID of the program item that produced this tool call.

              - `type: "program"`

                The caller type. Always `program`.

                - `"program"`

          - `output?: string | null`

            Optional human-readable log text from the apply patch tool (e.g., patch results or errors).

        - `McpListTools`

          A list of tools available on an MCP server.

          - `id: string`

            The unique ID of the list.

          - `server_label: string`

            The label of the MCP server.

          - `tools: Array<Tool>`

            The tools available on the server.

            - `input_schema: unknown`

              The JSON schema describing the tool's input.

            - `name: string`

              The name of the tool.

            - `annotations?: unknown`

              Additional annotations about the tool.

            - `description?: string | null`

              The description of the tool.

          - `type: "mcp_list_tools"`

            The type of the item. Always `mcp_list_tools`.

            - `"mcp_list_tools"`

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

          - `error?: string | null`

            Error message if the server could not list tools.

        - `McpApprovalRequest`

          A request for human approval of a tool invocation.

          - `id: string`

            The unique ID of the approval request.

          - `arguments: string`

            A JSON string of arguments for the tool.

          - `name: string`

            The name of the tool to run.

          - `server_label: string`

            The label of the MCP server making the request.

          - `type: "mcp_approval_request"`

            The type of the item. Always `mcp_approval_request`.

            - `"mcp_approval_request"`

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

        - `McpApprovalResponse`

          A response to an MCP approval request.

          - `approval_request_id: string`

            The ID of the approval request being answered.

          - `approve: boolean`

            Whether the request was approved.

          - `type: "mcp_approval_response"`

            The type of the item. Always `mcp_approval_response`.

            - `"mcp_approval_response"`

          - `id?: string | null`

            The unique ID of the approval response

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

          - `reason?: string | null`

            Optional reason for the decision.

        - `McpCall`

          An invocation of a tool on an MCP server.

          - `id: string`

            The unique ID of the tool call.

          - `arguments: string`

            A JSON string of the arguments passed to the tool.

          - `name: string`

            The name of the tool that was run.

          - `server_label: string`

            The label of the MCP server running the tool.

          - `type: "mcp_call"`

            The type of the item. Always `mcp_call`.

            - `"mcp_call"`

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

          - `approval_request_id?: string | null`

            Unique identifier for the MCP tool call approval request.
            Include this value in a subsequent `mcp_approval_response` input to approve or reject the corresponding tool call.

          - `error?: BetaMcpToolCallError | null`

            The error from the tool call, if any.

            - `McpProtocolError`

              - `code: number`

              - `message: string`

              - `type: "mcp_protocol_error"`

                - `"mcp_protocol_error"`

            - `McpToolExecutionError`

              - `content: unknown`

              - `type: "mcp_tool_execution_error"`

                - `"mcp_tool_execution_error"`

            - `HTTPError`

              - `code: number`

              - `message: string`

              - `type: "http_error"`

                - `"http_error"`

          - `output?: string | null`

            The output from the tool call.

          - `status?: "in_progress" | "completed" | "incomplete" | 2 more`

            The status of the tool call. One of `in_progress`, `completed`, `incomplete`, `calling`, or `failed`.

            - `"in_progress"`

            - `"completed"`

            - `"incomplete"`

            - `"calling"`

            - `"failed"`

        - `BetaResponseCustomToolCallOutput`

          The output of a custom tool call from your code, being sent back to the model.

          - `call_id: string`

            The call ID, used to map this custom tool call output to a custom tool call.

          - `output: string | Array<BetaResponseInputText | BetaResponseInputImage | BetaResponseInputFile>`

            The output from the custom tool call generated by your code.
            Can be a string or an list of output content.

            - `string`

            - `Array<BetaResponseInputText | BetaResponseInputImage | BetaResponseInputFile>`

              - `BetaResponseInputText`

                A text input to the model.

              - `BetaResponseInputImage`

                An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision).

              - `BetaResponseInputFile`

                A file input to the model.

          - `type: "custom_tool_call_output"`

            The type of the custom tool call output. Always `custom_tool_call_output`.

            - `"custom_tool_call_output"`

          - `id?: string`

            The unique ID of the custom tool call output in the OpenAI platform.

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

          - `caller?: Direct | Program | null`

            The execution context that produced this tool call.

            - `Direct`

              - `type: "direct"`

                The caller type. Always `direct`.

                - `"direct"`

            - `Program`

              - `caller_id: string`

                The call ID of the program item that produced this tool call.

              - `type: "program"`

                The caller type. Always `program`.

                - `"program"`

        - `BetaResponseCustomToolCall`

          A call to a custom tool created by the model.

          - `call_id: string`

            An identifier used to map this custom tool call to a tool call output.

          - `input: string`

            The input for the custom tool call generated by the model.

          - `name: string`

            The name of the custom tool being called.

          - `type: "custom_tool_call"`

            The type of the custom tool call. Always `custom_tool_call`.

            - `"custom_tool_call"`

          - `id?: string`

            The unique ID of the custom tool call in the OpenAI platform.

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

          - `caller?: Direct | Program | null`

            The execution context that produced this tool call.

            - `Direct`

              - `type: "direct"`

                - `"direct"`

            - `Program`

              - `caller_id: string`

                The call ID of the program item that produced this tool call.

              - `type: "program"`

                - `"program"`

          - `namespace?: string`

            The namespace of the custom tool being called.

        - `CompactionTrigger`

          Compacts the current context. Must be the final input item.

          - `type: "compaction_trigger"`

            The type of the item. Always `compaction_trigger`.

            - `"compaction_trigger"`

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

        - `ItemReference`

          An internal identifier for an item to reference.

          - `id: string`

            The ID of the item to reference.

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

          - `type?: "item_reference" | null`

            The type of item to reference. Always `item_reference`.

            - `"item_reference"`

        - `Program`

          - `id: string`

            The unique ID of this program item.

          - `call_id: string`

            The stable call ID of the program item.

          - `code: string`

            The JavaScript source executed by programmatic tool calling.

          - `fingerprint: string`

            Opaque program replay fingerprint that must be round-tripped.

          - `type: "program"`

            The item type. Always `program`.

            - `"program"`

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

        - `ProgramOutput`

          - `id: string`

            The unique ID of this program output item.

          - `call_id: string`

            The call ID of the program item.

          - `result: string`

            The result produced by the program item.

          - `status: "completed" | "incomplete"`

            The terminal status of the program output.

            - `"completed"`

            - `"incomplete"`

          - `type: "program_output"`

            The item type. Always `program_output`.

            - `"program_output"`

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

    - `metadata: Record<string, string> | null`

      Set of 16 key-value pairs that can be attached to an object. This can be
      useful for storing additional information about the object in a structured
      format, and querying for objects via API or the dashboard.

      Keys are strings with a maximum length of 64 characters. Values are strings
      with a maximum length of 512 characters.

    - `model: "gpt-5.6-sol" | "gpt-5.6-terra" | "gpt-5.6-luna" | 99 more | (string & {})`

      Model ID used to generate the response, like `gpt-4o` or `o3`. OpenAI
      offers a wide range of models with different capabilities, performance
      characteristics, and price points. Refer to the [model guide](https://platform.openai.com/docs/models)
      to browse and compare available models.

      - `"gpt-5.6-sol" | "gpt-5.6-terra" | "gpt-5.6-luna" | 99 more`

        - `"gpt-5.6-sol"`

        - `"gpt-5.6-terra"`

        - `"gpt-5.6-luna"`

        - `"gpt-5.5"`

        - `"gpt-5.5-2026-04-23"`

        - `"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.5-pro"`

        - `"gpt-5.5-pro-2026-04-23"`

        - `"gpt-5-codex"`

        - `"gpt-5-pro"`

        - `"gpt-5-pro-2025-10-06"`

        - `"gpt-5.1-codex-max"`

        - `"gpt-daybreak-blue-latest"`

        - `"gpt-daybreak-red-latest"`

        - `"gpt-5.6-cyber"`

      - `(string & {})`

    - `object: "response"`

      The object type of this resource - always set to `response`.

      - `"response"`

    - `output: Array<BetaResponseOutputItem>`

      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.

      - `BetaResponseOutputMessage`

        An output message from the model.

      - `BetaResponseFileSearchToolCall`

        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.

      - `BetaResponseFunctionToolCall`

        A tool call to run a function. See the
        [function calling guide](https://platform.openai.com/docs/guides/function-calling) for more information.

      - `BetaResponseFunctionToolCallOutputItem`

        - `id: string`

          The unique ID of the function call tool output.

        - `call_id: string`

          The unique ID of the function tool call generated by the model.

        - `output: string | Array<BetaResponseInputText | BetaResponseInputImage | BetaResponseInputFile>`

          The output from the function call generated by your code.
          Can be a string or an list of output content.

          - `string`

          - `Array<BetaResponseInputText | BetaResponseInputImage | BetaResponseInputFile>`

            - `BetaResponseInputText`

              A text input to the model.

            - `BetaResponseInputImage`

              An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision).

            - `BetaResponseInputFile`

              A file input to 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.

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

        - `type: "function_call_output"`

          The type of the function tool call output. Always `function_call_output`.

          - `"function_call_output"`

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `caller?: Direct | Program | null`

          The execution context that produced this tool call.

          - `Direct`

            - `type: "direct"`

              The caller type. Always `direct`.

              - `"direct"`

          - `Program`

            - `caller_id: string`

              The call ID of the program item that produced this tool call.

            - `type: "program"`

              The caller type. Always `program`.

              - `"program"`

        - `created_by?: string`

          The identifier of the actor that created the item.

        - `name?: string`

          The name of the tool that produced the output.

        - `namespace?: string`

          The namespace of the tool that produced the output.

      - `AgentMessage`

        - `id: string`

          The unique ID of the agent message.

        - `author: string`

          The sending agent identity.

        - `content: Array<BetaResponseInputText | BetaResponseOutputText | Text | 7 more>`

          Encrypted content sent between agents.

          - `BetaResponseInputText`

            A text input to the model.

          - `BetaResponseOutputText`

            A text output from the model.

          - `Text`

            A text content.

            - `text: string`

            - `type: "text"`

              - `"text"`

          - `SummaryText`

            A summary text from the model.

            - `text: string`

              A summary of the reasoning output from the model so far.

            - `type: "summary_text"`

              The type of the object. Always `summary_text`.

              - `"summary_text"`

          - `ReasoningText`

            Reasoning text from the model.

            - `text: string`

              The reasoning text from the model.

            - `type: "reasoning_text"`

              The type of the reasoning text. Always `reasoning_text`.

              - `"reasoning_text"`

          - `BetaResponseOutputRefusal`

            A refusal from the model.

          - `BetaResponseInputImage`

            An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision).

          - `ComputerScreenshot`

            A screenshot of a computer.

            - `detail: BetaImageDetail`

              The detail level of the screenshot image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`.

            - `file_id: string | null`

              The identifier of an uploaded file that contains the screenshot.

            - `image_url: string | null`

              The URL of the screenshot image.

            - `type: "computer_screenshot"`

              Specifies the event type. For a computer screenshot, this property is always set to `computer_screenshot`.

              - `"computer_screenshot"`

            - `prompt_cache_breakpoint?: PromptCacheBreakpoint`

              Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.

              - `mode: "explicit"`

                The breakpoint mode. Always `explicit`.

                - `"explicit"`

          - `BetaResponseInputFile`

            A file input to the model.

          - `EncryptedContent`

            Opaque encrypted content that Responses API decrypts inside trusted model execution.

            - `encrypted_content: string`

              Opaque encrypted content.

            - `type: "encrypted_content"`

              The type of the input item. Always `encrypted_content`.

              - `"encrypted_content"`

        - `recipient: string`

          The destination agent identity.

        - `type: "agent_message"`

          The type of the item. Always `agent_message`.

          - `"agent_message"`

        - `agent?: Agent`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

      - `MultiAgentCall`

        - `id: string`

          The unique ID of the multi-agent call item.

        - `action: "spawn_agent" | "interrupt_agent" | "list_agents" | 3 more`

          The multi-agent action to execute.

          - `"spawn_agent"`

          - `"interrupt_agent"`

          - `"list_agents"`

          - `"send_message"`

          - `"followup_task"`

          - `"wait_agent"`

        - `arguments: string`

          The JSON string of arguments generated for the action.

        - `call_id: string`

          The unique ID linking this call to its output.

        - `type: "multi_agent_call"`

          The type of the multi-agent call. Always `multi_agent_call`.

          - `"multi_agent_call"`

        - `agent?: Agent`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

      - `MultiAgentCallOutput`

        - `id: string`

          The unique ID of the multi-agent call output item.

        - `action: "spawn_agent" | "interrupt_agent" | "list_agents" | 3 more`

          The multi-agent action that produced this result.

          - `"spawn_agent"`

          - `"interrupt_agent"`

          - `"list_agents"`

          - `"send_message"`

          - `"followup_task"`

          - `"wait_agent"`

        - `call_id: string`

          The unique ID of the multi-agent call.

        - `output: Array<BetaResponseOutputText>`

          Text output returned by the multi-agent action.

          - `annotations: Array<FileCitation | URLCitation | ContainerFileCitation | FilePath>`

            The annotations of the text output.

          - `text: string`

            The text output from the model.

          - `type: "output_text"`

            The type of the output text. Always `output_text`.

          - `logprobs?: Array<Logprob>`

        - `type: "multi_agent_call_output"`

          The type of the multi-agent result. Always `multi_agent_call_output`.

          - `"multi_agent_call_output"`

        - `agent?: Agent`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

      - `BetaResponseFunctionWebSearch`

        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.

      - `BetaResponseComputerToolCall`

        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.

      - `BetaResponseComputerToolCallOutputItem`

        - `id: string`

          The unique ID of the computer call tool output.

        - `call_id: string`

          The ID of the computer tool call that produced the output.

        - `output: BetaResponseComputerToolCallOutputScreenshot`

          A computer screenshot image used with the computer use tool.

        - `status: "completed" | "incomplete" | "failed" | "in_progress"`

          The status of the message input. One of `in_progress`, `completed`, or
          `incomplete`. Populated when input items are returned via API.

          - `"completed"`

          - `"incomplete"`

          - `"failed"`

          - `"in_progress"`

        - `type: "computer_call_output"`

          The type of the computer tool call output. Always `computer_call_output`.

          - `"computer_call_output"`

        - `acknowledged_safety_checks?: Array<AcknowledgedSafetyCheck>`

          The safety checks reported by the API that have been acknowledged by the
          developer.

          - `id: string`

            The ID of the pending safety check.

          - `code?: string | null`

            The type of the pending safety check.

          - `message?: string | null`

            Details about the pending safety check.

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `created_by?: string`

          The identifier of the actor that created the item.

      - `BetaResponseReasoningItem`

        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).

      - `Program`

        - `id: string`

          The unique ID of the program item.

        - `call_id: string`

          The stable call ID of the program item.

        - `code: string`

          The JavaScript source executed by programmatic tool calling.

        - `fingerprint: string`

          Opaque program replay fingerprint that must be round-tripped.

        - `type: "program"`

          The type of the item. Always `program`.

          - `"program"`

        - `agent?: Agent`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

      - `ProgramOutput`

        - `id: string`

          The unique ID of the program output item.

        - `call_id: string`

          The call ID of the program item.

        - `result: string`

          The result produced by the program item.

        - `status: "completed" | "incomplete"`

          The terminal status of the program output item.

          - `"completed"`

          - `"incomplete"`

        - `type: "program_output"`

          The type of the item. Always `program_output`.

          - `"program_output"`

        - `agent?: Agent`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

      - `BetaResponseToolSearchCall`

        - `id: string`

          The unique ID of the tool search call item.

        - `arguments: unknown`

          Arguments used for the tool search call.

        - `call_id: string | null`

          The unique ID of the tool search call generated by the model.

        - `execution: "server" | "client"`

          Whether tool search was executed by the server or by the client.

          - `"server"`

          - `"client"`

        - `status: "in_progress" | "completed" | "incomplete"`

          The status of the tool search call item that was recorded.

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

        - `type: "tool_search_call"`

          The type of the item. Always `tool_search_call`.

          - `"tool_search_call"`

        - `agent?: Agent`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `created_by?: string`

          The identifier of the actor that created the item.

      - `BetaResponseToolSearchOutputItem`

        - `id: string`

          The unique ID of the tool search output item.

        - `call_id: string | null`

          The unique ID of the tool search call generated by the model.

        - `execution: "server" | "client"`

          Whether tool search was executed by the server or by the client.

          - `"server"`

          - `"client"`

        - `status: "in_progress" | "completed" | "incomplete"`

          The status of the tool search output item that was recorded.

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

        - `tools: Array<BetaTool>`

          The loaded tool definitions returned by tool search.

          - `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).

          - `Mcp`

            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).

          - `CodeInterpreter`

            A tool that runs Python code to help generate a response to a prompt.

          - `ProgrammaticToolCalling`

          - `ImageGeneration`

            A tool that generates images using the GPT image models.

          - `LocalShell`

            A tool that allows the model to execute shell commands in a local environment.

          - `BetaFunctionShellTool`

            A tool that allows the model to execute shell commands.

          - `BetaCustomTool`

            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)

          - `BetaNamespaceTool`

            Groups function/custom tools under a shared namespace.

          - `BetaToolSearchTool`

            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).

          - `BetaApplyPatchTool`

            Allows the assistant to create, delete, or update files using unified diffs.

        - `type: "tool_search_output"`

          The type of the item. Always `tool_search_output`.

          - `"tool_search_output"`

        - `agent?: Agent`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `created_by?: string`

          The identifier of the actor that created the item.

      - `AdditionalTools`

        - `id: string`

          The unique ID of the additional tools item.

        - `role: "unknown" | "user" | "assistant" | 5 more`

          The role that provided the additional tools.

          - `"unknown"`

          - `"user"`

          - `"assistant"`

          - `"system"`

          - `"critic"`

          - `"discriminator"`

          - `"developer"`

          - `"tool"`

        - `tools: Array<BetaTool>`

          The additional tool definitions made available at this item.

          - `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).

          - `Mcp`

            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).

          - `CodeInterpreter`

            A tool that runs Python code to help generate a response to a prompt.

          - `ProgrammaticToolCalling`

          - `ImageGeneration`

            A tool that generates images using the GPT image models.

          - `LocalShell`

            A tool that allows the model to execute shell commands in a local environment.

          - `BetaFunctionShellTool`

            A tool that allows the model to execute shell commands.

          - `BetaCustomTool`

            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)

          - `BetaNamespaceTool`

            Groups function/custom tools under a shared namespace.

          - `BetaToolSearchTool`

            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).

          - `BetaApplyPatchTool`

            Allows the assistant to create, delete, or update files using unified diffs.

        - `type: "additional_tools"`

          The type of the item. Always `additional_tools`.

          - `"additional_tools"`

        - `agent?: Agent`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

      - `BetaResponseCompactionItem`

        A compaction item generated by the [`v1/responses/compact` API](https://platform.openai.com/docs/api-reference/responses/compact).

        - `id: string`

          The unique ID of the compaction item.

        - `encrypted_content: string`

          The encrypted content that was produced by compaction.

        - `type: "compaction"`

          The type of the item. Always `compaction`.

          - `"compaction"`

        - `agent?: Agent`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `created_by?: string`

          The identifier of the actor that created the item.

      - `ImageGenerationCall`

        An image generation request made by the model.

        - `id: string`

          The unique ID of the image generation call.

        - `result: string | null`

          The generated image encoded in base64.

        - `status: "in_progress" | "completed" | "generating" | "failed"`

          The status of the image generation call.

          - `"in_progress"`

          - `"completed"`

          - `"generating"`

          - `"failed"`

        - `type: "image_generation_call"`

          The type of the image generation call. Always `image_generation_call`.

          - `"image_generation_call"`

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

      - `BetaResponseCodeInterpreterToolCall`

        A tool call to run code.

      - `LocalShellCall`

        A tool call to run a command on the local shell.

        - `id: string`

          The unique ID of the local shell call.

        - `action: Action`

          Execute a shell command on the server.

          - `command: Array<string>`

            The command to run.

          - `env: Record<string, string>`

            Environment variables to set for the command.

          - `type: "exec"`

            The type of the local shell action. Always `exec`.

            - `"exec"`

          - `timeout_ms?: number | null`

            Optional timeout in milliseconds for the command.

          - `user?: string | null`

            Optional user to run the command as.

          - `working_directory?: string | null`

            Optional working directory to run the command in.

        - `call_id: string`

          The unique ID of the local shell tool call generated by the model.

        - `status: "in_progress" | "completed" | "incomplete"`

          The status of the local shell call.

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

        - `type: "local_shell_call"`

          The type of the local shell call. Always `local_shell_call`.

          - `"local_shell_call"`

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

      - `LocalShellCallOutput`

        The output of a local shell tool call.

        - `id: string`

          The unique ID of the local shell tool call generated by the model.

        - `output: string`

          A JSON string of the output of the local shell tool call.

        - `type: "local_shell_call_output"`

          The type of the local shell tool call output. Always `local_shell_call_output`.

          - `"local_shell_call_output"`

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `status?: "in_progress" | "completed" | "incomplete" | null`

          The status of the item. One of `in_progress`, `completed`, or `incomplete`.

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

      - `BetaResponseFunctionShellToolCall`

        A tool call that executes one or more shell commands in a managed environment.

        - `id: string`

          The unique ID of the shell tool call. Populated when this item is returned via API.

        - `action: Action`

          The shell commands and limits that describe how to run the tool call.

          - `commands: Array<string>`

          - `max_output_length: number | null`

            Optional maximum number of characters to return from each command.

          - `timeout_ms: number | null`

            Optional timeout in milliseconds for the commands.

        - `call_id: string`

          The unique ID of the shell tool call generated by the model.

        - `environment: BetaResponseLocalEnvironment | BetaResponseContainerReference | null`

          Represents the use of a local environment to perform shell actions.

          - `BetaResponseLocalEnvironment`

            Represents the use of a local environment to perform shell actions.

            - `type: "local"`

              The environment type. Always `local`.

              - `"local"`

          - `BetaResponseContainerReference`

            Represents a container created with /v1/containers.

            - `container_id: string`

            - `type: "container_reference"`

              The environment type. Always `container_reference`.

              - `"container_reference"`

        - `status: "in_progress" | "completed" | "incomplete"`

          The status of the shell call. One of `in_progress`, `completed`, or `incomplete`.

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

        - `type: "shell_call"`

          The type of the item. Always `shell_call`.

          - `"shell_call"`

        - `agent?: Agent`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `caller?: Direct | Program | null`

          The execution context that produced this tool call.

          - `Direct`

            - `type: "direct"`

              - `"direct"`

          - `Program`

            - `caller_id: string`

              The call ID of the program item that produced this tool call.

            - `type: "program"`

              - `"program"`

        - `created_by?: string`

          The ID of the entity that created this tool call.

      - `BetaResponseFunctionShellToolCallOutput`

        The output of a shell tool call that was emitted.

        - `id: string`

          The unique ID of the shell call output. Populated when this item is returned via API.

        - `call_id: string`

          The unique ID of the shell tool call generated by the model.

        - `max_output_length: number | null`

          The maximum length of the shell command output. This is generated by the model and should be passed back with the raw output.

        - `output: Array<Output>`

          An array of shell call output contents

          - `outcome: Timeout | Exit`

            Represents either an exit outcome (with an exit code) or a timeout outcome for a shell call output chunk.

            - `Timeout`

              Indicates that the shell call exceeded its configured time limit.

              - `type: "timeout"`

                The outcome type. Always `timeout`.

                - `"timeout"`

            - `Exit`

              Indicates that the shell commands finished and returned an exit code.

              - `exit_code: number`

                Exit code from the shell process.

              - `type: "exit"`

                The outcome type. Always `exit`.

                - `"exit"`

          - `stderr: string`

            The standard error output that was captured.

          - `stdout: string`

            The standard output that was captured.

          - `created_by?: string`

            The identifier of the actor that created the item.

        - `status: "in_progress" | "completed" | "incomplete"`

          The status of the shell call output. One of `in_progress`, `completed`, or `incomplete`.

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

        - `type: "shell_call_output"`

          The type of the shell call output. Always `shell_call_output`.

          - `"shell_call_output"`

        - `agent?: Agent`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `caller?: Direct | Program | null`

          The execution context that produced this tool call.

          - `Direct`

            - `type: "direct"`

              - `"direct"`

          - `Program`

            - `caller_id: string`

              The call ID of the program item that produced this tool call.

            - `type: "program"`

              - `"program"`

        - `created_by?: string`

          The identifier of the actor that created the item.

      - `BetaResponseApplyPatchToolCall`

        A tool call that applies file diffs by creating, deleting, or updating files.

        - `id: string`

          The unique ID of the apply patch tool call. Populated when this item is returned via API.

        - `call_id: string`

          The unique ID of the apply patch tool call generated by the model.

        - `operation: CreateFile | DeleteFile | UpdateFile`

          One of the create_file, delete_file, or update_file operations applied via apply_patch.

          - `CreateFile`

            Instruction describing how to create a file via the apply_patch tool.

            - `diff: string`

              Diff to apply.

            - `path: string`

              Path of the file to create.

            - `type: "create_file"`

              Create a new file with the provided diff.

              - `"create_file"`

          - `DeleteFile`

            Instruction describing how to delete a file via the apply_patch tool.

            - `path: string`

              Path of the file to delete.

            - `type: "delete_file"`

              Delete the specified file.

              - `"delete_file"`

          - `UpdateFile`

            Instruction describing how to update a file via the apply_patch tool.

            - `diff: string`

              Diff to apply.

            - `path: string`

              Path of the file to update.

            - `type: "update_file"`

              Update an existing file with the provided diff.

              - `"update_file"`

        - `status: "in_progress" | "completed"`

          The status of the apply patch tool call. One of `in_progress` or `completed`.

          - `"in_progress"`

          - `"completed"`

        - `type: "apply_patch_call"`

          The type of the item. Always `apply_patch_call`.

          - `"apply_patch_call"`

        - `agent?: Agent`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `caller?: Direct | Program | null`

          The execution context that produced this tool call.

          - `Direct`

            - `type: "direct"`

              - `"direct"`

          - `Program`

            - `caller_id: string`

              The call ID of the program item that produced this tool call.

            - `type: "program"`

              - `"program"`

        - `created_by?: string`

          The ID of the entity that created this tool call.

      - `BetaResponseApplyPatchToolCallOutput`

        The output emitted by an apply patch tool call.

        - `id: string`

          The unique ID of the apply patch tool call output. Populated when this item is returned via API.

        - `call_id: string`

          The unique ID of the apply patch tool call generated by the model.

        - `status: "completed" | "failed"`

          The status of the apply patch tool call output. One of `completed` or `failed`.

          - `"completed"`

          - `"failed"`

        - `type: "apply_patch_call_output"`

          The type of the item. Always `apply_patch_call_output`.

          - `"apply_patch_call_output"`

        - `agent?: Agent`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `caller?: Direct | Program | null`

          The execution context that produced this tool call.

          - `Direct`

            - `type: "direct"`

              - `"direct"`

          - `Program`

            - `caller_id: string`

              The call ID of the program item that produced this tool call.

            - `type: "program"`

              - `"program"`

        - `created_by?: string`

          The ID of the entity that created this tool call output.

        - `output?: string | null`

          Optional textual output returned by the apply patch tool.

      - `McpCall`

        An invocation of a tool on an MCP server.

        - `id: string`

          The unique ID of the tool call.

        - `arguments: string`

          A JSON string of the arguments passed to the tool.

        - `name: string`

          The name of the tool that was run.

        - `server_label: string`

          The label of the MCP server running the tool.

        - `type: "mcp_call"`

          The type of the item. Always `mcp_call`.

          - `"mcp_call"`

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `approval_request_id?: string | null`

          Unique identifier for the MCP tool call approval request.
          Include this value in a subsequent `mcp_approval_response` input to approve or reject the corresponding tool call.

        - `error?: BetaMcpToolCallError | null`

          The error from the tool call, if any.

        - `output?: string | null`

          The output from the tool call.

        - `status?: "in_progress" | "completed" | "incomplete" | 2 more`

          The status of the tool call. One of `in_progress`, `completed`, `incomplete`, `calling`, or `failed`.

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

          - `"calling"`

          - `"failed"`

      - `McpListTools`

        A list of tools available on an MCP server.

        - `id: string`

          The unique ID of the list.

        - `server_label: string`

          The label of the MCP server.

        - `tools: Array<Tool>`

          The tools available on the server.

          - `input_schema: unknown`

            The JSON schema describing the tool's input.

          - `name: string`

            The name of the tool.

          - `annotations?: unknown`

            Additional annotations about the tool.

          - `description?: string | null`

            The description of the tool.

        - `type: "mcp_list_tools"`

          The type of the item. Always `mcp_list_tools`.

          - `"mcp_list_tools"`

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `error?: string | null`

          Error message if the server could not list tools.

      - `McpApprovalRequest`

        A request for human approval of a tool invocation.

        - `id: string`

          The unique ID of the approval request.

        - `arguments: string`

          A JSON string of arguments for the tool.

        - `name: string`

          The name of the tool to run.

        - `server_label: string`

          The label of the MCP server making the request.

        - `type: "mcp_approval_request"`

          The type of the item. Always `mcp_approval_request`.

          - `"mcp_approval_request"`

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

      - `McpApprovalResponse`

        A response to an MCP approval request.

        - `id: string`

          The unique ID of the approval response

        - `approval_request_id: string`

          The ID of the approval request being answered.

        - `approve: boolean`

          Whether the request was approved.

        - `type: "mcp_approval_response"`

          The type of the item. Always `mcp_approval_response`.

          - `"mcp_approval_response"`

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `reason?: string | null`

          Optional reason for the decision.

      - `BetaResponseCustomToolCall`

        A call to a custom tool created by the model.

      - `BetaResponseCustomToolCallOutputItem extends BetaResponseCustomToolCallOutput`

        The output of a custom tool call from your code, being sent back to the model.

        - `id: string`

          The unique ID of the custom tool call output item.

        - `status: "in_progress" | "completed" | "incomplete"`

          The status of the item. One of `in_progress`, `completed`, or
          `incomplete`. Populated when items are returned via API.

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

        - `created_by?: string`

          The identifier of the actor that created the item.

    - `parallel_tool_calls: boolean`

      Whether to allow the model to run tool calls in parallel.

    - `temperature: number | null`

      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.

    - `tool_choice: BetaToolChoiceOptions | BetaToolChoiceAllowed | BetaToolChoiceTypes | 6 more`

      How the model should select which tool (or tools) to use when generating
      a response. See the `tools` parameter to see how to specify which tools
      the model can call.

      - `BetaToolChoiceOptions = "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.

        - `"none"`

        - `"auto"`

        - `"required"`

      - `BetaToolChoiceAllowed`

        Constrains the tools available to the model to a pre-defined set.

        - `mode: "auto" | "required"`

          Constrains the tools available to the model to a pre-defined set.

          `auto` allows the model to pick from among the allowed tools and generate a
          message.

          `required` requires the model to call one or more of the allowed tools.

          - `"auto"`

          - `"required"`

        - `tools: Array<Record<string, unknown>>`

          A list of tool definitions that the model should be allowed to call.

          For the Responses API, the list of tool definitions might look like:

          ```json
          [
            { "type": "function", "name": "get_weather" },
            { "type": "mcp", "server_label": "deepwiki" },
            { "type": "image_generation" }
          ]
          ```

        - `type: "allowed_tools"`

          Allowed tool configuration type. Always `allowed_tools`.

          - `"allowed_tools"`

      - `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" | 5 more`

          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`

          - `"file_search"`

          - `"web_search_preview"`

          - `"computer"`

          - `"computer_use_preview"`

          - `"computer_use"`

          - `"web_search_preview_2025_03_11"`

          - `"image_generation"`

          - `"code_interpreter"`

      - `BetaToolChoiceFunction`

        Use this option to force the model to call a specific function.

        - `name: string`

          The name of the function to call.

        - `type: "function"`

          For function calling, the type is always `function`.

          - `"function"`

      - `BetaToolChoiceMcp`

        Use this option to force the model to call a specific tool on a remote MCP server.

        - `server_label: string`

          The label of the MCP server to use.

        - `type: "mcp"`

          For MCP tools, the type is always `mcp`.

          - `"mcp"`

        - `name?: string | null`

          The name of the tool to call on the server.

      - `BetaToolChoiceCustom`

        Use this option to force the model to call a specific custom tool.

        - `name: string`

          The name of the custom tool to call.

        - `type: "custom"`

          For custom tool calling, the type is always `custom`.

          - `"custom"`

      - `BetaSpecificProgrammaticToolCallingParam`

        - `type: "programmatic_tool_calling"`

          The tool to call. Always `programmatic_tool_calling`.

          - `"programmatic_tool_calling"`

      - `BetaToolChoiceApplyPatch`

        Forces the model to call the apply_patch tool when executing a tool call.

        - `type: "apply_patch"`

          The tool to call. Always `apply_patch`.

          - `"apply_patch"`

      - `BetaToolChoiceShell`

        Forces the model to call the shell tool when a tool call is required.

        - `type: "shell"`

          The tool to call. Always `shell`.

          - `"shell"`

    - `tools: Array<BetaTool>`

      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.

      - `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).

      - `Mcp`

        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).

      - `CodeInterpreter`

        A tool that runs Python code to help generate a response to a prompt.

      - `ProgrammaticToolCalling`

      - `ImageGeneration`

        A tool that generates images using the GPT image models.

      - `LocalShell`

        A tool that allows the model to execute shell commands in a local environment.

      - `BetaFunctionShellTool`

        A tool that allows the model to execute shell commands.

      - `BetaCustomTool`

        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)

      - `BetaNamespaceTool`

        Groups function/custom tools under a shared namespace.

      - `BetaToolSearchTool`

        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).

      - `BetaApplyPatchTool`

        Allows the assistant to create, delete, or update files using unified diffs.

    - `top_p: number | null`

      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.

    - `background?: boolean | null`

      Whether to run the model response in the background.
      [Learn more](https://platform.openai.com/docs/guides/background).

    - `completed_at?: number | null`

      Unix timestamp (in seconds) of when this Response was completed.
      Only present when the status is `completed`.

    - `conversation?: Conversation | null`

      The conversation that this response belonged to. Input items and output items from this response were automatically added to this conversation.

      - `id: string`

        The unique ID of the conversation that this response was associated with.

    - `max_output_tokens?: number | null`

      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).

    - `max_tool_calls?: number | null`

      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.

    - `moderation?: Moderation | null`

      Moderation results for the response input and output, if moderated completions were requested.

      - `input: ModerationResult | Error`

        Moderation for the response input.

        - `ModerationResult`

          A moderation result produced for the response input or output.

          - `categories: Record<string, boolean>`

            A dictionary of moderation categories to booleans, True if the input is flagged under this category.

          - `category_applied_input_types: Record<string, Array<"text" | "image">>`

            Which modalities of input are reflected by the score for each category.

            - `"text"`

            - `"image"`

          - `category_scores: Record<string, number>`

            A dictionary of moderation categories to scores.

          - `flagged: boolean`

            A boolean indicating whether the content was flagged by any category.

          - `model: string`

            The moderation model that produced this result.

          - `type: "moderation_result"`

            The object type, which was always `moderation_result` for successful moderation results.

            - `"moderation_result"`

        - `Error`

          An error produced while attempting moderation for the response input or output.

          - `code: string`

            The error code.

          - `message: string`

            The error message.

          - `type: "error"`

            The object type, which was always `error` for moderation failures.

            - `"error"`

      - `output: ModerationResult | Error`

        Moderation for the response output.

        - `ModerationResult`

          A moderation result produced for the response input or output.

          - `categories: Record<string, boolean>`

            A dictionary of moderation categories to booleans, True if the input is flagged under this category.

          - `category_applied_input_types: Record<string, Array<"text" | "image">>`

            Which modalities of input are reflected by the score for each category.

            - `"text"`

            - `"image"`

          - `category_scores: Record<string, number>`

            A dictionary of moderation categories to scores.

          - `flagged: boolean`

            A boolean indicating whether the content was flagged by any category.

          - `model: string`

            The moderation model that produced this result.

          - `type: "moderation_result"`

            The object type, which was always `moderation_result` for successful moderation results.

            - `"moderation_result"`

        - `Error`

          An error produced while attempting moderation for the response input or output.

          - `code: string`

            The error code.

          - `message: string`

            The error message.

          - `type: "error"`

            The object type, which was always `error` for moderation failures.

            - `"error"`

    - `previous_response_id?: string | null`

      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`.

    - `prompt?: BetaResponsePrompt | null`

      Reference to a prompt template and its variables.
      [Learn more](https://platform.openai.com/docs/guides/text?api-mode=responses#reusable-prompts).

      - `id: string`

        The unique identifier of the prompt template to use.

      - `variables?: Record<string, string | BetaResponseInputText | BetaResponseInputImage | BetaResponseInputFile> | null`

        Optional map of values to substitute in for variables in your
        prompt. The substitution values can either be strings, or other
        Response input types like images or files.

        - `string`

        - `BetaResponseInputText`

          A text input to the model.

        - `BetaResponseInputImage`

          An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision).

        - `BetaResponseInputFile`

          A file input to the model.

      - `version?: string | null`

        Optional version of the prompt template.

    - `prompt_cache_key?: string | null`

      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).

    - `prompt_cache_options?: PromptCacheOptions`

      The prompt-caching options that were applied to the response. Supported for `gpt-5.6` and later models.

      - `mode: "implicit" | "explicit"`

        Whether implicit prompt-cache breakpoints were enabled.

        - `"implicit"`

        - `"explicit"`

      - `ttl: "30m"`

        The minimum lifetime applied to each cache breakpoint.

        - `"30m"`

    - `prompt_cache_retention?: "in_memory" | "24h" | null`

      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.

      - `"in_memory"`

      - `"24h"`

    - `reasoning?: Reasoning | null`

      **gpt-5 and o-series models only**

      Configuration options for
      [reasoning models](https://platform.openai.com/docs/guides/reasoning).

      - `context?: "auto" | "current_turn" | "all_turns" | null`

        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.

        - `"auto"`

        - `"current_turn"`

        - `"all_turns"`

      - `effort?: "none" | "minimal" | "low" | 4 more | null`

        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.

        - `"none"`

        - `"minimal"`

        - `"low"`

        - `"medium"`

        - `"high"`

        - `"xhigh"`

        - `"max"`

      - `generate_summary?: "auto" | "concise" | "detailed" | null`

        **Deprecated:** use `summary` instead.

        A summary of the reasoning performed by the model. This can be
        useful for debugging and understanding the model's reasoning process.
        One of `auto`, `concise`, or `detailed`.

        - `"auto"`

        - `"concise"`

        - `"detailed"`

      - `mode?: (string & {}) | "standard" | "pro"`

        Controls the reasoning execution mode for the request.

        When returned on a response, this is the effective execution mode.

        - `(string & {})`

        - `"standard" | "pro"`

          - `"standard"`

          - `"pro"`

      - `summary?: "auto" | "concise" | "detailed" | null`

        A summary of the reasoning performed by the model. This can be
        useful for debugging and understanding the model's reasoning process.
        One of `auto`, `concise`, or `detailed`.

        `concise` is supported for `computer-use-preview` models and all reasoning models after `gpt-5`.

        - `"auto"`

        - `"concise"`

        - `"detailed"`

    - `safety_identifier?: string | null`

      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).

    - `service_tier?: BetaServiceTier | null`

      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.
      - If set to 'ultrafast', then the request will be processed with the access-controlled Ultrafast Processing service tier. This tier is currently available for `gpt-5.6-sol`; a response served through it will show `service_tier=ultrafast`.
      - When not set, the default behavior is 'auto'.

      When the `service_tier` parameter is set, the response body will include the `service_tier` value based on the processing mode actually used to serve the request. This response value may be different from the value set in the parameter.

      - `"auto"`

      - `"default"`

      - `"flex"`

      - `"scale"`

      - `"priority"`

      - `"fast"`

      - `"ultrafast"`

    - `status?: BetaResponseStatus`

      The status of the response generation. One of `completed`, `failed`,
      `in_progress`, `cancelled`, `queued`, or `incomplete`.

      - `"completed"`

      - `"failed"`

      - `"in_progress"`

      - `"cancelled"`

      - `"queued"`

      - `"incomplete"`

    - `text?: BetaResponseTextConfig`

      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?: BetaResponseFormatTextConfig`

        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.

        - `Text`

          Default response format. Used to generate text responses.

          - `type: "text"`

            The type of response format being defined. Always `text`.

            - `"text"`

        - `BetaResponseFormatTextJSONSchemaConfig`

          JSON Schema response format. Used to generate structured JSON responses.
          Learn more about [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs).

          - `name: string`

            The name of the response format. Must be a-z, A-Z, 0-9, or contain
            underscores and dashes, with a maximum length of 64.

          - `schema: Record<string, unknown>`

            The schema for the response format, described as a JSON Schema object.
            Learn how to build JSON schemas [here](https://json-schema.org/).

          - `type: "json_schema"`

            The type of response format being defined. Always `json_schema`.

            - `"json_schema"`

          - `description?: string`

            A description of what the response format is for, used by the model to
            determine how to respond in the format.

          - `strict?: boolean | null`

            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).

        - `JSONObject`

          JSON object response format. An older method of generating JSON responses.
          Using `json_schema` is recommended for models that support it. Note that the
          model will not generate JSON without a system or user message instructing it
          to do so.

          - `type: "json_object"`

            The type of response format being defined. Always `json_object`.

            - `"json_object"`

      - `verbosity?: "low" | "medium" | "high" | null`

        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`.

        - `"low"`

        - `"medium"`

        - `"high"`

    - `top_logprobs?: number | null`

      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.

    - `truncation?: "auto" | "disabled" | null`

      The truncation strategy to use for the model response.

      - `auto`: If the input to this Response exceeds
        the model's context window size, the model will truncate the
        response to fit the context window by dropping items from the beginning of the conversation.
      - `disabled` (default): If the input size will exceed the context window
        size for a model, the request will fail with a 400 error.

      - `"auto"`

      - `"disabled"`

    - `usage?: BetaResponseUsage`

      Represents token usage details including input tokens, output tokens,
      a breakdown of output tokens, and the total tokens used.

      - `input_tokens: number`

        The number of input tokens.

      - `input_tokens_details: InputTokensDetails`

        A detailed breakdown of the input tokens.

        - `cache_write_tokens: number`

          The number of input tokens that were written to the cache.

        - `cached_tokens: number`

          The number of tokens that were retrieved from the cache.
          [More on prompt caching](https://platform.openai.com/docs/guides/prompt-caching).

      - `output_tokens: number`

        The number of output tokens.

      - `output_tokens_details: OutputTokensDetails`

        A detailed breakdown of the output tokens.

        - `reasoning_tokens: number`

          The number of reasoning tokens.

      - `total_tokens: number`

        The total number of tokens used.

    - `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).

  - `sequence_number: number`

    The sequence number for this event.

  - `type: "response.created"`

    The type of the event. Always `response.created`.

    - `"response.created"`

  - `agent?: Agent | null`

    The agent that owns this multi-agent streaming event.

    - `agent_name: string`

      The canonical name of the agent that produced this item.

### Beta Response Custom Tool Call

- `BetaResponseCustomToolCall`

  A call to a custom tool created by the model.

  - `call_id: string`

    An identifier used to map this custom tool call to a tool call output.

  - `input: string`

    The input for the custom tool call generated by the model.

  - `name: string`

    The name of the custom tool being called.

  - `type: "custom_tool_call"`

    The type of the custom tool call. Always `custom_tool_call`.

    - `"custom_tool_call"`

  - `id?: string`

    The unique ID of the custom tool call in the OpenAI platform.

  - `agent?: Agent | null`

    The agent that produced this item.

    - `agent_name: string`

      The canonical name of the agent that produced this item.

  - `caller?: Direct | Program | null`

    The execution context that produced this tool call.

    - `Direct`

      - `type: "direct"`

        - `"direct"`

    - `Program`

      - `caller_id: string`

        The call ID of the program item that produced this tool call.

      - `type: "program"`

        - `"program"`

  - `namespace?: string`

    The namespace of the custom tool being called.

### Beta Response Custom Tool Call Input Delta Event

- `BetaResponseCustomToolCallInputDeltaEvent`

  Event representing a delta (partial update) to the input of a custom tool call.

  - `delta: string`

    The incremental input data (delta) for the custom tool call.

  - `item_id: string`

    Unique identifier for the API item associated with this event.

  - `output_index: number`

    The index of the output this delta applies to.

  - `sequence_number: number`

    The sequence number of this event.

  - `type: "response.custom_tool_call_input.delta"`

    The event type identifier.

    - `"response.custom_tool_call_input.delta"`

  - `agent?: Agent | null`

    The agent that owns this multi-agent streaming event.

    - `agent_name: string`

      The canonical name of the agent that produced this item.

### Beta Response Custom Tool Call Input Done Event

- `BetaResponseCustomToolCallInputDoneEvent`

  Event indicating that input for a custom tool call is complete.

  - `input: string`

    The complete input data for the custom tool call.

  - `item_id: string`

    Unique identifier for the API item associated with this event.

  - `output_index: number`

    The index of the output this event applies to.

  - `sequence_number: number`

    The sequence number of this event.

  - `type: "response.custom_tool_call_input.done"`

    The event type identifier.

    - `"response.custom_tool_call_input.done"`

  - `agent?: Agent | null`

    The agent that owns this multi-agent streaming event.

    - `agent_name: string`

      The canonical name of the agent that produced this item.

### Beta Response Custom Tool Call Item

- `BetaResponseCustomToolCallItem extends BetaResponseCustomToolCall`

  A call to a custom tool created by the model.

  - `id: string`

    The unique ID of the custom tool call item.

  - `status: "in_progress" | "completed" | "incomplete"`

    The status of the item. One of `in_progress`, `completed`, or
    `incomplete`. Populated when items are returned via API.

    - `"in_progress"`

    - `"completed"`

    - `"incomplete"`

  - `created_by?: string`

    The identifier of the actor that created the item.

### Beta Response Custom Tool Call Output

- `BetaResponseCustomToolCallOutput`

  The output of a custom tool call from your code, being sent back to the model.

  - `call_id: string`

    The call ID, used to map this custom tool call output to a custom tool call.

  - `output: string | Array<BetaResponseInputText | BetaResponseInputImage | BetaResponseInputFile>`

    The output from the custom tool call generated by your code.
    Can be a string or an list of output content.

    - `string`

    - `Array<BetaResponseInputText | BetaResponseInputImage | BetaResponseInputFile>`

      - `BetaResponseInputText`

        A text input to the model.

        - `text: string`

          The text input to the model.

        - `type: "input_text"`

          The type of the input item. Always `input_text`.

          - `"input_text"`

        - `prompt_cache_breakpoint?: PromptCacheBreakpoint`

          Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.

          - `mode: "explicit"`

            The breakpoint mode. Always `explicit`.

            - `"explicit"`

      - `BetaResponseInputImage`

        An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision).

        - `detail: BetaImageDetail`

          The detail level of the image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`.

          - `"low"`

          - `"high"`

          - `"auto"`

          - `"original"`

        - `type: "input_image"`

          The type of the input item. Always `input_image`.

          - `"input_image"`

        - `file_id?: string | null`

          The ID of the file to be sent to the model.

        - `image_url?: string | null`

          The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.

        - `prompt_cache_breakpoint?: PromptCacheBreakpoint`

          Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.

          - `mode: "explicit"`

            The breakpoint mode. Always `explicit`.

            - `"explicit"`

      - `BetaResponseInputFile`

        A file input to the model.

        - `type: "input_file"`

          The type of the input item. Always `input_file`.

          - `"input_file"`

        - `detail?: "auto" | "low" | "high"`

          The detail level of the file to be sent to the model. Use `auto` to let the system select the detail level; for GPT-5.6 and later models, `auto` uses high-quality rendering, which may increase input token usage. Use `low` for lower-cost rendering, or `high` to render the file at higher quality. Defaults to `auto`.

          - `"auto"`

          - `"low"`

          - `"high"`

        - `file_data?: string`

          The content of the file to be sent to the model.

        - `file_id?: string | null`

          The ID of the file to be sent to the model.

        - `file_url?: string`

          The URL of the file to be sent to the model.

        - `filename?: string`

          The name of the file to be sent to the model.

        - `prompt_cache_breakpoint?: PromptCacheBreakpoint`

          Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.

          - `mode: "explicit"`

            The breakpoint mode. Always `explicit`.

            - `"explicit"`

  - `type: "custom_tool_call_output"`

    The type of the custom tool call output. Always `custom_tool_call_output`.

    - `"custom_tool_call_output"`

  - `id?: string`

    The unique ID of the custom tool call output in the OpenAI platform.

  - `agent?: Agent | null`

    The agent that produced this item.

    - `agent_name: string`

      The canonical name of the agent that produced this item.

  - `caller?: Direct | Program | null`

    The execution context that produced this tool call.

    - `Direct`

      - `type: "direct"`

        The caller type. Always `direct`.

        - `"direct"`

    - `Program`

      - `caller_id: string`

        The call ID of the program item that produced this tool call.

      - `type: "program"`

        The caller type. Always `program`.

        - `"program"`

### Beta Response Custom Tool Call Output Item

- `BetaResponseCustomToolCallOutputItem extends BetaResponseCustomToolCallOutput`

  The output of a custom tool call from your code, being sent back to the model.

  - `id: string`

    The unique ID of the custom tool call output item.

  - `status: "in_progress" | "completed" | "incomplete"`

    The status of the item. One of `in_progress`, `completed`, or
    `incomplete`. Populated when items are returned via API.

    - `"in_progress"`

    - `"completed"`

    - `"incomplete"`

  - `created_by?: string`

    The identifier of the actor that created the item.

### Beta Response Error

- `BetaResponseError`

  An error object returned when the model fails to generate a Response.

  - `code: "server_error" | "rate_limit_exceeded" | "invalid_prompt" | 17 more`

    The error code for the response.

    - `"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"`

  - `message: string`

    A human-readable description of the error.

### Beta Response Error Event

- `BetaResponseErrorEvent`

  Emitted when an error occurs.

  - `code: string | null`

    The error code.

  - `message: string`

    The error message.

  - `param: string | null`

    The error parameter.

  - `sequence_number: number`

    The sequence number of this event.

  - `type: "error"`

    The type of the event. Always `error`.

    - `"error"`

  - `agent?: Agent | null`

    The agent that owns this multi-agent streaming event.

    - `agent_name: string`

      The canonical name of the agent that produced this item.

### Beta Response Failed Event

- `BetaResponseFailedEvent`

  An event that is emitted when a response fails.

  - `response: BetaResponse`

    The response that failed.

    - `id: string`

      Unique identifier for this Response.

    - `created_at: number`

      Unix timestamp (in seconds) of when this Response was created.

    - `error: BetaResponseError | null`

      An error object returned when the model fails to generate a Response.

      - `code: "server_error" | "rate_limit_exceeded" | "invalid_prompt" | 17 more`

        The error code for the response.

        - `"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"`

      - `message: string`

        A human-readable description of the error.

    - `incomplete_details: IncompleteDetails | null`

      Details about why the response is incomplete.

      - `reason?: "max_output_tokens" | "content_filter"`

        The reason why the response is incomplete.

        - `"max_output_tokens"`

        - `"content_filter"`

    - `instructions: string | Array<BetaResponseInputItem> | null`

      A system (or developer) message inserted into the model's context.

      When using along with `previous_response_id`, the instructions from a previous
      response will not be carried over to the next response. This makes it simple
      to swap out system (or developer) messages in new responses.

      - `string`

      - `Array<BetaResponseInputItem>`

        - `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.

          - `content: string | BetaResponseInputMessageContentList`

            Text, image, or audio input to the model, used to generate a response.
            Can also contain previous assistant responses.

            - `string`

            - `BetaResponseInputMessageContentList = Array<BetaResponseInputContent>`

              A list of one or many input items to the model, containing different content
              types.

              - `BetaResponseInputText`

                A text input to the model.

                - `text: string`

                  The text input to the model.

                - `type: "input_text"`

                  The type of the input item. Always `input_text`.

                  - `"input_text"`

                - `prompt_cache_breakpoint?: PromptCacheBreakpoint`

                  Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.

                  - `mode: "explicit"`

                    The breakpoint mode. Always `explicit`.

                    - `"explicit"`

              - `BetaResponseInputImage`

                An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision).

                - `detail: BetaImageDetail`

                  The detail level of the image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`.

                  - `"low"`

                  - `"high"`

                  - `"auto"`

                  - `"original"`

                - `type: "input_image"`

                  The type of the input item. Always `input_image`.

                  - `"input_image"`

                - `file_id?: string | null`

                  The ID of the file to be sent to the model.

                - `image_url?: string | null`

                  The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.

                - `prompt_cache_breakpoint?: PromptCacheBreakpoint`

                  Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.

                  - `mode: "explicit"`

                    The breakpoint mode. Always `explicit`.

                    - `"explicit"`

              - `BetaResponseInputFile`

                A file input to the model.

                - `type: "input_file"`

                  The type of the input item. Always `input_file`.

                  - `"input_file"`

                - `detail?: "auto" | "low" | "high"`

                  The detail level of the file to be sent to the model. Use `auto` to let the system select the detail level; for GPT-5.6 and later models, `auto` uses high-quality rendering, which may increase input token usage. Use `low` for lower-cost rendering, or `high` to render the file at higher quality. Defaults to `auto`.

                  - `"auto"`

                  - `"low"`

                  - `"high"`

                - `file_data?: string`

                  The content of the file to be sent to the model.

                - `file_id?: string | null`

                  The ID of the file to be sent to the model.

                - `file_url?: string`

                  The URL of the file to be sent to the model.

                - `filename?: string`

                  The name of the file to be sent to the model.

                - `prompt_cache_breakpoint?: PromptCacheBreakpoint`

                  Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.

                  - `mode: "explicit"`

                    The breakpoint mode. Always `explicit`.

                    - `"explicit"`

          - `role: "user" | "assistant" | "system" | "developer"`

            The role of the message input. One of `user`, `assistant`, `system`, or
            `developer`.

            - `"user"`

            - `"assistant"`

            - `"system"`

            - `"developer"`

          - `phase?: "commentary" | "final_answer" | null`

            Labels an `assistant` message as intermediate commentary (`commentary`) or the final answer (`final_answer`).
            For models like `gpt-5.3-codex` and beyond, when sending follow-up requests, preserve and resend
            phase on all assistant messages — dropping it can degrade performance. Not used for user messages.

            - `"commentary"`

            - `"final_answer"`

          - `type?: "message"`

            The type of the message input. Always `message`.

            - `"message"`

        - `Message`

          A message input to the model with a role indicating instruction following
          hierarchy. Instructions given with the `developer` or `system` role take
          precedence over instructions given with the `user` role.

          - `content: BetaResponseInputMessageContentList`

            A list of one or many input items to the model, containing different content
            types.

          - `role: "user" | "system" | "developer"`

            The role of the message input. One of `user`, `system`, or `developer`.

            - `"user"`

            - `"system"`

            - `"developer"`

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

          - `status?: "in_progress" | "completed" | "incomplete"`

            The status of item. One of `in_progress`, `completed`, or
            `incomplete`. Populated when items are returned via API.

            - `"in_progress"`

            - `"completed"`

            - `"incomplete"`

          - `type?: "message"`

            The type of the message input. Always set to `message`.

            - `"message"`

        - `BetaResponseOutputMessage`

          An output message from the model.

          - `id: string`

            The unique ID of the output message.

          - `content: Array<BetaResponseOutputText | BetaResponseOutputRefusal>`

            The content of the output message.

            - `BetaResponseOutputText`

              A text output from the model.

              - `annotations: Array<FileCitation | URLCitation | ContainerFileCitation | FilePath>`

                The annotations of the text output.

                - `FileCitation`

                  A citation to a file.

                  - `file_id: string`

                    The ID of the file.

                  - `filename: string`

                    The filename of the file cited.

                  - `index: number`

                    The index of the file in the list of files.

                  - `type: "file_citation"`

                    The type of the file citation. Always `file_citation`.

                    - `"file_citation"`

                - `URLCitation`

                  A citation for a web resource used to generate a model response.

                  - `end_index: number`

                    The index of the last character of the URL citation in the message.

                  - `start_index: number`

                    The index of the first character of the URL citation in the message.

                  - `title: string`

                    The title of the web resource.

                  - `type: "url_citation"`

                    The type of the URL citation. Always `url_citation`.

                    - `"url_citation"`

                  - `url: string`

                    The URL of the web resource.

                - `ContainerFileCitation`

                  A citation for a container file used to generate a model response.

                  - `container_id: string`

                    The ID of the container file.

                  - `end_index: number`

                    The index of the last character of the container file citation in the message.

                  - `file_id: string`

                    The ID of the file.

                  - `filename: string`

                    The filename of the container file cited.

                  - `start_index: number`

                    The index of the first character of the container file citation in the message.

                  - `type: "container_file_citation"`

                    The type of the container file citation. Always `container_file_citation`.

                    - `"container_file_citation"`

                - `FilePath`

                  A path to a file.

                  - `file_id: string`

                    The ID of the file.

                  - `index: number`

                    The index of the file in the list of files.

                  - `type: "file_path"`

                    The type of the file path. Always `file_path`.

                    - `"file_path"`

              - `text: string`

                The text output from the model.

              - `type: "output_text"`

                The type of the output text. Always `output_text`.

                - `"output_text"`

              - `logprobs?: Array<Logprob>`

                - `token: string`

                - `bytes: Array<number>`

                - `logprob: number`

                - `top_logprobs: Array<TopLogprob>`

                  - `token: string`

                  - `bytes: Array<number>`

                  - `logprob: number`

            - `BetaResponseOutputRefusal`

              A refusal from the model.

              - `refusal: string`

                The refusal explanation from the model.

              - `type: "refusal"`

                The type of the refusal. Always `refusal`.

                - `"refusal"`

          - `role: "assistant"`

            The role of the output message. Always `assistant`.

            - `"assistant"`

          - `status: "in_progress" | "completed" | "incomplete"`

            The status of the message input. One of `in_progress`, `completed`, or
            `incomplete`. Populated when input items are returned via API.

            - `"in_progress"`

            - `"completed"`

            - `"incomplete"`

          - `type: "message"`

            The type of the output message. Always `message`.

            - `"message"`

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

          - `phase?: "commentary" | "final_answer" | null`

            Labels an `assistant` message as intermediate commentary (`commentary`) or the final answer (`final_answer`).
            For models like `gpt-5.3-codex` and beyond, when sending follow-up requests, preserve and resend
            phase on all assistant messages — dropping it can degrade performance. Not used for user messages.

            - `"commentary"`

            - `"final_answer"`

        - `BetaResponseFileSearchToolCall`

          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.

          - `id: string`

            The unique ID of the file search tool call.

          - `queries: Array<string>`

            The queries used to search for files.

          - `status: "in_progress" | "searching" | "completed" | 2 more`

            The status of the file search tool call. One of `in_progress`,
            `searching`, `incomplete` or `failed`,

            - `"in_progress"`

            - `"searching"`

            - `"completed"`

            - `"incomplete"`

            - `"failed"`

          - `type: "file_search_call"`

            The type of the file search tool call. Always `file_search_call`.

            - `"file_search_call"`

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

          - `results?: Array<Result> | null`

            The results of the file search tool call.

            - `attributes?: Record<string, string | number | boolean> | null`

              Set of 16 key-value pairs that can be attached to an object. This can be
              useful for storing additional information about the object in a structured
              format, and querying for objects via API or the dashboard. Keys are strings
              with a maximum length of 64 characters. Values are strings with a maximum
              length of 512 characters, booleans, or numbers.

              - `string`

              - `number`

              - `boolean`

            - `file_id?: string`

              The unique ID of the file.

            - `filename?: string`

              The name of the file.

            - `score?: number`

              The relevance score of the file - a value between 0 and 1.

            - `text?: string`

              The text that was retrieved from the file.

        - `BetaResponseComputerToolCall`

          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.

          - `id: string`

            The unique ID of the computer call.

          - `call_id: string`

            An identifier used when responding to the tool call with output.

          - `pending_safety_checks: Array<PendingSafetyCheck>`

            The pending safety checks for the computer call.

            - `id: string`

              The ID of the pending safety check.

            - `code?: string | null`

              The type of the pending safety check.

            - `message?: string | null`

              Details about the pending safety check.

          - `status: "in_progress" | "completed" | "incomplete"`

            The status of the item. One of `in_progress`, `completed`, or
            `incomplete`. Populated when items are returned via API.

            - `"in_progress"`

            - `"completed"`

            - `"incomplete"`

          - `type: "computer_call"`

            The type of the computer call. Always `computer_call`.

            - `"computer_call"`

          - `action?: BetaComputerAction`

            A click action.

            - `Click`

              A click action.

              - `button: "left" | "right" | "wheel" | 2 more`

                Indicates which mouse button was pressed during the click. One of `left`, `right`, `wheel`, `back`, or `forward`.

                - `"left"`

                - `"right"`

                - `"wheel"`

                - `"back"`

                - `"forward"`

              - `type: "click"`

                Specifies the event type. For a click action, this property is always `click`.

                - `"click"`

              - `x: number`

                The x-coordinate where the click occurred.

              - `y: number`

                The y-coordinate where the click occurred.

              - `keys?: Array<string> | null`

                The keys being held while clicking.

            - `DoubleClick`

              A double click action.

              - `keys: Array<string> | null`

                The keys being held while double-clicking.

              - `type: "double_click"`

                Specifies the event type. For a double click action, this property is always set to `double_click`.

                - `"double_click"`

              - `x: number`

                The x-coordinate where the double click occurred.

              - `y: number`

                The y-coordinate where the double click occurred.

            - `Drag`

              A drag action.

              - `path: Array<Path>`

                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 }
                ]
                ```

                - `x: number`

                  The x-coordinate.

                - `y: number`

                  The y-coordinate.

              - `type: "drag"`

                Specifies the event type. For a drag action, this property is always set to `drag`.

                - `"drag"`

              - `keys?: Array<string> | null`

                The keys being held while dragging the mouse.

            - `Keypress`

              A collection of keypresses the model would like to perform.

              - `keys: Array<string>`

                The combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key.

              - `type: "keypress"`

                Specifies the event type. For a keypress action, this property is always set to `keypress`.

                - `"keypress"`

            - `Move`

              A mouse move action.

              - `type: "move"`

                Specifies the event type. For a move action, this property is always set to `move`.

                - `"move"`

              - `x: number`

                The x-coordinate to move to.

              - `y: number`

                The y-coordinate to move to.

              - `keys?: Array<string> | null`

                The keys being held while moving the mouse.

            - `Screenshot`

              A screenshot action.

              - `type: "screenshot"`

                Specifies the event type. For a screenshot action, this property is always set to `screenshot`.

                - `"screenshot"`

            - `Scroll`

              A scroll action.

              - `scroll_x: number`

                The horizontal scroll distance.

              - `scroll_y: number`

                The vertical scroll distance.

              - `type: "scroll"`

                Specifies the event type. For a scroll action, this property is always set to `scroll`.

                - `"scroll"`

              - `x: number`

                The x-coordinate where the scroll occurred.

              - `y: number`

                The y-coordinate where the scroll occurred.

              - `keys?: Array<string> | null`

                The keys being held while scrolling.

            - `Type`

              An action to type in text.

              - `text: string`

                The text to type.

              - `type: "type"`

                Specifies the event type. For a type action, this property is always set to `type`.

                - `"type"`

            - `Wait`

              A wait action.

              - `type: "wait"`

                Specifies the event type. For a wait action, this property is always set to `wait`.

                - `"wait"`

          - `actions?: BetaComputerActionList`

            Flattened batched actions for `computer_use`. Each action includes an
            `type` discriminator and action-specific fields.

            - `Click`

              A click action.

            - `DoubleClick`

              A double click action.

            - `Drag`

              A drag action.

            - `Keypress`

              A collection of keypresses the model would like to perform.

            - `Move`

              A mouse move action.

            - `Screenshot`

              A screenshot action.

            - `Scroll`

              A scroll action.

            - `Type`

              An action to type in text.

            - `Wait`

              A wait action.

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

        - `ComputerCallOutput`

          The output of a computer tool call.

          - `call_id: string`

            The ID of the computer tool call that produced the output.

          - `output: BetaResponseComputerToolCallOutputScreenshot`

            A computer screenshot image used with the computer use tool.

            - `type: "computer_screenshot"`

              Specifies the event type. For a computer screenshot, this property is
              always set to `computer_screenshot`.

              - `"computer_screenshot"`

            - `file_id?: string`

              The identifier of an uploaded file that contains the screenshot.

            - `image_url?: string`

              The URL of the screenshot image.

          - `type: "computer_call_output"`

            The type of the computer tool call output. Always `computer_call_output`.

            - `"computer_call_output"`

          - `id?: string | null`

            The ID of the computer tool call output.

          - `acknowledged_safety_checks?: Array<AcknowledgedSafetyCheck> | null`

            The safety checks reported by the API that have been acknowledged by the developer.

            - `id: string`

              The ID of the pending safety check.

            - `code?: string | null`

              The type of the pending safety check.

            - `message?: string | null`

              Details about the pending safety check.

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

          - `status?: "in_progress" | "completed" | "incomplete" | null`

            The status of the message input. One of `in_progress`, `completed`, or `incomplete`. Populated when input items are returned via API.

            - `"in_progress"`

            - `"completed"`

            - `"incomplete"`

        - `BetaResponseFunctionWebSearch`

          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.

          - `id: string`

            The unique ID of the web search tool call.

          - `action: Search | OpenPage | FindInPage`

            An object describing the specific action taken in this web search call.
            Includes details on how the model used the web (search, open_page, find_in_page).

            - `Search`

              Action type "search" - Performs a web search query.

              - `type: "search"`

                The action type.

                - `"search"`

              - `queries?: Array<string>`

                The search queries.

              - `query?: string`

                The search query.

              - `sources?: Array<Source>`

                The sources used in the search.

                - `type: "url"`

                  The type of source. Always `url`.

                  - `"url"`

                - `url: string`

                  The URL of the source.

            - `OpenPage`

              Action type "open_page" - Opens a specific URL from search results.

              - `type: "open_page"`

                The action type.

                - `"open_page"`

              - `url?: string | null`

                The URL opened by the model.

            - `FindInPage`

              Action type "find_in_page": Searches for a pattern within a loaded page.

              - `pattern: string`

                The pattern or text to search for within the page.

              - `type: "find_in_page"`

                The action type.

                - `"find_in_page"`

              - `url: string`

                The URL of the page searched for the pattern.

          - `status: "in_progress" | "searching" | "completed" | "failed"`

            The status of the web search tool call.

            - `"in_progress"`

            - `"searching"`

            - `"completed"`

            - `"failed"`

          - `type: "web_search_call"`

            The type of the web search tool call. Always `web_search_call`.

            - `"web_search_call"`

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

        - `BetaResponseFunctionToolCall`

          A tool call to run a function. See the
          [function calling guide](https://platform.openai.com/docs/guides/function-calling) for more information.

          - `arguments: string`

            A JSON string of the arguments to pass to the function.

          - `call_id: string`

            The unique ID of the function tool call generated by the model.

          - `name: string`

            The name of the function to run.

          - `type: "function_call"`

            The type of the function tool call. Always `function_call`.

            - `"function_call"`

          - `id?: string`

            The unique ID of the function tool call.

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

          - `caller?: Direct | Program | null`

            The execution context that produced this tool call.

            - `Direct`

              - `type: "direct"`

                - `"direct"`

            - `Program`

              - `caller_id: string`

                The call ID of the program item that produced this tool call.

              - `type: "program"`

                - `"program"`

          - `namespace?: string`

            The namespace of the function to run.

          - `status?: "in_progress" | "completed" | "incomplete"`

            The status of the item. One of `in_progress`, `completed`, or
            `incomplete`. Populated when items are returned via API.

            - `"in_progress"`

            - `"completed"`

            - `"incomplete"`

        - `FunctionCallOutput`

          The output of a function tool call.

          - `call_id: string`

            The unique ID of the function tool call generated by the model.

          - `output: string | BetaResponseFunctionCallOutputItemList`

            Text, image, or file output of the function tool call.

            - `string`

            - `BetaResponseFunctionCallOutputItemList = Array<BetaResponseFunctionCallOutputItem>`

              An array of content outputs (text, image, file) for the function tool call.

              - `BetaResponseInputTextContent`

                A text input to the model.

                - `text: string`

                  The text input to the model.

                - `type: "input_text"`

                  The type of the input item. Always `input_text`.

                  - `"input_text"`

                - `prompt_cache_breakpoint?: PromptCacheBreakpoint | null`

                  Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.

                  - `mode: "explicit"`

                    The breakpoint mode. Always `explicit`.

                    - `"explicit"`

              - `BetaResponseInputImageContent`

                An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision)

                - `type: "input_image"`

                  The type of the input item. Always `input_image`.

                  - `"input_image"`

                - `detail?: BetaImageDetail | null`

                  The detail level of the image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`.

                - `file_id?: string | null`

                  The ID of the file to be sent to the model.

                - `image_url?: string | null`

                  The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.

                - `prompt_cache_breakpoint?: PromptCacheBreakpoint | null`

                  Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.

                  - `mode: "explicit"`

                    The breakpoint mode. Always `explicit`.

                    - `"explicit"`

              - `BetaResponseInputFileContent`

                A file input to the model.

                - `type: "input_file"`

                  The type of the input item. Always `input_file`.

                  - `"input_file"`

                - `detail?: "auto" | "low" | "high"`

                  The detail level of the file to be sent to the model. Use `auto` to let the system select the detail level; for GPT-5.6 and later models, `auto` uses high-quality rendering, which may increase input token usage. Use `low` for lower-cost rendering, or `high` to render the file at higher quality. Defaults to `auto`.

                  - `"auto"`

                  - `"low"`

                  - `"high"`

                - `file_data?: string | null`

                  The base64-encoded data of the file to be sent to the model.

                - `file_id?: string | null`

                  The ID of the file to be sent to the model.

                - `file_url?: string | null`

                  The URL of the file to be sent to the model.

                - `filename?: string | null`

                  The name of the file to be sent to the model.

                - `prompt_cache_breakpoint?: PromptCacheBreakpoint | null`

                  Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.

                  - `mode: "explicit"`

                    The breakpoint mode. Always `explicit`.

                    - `"explicit"`

          - `type: "function_call_output"`

            The type of the function tool call output. Always `function_call_output`.

            - `"function_call_output"`

          - `id?: string | null`

            The unique ID of the function tool call output. Populated when this item is returned via API.

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

          - `caller?: Direct | Program | null`

            The execution context that produced this tool call.

            - `Direct`

              - `type: "direct"`

                The caller type. Always `direct`.

                - `"direct"`

            - `Program`

              - `caller_id: string`

                The call ID of the program item that produced this tool call.

              - `type: "program"`

                The caller type. Always `program`.

                - `"program"`

          - `name?: string | null`

            The name of the tool that produced the output.

          - `namespace?: string | null`

            The namespace of the tool that produced the output.

          - `status?: "in_progress" | "completed" | "incomplete" | null`

            The status of the item. One of `in_progress`, `completed`, or `incomplete`. Populated when items are returned via API.

            - `"in_progress"`

            - `"completed"`

            - `"incomplete"`

        - `AgentMessage`

          A message routed between agents.

          - `author: string`

            The sending agent identity.

          - `content: Array<BetaResponseInputTextContent | BetaResponseInputImageContent | EncryptedContent>`

            Plaintext, image, or encrypted content sent between agents.

            - `BetaResponseInputTextContent`

              A text input to the model.

            - `BetaResponseInputImageContent`

              An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision)

            - `EncryptedContent`

              Opaque encrypted content that Responses API decrypts inside trusted model execution.

              - `encrypted_content: string`

                Opaque encrypted content.

              - `type: "encrypted_content"`

                The type of the input item. Always `encrypted_content`.

                - `"encrypted_content"`

          - `recipient: string`

            The destination agent identity.

          - `type: "agent_message"`

            The item type. Always `agent_message`.

            - `"agent_message"`

          - `id?: string | null`

            The unique ID of this agent message item.

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

        - `MultiAgentCall`

          - `action: "spawn_agent" | "interrupt_agent" | "list_agents" | 3 more`

            The multi-agent action that was executed.

            - `"spawn_agent"`

            - `"interrupt_agent"`

            - `"list_agents"`

            - `"send_message"`

            - `"followup_task"`

            - `"wait_agent"`

          - `arguments: string`

            The action arguments as a JSON string.

          - `call_id: string`

            The unique ID linking this call to its output.

          - `type: "multi_agent_call"`

            The item type. Always `multi_agent_call`.

            - `"multi_agent_call"`

          - `id?: string | null`

            The unique ID of this multi-agent call.

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

        - `MultiAgentCallOutput`

          - `action: "spawn_agent" | "interrupt_agent" | "list_agents" | 3 more`

            The multi-agent action that produced this result.

            - `"spawn_agent"`

            - `"interrupt_agent"`

            - `"list_agents"`

            - `"send_message"`

            - `"followup_task"`

            - `"wait_agent"`

          - `call_id: string`

            The unique ID of the multi-agent call.

          - `output: Array<Output>`

            Text output returned by the multi-agent action.

            - `text: string`

              The text content.

            - `type: "output_text"`

              The content type. Always `output_text`.

              - `"output_text"`

            - `annotations?: Array<FileCitation | URLCitation | ContainerFileCitation>`

              Citations associated with the text content.

              - `FileCitation`

                - `file_id: string`

                  The ID of the file.

                - `filename: string`

                  The filename of the file cited.

                - `index: number`

                  The index of the file in the list of files.

                - `type: "file_citation"`

                  The citation type. Always `file_citation`.

                  - `"file_citation"`

              - `URLCitation`

                - `end_index: number`

                  The index of the last character of the citation in the message.

                - `start_index: number`

                  The index of the first character of the citation in the message.

                - `title: string`

                  The title of the cited resource.

                - `type: "url_citation"`

                  The citation type. Always `url_citation`.

                  - `"url_citation"`

                - `url: string`

                  The URL of the cited resource.

              - `ContainerFileCitation`

                - `container_id: string`

                  The ID of the container.

                - `end_index: number`

                  The index of the last character of the citation in the message.

                - `file_id: string`

                  The ID of the container file.

                - `filename: string`

                  The filename of the container file cited.

                - `start_index: number`

                  The index of the first character of the citation in the message.

                - `type: "container_file_citation"`

                  The citation type. Always `container_file_citation`.

                  - `"container_file_citation"`

          - `type: "multi_agent_call_output"`

            The item type. Always `multi_agent_call_output`.

            - `"multi_agent_call_output"`

          - `id?: string | null`

            The unique ID of this multi-agent call output.

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

        - `ToolSearchCall`

          - `arguments: unknown`

            The arguments supplied to the tool search call.

          - `type: "tool_search_call"`

            The item type. Always `tool_search_call`.

            - `"tool_search_call"`

          - `id?: string | null`

            The unique ID of this tool search call.

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

          - `call_id?: string | null`

            The unique ID of the tool search call generated by the model.

          - `execution?: "server" | "client"`

            Whether tool search was executed by the server or by the client.

            - `"server"`

            - `"client"`

          - `status?: "in_progress" | "completed" | "incomplete" | null`

            The status of the tool search call.

            - `"in_progress"`

            - `"completed"`

            - `"incomplete"`

        - `BetaResponseToolSearchOutputItemParam`

          - `tools: Array<BetaTool>`

            The loaded tool definitions returned by the tool search output.

            - `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).

              - `name: string`

                The name of the function to call.

              - `parameters: Record<string, unknown> | null`

                A JSON schema object describing the parameters of the function.

              - `strict: boolean | null`

                Whether strict parameter validation is enforced for this function tool.

              - `type: "function"`

                The type of the function tool. Always `function`.

                - `"function"`

              - `allowed_callers?: Array<"direct" | "programmatic"> | null`

                The tool invocation context(s).

                - `"direct"`

                - `"programmatic"`

              - `defer_loading?: boolean`

                Whether this function is deferred and loaded via tool search.

              - `description?: string | null`

                A description of the function. Used by the model to determine whether or not to call the function.

              - `output_schema?: Record<string, unknown> | null`

                A JSON schema object describing the JSON value encoded in string outputs for this function.

            - `BetaFileSearchTool`

              A tool that searches for relevant content from uploaded files. Learn more about the [file search tool](https://platform.openai.com/docs/guides/tools-file-search).

              - `type: "file_search"`

                The type of the file search tool. Always `file_search`.

                - `"file_search"`

              - `vector_store_ids: Array<string>`

                The IDs of the vector stores to search.

              - `filters?: ComparisonFilter | CompoundFilter | null`

                A filter to apply.

                - `ComparisonFilter`

                  A filter used to compare a specified attribute key to a given value using a defined comparison operation.

                  - `key: string`

                    The key to compare against the value.

                  - `type: "eq" | "ne" | "gt" | 5 more`

                    Specifies the comparison operator: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`, `in`, `nin`.

                    - `eq`: equals
                    - `ne`: not equal
                    - `gt`: greater than
                    - `gte`: greater than or equal
                    - `lt`: less than
                    - `lte`: less than or equal
                    - `in`: in
                    - `nin`: not in

                    - `"eq"`

                    - `"ne"`

                    - `"gt"`

                    - `"gte"`

                    - `"lt"`

                    - `"lte"`

                    - `"in"`

                    - `"nin"`

                  - `value: string | number | boolean | Array<string | number>`

                    The value to compare against the attribute key; supports string, number, or boolean types.

                    - `string`

                    - `number`

                    - `boolean`

                    - `Array<string | number>`

                      - `string`

                      - `number`

                - `CompoundFilter`

                  Combine multiple filters using `and` or `or`.

                  - `filters: Array<ComparisonFilter | unknown>`

                    Array of filters to combine. Items can be `ComparisonFilter` or `CompoundFilter`.

                    - `ComparisonFilter`

                      A filter used to compare a specified attribute key to a given value using a defined comparison operation.

                      - `key: string`

                        The key to compare against the value.

                      - `type: "eq" | "ne" | "gt" | 5 more`

                        Specifies the comparison operator: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`, `in`, `nin`.

                        - `eq`: equals
                        - `ne`: not equal
                        - `gt`: greater than
                        - `gte`: greater than or equal
                        - `lt`: less than
                        - `lte`: less than or equal
                        - `in`: in
                        - `nin`: not in

                        - `"eq"`

                        - `"ne"`

                        - `"gt"`

                        - `"gte"`

                        - `"lt"`

                        - `"lte"`

                        - `"in"`

                        - `"nin"`

                      - `value: string | number | boolean | Array<string | number>`

                        The value to compare against the attribute key; supports string, number, or boolean types.

                        - `string`

                        - `number`

                        - `boolean`

                        - `Array<string | number>`

                          - `string`

                          - `number`

                    - `unknown`

                  - `type: "and" | "or"`

                    Type of operation: `and` or `or`.

                    - `"and"`

                    - `"or"`

              - `max_num_results?: number`

                The maximum number of results to return. This number should be between 1 and 50 inclusive.

              - `ranking_options?: RankingOptions`

                Ranking options for search.

                - `hybrid_search?: HybridSearch`

                  Weights that control how reciprocal rank fusion balances semantic embedding matches versus sparse keyword matches when hybrid search is enabled.

                  - `embedding_weight: number`

                    The weight of the embedding in the reciprocal ranking fusion.

                  - `text_weight: number`

                    The weight of the text in the reciprocal ranking fusion.

                - `ranker?: "auto" | "default-2024-11-15"`

                  The ranker to use for the file search.

                  - `"auto"`

                  - `"default-2024-11-15"`

                - `score_threshold?: number`

                  The score threshold for the file search, a number between 0 and 1. Numbers closer to 1 will attempt to return only the most relevant results, but may return fewer results.

            - `BetaComputerTool`

              A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use).

              - `type: "computer"`

                The type of the computer tool. Always `computer`.

                - `"computer"`

            - `BetaComputerUsePreviewTool`

              A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use).

              - `display_height: number`

                The height of the computer display.

              - `display_width: number`

                The width of the computer display.

              - `environment: "windows" | "mac" | "linux" | 2 more`

                The type of computer environment to control.

                - `"windows"`

                - `"mac"`

                - `"linux"`

                - `"ubuntu"`

                - `"browser"`

              - `type: "computer_use_preview"`

                The type of the computer use tool. Always `computer_use_preview`.

                - `"computer_use_preview"`

            - `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"`

                The type of the web search tool. One of `web_search` or `web_search_2025_08_26`.

                - `"web_search"`

                - `"web_search_2025_08_26"`

              - `external_web_access?: boolean`

                Allow live internet access for web search. Defaults to true when omitted. When false, the web search tool runs in offline/cache-only mode and will not fetch new external content.

              - `filters?: Filters | null`

                Filters for the search.

                - `allowed_domains?: Array<string> | null`

                  Allowed domains for the search. If not provided, all domains are allowed.
                  Subdomains of the provided domains are allowed as well.

                  Example: `["pubmed.ncbi.nlm.nih.gov"]`

              - `search_context_size?: "low" | "medium" | "high"`

                High level guidance for the amount of context window space to use for the search. One of `low`, `medium`, or `high`. `medium` is the default.

                - `"low"`

                - `"medium"`

                - `"high"`

              - `user_location?: UserLocation | null`

                The approximate location of the user.

                - `city?: string | null`

                  Free text input for the city of the user, e.g. `San Francisco`.

                - `country?: string | null`

                  The two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of the user, e.g. `US`.

                - `region?: string | null`

                  Free text input for the region of the user, e.g. `California`.

                - `timezone?: string | null`

                  The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of the user, e.g. `America/Los_Angeles`.

                - `type?: "approximate"`

                  The type of location approximation. Always `approximate`.

                  - `"approximate"`

            - `Mcp`

              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).

              - `server_label: string`

                A label for this MCP server, used to identify it in tool calls.

              - `type: "mcp"`

                The type of the MCP tool. Always `mcp`.

                - `"mcp"`

              - `allowed_callers?: Array<"direct" | "programmatic"> | null`

                The tool invocation context(s).

                - `"direct"`

                - `"programmatic"`

              - `allowed_tools?: Array<string> | McpToolFilter | null`

                List of allowed tool names or a filter object.

                - `Array<string>`

                - `McpToolFilter`

                  A filter object to specify which tools are allowed.

                  - `read_only?: boolean`

                    Indicates whether or not a tool modifies data or is read-only. If an
                    MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint),
                    it will match this filter.

                  - `tool_names?: Array<string>`

                    List of allowed tool names.

              - `authorization?: string`

                An OAuth access token that can be used with a remote MCP server, either
                with a custom MCP server URL or a service connector. Your application
                must handle the OAuth authorization flow and provide the token here.

              - `connector_id?: "connector_dropbox" | "connector_gmail" | "connector_googlecalendar" | 5 more`

                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`

                - `"connector_dropbox"`

                - `"connector_gmail"`

                - `"connector_googlecalendar"`

                - `"connector_googledrive"`

                - `"connector_microsoftteams"`

                - `"connector_outlookcalendar"`

                - `"connector_outlookemail"`

                - `"connector_sharepoint"`

              - `defer_loading?: boolean`

                Whether this MCP tool is deferred and discovered via tool search.

              - `headers?: Record<string, string> | null`

                Optional HTTP headers to send to the MCP server. Use for authentication
                or other purposes.

              - `require_approval?: McpToolApprovalFilter | "always" | "never" | null`

                Specify which of the MCP server's tools require approval.

                - `McpToolApprovalFilter`

                  Specify which of the MCP server's tools require approval. Can be
                  `always`, `never`, or a filter object associated with tools
                  that require approval.

                  - `always?: Always`

                    A filter object to specify which tools are allowed.

                    - `read_only?: boolean`

                      Indicates whether or not a tool modifies data or is read-only. If an
                      MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint),
                      it will match this filter.

                    - `tool_names?: Array<string>`

                      List of allowed tool names.

                  - `never?: Never`

                    A filter object to specify which tools are allowed.

                    - `read_only?: boolean`

                      Indicates whether or not a tool modifies data or is read-only. If an
                      MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint),
                      it will match this filter.

                    - `tool_names?: Array<string>`

                      List of allowed tool names.

                - `"always" | "never"`

                  - `"always"`

                  - `"never"`

              - `server_description?: string`

                Optional description of the MCP server, used to provide more context.

              - `server_url?: string`

                The URL for the MCP server. One of `server_url`, `connector_id`, or
                `tunnel_id` must be provided.

              - `tunnel_id?: string`

                The Secure MCP Tunnel ID to use instead of a direct server URL. One of
                `server_url`, `connector_id`, or `tunnel_id` must be provided.

            - `CodeInterpreter`

              A tool that runs Python code to help generate a response to a prompt.

              - `container: string | CodeInterpreterToolAuto`

                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`

                - `CodeInterpreterToolAuto`

                  Configuration for a code interpreter container. Optionally specify the IDs of the files to run the code on.

                  - `type: "auto"`

                    Always `auto`.

                    - `"auto"`

                  - `file_ids?: Array<string>`

                    An optional list of uploaded files to make available to your code.

                  - `memory_limit?: "1g" | "4g" | "16g" | "64g" | null`

                    The memory limit for the code interpreter container.

                    - `"1g"`

                    - `"4g"`

                    - `"16g"`

                    - `"64g"`

                  - `network_policy?: BetaContainerNetworkPolicyDisabled | BetaContainerNetworkPolicyAllowlist`

                    Network access policy for the container.

                    - `BetaContainerNetworkPolicyDisabled`

                      - `type: "disabled"`

                        Disable outbound network access. Always `disabled`.

                        - `"disabled"`

                    - `BetaContainerNetworkPolicyAllowlist`

                      - `allowed_domains: Array<string>`

                        A list of allowed domains when type is `allowlist`.

                      - `type: "allowlist"`

                        Allow outbound network access only to specified domains. Always `allowlist`.

                        - `"allowlist"`

                      - `domain_secrets?: Array<BetaContainerNetworkPolicyDomainSecret>`

                        Optional domain-scoped secrets for allowlisted domains.

                        - `domain: string`

                          The domain associated with the secret.

                        - `name: string`

                          The name of the secret to inject for the domain.

                        - `value: string`

                          The secret value to inject for the domain.

              - `type: "code_interpreter"`

                The type of the code interpreter tool. Always `code_interpreter`.

                - `"code_interpreter"`

              - `allowed_callers?: Array<"direct" | "programmatic"> | null`

                The tool invocation context(s).

                - `"direct"`

                - `"programmatic"`

            - `ProgrammaticToolCalling`

              - `type: "programmatic_tool_calling"`

                The type of the tool. Always `programmatic_tool_calling`.

                - `"programmatic_tool_calling"`

            - `ImageGeneration`

              A tool that generates images using the GPT image models.

              - `type: "image_generation"`

                The type of the image generation tool. Always `image_generation`.

                - `"image_generation"`

              - `action?: "generate" | "edit" | "auto"`

                Whether to generate a new image or edit an existing image. Default: `auto`.

                - `"generate"`

                - `"edit"`

                - `"auto"`

              - `background?: "transparent" | "opaque" | "auto"`

                Allows to set transparency for the background of the generated image(s).
                Must be one of `transparent`, `opaque`, or `auto` (default value). When
                `auto` is used, the model will automatically determine the best
                background for the image.

                Transparent backgrounds are available for supported GPT Image models.
                For `gpt-image-2` and `gpt-image-2-2026-04-21`, this support is in
                preview. When using `transparent`, set the output format to `png` or
                `webp`.

                - `"transparent"`

                - `"opaque"`

                - `"auto"`

              - `input_fidelity?: "high" | "low" | null`

                Control how much effort the model will exert to match the style and features, especially facial features, of input images. This parameter is only supported for `gpt-image-1` and `gpt-image-1.5` and later models, unsupported for `gpt-image-1-mini`. Supports `high` and `low`. Defaults to `low`.

                - `"high"`

                - `"low"`

              - `input_image_mask?: InputImageMask`

                Optional mask for inpainting. Contains `image_url`
                (string, optional) and `file_id` (string, optional).

                - `file_id?: string`

                  File ID for the mask image.

                - `image_url?: string`

                  Base64-encoded mask image.

              - `model?: (string & {}) | "gpt-image-1" | "gpt-image-1-mini" | "gpt-image-2" | 3 more`

                The image generation model to use. One of `gpt-image-1`,
                `gpt-image-1-mini`, `gpt-image-1.5`, `gpt-image-2`,
                `gpt-image-2-2026-04-21`, or `chatgpt-image-latest`. Default:
                `gpt-image-1`.

                - `(string & {})`

                - `"gpt-image-1" | "gpt-image-1-mini" | "gpt-image-2" | 3 more`

                  - `"gpt-image-1"`

                  - `"gpt-image-1-mini"`

                  - `"gpt-image-2"`

                  - `"gpt-image-2-2026-04-21"`

                  - `"gpt-image-1.5"`

                  - `"chatgpt-image-latest"`

              - `moderation?: "auto" | "low"`

                Moderation level for the generated image. Default: `auto`.

                - `"auto"`

                - `"low"`

              - `output_compression?: number`

                Compression level for the output image. Default: 100.

              - `output_format?: "png" | "webp" | "jpeg"`

                The output format of the generated image. One of `png`, `webp`, or
                `jpeg`. Default: `png`.

                - `"png"`

                - `"webp"`

                - `"jpeg"`

              - `partial_images?: number`

                Number of partial images to generate in streaming mode, from 0 (default value) to 3.

              - `quality?: "low" | "medium" | "high" | "auto"`

                The quality of the generated image. One of `low`, `medium`, `high`,
                or `auto`. Default: `auto`.

                - `"low"`

                - `"medium"`

                - `"high"`

                - `"auto"`

              - `size?: (string & {}) | "1024x1024" | "1024x1536" | "1536x1024" | "auto"`

                The size of the generated images. For `gpt-image-2` and `gpt-image-2-2026-04-21`, arbitrary resolutions are supported as `WIDTHxHEIGHT` strings, for example `1536x864`. Width and height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above `2560x1440` are experimental, and the maximum supported resolution is `3840x2160`. The requested size must also satisfy the model's current pixel and edge limits. The standard sizes `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models; `auto` is supported for models that allow automatic sizing. For `dall-e-2`, use one of `256x256`, `512x512`, or `1024x1024`. For `dall-e-3`, use one of `1024x1024`, `1792x1024`, or `1024x1792`.

                - `(string & {})`

                - `"1024x1024" | "1024x1536" | "1536x1024" | "auto"`

                  - `"1024x1024"`

                  - `"1024x1536"`

                  - `"1536x1024"`

                  - `"auto"`

            - `LocalShell`

              A tool that allows the model to execute shell commands in a local environment.

              - `type: "local_shell"`

                The type of the local shell tool. Always `local_shell`.

                - `"local_shell"`

            - `BetaFunctionShellTool`

              A tool that allows the model to execute shell commands.

              - `type: "shell"`

                The type of the shell tool. Always `shell`.

                - `"shell"`

              - `allowed_callers?: Array<"direct" | "programmatic"> | null`

                The tool invocation context(s).

                - `"direct"`

                - `"programmatic"`

              - `environment?: BetaContainerAuto | BetaLocalEnvironment | BetaContainerReference | null`

                - `BetaContainerAuto`

                  - `type: "container_auto"`

                    Automatically creates a container for this request

                    - `"container_auto"`

                  - `file_ids?: Array<string>`

                    An optional list of uploaded files to make available to your code.

                  - `memory_limit?: "1g" | "4g" | "16g" | "64g" | null`

                    The memory limit for the container.

                    - `"1g"`

                    - `"4g"`

                    - `"16g"`

                    - `"64g"`

                  - `network_policy?: BetaContainerNetworkPolicyDisabled | BetaContainerNetworkPolicyAllowlist`

                    Network access policy for the container.

                    - `BetaContainerNetworkPolicyDisabled`

                    - `BetaContainerNetworkPolicyAllowlist`

                  - `skills?: Array<BetaSkillReference | BetaInlineSkill>`

                    An optional list of skills referenced by id or inline data.

                    - `BetaSkillReference`

                      - `skill_id: string`

                        The ID of the referenced skill.

                      - `type: "skill_reference"`

                        References a skill created with the /v1/skills endpoint.

                        - `"skill_reference"`

                      - `version?: string`

                        Optional skill version. Use a positive integer or 'latest'. Omit for default.

                    - `BetaInlineSkill`

                      - `description: string`

                        The description of the skill.

                      - `name: string`

                        The name of the skill.

                      - `source: BetaInlineSkillSource`

                        Inline skill payload

                        - `data: string`

                          Base64-encoded skill zip bundle.

                        - `media_type: "application/zip"`

                          The media type of the inline skill payload. Must be `application/zip`.

                          - `"application/zip"`

                        - `type: "base64"`

                          The type of the inline skill source. Must be `base64`.

                          - `"base64"`

                      - `type: "inline"`

                        Defines an inline skill for this request.

                        - `"inline"`

                - `BetaLocalEnvironment`

                  - `type: "local"`

                    Use a local computer environment.

                    - `"local"`

                  - `skills?: Array<BetaLocalSkill>`

                    An optional list of skills.

                    - `description: string`

                      The description of the skill.

                    - `name: string`

                      The name of the skill.

                    - `path: string`

                      The path to the directory containing the skill.

                - `BetaContainerReference`

                  - `container_id: string`

                    The ID of the referenced container.

                  - `type: "container_reference"`

                    References a container created with the /v1/containers endpoint

                    - `"container_reference"`

            - `BetaCustomTool`

              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)

              - `name: string`

                The name of the custom tool, used to identify it in tool calls.

              - `type: "custom"`

                The type of the custom tool. Always `custom`.

                - `"custom"`

              - `allowed_callers?: Array<"direct" | "programmatic"> | null`

                The tool invocation context(s).

                - `"direct"`

                - `"programmatic"`

              - `defer_loading?: boolean`

                Whether this tool should be deferred and discovered via tool search.

              - `description?: string`

                Optional description of the custom tool, used to provide more context.

              - `format?: Text | Grammar`

                The input format for the custom tool. Default is unconstrained text.

                - `Text`

                  Unconstrained free-form text.

                  - `type: "text"`

                    Unconstrained text format. Always `text`.

                    - `"text"`

                - `Grammar`

                  A grammar defined by the user.

                  - `definition: string`

                    The grammar definition.

                  - `syntax: "lark" | "regex"`

                    The syntax of the grammar definition. One of `lark` or `regex`.

                    - `"lark"`

                    - `"regex"`

                  - `type: "grammar"`

                    Grammar format. Always `grammar`.

                    - `"grammar"`

            - `BetaNamespaceTool`

              Groups function/custom tools under a shared namespace.

              - `description: string`

                A description of the namespace shown to the model.

              - `name: string`

                The namespace name used in tool calls (for example, `crm`).

              - `tools: Array<Function | BetaCustomTool>`

                The function/custom tools available inside this namespace.

                - `Function`

                  - `name: string`

                  - `type: "function"`

                    - `"function"`

                  - `allowed_callers?: Array<"direct" | "programmatic"> | null`

                    The tool invocation context(s).

                    - `"direct"`

                    - `"programmatic"`

                  - `defer_loading?: boolean`

                    Whether this function should be deferred and discovered via tool search.

                  - `description?: string | null`

                  - `output_schema?: Record<string, unknown> | null`

                    A JSON Schema describing the JSON value encoded in string outputs for this function tool. This does not describe content-array outputs.

                  - `parameters?: unknown`

                  - `strict?: boolean | null`

                    Whether to enforce strict parameter validation. If omitted, Responses attempts to use strict validation when the schema is compatible, and falls back to non-strict validation otherwise.

                - `BetaCustomTool`

                  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: "namespace"`

                The type of the tool. Always `namespace`.

                - `"namespace"`

            - `BetaToolSearchTool`

              Hosted or BYOT tool search configuration for deferred tools.

              - `type: "tool_search"`

                The type of the tool. Always `tool_search`.

                - `"tool_search"`

              - `description?: string | null`

                Description shown to the model for a client-executed tool search tool.

              - `execution?: "server" | "client"`

                Whether tool search is executed by the server or by the client.

                - `"server"`

                - `"client"`

              - `parameters?: unknown`

                Parameter schema for a client-executed tool search tool.

            - `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"`

                The type of the web search tool. One of `web_search_preview` or `web_search_preview_2025_03_11`.

                - `"web_search_preview"`

                - `"web_search_preview_2025_03_11"`

              - `search_content_types?: Array<"text" | "image">`

                - `"text"`

                - `"image"`

              - `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.

                - `"low"`

                - `"medium"`

                - `"high"`

              - `user_location?: UserLocation | null`

                The user's location.

                - `type: "approximate"`

                  The type of location approximation. Always `approximate`.

                  - `"approximate"`

                - `city?: string | null`

                  Free text input for the city of the user, e.g. `San Francisco`.

                - `country?: string | null`

                  The two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of the user, e.g. `US`.

                - `region?: string | null`

                  Free text input for the region of the user, e.g. `California`.

                - `timezone?: string | null`

                  The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of the user, e.g. `America/Los_Angeles`.

            - `BetaApplyPatchTool`

              Allows the assistant to create, delete, or update files using unified diffs.

              - `type: "apply_patch"`

                The type of the tool. Always `apply_patch`.

                - `"apply_patch"`

              - `allowed_callers?: Array<"direct" | "programmatic"> | null`

                The tool invocation context(s).

                - `"direct"`

                - `"programmatic"`

          - `type: "tool_search_output"`

            The item type. Always `tool_search_output`.

            - `"tool_search_output"`

          - `id?: string | null`

            The unique ID of this tool search output.

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

          - `call_id?: string | null`

            The unique ID of the tool search call generated by the model.

          - `execution?: "server" | "client"`

            Whether tool search was executed by the server or by the client.

            - `"server"`

            - `"client"`

          - `status?: "in_progress" | "completed" | "incomplete" | null`

            The status of the tool search output.

            - `"in_progress"`

            - `"completed"`

            - `"incomplete"`

        - `AdditionalTools`

          - `role: "developer"`

            The role that provided the additional tools. Only `developer` is supported.

            - `"developer"`

          - `tools: Array<BetaTool>`

            A list of additional tools made available at this item.

            - `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).

            - `Mcp`

              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).

            - `CodeInterpreter`

              A tool that runs Python code to help generate a response to a prompt.

            - `ProgrammaticToolCalling`

            - `ImageGeneration`

              A tool that generates images using the GPT image models.

            - `LocalShell`

              A tool that allows the model to execute shell commands in a local environment.

            - `BetaFunctionShellTool`

              A tool that allows the model to execute shell commands.

            - `BetaCustomTool`

              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)

            - `BetaNamespaceTool`

              Groups function/custom tools under a shared namespace.

            - `BetaToolSearchTool`

              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).

            - `BetaApplyPatchTool`

              Allows the assistant to create, delete, or update files using unified diffs.

          - `type: "additional_tools"`

            The item type. Always `additional_tools`.

            - `"additional_tools"`

          - `id?: string | null`

            The unique ID of this additional tools item.

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

        - `BetaResponseReasoningItem`

          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).

          - `id: string`

            The unique identifier of the reasoning content.

          - `summary: Array<Summary>`

            Reasoning summary content.

            - `text: string`

              A summary of the reasoning output from the model so far.

            - `type: "summary_text"`

              The type of the object. Always `summary_text`.

              - `"summary_text"`

          - `type: "reasoning"`

            The type of the object. Always `reasoning`.

            - `"reasoning"`

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

          - `content?: Array<Content>`

            Reasoning text content.

            - `text: string`

              The reasoning text from the model.

            - `type: "reasoning_text"`

              The type of the reasoning text. Always `reasoning_text`.

              - `"reasoning_text"`

          - `encrypted_content?: string | null`

            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.

            When streaming, use the completed reasoning item and its
            `encrypted_content` from the `response.output_item.done` event in
            subsequent requests. The `encrypted_content` in
            `response.output_item.added` may be incomplete. This is especially
            important when `store` is `false` or when using Zero Data Retention.

          - `status?: "in_progress" | "completed" | "incomplete"`

            The status of the item. One of `in_progress`, `completed`, or
            `incomplete`. Populated when items are returned via API.

            - `"in_progress"`

            - `"completed"`

            - `"incomplete"`

        - `BetaResponseCompactionItemParam`

          A compaction item generated by the [`v1/responses/compact` API](https://platform.openai.com/docs/api-reference/responses/compact).

          - `encrypted_content: string`

            The encrypted content of the compaction summary.

          - `type: "compaction"`

            The type of the item. Always `compaction`.

            - `"compaction"`

          - `id?: string | null`

            The ID of the compaction item.

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

        - `ImageGenerationCall`

          An image generation request made by the model.

          - `id: string`

            The unique ID of the image generation call.

          - `result: string | null`

            The generated image encoded in base64.

          - `status: "in_progress" | "completed" | "generating" | "failed"`

            The status of the image generation call.

            - `"in_progress"`

            - `"completed"`

            - `"generating"`

            - `"failed"`

          - `type: "image_generation_call"`

            The type of the image generation call. Always `image_generation_call`.

            - `"image_generation_call"`

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

        - `BetaResponseCodeInterpreterToolCall`

          A tool call to run code.

          - `id: string`

            The unique ID of the code interpreter tool call.

          - `code: string | null`

            The code to run, or null if not available.

          - `container_id: string`

            The ID of the container used to run the code.

          - `outputs: Array<Logs | Image> | null`

            The outputs generated by the code interpreter, such as logs or images.
            Can be null if no outputs are available.

            - `Logs`

              The logs output from the code interpreter.

              - `logs: string`

                The logs output from the code interpreter.

              - `type: "logs"`

                The type of the output. Always `logs`.

                - `"logs"`

            - `Image`

              The image output from the code interpreter.

              - `type: "image"`

                The type of the output. Always `image`.

                - `"image"`

              - `url: string`

                The URL of the image output from the code interpreter.

          - `status: "in_progress" | "completed" | "incomplete" | 2 more`

            The status of the code interpreter tool call. Valid values are `in_progress`, `completed`, `incomplete`, `interpreting`, and `failed`.

            - `"in_progress"`

            - `"completed"`

            - `"incomplete"`

            - `"interpreting"`

            - `"failed"`

          - `type: "code_interpreter_call"`

            The type of the code interpreter tool call. Always `code_interpreter_call`.

            - `"code_interpreter_call"`

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

        - `LocalShellCall`

          A tool call to run a command on the local shell.

          - `id: string`

            The unique ID of the local shell call.

          - `action: Action`

            Execute a shell command on the server.

            - `command: Array<string>`

              The command to run.

            - `env: Record<string, string>`

              Environment variables to set for the command.

            - `type: "exec"`

              The type of the local shell action. Always `exec`.

              - `"exec"`

            - `timeout_ms?: number | null`

              Optional timeout in milliseconds for the command.

            - `user?: string | null`

              Optional user to run the command as.

            - `working_directory?: string | null`

              Optional working directory to run the command in.

          - `call_id: string`

            The unique ID of the local shell tool call generated by the model.

          - `status: "in_progress" | "completed" | "incomplete"`

            The status of the local shell call.

            - `"in_progress"`

            - `"completed"`

            - `"incomplete"`

          - `type: "local_shell_call"`

            The type of the local shell call. Always `local_shell_call`.

            - `"local_shell_call"`

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

        - `LocalShellCallOutput`

          The output of a local shell tool call.

          - `id: string`

            The unique ID of the local shell tool call generated by the model.

          - `output: string`

            A JSON string of the output of the local shell tool call.

          - `type: "local_shell_call_output"`

            The type of the local shell tool call output. Always `local_shell_call_output`.

            - `"local_shell_call_output"`

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

          - `status?: "in_progress" | "completed" | "incomplete" | null`

            The status of the item. One of `in_progress`, `completed`, or `incomplete`.

            - `"in_progress"`

            - `"completed"`

            - `"incomplete"`

        - `ShellCall`

          A tool representing a request to execute one or more shell commands.

          - `action: Action`

            The shell commands and limits that describe how to run the tool call.

            - `commands: Array<string>`

              Ordered shell commands for the execution environment to run.

            - `max_output_length?: number | null`

              Maximum number of UTF-8 characters to capture from combined stdout and stderr output.

            - `timeout_ms?: number | null`

              Maximum wall-clock time in milliseconds to allow the shell commands to run.

          - `call_id: string`

            The unique ID of the shell tool call generated by the model.

          - `type: "shell_call"`

            The type of the item. Always `shell_call`.

            - `"shell_call"`

          - `id?: string | null`

            The unique ID of the shell tool call. Populated when this item is returned via API.

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

          - `caller?: Direct | Program | null`

            The execution context that produced this tool call.

            - `Direct`

              - `type: "direct"`

                The caller type. Always `direct`.

                - `"direct"`

            - `Program`

              - `caller_id: string`

                The call ID of the program item that produced this tool call.

              - `type: "program"`

                The caller type. Always `program`.

                - `"program"`

          - `environment?: BetaLocalEnvironment | BetaContainerReference | null`

            The environment to execute the shell commands in.

            - `BetaLocalEnvironment`

            - `BetaContainerReference`

          - `status?: "in_progress" | "completed" | "incomplete" | null`

            The status of the shell call. One of `in_progress`, `completed`, or `incomplete`.

            - `"in_progress"`

            - `"completed"`

            - `"incomplete"`

        - `ShellCallOutput`

          The streamed output items emitted by a shell tool call.

          - `call_id: string`

            The unique ID of the shell tool call generated by the model.

          - `output: Array<BetaResponseFunctionShellCallOutputContent>`

            Captured chunks of stdout and stderr output, along with their associated outcomes.

            - `outcome: Timeout | Exit`

              The exit or timeout outcome associated with this shell call.

              - `Timeout`

                Indicates that the shell call exceeded its configured time limit.

                - `type: "timeout"`

                  The outcome type. Always `timeout`.

                  - `"timeout"`

              - `Exit`

                Indicates that the shell commands finished and returned an exit code.

                - `exit_code: number`

                  The exit code returned by the shell process.

                - `type: "exit"`

                  The outcome type. Always `exit`.

                  - `"exit"`

            - `stderr: string`

              Captured stderr output for the shell call.

            - `stdout: string`

              Captured stdout output for the shell call.

          - `type: "shell_call_output"`

            The type of the item. Always `shell_call_output`.

            - `"shell_call_output"`

          - `id?: string | null`

            The unique ID of the shell tool call output. Populated when this item is returned via API.

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

          - `caller?: Direct | Program | null`

            The execution context that produced this tool call.

            - `Direct`

              - `type: "direct"`

                The caller type. Always `direct`.

                - `"direct"`

            - `Program`

              - `caller_id: string`

                The call ID of the program item that produced this tool call.

              - `type: "program"`

                The caller type. Always `program`.

                - `"program"`

          - `max_output_length?: number | null`

            The maximum number of UTF-8 characters captured for this shell call's combined output.

          - `status?: "in_progress" | "completed" | "incomplete" | null`

            The status of the shell call output.

            - `"in_progress"`

            - `"completed"`

            - `"incomplete"`

        - `ApplyPatchCall`

          A tool call representing a request to create, delete, or update files using diff patches.

          - `call_id: string`

            The unique ID of the apply patch tool call generated by the model.

          - `operation: CreateFile | DeleteFile | UpdateFile`

            The specific create, delete, or update instruction for the apply_patch tool call.

            - `CreateFile`

              Instruction for creating a new file via the apply_patch tool.

              - `diff: string`

                Unified diff content to apply when creating the file.

              - `path: string`

                Path of the file to create relative to the workspace root.

              - `type: "create_file"`

                The operation type. Always `create_file`.

                - `"create_file"`

            - `DeleteFile`

              Instruction for deleting an existing file via the apply_patch tool.

              - `path: string`

                Path of the file to delete relative to the workspace root.

              - `type: "delete_file"`

                The operation type. Always `delete_file`.

                - `"delete_file"`

            - `UpdateFile`

              Instruction for updating an existing file via the apply_patch tool.

              - `diff: string`

                Unified diff content to apply to the existing file.

              - `path: string`

                Path of the file to update relative to the workspace root.

              - `type: "update_file"`

                The operation type. Always `update_file`.

                - `"update_file"`

          - `status: "in_progress" | "completed"`

            The status of the apply patch tool call. One of `in_progress` or `completed`.

            - `"in_progress"`

            - `"completed"`

          - `type: "apply_patch_call"`

            The type of the item. Always `apply_patch_call`.

            - `"apply_patch_call"`

          - `id?: string | null`

            The unique ID of the apply patch tool call. Populated when this item is returned via API.

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

          - `caller?: Direct | Program | null`

            The execution context that produced this tool call.

            - `Direct`

              - `type: "direct"`

                The caller type. Always `direct`.

                - `"direct"`

            - `Program`

              - `caller_id: string`

                The call ID of the program item that produced this tool call.

              - `type: "program"`

                The caller type. Always `program`.

                - `"program"`

        - `ApplyPatchCallOutput`

          The streamed output emitted by an apply patch tool call.

          - `call_id: string`

            The unique ID of the apply patch tool call generated by the model.

          - `status: "completed" | "failed"`

            The status of the apply patch tool call output. One of `completed` or `failed`.

            - `"completed"`

            - `"failed"`

          - `type: "apply_patch_call_output"`

            The type of the item. Always `apply_patch_call_output`.

            - `"apply_patch_call_output"`

          - `id?: string | null`

            The unique ID of the apply patch tool call output. Populated when this item is returned via API.

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

          - `caller?: Direct | Program | null`

            The execution context that produced this tool call.

            - `Direct`

              - `type: "direct"`

                The caller type. Always `direct`.

                - `"direct"`

            - `Program`

              - `caller_id: string`

                The call ID of the program item that produced this tool call.

              - `type: "program"`

                The caller type. Always `program`.

                - `"program"`

          - `output?: string | null`

            Optional human-readable log text from the apply patch tool (e.g., patch results or errors).

        - `McpListTools`

          A list of tools available on an MCP server.

          - `id: string`

            The unique ID of the list.

          - `server_label: string`

            The label of the MCP server.

          - `tools: Array<Tool>`

            The tools available on the server.

            - `input_schema: unknown`

              The JSON schema describing the tool's input.

            - `name: string`

              The name of the tool.

            - `annotations?: unknown`

              Additional annotations about the tool.

            - `description?: string | null`

              The description of the tool.

          - `type: "mcp_list_tools"`

            The type of the item. Always `mcp_list_tools`.

            - `"mcp_list_tools"`

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

          - `error?: string | null`

            Error message if the server could not list tools.

        - `McpApprovalRequest`

          A request for human approval of a tool invocation.

          - `id: string`

            The unique ID of the approval request.

          - `arguments: string`

            A JSON string of arguments for the tool.

          - `name: string`

            The name of the tool to run.

          - `server_label: string`

            The label of the MCP server making the request.

          - `type: "mcp_approval_request"`

            The type of the item. Always `mcp_approval_request`.

            - `"mcp_approval_request"`

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

        - `McpApprovalResponse`

          A response to an MCP approval request.

          - `approval_request_id: string`

            The ID of the approval request being answered.

          - `approve: boolean`

            Whether the request was approved.

          - `type: "mcp_approval_response"`

            The type of the item. Always `mcp_approval_response`.

            - `"mcp_approval_response"`

          - `id?: string | null`

            The unique ID of the approval response

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

          - `reason?: string | null`

            Optional reason for the decision.

        - `McpCall`

          An invocation of a tool on an MCP server.

          - `id: string`

            The unique ID of the tool call.

          - `arguments: string`

            A JSON string of the arguments passed to the tool.

          - `name: string`

            The name of the tool that was run.

          - `server_label: string`

            The label of the MCP server running the tool.

          - `type: "mcp_call"`

            The type of the item. Always `mcp_call`.

            - `"mcp_call"`

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

          - `approval_request_id?: string | null`

            Unique identifier for the MCP tool call approval request.
            Include this value in a subsequent `mcp_approval_response` input to approve or reject the corresponding tool call.

          - `error?: BetaMcpToolCallError | null`

            The error from the tool call, if any.

            - `McpProtocolError`

              - `code: number`

              - `message: string`

              - `type: "mcp_protocol_error"`

                - `"mcp_protocol_error"`

            - `McpToolExecutionError`

              - `content: unknown`

              - `type: "mcp_tool_execution_error"`

                - `"mcp_tool_execution_error"`

            - `HTTPError`

              - `code: number`

              - `message: string`

              - `type: "http_error"`

                - `"http_error"`

          - `output?: string | null`

            The output from the tool call.

          - `status?: "in_progress" | "completed" | "incomplete" | 2 more`

            The status of the tool call. One of `in_progress`, `completed`, `incomplete`, `calling`, or `failed`.

            - `"in_progress"`

            - `"completed"`

            - `"incomplete"`

            - `"calling"`

            - `"failed"`

        - `BetaResponseCustomToolCallOutput`

          The output of a custom tool call from your code, being sent back to the model.

          - `call_id: string`

            The call ID, used to map this custom tool call output to a custom tool call.

          - `output: string | Array<BetaResponseInputText | BetaResponseInputImage | BetaResponseInputFile>`

            The output from the custom tool call generated by your code.
            Can be a string or an list of output content.

            - `string`

            - `Array<BetaResponseInputText | BetaResponseInputImage | BetaResponseInputFile>`

              - `BetaResponseInputText`

                A text input to the model.

              - `BetaResponseInputImage`

                An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision).

              - `BetaResponseInputFile`

                A file input to the model.

          - `type: "custom_tool_call_output"`

            The type of the custom tool call output. Always `custom_tool_call_output`.

            - `"custom_tool_call_output"`

          - `id?: string`

            The unique ID of the custom tool call output in the OpenAI platform.

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

          - `caller?: Direct | Program | null`

            The execution context that produced this tool call.

            - `Direct`

              - `type: "direct"`

                The caller type. Always `direct`.

                - `"direct"`

            - `Program`

              - `caller_id: string`

                The call ID of the program item that produced this tool call.

              - `type: "program"`

                The caller type. Always `program`.

                - `"program"`

        - `BetaResponseCustomToolCall`

          A call to a custom tool created by the model.

          - `call_id: string`

            An identifier used to map this custom tool call to a tool call output.

          - `input: string`

            The input for the custom tool call generated by the model.

          - `name: string`

            The name of the custom tool being called.

          - `type: "custom_tool_call"`

            The type of the custom tool call. Always `custom_tool_call`.

            - `"custom_tool_call"`

          - `id?: string`

            The unique ID of the custom tool call in the OpenAI platform.

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

          - `caller?: Direct | Program | null`

            The execution context that produced this tool call.

            - `Direct`

              - `type: "direct"`

                - `"direct"`

            - `Program`

              - `caller_id: string`

                The call ID of the program item that produced this tool call.

              - `type: "program"`

                - `"program"`

          - `namespace?: string`

            The namespace of the custom tool being called.

        - `CompactionTrigger`

          Compacts the current context. Must be the final input item.

          - `type: "compaction_trigger"`

            The type of the item. Always `compaction_trigger`.

            - `"compaction_trigger"`

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

        - `ItemReference`

          An internal identifier for an item to reference.

          - `id: string`

            The ID of the item to reference.

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

          - `type?: "item_reference" | null`

            The type of item to reference. Always `item_reference`.

            - `"item_reference"`

        - `Program`

          - `id: string`

            The unique ID of this program item.

          - `call_id: string`

            The stable call ID of the program item.

          - `code: string`

            The JavaScript source executed by programmatic tool calling.

          - `fingerprint: string`

            Opaque program replay fingerprint that must be round-tripped.

          - `type: "program"`

            The item type. Always `program`.

            - `"program"`

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

        - `ProgramOutput`

          - `id: string`

            The unique ID of this program output item.

          - `call_id: string`

            The call ID of the program item.

          - `result: string`

            The result produced by the program item.

          - `status: "completed" | "incomplete"`

            The terminal status of the program output.

            - `"completed"`

            - `"incomplete"`

          - `type: "program_output"`

            The item type. Always `program_output`.

            - `"program_output"`

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

    - `metadata: Record<string, string> | null`

      Set of 16 key-value pairs that can be attached to an object. This can be
      useful for storing additional information about the object in a structured
      format, and querying for objects via API or the dashboard.

      Keys are strings with a maximum length of 64 characters. Values are strings
      with a maximum length of 512 characters.

    - `model: "gpt-5.6-sol" | "gpt-5.6-terra" | "gpt-5.6-luna" | 99 more | (string & {})`

      Model ID used to generate the response, like `gpt-4o` or `o3`. OpenAI
      offers a wide range of models with different capabilities, performance
      characteristics, and price points. Refer to the [model guide](https://platform.openai.com/docs/models)
      to browse and compare available models.

      - `"gpt-5.6-sol" | "gpt-5.6-terra" | "gpt-5.6-luna" | 99 more`

        - `"gpt-5.6-sol"`

        - `"gpt-5.6-terra"`

        - `"gpt-5.6-luna"`

        - `"gpt-5.5"`

        - `"gpt-5.5-2026-04-23"`

        - `"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.5-pro"`

        - `"gpt-5.5-pro-2026-04-23"`

        - `"gpt-5-codex"`

        - `"gpt-5-pro"`

        - `"gpt-5-pro-2025-10-06"`

        - `"gpt-5.1-codex-max"`

        - `"gpt-daybreak-blue-latest"`

        - `"gpt-daybreak-red-latest"`

        - `"gpt-5.6-cyber"`

      - `(string & {})`

    - `object: "response"`

      The object type of this resource - always set to `response`.

      - `"response"`

    - `output: Array<BetaResponseOutputItem>`

      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.

      - `BetaResponseOutputMessage`

        An output message from the model.

      - `BetaResponseFileSearchToolCall`

        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.

      - `BetaResponseFunctionToolCall`

        A tool call to run a function. See the
        [function calling guide](https://platform.openai.com/docs/guides/function-calling) for more information.

      - `BetaResponseFunctionToolCallOutputItem`

        - `id: string`

          The unique ID of the function call tool output.

        - `call_id: string`

          The unique ID of the function tool call generated by the model.

        - `output: string | Array<BetaResponseInputText | BetaResponseInputImage | BetaResponseInputFile>`

          The output from the function call generated by your code.
          Can be a string or an list of output content.

          - `string`

          - `Array<BetaResponseInputText | BetaResponseInputImage | BetaResponseInputFile>`

            - `BetaResponseInputText`

              A text input to the model.

            - `BetaResponseInputImage`

              An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision).

            - `BetaResponseInputFile`

              A file input to 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.

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

        - `type: "function_call_output"`

          The type of the function tool call output. Always `function_call_output`.

          - `"function_call_output"`

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `caller?: Direct | Program | null`

          The execution context that produced this tool call.

          - `Direct`

            - `type: "direct"`

              The caller type. Always `direct`.

              - `"direct"`

          - `Program`

            - `caller_id: string`

              The call ID of the program item that produced this tool call.

            - `type: "program"`

              The caller type. Always `program`.

              - `"program"`

        - `created_by?: string`

          The identifier of the actor that created the item.

        - `name?: string`

          The name of the tool that produced the output.

        - `namespace?: string`

          The namespace of the tool that produced the output.

      - `AgentMessage`

        - `id: string`

          The unique ID of the agent message.

        - `author: string`

          The sending agent identity.

        - `content: Array<BetaResponseInputText | BetaResponseOutputText | Text | 7 more>`

          Encrypted content sent between agents.

          - `BetaResponseInputText`

            A text input to the model.

          - `BetaResponseOutputText`

            A text output from the model.

          - `Text`

            A text content.

            - `text: string`

            - `type: "text"`

              - `"text"`

          - `SummaryText`

            A summary text from the model.

            - `text: string`

              A summary of the reasoning output from the model so far.

            - `type: "summary_text"`

              The type of the object. Always `summary_text`.

              - `"summary_text"`

          - `ReasoningText`

            Reasoning text from the model.

            - `text: string`

              The reasoning text from the model.

            - `type: "reasoning_text"`

              The type of the reasoning text. Always `reasoning_text`.

              - `"reasoning_text"`

          - `BetaResponseOutputRefusal`

            A refusal from the model.

          - `BetaResponseInputImage`

            An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision).

          - `ComputerScreenshot`

            A screenshot of a computer.

            - `detail: BetaImageDetail`

              The detail level of the screenshot image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`.

            - `file_id: string | null`

              The identifier of an uploaded file that contains the screenshot.

            - `image_url: string | null`

              The URL of the screenshot image.

            - `type: "computer_screenshot"`

              Specifies the event type. For a computer screenshot, this property is always set to `computer_screenshot`.

              - `"computer_screenshot"`

            - `prompt_cache_breakpoint?: PromptCacheBreakpoint`

              Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.

              - `mode: "explicit"`

                The breakpoint mode. Always `explicit`.

                - `"explicit"`

          - `BetaResponseInputFile`

            A file input to the model.

          - `EncryptedContent`

            Opaque encrypted content that Responses API decrypts inside trusted model execution.

            - `encrypted_content: string`

              Opaque encrypted content.

            - `type: "encrypted_content"`

              The type of the input item. Always `encrypted_content`.

              - `"encrypted_content"`

        - `recipient: string`

          The destination agent identity.

        - `type: "agent_message"`

          The type of the item. Always `agent_message`.

          - `"agent_message"`

        - `agent?: Agent`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

      - `MultiAgentCall`

        - `id: string`

          The unique ID of the multi-agent call item.

        - `action: "spawn_agent" | "interrupt_agent" | "list_agents" | 3 more`

          The multi-agent action to execute.

          - `"spawn_agent"`

          - `"interrupt_agent"`

          - `"list_agents"`

          - `"send_message"`

          - `"followup_task"`

          - `"wait_agent"`

        - `arguments: string`

          The JSON string of arguments generated for the action.

        - `call_id: string`

          The unique ID linking this call to its output.

        - `type: "multi_agent_call"`

          The type of the multi-agent call. Always `multi_agent_call`.

          - `"multi_agent_call"`

        - `agent?: Agent`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

      - `MultiAgentCallOutput`

        - `id: string`

          The unique ID of the multi-agent call output item.

        - `action: "spawn_agent" | "interrupt_agent" | "list_agents" | 3 more`

          The multi-agent action that produced this result.

          - `"spawn_agent"`

          - `"interrupt_agent"`

          - `"list_agents"`

          - `"send_message"`

          - `"followup_task"`

          - `"wait_agent"`

        - `call_id: string`

          The unique ID of the multi-agent call.

        - `output: Array<BetaResponseOutputText>`

          Text output returned by the multi-agent action.

          - `annotations: Array<FileCitation | URLCitation | ContainerFileCitation | FilePath>`

            The annotations of the text output.

          - `text: string`

            The text output from the model.

          - `type: "output_text"`

            The type of the output text. Always `output_text`.

          - `logprobs?: Array<Logprob>`

        - `type: "multi_agent_call_output"`

          The type of the multi-agent result. Always `multi_agent_call_output`.

          - `"multi_agent_call_output"`

        - `agent?: Agent`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

      - `BetaResponseFunctionWebSearch`

        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.

      - `BetaResponseComputerToolCall`

        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.

      - `BetaResponseComputerToolCallOutputItem`

        - `id: string`

          The unique ID of the computer call tool output.

        - `call_id: string`

          The ID of the computer tool call that produced the output.

        - `output: BetaResponseComputerToolCallOutputScreenshot`

          A computer screenshot image used with the computer use tool.

        - `status: "completed" | "incomplete" | "failed" | "in_progress"`

          The status of the message input. One of `in_progress`, `completed`, or
          `incomplete`. Populated when input items are returned via API.

          - `"completed"`

          - `"incomplete"`

          - `"failed"`

          - `"in_progress"`

        - `type: "computer_call_output"`

          The type of the computer tool call output. Always `computer_call_output`.

          - `"computer_call_output"`

        - `acknowledged_safety_checks?: Array<AcknowledgedSafetyCheck>`

          The safety checks reported by the API that have been acknowledged by the
          developer.

          - `id: string`

            The ID of the pending safety check.

          - `code?: string | null`

            The type of the pending safety check.

          - `message?: string | null`

            Details about the pending safety check.

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `created_by?: string`

          The identifier of the actor that created the item.

      - `BetaResponseReasoningItem`

        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).

      - `Program`

        - `id: string`

          The unique ID of the program item.

        - `call_id: string`

          The stable call ID of the program item.

        - `code: string`

          The JavaScript source executed by programmatic tool calling.

        - `fingerprint: string`

          Opaque program replay fingerprint that must be round-tripped.

        - `type: "program"`

          The type of the item. Always `program`.

          - `"program"`

        - `agent?: Agent`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

      - `ProgramOutput`

        - `id: string`

          The unique ID of the program output item.

        - `call_id: string`

          The call ID of the program item.

        - `result: string`

          The result produced by the program item.

        - `status: "completed" | "incomplete"`

          The terminal status of the program output item.

          - `"completed"`

          - `"incomplete"`

        - `type: "program_output"`

          The type of the item. Always `program_output`.

          - `"program_output"`

        - `agent?: Agent`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

      - `BetaResponseToolSearchCall`

        - `id: string`

          The unique ID of the tool search call item.

        - `arguments: unknown`

          Arguments used for the tool search call.

        - `call_id: string | null`

          The unique ID of the tool search call generated by the model.

        - `execution: "server" | "client"`

          Whether tool search was executed by the server or by the client.

          - `"server"`

          - `"client"`

        - `status: "in_progress" | "completed" | "incomplete"`

          The status of the tool search call item that was recorded.

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

        - `type: "tool_search_call"`

          The type of the item. Always `tool_search_call`.

          - `"tool_search_call"`

        - `agent?: Agent`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `created_by?: string`

          The identifier of the actor that created the item.

      - `BetaResponseToolSearchOutputItem`

        - `id: string`

          The unique ID of the tool search output item.

        - `call_id: string | null`

          The unique ID of the tool search call generated by the model.

        - `execution: "server" | "client"`

          Whether tool search was executed by the server or by the client.

          - `"server"`

          - `"client"`

        - `status: "in_progress" | "completed" | "incomplete"`

          The status of the tool search output item that was recorded.

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

        - `tools: Array<BetaTool>`

          The loaded tool definitions returned by tool search.

          - `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).

          - `Mcp`

            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).

          - `CodeInterpreter`

            A tool that runs Python code to help generate a response to a prompt.

          - `ProgrammaticToolCalling`

          - `ImageGeneration`

            A tool that generates images using the GPT image models.

          - `LocalShell`

            A tool that allows the model to execute shell commands in a local environment.

          - `BetaFunctionShellTool`

            A tool that allows the model to execute shell commands.

          - `BetaCustomTool`

            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)

          - `BetaNamespaceTool`

            Groups function/custom tools under a shared namespace.

          - `BetaToolSearchTool`

            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).

          - `BetaApplyPatchTool`

            Allows the assistant to create, delete, or update files using unified diffs.

        - `type: "tool_search_output"`

          The type of the item. Always `tool_search_output`.

          - `"tool_search_output"`

        - `agent?: Agent`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `created_by?: string`

          The identifier of the actor that created the item.

      - `AdditionalTools`

        - `id: string`

          The unique ID of the additional tools item.

        - `role: "unknown" | "user" | "assistant" | 5 more`

          The role that provided the additional tools.

          - `"unknown"`

          - `"user"`

          - `"assistant"`

          - `"system"`

          - `"critic"`

          - `"discriminator"`

          - `"developer"`

          - `"tool"`

        - `tools: Array<BetaTool>`

          The additional tool definitions made available at this item.

          - `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).

          - `Mcp`

            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).

          - `CodeInterpreter`

            A tool that runs Python code to help generate a response to a prompt.

          - `ProgrammaticToolCalling`

          - `ImageGeneration`

            A tool that generates images using the GPT image models.

          - `LocalShell`

            A tool that allows the model to execute shell commands in a local environment.

          - `BetaFunctionShellTool`

            A tool that allows the model to execute shell commands.

          - `BetaCustomTool`

            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)

          - `BetaNamespaceTool`

            Groups function/custom tools under a shared namespace.

          - `BetaToolSearchTool`

            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).

          - `BetaApplyPatchTool`

            Allows the assistant to create, delete, or update files using unified diffs.

        - `type: "additional_tools"`

          The type of the item. Always `additional_tools`.

          - `"additional_tools"`

        - `agent?: Agent`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

      - `BetaResponseCompactionItem`

        A compaction item generated by the [`v1/responses/compact` API](https://platform.openai.com/docs/api-reference/responses/compact).

        - `id: string`

          The unique ID of the compaction item.

        - `encrypted_content: string`

          The encrypted content that was produced by compaction.

        - `type: "compaction"`

          The type of the item. Always `compaction`.

          - `"compaction"`

        - `agent?: Agent`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `created_by?: string`

          The identifier of the actor that created the item.

      - `ImageGenerationCall`

        An image generation request made by the model.

        - `id: string`

          The unique ID of the image generation call.

        - `result: string | null`

          The generated image encoded in base64.

        - `status: "in_progress" | "completed" | "generating" | "failed"`

          The status of the image generation call.

          - `"in_progress"`

          - `"completed"`

          - `"generating"`

          - `"failed"`

        - `type: "image_generation_call"`

          The type of the image generation call. Always `image_generation_call`.

          - `"image_generation_call"`

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

      - `BetaResponseCodeInterpreterToolCall`

        A tool call to run code.

      - `LocalShellCall`

        A tool call to run a command on the local shell.

        - `id: string`

          The unique ID of the local shell call.

        - `action: Action`

          Execute a shell command on the server.

          - `command: Array<string>`

            The command to run.

          - `env: Record<string, string>`

            Environment variables to set for the command.

          - `type: "exec"`

            The type of the local shell action. Always `exec`.

            - `"exec"`

          - `timeout_ms?: number | null`

            Optional timeout in milliseconds for the command.

          - `user?: string | null`

            Optional user to run the command as.

          - `working_directory?: string | null`

            Optional working directory to run the command in.

        - `call_id: string`

          The unique ID of the local shell tool call generated by the model.

        - `status: "in_progress" | "completed" | "incomplete"`

          The status of the local shell call.

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

        - `type: "local_shell_call"`

          The type of the local shell call. Always `local_shell_call`.

          - `"local_shell_call"`

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

      - `LocalShellCallOutput`

        The output of a local shell tool call.

        - `id: string`

          The unique ID of the local shell tool call generated by the model.

        - `output: string`

          A JSON string of the output of the local shell tool call.

        - `type: "local_shell_call_output"`

          The type of the local shell tool call output. Always `local_shell_call_output`.

          - `"local_shell_call_output"`

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `status?: "in_progress" | "completed" | "incomplete" | null`

          The status of the item. One of `in_progress`, `completed`, or `incomplete`.

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

      - `BetaResponseFunctionShellToolCall`

        A tool call that executes one or more shell commands in a managed environment.

        - `id: string`

          The unique ID of the shell tool call. Populated when this item is returned via API.

        - `action: Action`

          The shell commands and limits that describe how to run the tool call.

          - `commands: Array<string>`

          - `max_output_length: number | null`

            Optional maximum number of characters to return from each command.

          - `timeout_ms: number | null`

            Optional timeout in milliseconds for the commands.

        - `call_id: string`

          The unique ID of the shell tool call generated by the model.

        - `environment: BetaResponseLocalEnvironment | BetaResponseContainerReference | null`

          Represents the use of a local environment to perform shell actions.

          - `BetaResponseLocalEnvironment`

            Represents the use of a local environment to perform shell actions.

            - `type: "local"`

              The environment type. Always `local`.

              - `"local"`

          - `BetaResponseContainerReference`

            Represents a container created with /v1/containers.

            - `container_id: string`

            - `type: "container_reference"`

              The environment type. Always `container_reference`.

              - `"container_reference"`

        - `status: "in_progress" | "completed" | "incomplete"`

          The status of the shell call. One of `in_progress`, `completed`, or `incomplete`.

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

        - `type: "shell_call"`

          The type of the item. Always `shell_call`.

          - `"shell_call"`

        - `agent?: Agent`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `caller?: Direct | Program | null`

          The execution context that produced this tool call.

          - `Direct`

            - `type: "direct"`

              - `"direct"`

          - `Program`

            - `caller_id: string`

              The call ID of the program item that produced this tool call.

            - `type: "program"`

              - `"program"`

        - `created_by?: string`

          The ID of the entity that created this tool call.

      - `BetaResponseFunctionShellToolCallOutput`

        The output of a shell tool call that was emitted.

        - `id: string`

          The unique ID of the shell call output. Populated when this item is returned via API.

        - `call_id: string`

          The unique ID of the shell tool call generated by the model.

        - `max_output_length: number | null`

          The maximum length of the shell command output. This is generated by the model and should be passed back with the raw output.

        - `output: Array<Output>`

          An array of shell call output contents

          - `outcome: Timeout | Exit`

            Represents either an exit outcome (with an exit code) or a timeout outcome for a shell call output chunk.

            - `Timeout`

              Indicates that the shell call exceeded its configured time limit.

              - `type: "timeout"`

                The outcome type. Always `timeout`.

                - `"timeout"`

            - `Exit`

              Indicates that the shell commands finished and returned an exit code.

              - `exit_code: number`

                Exit code from the shell process.

              - `type: "exit"`

                The outcome type. Always `exit`.

                - `"exit"`

          - `stderr: string`

            The standard error output that was captured.

          - `stdout: string`

            The standard output that was captured.

          - `created_by?: string`

            The identifier of the actor that created the item.

        - `status: "in_progress" | "completed" | "incomplete"`

          The status of the shell call output. One of `in_progress`, `completed`, or `incomplete`.

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

        - `type: "shell_call_output"`

          The type of the shell call output. Always `shell_call_output`.

          - `"shell_call_output"`

        - `agent?: Agent`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `caller?: Direct | Program | null`

          The execution context that produced this tool call.

          - `Direct`

            - `type: "direct"`

              - `"direct"`

          - `Program`

            - `caller_id: string`

              The call ID of the program item that produced this tool call.

            - `type: "program"`

              - `"program"`

        - `created_by?: string`

          The identifier of the actor that created the item.

      - `BetaResponseApplyPatchToolCall`

        A tool call that applies file diffs by creating, deleting, or updating files.

        - `id: string`

          The unique ID of the apply patch tool call. Populated when this item is returned via API.

        - `call_id: string`

          The unique ID of the apply patch tool call generated by the model.

        - `operation: CreateFile | DeleteFile | UpdateFile`

          One of the create_file, delete_file, or update_file operations applied via apply_patch.

          - `CreateFile`

            Instruction describing how to create a file via the apply_patch tool.

            - `diff: string`

              Diff to apply.

            - `path: string`

              Path of the file to create.

            - `type: "create_file"`

              Create a new file with the provided diff.

              - `"create_file"`

          - `DeleteFile`

            Instruction describing how to delete a file via the apply_patch tool.

            - `path: string`

              Path of the file to delete.

            - `type: "delete_file"`

              Delete the specified file.

              - `"delete_file"`

          - `UpdateFile`

            Instruction describing how to update a file via the apply_patch tool.

            - `diff: string`

              Diff to apply.

            - `path: string`

              Path of the file to update.

            - `type: "update_file"`

              Update an existing file with the provided diff.

              - `"update_file"`

        - `status: "in_progress" | "completed"`

          The status of the apply patch tool call. One of `in_progress` or `completed`.

          - `"in_progress"`

          - `"completed"`

        - `type: "apply_patch_call"`

          The type of the item. Always `apply_patch_call`.

          - `"apply_patch_call"`

        - `agent?: Agent`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `caller?: Direct | Program | null`

          The execution context that produced this tool call.

          - `Direct`

            - `type: "direct"`

              - `"direct"`

          - `Program`

            - `caller_id: string`

              The call ID of the program item that produced this tool call.

            - `type: "program"`

              - `"program"`

        - `created_by?: string`

          The ID of the entity that created this tool call.

      - `BetaResponseApplyPatchToolCallOutput`

        The output emitted by an apply patch tool call.

        - `id: string`

          The unique ID of the apply patch tool call output. Populated when this item is returned via API.

        - `call_id: string`

          The unique ID of the apply patch tool call generated by the model.

        - `status: "completed" | "failed"`

          The status of the apply patch tool call output. One of `completed` or `failed`.

          - `"completed"`

          - `"failed"`

        - `type: "apply_patch_call_output"`

          The type of the item. Always `apply_patch_call_output`.

          - `"apply_patch_call_output"`

        - `agent?: Agent`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `caller?: Direct | Program | null`

          The execution context that produced this tool call.

          - `Direct`

            - `type: "direct"`

              - `"direct"`

          - `Program`

            - `caller_id: string`

              The call ID of the program item that produced this tool call.

            - `type: "program"`

              - `"program"`

        - `created_by?: string`

          The ID of the entity that created this tool call output.

        - `output?: string | null`

          Optional textual output returned by the apply patch tool.

      - `McpCall`

        An invocation of a tool on an MCP server.

        - `id: string`

          The unique ID of the tool call.

        - `arguments: string`

          A JSON string of the arguments passed to the tool.

        - `name: string`

          The name of the tool that was run.

        - `server_label: string`

          The label of the MCP server running the tool.

        - `type: "mcp_call"`

          The type of the item. Always `mcp_call`.

          - `"mcp_call"`

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `approval_request_id?: string | null`

          Unique identifier for the MCP tool call approval request.
          Include this value in a subsequent `mcp_approval_response` input to approve or reject the corresponding tool call.

        - `error?: BetaMcpToolCallError | null`

          The error from the tool call, if any.

        - `output?: string | null`

          The output from the tool call.

        - `status?: "in_progress" | "completed" | "incomplete" | 2 more`

          The status of the tool call. One of `in_progress`, `completed`, `incomplete`, `calling`, or `failed`.

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

          - `"calling"`

          - `"failed"`

      - `McpListTools`

        A list of tools available on an MCP server.

        - `id: string`

          The unique ID of the list.

        - `server_label: string`

          The label of the MCP server.

        - `tools: Array<Tool>`

          The tools available on the server.

          - `input_schema: unknown`

            The JSON schema describing the tool's input.

          - `name: string`

            The name of the tool.

          - `annotations?: unknown`

            Additional annotations about the tool.

          - `description?: string | null`

            The description of the tool.

        - `type: "mcp_list_tools"`

          The type of the item. Always `mcp_list_tools`.

          - `"mcp_list_tools"`

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `error?: string | null`

          Error message if the server could not list tools.

      - `McpApprovalRequest`

        A request for human approval of a tool invocation.

        - `id: string`

          The unique ID of the approval request.

        - `arguments: string`

          A JSON string of arguments for the tool.

        - `name: string`

          The name of the tool to run.

        - `server_label: string`

          The label of the MCP server making the request.

        - `type: "mcp_approval_request"`

          The type of the item. Always `mcp_approval_request`.

          - `"mcp_approval_request"`

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

      - `McpApprovalResponse`

        A response to an MCP approval request.

        - `id: string`

          The unique ID of the approval response

        - `approval_request_id: string`

          The ID of the approval request being answered.

        - `approve: boolean`

          Whether the request was approved.

        - `type: "mcp_approval_response"`

          The type of the item. Always `mcp_approval_response`.

          - `"mcp_approval_response"`

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `reason?: string | null`

          Optional reason for the decision.

      - `BetaResponseCustomToolCall`

        A call to a custom tool created by the model.

      - `BetaResponseCustomToolCallOutputItem extends BetaResponseCustomToolCallOutput`

        The output of a custom tool call from your code, being sent back to the model.

        - `id: string`

          The unique ID of the custom tool call output item.

        - `status: "in_progress" | "completed" | "incomplete"`

          The status of the item. One of `in_progress`, `completed`, or
          `incomplete`. Populated when items are returned via API.

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

        - `created_by?: string`

          The identifier of the actor that created the item.

    - `parallel_tool_calls: boolean`

      Whether to allow the model to run tool calls in parallel.

    - `temperature: number | null`

      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.

    - `tool_choice: BetaToolChoiceOptions | BetaToolChoiceAllowed | BetaToolChoiceTypes | 6 more`

      How the model should select which tool (or tools) to use when generating
      a response. See the `tools` parameter to see how to specify which tools
      the model can call.

      - `BetaToolChoiceOptions = "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.

        - `"none"`

        - `"auto"`

        - `"required"`

      - `BetaToolChoiceAllowed`

        Constrains the tools available to the model to a pre-defined set.

        - `mode: "auto" | "required"`

          Constrains the tools available to the model to a pre-defined set.

          `auto` allows the model to pick from among the allowed tools and generate a
          message.

          `required` requires the model to call one or more of the allowed tools.

          - `"auto"`

          - `"required"`

        - `tools: Array<Record<string, unknown>>`

          A list of tool definitions that the model should be allowed to call.

          For the Responses API, the list of tool definitions might look like:

          ```json
          [
            { "type": "function", "name": "get_weather" },
            { "type": "mcp", "server_label": "deepwiki" },
            { "type": "image_generation" }
          ]
          ```

        - `type: "allowed_tools"`

          Allowed tool configuration type. Always `allowed_tools`.

          - `"allowed_tools"`

      - `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" | 5 more`

          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`

          - `"file_search"`

          - `"web_search_preview"`

          - `"computer"`

          - `"computer_use_preview"`

          - `"computer_use"`

          - `"web_search_preview_2025_03_11"`

          - `"image_generation"`

          - `"code_interpreter"`

      - `BetaToolChoiceFunction`

        Use this option to force the model to call a specific function.

        - `name: string`

          The name of the function to call.

        - `type: "function"`

          For function calling, the type is always `function`.

          - `"function"`

      - `BetaToolChoiceMcp`

        Use this option to force the model to call a specific tool on a remote MCP server.

        - `server_label: string`

          The label of the MCP server to use.

        - `type: "mcp"`

          For MCP tools, the type is always `mcp`.

          - `"mcp"`

        - `name?: string | null`

          The name of the tool to call on the server.

      - `BetaToolChoiceCustom`

        Use this option to force the model to call a specific custom tool.

        - `name: string`

          The name of the custom tool to call.

        - `type: "custom"`

          For custom tool calling, the type is always `custom`.

          - `"custom"`

      - `BetaSpecificProgrammaticToolCallingParam`

        - `type: "programmatic_tool_calling"`

          The tool to call. Always `programmatic_tool_calling`.

          - `"programmatic_tool_calling"`

      - `BetaToolChoiceApplyPatch`

        Forces the model to call the apply_patch tool when executing a tool call.

        - `type: "apply_patch"`

          The tool to call. Always `apply_patch`.

          - `"apply_patch"`

      - `BetaToolChoiceShell`

        Forces the model to call the shell tool when a tool call is required.

        - `type: "shell"`

          The tool to call. Always `shell`.

          - `"shell"`

    - `tools: Array<BetaTool>`

      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.

      - `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).

      - `Mcp`

        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).

      - `CodeInterpreter`

        A tool that runs Python code to help generate a response to a prompt.

      - `ProgrammaticToolCalling`

      - `ImageGeneration`

        A tool that generates images using the GPT image models.

      - `LocalShell`

        A tool that allows the model to execute shell commands in a local environment.

      - `BetaFunctionShellTool`

        A tool that allows the model to execute shell commands.

      - `BetaCustomTool`

        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)

      - `BetaNamespaceTool`

        Groups function/custom tools under a shared namespace.

      - `BetaToolSearchTool`

        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).

      - `BetaApplyPatchTool`

        Allows the assistant to create, delete, or update files using unified diffs.

    - `top_p: number | null`

      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.

    - `background?: boolean | null`

      Whether to run the model response in the background.
      [Learn more](https://platform.openai.com/docs/guides/background).

    - `completed_at?: number | null`

      Unix timestamp (in seconds) of when this Response was completed.
      Only present when the status is `completed`.

    - `conversation?: Conversation | null`

      The conversation that this response belonged to. Input items and output items from this response were automatically added to this conversation.

      - `id: string`

        The unique ID of the conversation that this response was associated with.

    - `max_output_tokens?: number | null`

      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).

    - `max_tool_calls?: number | null`

      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.

    - `moderation?: Moderation | null`

      Moderation results for the response input and output, if moderated completions were requested.

      - `input: ModerationResult | Error`

        Moderation for the response input.

        - `ModerationResult`

          A moderation result produced for the response input or output.

          - `categories: Record<string, boolean>`

            A dictionary of moderation categories to booleans, True if the input is flagged under this category.

          - `category_applied_input_types: Record<string, Array<"text" | "image">>`

            Which modalities of input are reflected by the score for each category.

            - `"text"`

            - `"image"`

          - `category_scores: Record<string, number>`

            A dictionary of moderation categories to scores.

          - `flagged: boolean`

            A boolean indicating whether the content was flagged by any category.

          - `model: string`

            The moderation model that produced this result.

          - `type: "moderation_result"`

            The object type, which was always `moderation_result` for successful moderation results.

            - `"moderation_result"`

        - `Error`

          An error produced while attempting moderation for the response input or output.

          - `code: string`

            The error code.

          - `message: string`

            The error message.

          - `type: "error"`

            The object type, which was always `error` for moderation failures.

            - `"error"`

      - `output: ModerationResult | Error`

        Moderation for the response output.

        - `ModerationResult`

          A moderation result produced for the response input or output.

          - `categories: Record<string, boolean>`

            A dictionary of moderation categories to booleans, True if the input is flagged under this category.

          - `category_applied_input_types: Record<string, Array<"text" | "image">>`

            Which modalities of input are reflected by the score for each category.

            - `"text"`

            - `"image"`

          - `category_scores: Record<string, number>`

            A dictionary of moderation categories to scores.

          - `flagged: boolean`

            A boolean indicating whether the content was flagged by any category.

          - `model: string`

            The moderation model that produced this result.

          - `type: "moderation_result"`

            The object type, which was always `moderation_result` for successful moderation results.

            - `"moderation_result"`

        - `Error`

          An error produced while attempting moderation for the response input or output.

          - `code: string`

            The error code.

          - `message: string`

            The error message.

          - `type: "error"`

            The object type, which was always `error` for moderation failures.

            - `"error"`

    - `previous_response_id?: string | null`

      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`.

    - `prompt?: BetaResponsePrompt | null`

      Reference to a prompt template and its variables.
      [Learn more](https://platform.openai.com/docs/guides/text?api-mode=responses#reusable-prompts).

      - `id: string`

        The unique identifier of the prompt template to use.

      - `variables?: Record<string, string | BetaResponseInputText | BetaResponseInputImage | BetaResponseInputFile> | null`

        Optional map of values to substitute in for variables in your
        prompt. The substitution values can either be strings, or other
        Response input types like images or files.

        - `string`

        - `BetaResponseInputText`

          A text input to the model.

        - `BetaResponseInputImage`

          An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision).

        - `BetaResponseInputFile`

          A file input to the model.

      - `version?: string | null`

        Optional version of the prompt template.

    - `prompt_cache_key?: string | null`

      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).

    - `prompt_cache_options?: PromptCacheOptions`

      The prompt-caching options that were applied to the response. Supported for `gpt-5.6` and later models.

      - `mode: "implicit" | "explicit"`

        Whether implicit prompt-cache breakpoints were enabled.

        - `"implicit"`

        - `"explicit"`

      - `ttl: "30m"`

        The minimum lifetime applied to each cache breakpoint.

        - `"30m"`

    - `prompt_cache_retention?: "in_memory" | "24h" | null`

      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.

      - `"in_memory"`

      - `"24h"`

    - `reasoning?: Reasoning | null`

      **gpt-5 and o-series models only**

      Configuration options for
      [reasoning models](https://platform.openai.com/docs/guides/reasoning).

      - `context?: "auto" | "current_turn" | "all_turns" | null`

        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.

        - `"auto"`

        - `"current_turn"`

        - `"all_turns"`

      - `effort?: "none" | "minimal" | "low" | 4 more | null`

        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.

        - `"none"`

        - `"minimal"`

        - `"low"`

        - `"medium"`

        - `"high"`

        - `"xhigh"`

        - `"max"`

      - `generate_summary?: "auto" | "concise" | "detailed" | null`

        **Deprecated:** use `summary` instead.

        A summary of the reasoning performed by the model. This can be
        useful for debugging and understanding the model's reasoning process.
        One of `auto`, `concise`, or `detailed`.

        - `"auto"`

        - `"concise"`

        - `"detailed"`

      - `mode?: (string & {}) | "standard" | "pro"`

        Controls the reasoning execution mode for the request.

        When returned on a response, this is the effective execution mode.

        - `(string & {})`

        - `"standard" | "pro"`

          - `"standard"`

          - `"pro"`

      - `summary?: "auto" | "concise" | "detailed" | null`

        A summary of the reasoning performed by the model. This can be
        useful for debugging and understanding the model's reasoning process.
        One of `auto`, `concise`, or `detailed`.

        `concise` is supported for `computer-use-preview` models and all reasoning models after `gpt-5`.

        - `"auto"`

        - `"concise"`

        - `"detailed"`

    - `safety_identifier?: string | null`

      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).

    - `service_tier?: BetaServiceTier | null`

      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.
      - If set to 'ultrafast', then the request will be processed with the access-controlled Ultrafast Processing service tier. This tier is currently available for `gpt-5.6-sol`; a response served through it will show `service_tier=ultrafast`.
      - When not set, the default behavior is 'auto'.

      When the `service_tier` parameter is set, the response body will include the `service_tier` value based on the processing mode actually used to serve the request. This response value may be different from the value set in the parameter.

      - `"auto"`

      - `"default"`

      - `"flex"`

      - `"scale"`

      - `"priority"`

      - `"fast"`

      - `"ultrafast"`

    - `status?: BetaResponseStatus`

      The status of the response generation. One of `completed`, `failed`,
      `in_progress`, `cancelled`, `queued`, or `incomplete`.

      - `"completed"`

      - `"failed"`

      - `"in_progress"`

      - `"cancelled"`

      - `"queued"`

      - `"incomplete"`

    - `text?: BetaResponseTextConfig`

      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?: BetaResponseFormatTextConfig`

        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.

        - `Text`

          Default response format. Used to generate text responses.

          - `type: "text"`

            The type of response format being defined. Always `text`.

            - `"text"`

        - `BetaResponseFormatTextJSONSchemaConfig`

          JSON Schema response format. Used to generate structured JSON responses.
          Learn more about [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs).

          - `name: string`

            The name of the response format. Must be a-z, A-Z, 0-9, or contain
            underscores and dashes, with a maximum length of 64.

          - `schema: Record<string, unknown>`

            The schema for the response format, described as a JSON Schema object.
            Learn how to build JSON schemas [here](https://json-schema.org/).

          - `type: "json_schema"`

            The type of response format being defined. Always `json_schema`.

            - `"json_schema"`

          - `description?: string`

            A description of what the response format is for, used by the model to
            determine how to respond in the format.

          - `strict?: boolean | null`

            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).

        - `JSONObject`

          JSON object response format. An older method of generating JSON responses.
          Using `json_schema` is recommended for models that support it. Note that the
          model will not generate JSON without a system or user message instructing it
          to do so.

          - `type: "json_object"`

            The type of response format being defined. Always `json_object`.

            - `"json_object"`

      - `verbosity?: "low" | "medium" | "high" | null`

        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`.

        - `"low"`

        - `"medium"`

        - `"high"`

    - `top_logprobs?: number | null`

      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.

    - `truncation?: "auto" | "disabled" | null`

      The truncation strategy to use for the model response.

      - `auto`: If the input to this Response exceeds
        the model's context window size, the model will truncate the
        response to fit the context window by dropping items from the beginning of the conversation.
      - `disabled` (default): If the input size will exceed the context window
        size for a model, the request will fail with a 400 error.

      - `"auto"`

      - `"disabled"`

    - `usage?: BetaResponseUsage`

      Represents token usage details including input tokens, output tokens,
      a breakdown of output tokens, and the total tokens used.

      - `input_tokens: number`

        The number of input tokens.

      - `input_tokens_details: InputTokensDetails`

        A detailed breakdown of the input tokens.

        - `cache_write_tokens: number`

          The number of input tokens that were written to the cache.

        - `cached_tokens: number`

          The number of tokens that were retrieved from the cache.
          [More on prompt caching](https://platform.openai.com/docs/guides/prompt-caching).

      - `output_tokens: number`

        The number of output tokens.

      - `output_tokens_details: OutputTokensDetails`

        A detailed breakdown of the output tokens.

        - `reasoning_tokens: number`

          The number of reasoning tokens.

      - `total_tokens: number`

        The total number of tokens used.

    - `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).

  - `sequence_number: number`

    The sequence number of this event.

  - `type: "response.failed"`

    The type of the event. Always `response.failed`.

    - `"response.failed"`

  - `agent?: Agent | null`

    The agent that owns this multi-agent streaming event.

    - `agent_name: string`

      The canonical name of the agent that produced this item.

### Beta Response File Search Call Completed Event

- `BetaResponseFileSearchCallCompletedEvent`

  Emitted when a file search call is completed (results found).

  - `item_id: string`

    The ID of the output item that the file search call is initiated.

  - `output_index: number`

    The index of the output item that the file search call is initiated.

  - `sequence_number: number`

    The sequence number of this event.

  - `type: "response.file_search_call.completed"`

    The type of the event. Always `response.file_search_call.completed`.

    - `"response.file_search_call.completed"`

  - `agent?: Agent | null`

    The agent that owns this multi-agent streaming event.

    - `agent_name: string`

      The canonical name of the agent that produced this item.

### Beta Response File Search Call In Progress Event

- `BetaResponseFileSearchCallInProgressEvent`

  Emitted when a file search call is initiated.

  - `item_id: string`

    The ID of the output item that the file search call is initiated.

  - `output_index: number`

    The index of the output item that the file search call is initiated.

  - `sequence_number: number`

    The sequence number of this event.

  - `type: "response.file_search_call.in_progress"`

    The type of the event. Always `response.file_search_call.in_progress`.

    - `"response.file_search_call.in_progress"`

  - `agent?: Agent | null`

    The agent that owns this multi-agent streaming event.

    - `agent_name: string`

      The canonical name of the agent that produced this item.

### Beta Response File Search Call Searching Event

- `BetaResponseFileSearchCallSearchingEvent`

  Emitted when a file search is currently searching.

  - `item_id: string`

    The ID of the output item that the file search call is initiated.

  - `output_index: number`

    The index of the output item that the file search call is searching.

  - `sequence_number: number`

    The sequence number of this event.

  - `type: "response.file_search_call.searching"`

    The type of the event. Always `response.file_search_call.searching`.

    - `"response.file_search_call.searching"`

  - `agent?: Agent | null`

    The agent that owns this multi-agent streaming event.

    - `agent_name: string`

      The canonical name of the agent that produced this item.

### Beta Response File Search Tool Call

- `BetaResponseFileSearchToolCall`

  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.

  - `id: string`

    The unique ID of the file search tool call.

  - `queries: Array<string>`

    The queries used to search for files.

  - `status: "in_progress" | "searching" | "completed" | 2 more`

    The status of the file search tool call. One of `in_progress`,
    `searching`, `incomplete` or `failed`,

    - `"in_progress"`

    - `"searching"`

    - `"completed"`

    - `"incomplete"`

    - `"failed"`

  - `type: "file_search_call"`

    The type of the file search tool call. Always `file_search_call`.

    - `"file_search_call"`

  - `agent?: Agent | null`

    The agent that produced this item.

    - `agent_name: string`

      The canonical name of the agent that produced this item.

  - `results?: Array<Result> | null`

    The results of the file search tool call.

    - `attributes?: Record<string, string | number | boolean> | null`

      Set of 16 key-value pairs that can be attached to an object. This can be
      useful for storing additional information about the object in a structured
      format, and querying for objects via API or the dashboard. Keys are strings
      with a maximum length of 64 characters. Values are strings with a maximum
      length of 512 characters, booleans, or numbers.

      - `string`

      - `number`

      - `boolean`

    - `file_id?: string`

      The unique ID of the file.

    - `filename?: string`

      The name of the file.

    - `score?: number`

      The relevance score of the file - a value between 0 and 1.

    - `text?: string`

      The text that was retrieved from the file.

### Beta Response Format Text Config

- `BetaResponseFormatTextConfig = Text | BetaResponseFormatTextJSONSchemaConfig | JSONObject`

  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.

  - `Text`

    Default response format. Used to generate text responses.

    - `type: "text"`

      The type of response format being defined. Always `text`.

      - `"text"`

  - `BetaResponseFormatTextJSONSchemaConfig`

    JSON Schema response format. Used to generate structured JSON responses.
    Learn more about [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs).

    - `name: string`

      The name of the response format. Must be a-z, A-Z, 0-9, or contain
      underscores and dashes, with a maximum length of 64.

    - `schema: Record<string, unknown>`

      The schema for the response format, described as a JSON Schema object.
      Learn how to build JSON schemas [here](https://json-schema.org/).

    - `type: "json_schema"`

      The type of response format being defined. Always `json_schema`.

      - `"json_schema"`

    - `description?: string`

      A description of what the response format is for, used by the model to
      determine how to respond in the format.

    - `strict?: boolean | null`

      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).

  - `JSONObject`

    JSON object response format. An older method of generating JSON responses.
    Using `json_schema` is recommended for models that support it. Note that the
    model will not generate JSON without a system or user message instructing it
    to do so.

    - `type: "json_object"`

      The type of response format being defined. Always `json_object`.

      - `"json_object"`

### Beta Response Format Text JSON Schema Config

- `BetaResponseFormatTextJSONSchemaConfig`

  JSON Schema response format. Used to generate structured JSON responses.
  Learn more about [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs).

  - `name: string`

    The name of the response format. Must be a-z, A-Z, 0-9, or contain
    underscores and dashes, with a maximum length of 64.

  - `schema: Record<string, unknown>`

    The schema for the response format, described as a JSON Schema object.
    Learn how to build JSON schemas [here](https://json-schema.org/).

  - `type: "json_schema"`

    The type of response format being defined. Always `json_schema`.

    - `"json_schema"`

  - `description?: string`

    A description of what the response format is for, used by the model to
    determine how to respond in the format.

  - `strict?: boolean | null`

    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).

### Beta Response Function Call Arguments Delta Event

- `BetaResponseFunctionCallArgumentsDeltaEvent`

  Emitted when there is a partial function-call arguments delta.

  - `delta: string`

    The function-call arguments delta that is added.

  - `item_id: string`

    The ID of the output item that the function-call arguments delta is added to.

  - `output_index: number`

    The index of the output item that the function-call arguments delta is added to.

  - `sequence_number: number`

    The sequence number of this event.

  - `type: "response.function_call_arguments.delta"`

    The type of the event. Always `response.function_call_arguments.delta`.

    - `"response.function_call_arguments.delta"`

  - `agent?: Agent | null`

    The agent that owns this multi-agent streaming event.

    - `agent_name: string`

      The canonical name of the agent that produced this item.

### Beta Response Function Call Arguments Done Event

- `BetaResponseFunctionCallArgumentsDoneEvent`

  Emitted when function-call arguments are finalized.

  - `arguments: string`

    The function-call arguments.

  - `item_id: string`

    The ID of the item.

  - `name: string`

    The name of the function that was called.

  - `output_index: number`

    The index of the output item.

  - `sequence_number: number`

    The sequence number of this event.

  - `type: "response.function_call_arguments.done"`

    - `"response.function_call_arguments.done"`

  - `agent?: Agent | null`

    The agent that owns this multi-agent streaming event.

    - `agent_name: string`

      The canonical name of the agent that produced this item.

### Beta Response Function Call Output Item

- `BetaResponseFunctionCallOutputItem = BetaResponseInputTextContent | BetaResponseInputImageContent | BetaResponseInputFileContent`

  A piece of message content, such as text, an image, or a file.

  - `BetaResponseInputTextContent`

    A text input to the model.

    - `text: string`

      The text input to the model.

    - `type: "input_text"`

      The type of the input item. Always `input_text`.

      - `"input_text"`

    - `prompt_cache_breakpoint?: PromptCacheBreakpoint | null`

      Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.

      - `mode: "explicit"`

        The breakpoint mode. Always `explicit`.

        - `"explicit"`

  - `BetaResponseInputImageContent`

    An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision)

    - `type: "input_image"`

      The type of the input item. Always `input_image`.

      - `"input_image"`

    - `detail?: BetaImageDetail | null`

      The detail level of the image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`.

      - `"low"`

      - `"high"`

      - `"auto"`

      - `"original"`

    - `file_id?: string | null`

      The ID of the file to be sent to the model.

    - `image_url?: string | null`

      The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.

    - `prompt_cache_breakpoint?: PromptCacheBreakpoint | null`

      Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.

      - `mode: "explicit"`

        The breakpoint mode. Always `explicit`.

        - `"explicit"`

  - `BetaResponseInputFileContent`

    A file input to the model.

    - `type: "input_file"`

      The type of the input item. Always `input_file`.

      - `"input_file"`

    - `detail?: "auto" | "low" | "high"`

      The detail level of the file to be sent to the model. Use `auto` to let the system select the detail level; for GPT-5.6 and later models, `auto` uses high-quality rendering, which may increase input token usage. Use `low` for lower-cost rendering, or `high` to render the file at higher quality. Defaults to `auto`.

      - `"auto"`

      - `"low"`

      - `"high"`

    - `file_data?: string | null`

      The base64-encoded data of the file to be sent to the model.

    - `file_id?: string | null`

      The ID of the file to be sent to the model.

    - `file_url?: string | null`

      The URL of the file to be sent to the model.

    - `filename?: string | null`

      The name of the file to be sent to the model.

    - `prompt_cache_breakpoint?: PromptCacheBreakpoint | null`

      Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.

      - `mode: "explicit"`

        The breakpoint mode. Always `explicit`.

        - `"explicit"`

### Beta Response Function Call Output Item List

- `BetaResponseFunctionCallOutputItemList = Array<BetaResponseFunctionCallOutputItem>`

  An array of content outputs (text, image, file) for the function tool call.

  - `BetaResponseInputTextContent`

    A text input to the model.

    - `text: string`

      The text input to the model.

    - `type: "input_text"`

      The type of the input item. Always `input_text`.

      - `"input_text"`

    - `prompt_cache_breakpoint?: PromptCacheBreakpoint | null`

      Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.

      - `mode: "explicit"`

        The breakpoint mode. Always `explicit`.

        - `"explicit"`

  - `BetaResponseInputImageContent`

    An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision)

    - `type: "input_image"`

      The type of the input item. Always `input_image`.

      - `"input_image"`

    - `detail?: BetaImageDetail | null`

      The detail level of the image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`.

      - `"low"`

      - `"high"`

      - `"auto"`

      - `"original"`

    - `file_id?: string | null`

      The ID of the file to be sent to the model.

    - `image_url?: string | null`

      The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.

    - `prompt_cache_breakpoint?: PromptCacheBreakpoint | null`

      Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.

      - `mode: "explicit"`

        The breakpoint mode. Always `explicit`.

        - `"explicit"`

  - `BetaResponseInputFileContent`

    A file input to the model.

    - `type: "input_file"`

      The type of the input item. Always `input_file`.

      - `"input_file"`

    - `detail?: "auto" | "low" | "high"`

      The detail level of the file to be sent to the model. Use `auto` to let the system select the detail level; for GPT-5.6 and later models, `auto` uses high-quality rendering, which may increase input token usage. Use `low` for lower-cost rendering, or `high` to render the file at higher quality. Defaults to `auto`.

      - `"auto"`

      - `"low"`

      - `"high"`

    - `file_data?: string | null`

      The base64-encoded data of the file to be sent to the model.

    - `file_id?: string | null`

      The ID of the file to be sent to the model.

    - `file_url?: string | null`

      The URL of the file to be sent to the model.

    - `filename?: string | null`

      The name of the file to be sent to the model.

    - `prompt_cache_breakpoint?: PromptCacheBreakpoint | null`

      Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.

      - `mode: "explicit"`

        The breakpoint mode. Always `explicit`.

        - `"explicit"`

### Beta Response Function Shell Call Output Content

- `BetaResponseFunctionShellCallOutputContent`

  Captured stdout and stderr for a portion of a shell tool call output.

  - `outcome: Timeout | Exit`

    The exit or timeout outcome associated with this shell call.

    - `Timeout`

      Indicates that the shell call exceeded its configured time limit.

      - `type: "timeout"`

        The outcome type. Always `timeout`.

        - `"timeout"`

    - `Exit`

      Indicates that the shell commands finished and returned an exit code.

      - `exit_code: number`

        The exit code returned by the shell process.

      - `type: "exit"`

        The outcome type. Always `exit`.

        - `"exit"`

  - `stderr: string`

    Captured stderr output for the shell call.

  - `stdout: string`

    Captured stdout output for the shell call.

### Beta Response Function Shell Tool Call

- `BetaResponseFunctionShellToolCall`

  A tool call that executes one or more shell commands in a managed environment.

  - `id: string`

    The unique ID of the shell tool call. Populated when this item is returned via API.

  - `action: Action`

    The shell commands and limits that describe how to run the tool call.

    - `commands: Array<string>`

    - `max_output_length: number | null`

      Optional maximum number of characters to return from each command.

    - `timeout_ms: number | null`

      Optional timeout in milliseconds for the commands.

  - `call_id: string`

    The unique ID of the shell tool call generated by the model.

  - `environment: BetaResponseLocalEnvironment | BetaResponseContainerReference | null`

    Represents the use of a local environment to perform shell actions.

    - `BetaResponseLocalEnvironment`

      Represents the use of a local environment to perform shell actions.

      - `type: "local"`

        The environment type. Always `local`.

        - `"local"`

    - `BetaResponseContainerReference`

      Represents a container created with /v1/containers.

      - `container_id: string`

      - `type: "container_reference"`

        The environment type. Always `container_reference`.

        - `"container_reference"`

  - `status: "in_progress" | "completed" | "incomplete"`

    The status of the shell call. One of `in_progress`, `completed`, or `incomplete`.

    - `"in_progress"`

    - `"completed"`

    - `"incomplete"`

  - `type: "shell_call"`

    The type of the item. Always `shell_call`.

    - `"shell_call"`

  - `agent?: Agent`

    The agent that produced this item.

    - `agent_name: string`

      The canonical name of the agent that produced this item.

  - `caller?: Direct | Program | null`

    The execution context that produced this tool call.

    - `Direct`

      - `type: "direct"`

        - `"direct"`

    - `Program`

      - `caller_id: string`

        The call ID of the program item that produced this tool call.

      - `type: "program"`

        - `"program"`

  - `created_by?: string`

    The ID of the entity that created this tool call.

### Beta Response Function Shell Tool Call Output

- `BetaResponseFunctionShellToolCallOutput`

  The output of a shell tool call that was emitted.

  - `id: string`

    The unique ID of the shell call output. Populated when this item is returned via API.

  - `call_id: string`

    The unique ID of the shell tool call generated by the model.

  - `max_output_length: number | null`

    The maximum length of the shell command output. This is generated by the model and should be passed back with the raw output.

  - `output: Array<Output>`

    An array of shell call output contents

    - `outcome: Timeout | Exit`

      Represents either an exit outcome (with an exit code) or a timeout outcome for a shell call output chunk.

      - `Timeout`

        Indicates that the shell call exceeded its configured time limit.

        - `type: "timeout"`

          The outcome type. Always `timeout`.

          - `"timeout"`

      - `Exit`

        Indicates that the shell commands finished and returned an exit code.

        - `exit_code: number`

          Exit code from the shell process.

        - `type: "exit"`

          The outcome type. Always `exit`.

          - `"exit"`

    - `stderr: string`

      The standard error output that was captured.

    - `stdout: string`

      The standard output that was captured.

    - `created_by?: string`

      The identifier of the actor that created the item.

  - `status: "in_progress" | "completed" | "incomplete"`

    The status of the shell call output. One of `in_progress`, `completed`, or `incomplete`.

    - `"in_progress"`

    - `"completed"`

    - `"incomplete"`

  - `type: "shell_call_output"`

    The type of the shell call output. Always `shell_call_output`.

    - `"shell_call_output"`

  - `agent?: Agent`

    The agent that produced this item.

    - `agent_name: string`

      The canonical name of the agent that produced this item.

  - `caller?: Direct | Program | null`

    The execution context that produced this tool call.

    - `Direct`

      - `type: "direct"`

        - `"direct"`

    - `Program`

      - `caller_id: string`

        The call ID of the program item that produced this tool call.

      - `type: "program"`

        - `"program"`

  - `created_by?: string`

    The identifier of the actor that created the item.

### Beta Response Function Tool Call

- `BetaResponseFunctionToolCall`

  A tool call to run a function. See the
  [function calling guide](https://platform.openai.com/docs/guides/function-calling) for more information.

  - `arguments: string`

    A JSON string of the arguments to pass to the function.

  - `call_id: string`

    The unique ID of the function tool call generated by the model.

  - `name: string`

    The name of the function to run.

  - `type: "function_call"`

    The type of the function tool call. Always `function_call`.

    - `"function_call"`

  - `id?: string`

    The unique ID of the function tool call.

  - `agent?: Agent | null`

    The agent that produced this item.

    - `agent_name: string`

      The canonical name of the agent that produced this item.

  - `caller?: Direct | Program | null`

    The execution context that produced this tool call.

    - `Direct`

      - `type: "direct"`

        - `"direct"`

    - `Program`

      - `caller_id: string`

        The call ID of the program item that produced this tool call.

      - `type: "program"`

        - `"program"`

  - `namespace?: string`

    The namespace of the function to run.

  - `status?: "in_progress" | "completed" | "incomplete"`

    The status of the item. One of `in_progress`, `completed`, or
    `incomplete`. Populated when items are returned via API.

    - `"in_progress"`

    - `"completed"`

    - `"incomplete"`

### Beta Response Function Tool Call Item

- `BetaResponseFunctionToolCallItem extends BetaResponseFunctionToolCall`

  A tool call to run a function. See the
  [function calling guide](https://platform.openai.com/docs/guides/function-calling) for more information.

  - `id: string`

    The unique ID of the function tool call.

  - `status: "in_progress" | "completed" | "incomplete"`

    The status of the item. One of `in_progress`, `completed`, or
    `incomplete`. Populated when items are returned via API.

    - `"in_progress"`

    - `"completed"`

    - `"incomplete"`

  - `created_by?: string`

    The identifier of the actor that created the item.

### Beta Response Function Tool Call Output Item

- `BetaResponseFunctionToolCallOutputItem`

  - `id: string`

    The unique ID of the function call tool output.

  - `call_id: string`

    The unique ID of the function tool call generated by the model.

  - `output: string | Array<BetaResponseInputText | BetaResponseInputImage | BetaResponseInputFile>`

    The output from the function call generated by your code.
    Can be a string or an list of output content.

    - `string`

    - `Array<BetaResponseInputText | BetaResponseInputImage | BetaResponseInputFile>`

      - `BetaResponseInputText`

        A text input to the model.

        - `text: string`

          The text input to the model.

        - `type: "input_text"`

          The type of the input item. Always `input_text`.

          - `"input_text"`

        - `prompt_cache_breakpoint?: PromptCacheBreakpoint`

          Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.

          - `mode: "explicit"`

            The breakpoint mode. Always `explicit`.

            - `"explicit"`

      - `BetaResponseInputImage`

        An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision).

        - `detail: BetaImageDetail`

          The detail level of the image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`.

          - `"low"`

          - `"high"`

          - `"auto"`

          - `"original"`

        - `type: "input_image"`

          The type of the input item. Always `input_image`.

          - `"input_image"`

        - `file_id?: string | null`

          The ID of the file to be sent to the model.

        - `image_url?: string | null`

          The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.

        - `prompt_cache_breakpoint?: PromptCacheBreakpoint`

          Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.

          - `mode: "explicit"`

            The breakpoint mode. Always `explicit`.

            - `"explicit"`

      - `BetaResponseInputFile`

        A file input to the model.

        - `type: "input_file"`

          The type of the input item. Always `input_file`.

          - `"input_file"`

        - `detail?: "auto" | "low" | "high"`

          The detail level of the file to be sent to the model. Use `auto` to let the system select the detail level; for GPT-5.6 and later models, `auto` uses high-quality rendering, which may increase input token usage. Use `low` for lower-cost rendering, or `high` to render the file at higher quality. Defaults to `auto`.

          - `"auto"`

          - `"low"`

          - `"high"`

        - `file_data?: string`

          The content of the file to be sent to the model.

        - `file_id?: string | null`

          The ID of the file to be sent to the model.

        - `file_url?: string`

          The URL of the file to be sent to the model.

        - `filename?: string`

          The name of the file to be sent to the model.

        - `prompt_cache_breakpoint?: PromptCacheBreakpoint`

          Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.

          - `mode: "explicit"`

            The breakpoint mode. Always `explicit`.

            - `"explicit"`

  - `status: "in_progress" | "completed" | "incomplete"`

    The status of the item. One of `in_progress`, `completed`, or
    `incomplete`. Populated when items are returned via API.

    - `"in_progress"`

    - `"completed"`

    - `"incomplete"`

  - `type: "function_call_output"`

    The type of the function tool call output. Always `function_call_output`.

    - `"function_call_output"`

  - `agent?: Agent | null`

    The agent that produced this item.

    - `agent_name: string`

      The canonical name of the agent that produced this item.

  - `caller?: Direct | Program | null`

    The execution context that produced this tool call.

    - `Direct`

      - `type: "direct"`

        The caller type. Always `direct`.

        - `"direct"`

    - `Program`

      - `caller_id: string`

        The call ID of the program item that produced this tool call.

      - `type: "program"`

        The caller type. Always `program`.

        - `"program"`

  - `created_by?: string`

    The identifier of the actor that created the item.

  - `name?: string`

    The name of the tool that produced the output.

  - `namespace?: string`

    The namespace of the tool that produced the output.

### Beta Response Function Web Search

- `BetaResponseFunctionWebSearch`

  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.

  - `id: string`

    The unique ID of the web search tool call.

  - `action: Search | OpenPage | FindInPage`

    An object describing the specific action taken in this web search call.
    Includes details on how the model used the web (search, open_page, find_in_page).

    - `Search`

      Action type "search" - Performs a web search query.

      - `type: "search"`

        The action type.

        - `"search"`

      - `queries?: Array<string>`

        The search queries.

      - `query?: string`

        The search query.

      - `sources?: Array<Source>`

        The sources used in the search.

        - `type: "url"`

          The type of source. Always `url`.

          - `"url"`

        - `url: string`

          The URL of the source.

    - `OpenPage`

      Action type "open_page" - Opens a specific URL from search results.

      - `type: "open_page"`

        The action type.

        - `"open_page"`

      - `url?: string | null`

        The URL opened by the model.

    - `FindInPage`

      Action type "find_in_page": Searches for a pattern within a loaded page.

      - `pattern: string`

        The pattern or text to search for within the page.

      - `type: "find_in_page"`

        The action type.

        - `"find_in_page"`

      - `url: string`

        The URL of the page searched for the pattern.

  - `status: "in_progress" | "searching" | "completed" | "failed"`

    The status of the web search tool call.

    - `"in_progress"`

    - `"searching"`

    - `"completed"`

    - `"failed"`

  - `type: "web_search_call"`

    The type of the web search tool call. Always `web_search_call`.

    - `"web_search_call"`

  - `agent?: Agent | null`

    The agent that produced this item.

    - `agent_name: string`

      The canonical name of the agent that produced this item.

### Beta Response Image Gen Call Completed Event

- `BetaResponseImageGenCallCompletedEvent`

  Emitted when an image generation tool call has completed and the final image is available.

  - `item_id: string`

    The unique identifier of the image generation item being processed.

  - `output_index: number`

    The index of the output item in the response's output array.

  - `sequence_number: number`

    The sequence number of this event.

  - `type: "response.image_generation_call.completed"`

    The type of the event. Always 'response.image_generation_call.completed'.

    - `"response.image_generation_call.completed"`

  - `agent?: Agent | null`

    The agent that owns this multi-agent streaming event.

    - `agent_name: string`

      The canonical name of the agent that produced this item.

### Beta Response Image Gen Call Generating Event

- `BetaResponseImageGenCallGeneratingEvent`

  Emitted when an image generation tool call is actively generating an image (intermediate state).

  - `item_id: string`

    The unique identifier of the image generation item being processed.

  - `output_index: number`

    The index of the output item in the response's output array.

  - `sequence_number: number`

    The sequence number of the image generation item being processed.

  - `type: "response.image_generation_call.generating"`

    The type of the event. Always 'response.image_generation_call.generating'.

    - `"response.image_generation_call.generating"`

  - `agent?: Agent | null`

    The agent that owns this multi-agent streaming event.

    - `agent_name: string`

      The canonical name of the agent that produced this item.

### Beta Response Image Gen Call In Progress Event

- `BetaResponseImageGenCallInProgressEvent`

  Emitted when an image generation tool call is in progress.

  - `item_id: string`

    The unique identifier of the image generation item being processed.

  - `output_index: number`

    The index of the output item in the response's output array.

  - `sequence_number: number`

    The sequence number of the image generation item being processed.

  - `type: "response.image_generation_call.in_progress"`

    The type of the event. Always 'response.image_generation_call.in_progress'.

    - `"response.image_generation_call.in_progress"`

  - `agent?: Agent | null`

    The agent that owns this multi-agent streaming event.

    - `agent_name: string`

      The canonical name of the agent that produced this item.

### Beta Response Image Gen Call Partial Image Event

- `BetaResponseImageGenCallPartialImageEvent`

  Emitted when a partial image is available during image generation streaming.

  - `item_id: string`

    The unique identifier of the image generation item being processed.

  - `output_index: number`

    The index of the output item in the response's output array.

  - `partial_image_b64: string`

    Base64-encoded partial image data, suitable for rendering as an image.

  - `partial_image_index: number`

    0-based index for the partial image (backend is 1-based, but this is 0-based for the user).

  - `sequence_number: number`

    The sequence number of the image generation item being processed.

  - `type: "response.image_generation_call.partial_image"`

    The type of the event. Always 'response.image_generation_call.partial_image'.

    - `"response.image_generation_call.partial_image"`

  - `agent?: Agent | null`

    The agent that owns this multi-agent streaming event.

    - `agent_name: string`

      The canonical name of the agent that produced this item.

  - `background?: string`

    The background setting that was used.

  - `output_format?: string`

    The output format that was used.

  - `quality?: string`

    The image quality that was used.

  - `size?: string`

    The image size that was used.

### Beta Response In Progress Event

- `BetaResponseInProgressEvent`

  Emitted when the response is in progress.

  - `response: BetaResponse`

    The response that is in progress.

    - `id: string`

      Unique identifier for this Response.

    - `created_at: number`

      Unix timestamp (in seconds) of when this Response was created.

    - `error: BetaResponseError | null`

      An error object returned when the model fails to generate a Response.

      - `code: "server_error" | "rate_limit_exceeded" | "invalid_prompt" | 17 more`

        The error code for the response.

        - `"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"`

      - `message: string`

        A human-readable description of the error.

    - `incomplete_details: IncompleteDetails | null`

      Details about why the response is incomplete.

      - `reason?: "max_output_tokens" | "content_filter"`

        The reason why the response is incomplete.

        - `"max_output_tokens"`

        - `"content_filter"`

    - `instructions: string | Array<BetaResponseInputItem> | null`

      A system (or developer) message inserted into the model's context.

      When using along with `previous_response_id`, the instructions from a previous
      response will not be carried over to the next response. This makes it simple
      to swap out system (or developer) messages in new responses.

      - `string`

      - `Array<BetaResponseInputItem>`

        - `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.

          - `content: string | BetaResponseInputMessageContentList`

            Text, image, or audio input to the model, used to generate a response.
            Can also contain previous assistant responses.

            - `string`

            - `BetaResponseInputMessageContentList = Array<BetaResponseInputContent>`

              A list of one or many input items to the model, containing different content
              types.

              - `BetaResponseInputText`

                A text input to the model.

                - `text: string`

                  The text input to the model.

                - `type: "input_text"`

                  The type of the input item. Always `input_text`.

                  - `"input_text"`

                - `prompt_cache_breakpoint?: PromptCacheBreakpoint`

                  Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.

                  - `mode: "explicit"`

                    The breakpoint mode. Always `explicit`.

                    - `"explicit"`

              - `BetaResponseInputImage`

                An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision).

                - `detail: BetaImageDetail`

                  The detail level of the image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`.

                  - `"low"`

                  - `"high"`

                  - `"auto"`

                  - `"original"`

                - `type: "input_image"`

                  The type of the input item. Always `input_image`.

                  - `"input_image"`

                - `file_id?: string | null`

                  The ID of the file to be sent to the model.

                - `image_url?: string | null`

                  The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.

                - `prompt_cache_breakpoint?: PromptCacheBreakpoint`

                  Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.

                  - `mode: "explicit"`

                    The breakpoint mode. Always `explicit`.

                    - `"explicit"`

              - `BetaResponseInputFile`

                A file input to the model.

                - `type: "input_file"`

                  The type of the input item. Always `input_file`.

                  - `"input_file"`

                - `detail?: "auto" | "low" | "high"`

                  The detail level of the file to be sent to the model. Use `auto` to let the system select the detail level; for GPT-5.6 and later models, `auto` uses high-quality rendering, which may increase input token usage. Use `low` for lower-cost rendering, or `high` to render the file at higher quality. Defaults to `auto`.

                  - `"auto"`

                  - `"low"`

                  - `"high"`

                - `file_data?: string`

                  The content of the file to be sent to the model.

                - `file_id?: string | null`

                  The ID of the file to be sent to the model.

                - `file_url?: string`

                  The URL of the file to be sent to the model.

                - `filename?: string`

                  The name of the file to be sent to the model.

                - `prompt_cache_breakpoint?: PromptCacheBreakpoint`

                  Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.

                  - `mode: "explicit"`

                    The breakpoint mode. Always `explicit`.

                    - `"explicit"`

          - `role: "user" | "assistant" | "system" | "developer"`

            The role of the message input. One of `user`, `assistant`, `system`, or
            `developer`.

            - `"user"`

            - `"assistant"`

            - `"system"`

            - `"developer"`

          - `phase?: "commentary" | "final_answer" | null`

            Labels an `assistant` message as intermediate commentary (`commentary`) or the final answer (`final_answer`).
            For models like `gpt-5.3-codex` and beyond, when sending follow-up requests, preserve and resend
            phase on all assistant messages — dropping it can degrade performance. Not used for user messages.

            - `"commentary"`

            - `"final_answer"`

          - `type?: "message"`

            The type of the message input. Always `message`.

            - `"message"`

        - `Message`

          A message input to the model with a role indicating instruction following
          hierarchy. Instructions given with the `developer` or `system` role take
          precedence over instructions given with the `user` role.

          - `content: BetaResponseInputMessageContentList`

            A list of one or many input items to the model, containing different content
            types.

          - `role: "user" | "system" | "developer"`

            The role of the message input. One of `user`, `system`, or `developer`.

            - `"user"`

            - `"system"`

            - `"developer"`

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

          - `status?: "in_progress" | "completed" | "incomplete"`

            The status of item. One of `in_progress`, `completed`, or
            `incomplete`. Populated when items are returned via API.

            - `"in_progress"`

            - `"completed"`

            - `"incomplete"`

          - `type?: "message"`

            The type of the message input. Always set to `message`.

            - `"message"`

        - `BetaResponseOutputMessage`

          An output message from the model.

          - `id: string`

            The unique ID of the output message.

          - `content: Array<BetaResponseOutputText | BetaResponseOutputRefusal>`

            The content of the output message.

            - `BetaResponseOutputText`

              A text output from the model.

              - `annotations: Array<FileCitation | URLCitation | ContainerFileCitation | FilePath>`

                The annotations of the text output.

                - `FileCitation`

                  A citation to a file.

                  - `file_id: string`

                    The ID of the file.

                  - `filename: string`

                    The filename of the file cited.

                  - `index: number`

                    The index of the file in the list of files.

                  - `type: "file_citation"`

                    The type of the file citation. Always `file_citation`.

                    - `"file_citation"`

                - `URLCitation`

                  A citation for a web resource used to generate a model response.

                  - `end_index: number`

                    The index of the last character of the URL citation in the message.

                  - `start_index: number`

                    The index of the first character of the URL citation in the message.

                  - `title: string`

                    The title of the web resource.

                  - `type: "url_citation"`

                    The type of the URL citation. Always `url_citation`.

                    - `"url_citation"`

                  - `url: string`

                    The URL of the web resource.

                - `ContainerFileCitation`

                  A citation for a container file used to generate a model response.

                  - `container_id: string`

                    The ID of the container file.

                  - `end_index: number`

                    The index of the last character of the container file citation in the message.

                  - `file_id: string`

                    The ID of the file.

                  - `filename: string`

                    The filename of the container file cited.

                  - `start_index: number`

                    The index of the first character of the container file citation in the message.

                  - `type: "container_file_citation"`

                    The type of the container file citation. Always `container_file_citation`.

                    - `"container_file_citation"`

                - `FilePath`

                  A path to a file.

                  - `file_id: string`

                    The ID of the file.

                  - `index: number`

                    The index of the file in the list of files.

                  - `type: "file_path"`

                    The type of the file path. Always `file_path`.

                    - `"file_path"`

              - `text: string`

                The text output from the model.

              - `type: "output_text"`

                The type of the output text. Always `output_text`.

                - `"output_text"`

              - `logprobs?: Array<Logprob>`

                - `token: string`

                - `bytes: Array<number>`

                - `logprob: number`

                - `top_logprobs: Array<TopLogprob>`

                  - `token: string`

                  - `bytes: Array<number>`

                  - `logprob: number`

            - `BetaResponseOutputRefusal`

              A refusal from the model.

              - `refusal: string`

                The refusal explanation from the model.

              - `type: "refusal"`

                The type of the refusal. Always `refusal`.

                - `"refusal"`

          - `role: "assistant"`

            The role of the output message. Always `assistant`.

            - `"assistant"`

          - `status: "in_progress" | "completed" | "incomplete"`

            The status of the message input. One of `in_progress`, `completed`, or
            `incomplete`. Populated when input items are returned via API.

            - `"in_progress"`

            - `"completed"`

            - `"incomplete"`

          - `type: "message"`

            The type of the output message. Always `message`.

            - `"message"`

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

          - `phase?: "commentary" | "final_answer" | null`

            Labels an `assistant` message as intermediate commentary (`commentary`) or the final answer (`final_answer`).
            For models like `gpt-5.3-codex` and beyond, when sending follow-up requests, preserve and resend
            phase on all assistant messages — dropping it can degrade performance. Not used for user messages.

            - `"commentary"`

            - `"final_answer"`

        - `BetaResponseFileSearchToolCall`

          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.

          - `id: string`

            The unique ID of the file search tool call.

          - `queries: Array<string>`

            The queries used to search for files.

          - `status: "in_progress" | "searching" | "completed" | 2 more`

            The status of the file search tool call. One of `in_progress`,
            `searching`, `incomplete` or `failed`,

            - `"in_progress"`

            - `"searching"`

            - `"completed"`

            - `"incomplete"`

            - `"failed"`

          - `type: "file_search_call"`

            The type of the file search tool call. Always `file_search_call`.

            - `"file_search_call"`

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

          - `results?: Array<Result> | null`

            The results of the file search tool call.

            - `attributes?: Record<string, string | number | boolean> | null`

              Set of 16 key-value pairs that can be attached to an object. This can be
              useful for storing additional information about the object in a structured
              format, and querying for objects via API or the dashboard. Keys are strings
              with a maximum length of 64 characters. Values are strings with a maximum
              length of 512 characters, booleans, or numbers.

              - `string`

              - `number`

              - `boolean`

            - `file_id?: string`

              The unique ID of the file.

            - `filename?: string`

              The name of the file.

            - `score?: number`

              The relevance score of the file - a value between 0 and 1.

            - `text?: string`

              The text that was retrieved from the file.

        - `BetaResponseComputerToolCall`

          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.

          - `id: string`

            The unique ID of the computer call.

          - `call_id: string`

            An identifier used when responding to the tool call with output.

          - `pending_safety_checks: Array<PendingSafetyCheck>`

            The pending safety checks for the computer call.

            - `id: string`

              The ID of the pending safety check.

            - `code?: string | null`

              The type of the pending safety check.

            - `message?: string | null`

              Details about the pending safety check.

          - `status: "in_progress" | "completed" | "incomplete"`

            The status of the item. One of `in_progress`, `completed`, or
            `incomplete`. Populated when items are returned via API.

            - `"in_progress"`

            - `"completed"`

            - `"incomplete"`

          - `type: "computer_call"`

            The type of the computer call. Always `computer_call`.

            - `"computer_call"`

          - `action?: BetaComputerAction`

            A click action.

            - `Click`

              A click action.

              - `button: "left" | "right" | "wheel" | 2 more`

                Indicates which mouse button was pressed during the click. One of `left`, `right`, `wheel`, `back`, or `forward`.

                - `"left"`

                - `"right"`

                - `"wheel"`

                - `"back"`

                - `"forward"`

              - `type: "click"`

                Specifies the event type. For a click action, this property is always `click`.

                - `"click"`

              - `x: number`

                The x-coordinate where the click occurred.

              - `y: number`

                The y-coordinate where the click occurred.

              - `keys?: Array<string> | null`

                The keys being held while clicking.

            - `DoubleClick`

              A double click action.

              - `keys: Array<string> | null`

                The keys being held while double-clicking.

              - `type: "double_click"`

                Specifies the event type. For a double click action, this property is always set to `double_click`.

                - `"double_click"`

              - `x: number`

                The x-coordinate where the double click occurred.

              - `y: number`

                The y-coordinate where the double click occurred.

            - `Drag`

              A drag action.

              - `path: Array<Path>`

                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 }
                ]
                ```

                - `x: number`

                  The x-coordinate.

                - `y: number`

                  The y-coordinate.

              - `type: "drag"`

                Specifies the event type. For a drag action, this property is always set to `drag`.

                - `"drag"`

              - `keys?: Array<string> | null`

                The keys being held while dragging the mouse.

            - `Keypress`

              A collection of keypresses the model would like to perform.

              - `keys: Array<string>`

                The combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key.

              - `type: "keypress"`

                Specifies the event type. For a keypress action, this property is always set to `keypress`.

                - `"keypress"`

            - `Move`

              A mouse move action.

              - `type: "move"`

                Specifies the event type. For a move action, this property is always set to `move`.

                - `"move"`

              - `x: number`

                The x-coordinate to move to.

              - `y: number`

                The y-coordinate to move to.

              - `keys?: Array<string> | null`

                The keys being held while moving the mouse.

            - `Screenshot`

              A screenshot action.

              - `type: "screenshot"`

                Specifies the event type. For a screenshot action, this property is always set to `screenshot`.

                - `"screenshot"`

            - `Scroll`

              A scroll action.

              - `scroll_x: number`

                The horizontal scroll distance.

              - `scroll_y: number`

                The vertical scroll distance.

              - `type: "scroll"`

                Specifies the event type. For a scroll action, this property is always set to `scroll`.

                - `"scroll"`

              - `x: number`

                The x-coordinate where the scroll occurred.

              - `y: number`

                The y-coordinate where the scroll occurred.

              - `keys?: Array<string> | null`

                The keys being held while scrolling.

            - `Type`

              An action to type in text.

              - `text: string`

                The text to type.

              - `type: "type"`

                Specifies the event type. For a type action, this property is always set to `type`.

                - `"type"`

            - `Wait`

              A wait action.

              - `type: "wait"`

                Specifies the event type. For a wait action, this property is always set to `wait`.

                - `"wait"`

          - `actions?: BetaComputerActionList`

            Flattened batched actions for `computer_use`. Each action includes an
            `type` discriminator and action-specific fields.

            - `Click`

              A click action.

            - `DoubleClick`

              A double click action.

            - `Drag`

              A drag action.

            - `Keypress`

              A collection of keypresses the model would like to perform.

            - `Move`

              A mouse move action.

            - `Screenshot`

              A screenshot action.

            - `Scroll`

              A scroll action.

            - `Type`

              An action to type in text.

            - `Wait`

              A wait action.

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

        - `ComputerCallOutput`

          The output of a computer tool call.

          - `call_id: string`

            The ID of the computer tool call that produced the output.

          - `output: BetaResponseComputerToolCallOutputScreenshot`

            A computer screenshot image used with the computer use tool.

            - `type: "computer_screenshot"`

              Specifies the event type. For a computer screenshot, this property is
              always set to `computer_screenshot`.

              - `"computer_screenshot"`

            - `file_id?: string`

              The identifier of an uploaded file that contains the screenshot.

            - `image_url?: string`

              The URL of the screenshot image.

          - `type: "computer_call_output"`

            The type of the computer tool call output. Always `computer_call_output`.

            - `"computer_call_output"`

          - `id?: string | null`

            The ID of the computer tool call output.

          - `acknowledged_safety_checks?: Array<AcknowledgedSafetyCheck> | null`

            The safety checks reported by the API that have been acknowledged by the developer.

            - `id: string`

              The ID of the pending safety check.

            - `code?: string | null`

              The type of the pending safety check.

            - `message?: string | null`

              Details about the pending safety check.

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

          - `status?: "in_progress" | "completed" | "incomplete" | null`

            The status of the message input. One of `in_progress`, `completed`, or `incomplete`. Populated when input items are returned via API.

            - `"in_progress"`

            - `"completed"`

            - `"incomplete"`

        - `BetaResponseFunctionWebSearch`

          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.

          - `id: string`

            The unique ID of the web search tool call.

          - `action: Search | OpenPage | FindInPage`

            An object describing the specific action taken in this web search call.
            Includes details on how the model used the web (search, open_page, find_in_page).

            - `Search`

              Action type "search" - Performs a web search query.

              - `type: "search"`

                The action type.

                - `"search"`

              - `queries?: Array<string>`

                The search queries.

              - `query?: string`

                The search query.

              - `sources?: Array<Source>`

                The sources used in the search.

                - `type: "url"`

                  The type of source. Always `url`.

                  - `"url"`

                - `url: string`

                  The URL of the source.

            - `OpenPage`

              Action type "open_page" - Opens a specific URL from search results.

              - `type: "open_page"`

                The action type.

                - `"open_page"`

              - `url?: string | null`

                The URL opened by the model.

            - `FindInPage`

              Action type "find_in_page": Searches for a pattern within a loaded page.

              - `pattern: string`

                The pattern or text to search for within the page.

              - `type: "find_in_page"`

                The action type.

                - `"find_in_page"`

              - `url: string`

                The URL of the page searched for the pattern.

          - `status: "in_progress" | "searching" | "completed" | "failed"`

            The status of the web search tool call.

            - `"in_progress"`

            - `"searching"`

            - `"completed"`

            - `"failed"`

          - `type: "web_search_call"`

            The type of the web search tool call. Always `web_search_call`.

            - `"web_search_call"`

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

        - `BetaResponseFunctionToolCall`

          A tool call to run a function. See the
          [function calling guide](https://platform.openai.com/docs/guides/function-calling) for more information.

          - `arguments: string`

            A JSON string of the arguments to pass to the function.

          - `call_id: string`

            The unique ID of the function tool call generated by the model.

          - `name: string`

            The name of the function to run.

          - `type: "function_call"`

            The type of the function tool call. Always `function_call`.

            - `"function_call"`

          - `id?: string`

            The unique ID of the function tool call.

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

          - `caller?: Direct | Program | null`

            The execution context that produced this tool call.

            - `Direct`

              - `type: "direct"`

                - `"direct"`

            - `Program`

              - `caller_id: string`

                The call ID of the program item that produced this tool call.

              - `type: "program"`

                - `"program"`

          - `namespace?: string`

            The namespace of the function to run.

          - `status?: "in_progress" | "completed" | "incomplete"`

            The status of the item. One of `in_progress`, `completed`, or
            `incomplete`. Populated when items are returned via API.

            - `"in_progress"`

            - `"completed"`

            - `"incomplete"`

        - `FunctionCallOutput`

          The output of a function tool call.

          - `call_id: string`

            The unique ID of the function tool call generated by the model.

          - `output: string | BetaResponseFunctionCallOutputItemList`

            Text, image, or file output of the function tool call.

            - `string`

            - `BetaResponseFunctionCallOutputItemList = Array<BetaResponseFunctionCallOutputItem>`

              An array of content outputs (text, image, file) for the function tool call.

              - `BetaResponseInputTextContent`

                A text input to the model.

                - `text: string`

                  The text input to the model.

                - `type: "input_text"`

                  The type of the input item. Always `input_text`.

                  - `"input_text"`

                - `prompt_cache_breakpoint?: PromptCacheBreakpoint | null`

                  Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.

                  - `mode: "explicit"`

                    The breakpoint mode. Always `explicit`.

                    - `"explicit"`

              - `BetaResponseInputImageContent`

                An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision)

                - `type: "input_image"`

                  The type of the input item. Always `input_image`.

                  - `"input_image"`

                - `detail?: BetaImageDetail | null`

                  The detail level of the image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`.

                - `file_id?: string | null`

                  The ID of the file to be sent to the model.

                - `image_url?: string | null`

                  The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.

                - `prompt_cache_breakpoint?: PromptCacheBreakpoint | null`

                  Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.

                  - `mode: "explicit"`

                    The breakpoint mode. Always `explicit`.

                    - `"explicit"`

              - `BetaResponseInputFileContent`

                A file input to the model.

                - `type: "input_file"`

                  The type of the input item. Always `input_file`.

                  - `"input_file"`

                - `detail?: "auto" | "low" | "high"`

                  The detail level of the file to be sent to the model. Use `auto` to let the system select the detail level; for GPT-5.6 and later models, `auto` uses high-quality rendering, which may increase input token usage. Use `low` for lower-cost rendering, or `high` to render the file at higher quality. Defaults to `auto`.

                  - `"auto"`

                  - `"low"`

                  - `"high"`

                - `file_data?: string | null`

                  The base64-encoded data of the file to be sent to the model.

                - `file_id?: string | null`

                  The ID of the file to be sent to the model.

                - `file_url?: string | null`

                  The URL of the file to be sent to the model.

                - `filename?: string | null`

                  The name of the file to be sent to the model.

                - `prompt_cache_breakpoint?: PromptCacheBreakpoint | null`

                  Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.

                  - `mode: "explicit"`

                    The breakpoint mode. Always `explicit`.

                    - `"explicit"`

          - `type: "function_call_output"`

            The type of the function tool call output. Always `function_call_output`.

            - `"function_call_output"`

          - `id?: string | null`

            The unique ID of the function tool call output. Populated when this item is returned via API.

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

          - `caller?: Direct | Program | null`

            The execution context that produced this tool call.

            - `Direct`

              - `type: "direct"`

                The caller type. Always `direct`.

                - `"direct"`

            - `Program`

              - `caller_id: string`

                The call ID of the program item that produced this tool call.

              - `type: "program"`

                The caller type. Always `program`.

                - `"program"`

          - `name?: string | null`

            The name of the tool that produced the output.

          - `namespace?: string | null`

            The namespace of the tool that produced the output.

          - `status?: "in_progress" | "completed" | "incomplete" | null`

            The status of the item. One of `in_progress`, `completed`, or `incomplete`. Populated when items are returned via API.

            - `"in_progress"`

            - `"completed"`

            - `"incomplete"`

        - `AgentMessage`

          A message routed between agents.

          - `author: string`

            The sending agent identity.

          - `content: Array<BetaResponseInputTextContent | BetaResponseInputImageContent | EncryptedContent>`

            Plaintext, image, or encrypted content sent between agents.

            - `BetaResponseInputTextContent`

              A text input to the model.

            - `BetaResponseInputImageContent`

              An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision)

            - `EncryptedContent`

              Opaque encrypted content that Responses API decrypts inside trusted model execution.

              - `encrypted_content: string`

                Opaque encrypted content.

              - `type: "encrypted_content"`

                The type of the input item. Always `encrypted_content`.

                - `"encrypted_content"`

          - `recipient: string`

            The destination agent identity.

          - `type: "agent_message"`

            The item type. Always `agent_message`.

            - `"agent_message"`

          - `id?: string | null`

            The unique ID of this agent message item.

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

        - `MultiAgentCall`

          - `action: "spawn_agent" | "interrupt_agent" | "list_agents" | 3 more`

            The multi-agent action that was executed.

            - `"spawn_agent"`

            - `"interrupt_agent"`

            - `"list_agents"`

            - `"send_message"`

            - `"followup_task"`

            - `"wait_agent"`

          - `arguments: string`

            The action arguments as a JSON string.

          - `call_id: string`

            The unique ID linking this call to its output.

          - `type: "multi_agent_call"`

            The item type. Always `multi_agent_call`.

            - `"multi_agent_call"`

          - `id?: string | null`

            The unique ID of this multi-agent call.

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

        - `MultiAgentCallOutput`

          - `action: "spawn_agent" | "interrupt_agent" | "list_agents" | 3 more`

            The multi-agent action that produced this result.

            - `"spawn_agent"`

            - `"interrupt_agent"`

            - `"list_agents"`

            - `"send_message"`

            - `"followup_task"`

            - `"wait_agent"`

          - `call_id: string`

            The unique ID of the multi-agent call.

          - `output: Array<Output>`

            Text output returned by the multi-agent action.

            - `text: string`

              The text content.

            - `type: "output_text"`

              The content type. Always `output_text`.

              - `"output_text"`

            - `annotations?: Array<FileCitation | URLCitation | ContainerFileCitation>`

              Citations associated with the text content.

              - `FileCitation`

                - `file_id: string`

                  The ID of the file.

                - `filename: string`

                  The filename of the file cited.

                - `index: number`

                  The index of the file in the list of files.

                - `type: "file_citation"`

                  The citation type. Always `file_citation`.

                  - `"file_citation"`

              - `URLCitation`

                - `end_index: number`

                  The index of the last character of the citation in the message.

                - `start_index: number`

                  The index of the first character of the citation in the message.

                - `title: string`

                  The title of the cited resource.

                - `type: "url_citation"`

                  The citation type. Always `url_citation`.

                  - `"url_citation"`

                - `url: string`

                  The URL of the cited resource.

              - `ContainerFileCitation`

                - `container_id: string`

                  The ID of the container.

                - `end_index: number`

                  The index of the last character of the citation in the message.

                - `file_id: string`

                  The ID of the container file.

                - `filename: string`

                  The filename of the container file cited.

                - `start_index: number`

                  The index of the first character of the citation in the message.

                - `type: "container_file_citation"`

                  The citation type. Always `container_file_citation`.

                  - `"container_file_citation"`

          - `type: "multi_agent_call_output"`

            The item type. Always `multi_agent_call_output`.

            - `"multi_agent_call_output"`

          - `id?: string | null`

            The unique ID of this multi-agent call output.

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

        - `ToolSearchCall`

          - `arguments: unknown`

            The arguments supplied to the tool search call.

          - `type: "tool_search_call"`

            The item type. Always `tool_search_call`.

            - `"tool_search_call"`

          - `id?: string | null`

            The unique ID of this tool search call.

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

          - `call_id?: string | null`

            The unique ID of the tool search call generated by the model.

          - `execution?: "server" | "client"`

            Whether tool search was executed by the server or by the client.

            - `"server"`

            - `"client"`

          - `status?: "in_progress" | "completed" | "incomplete" | null`

            The status of the tool search call.

            - `"in_progress"`

            - `"completed"`

            - `"incomplete"`

        - `BetaResponseToolSearchOutputItemParam`

          - `tools: Array<BetaTool>`

            The loaded tool definitions returned by the tool search output.

            - `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).

              - `name: string`

                The name of the function to call.

              - `parameters: Record<string, unknown> | null`

                A JSON schema object describing the parameters of the function.

              - `strict: boolean | null`

                Whether strict parameter validation is enforced for this function tool.

              - `type: "function"`

                The type of the function tool. Always `function`.

                - `"function"`

              - `allowed_callers?: Array<"direct" | "programmatic"> | null`

                The tool invocation context(s).

                - `"direct"`

                - `"programmatic"`

              - `defer_loading?: boolean`

                Whether this function is deferred and loaded via tool search.

              - `description?: string | null`

                A description of the function. Used by the model to determine whether or not to call the function.

              - `output_schema?: Record<string, unknown> | null`

                A JSON schema object describing the JSON value encoded in string outputs for this function.

            - `BetaFileSearchTool`

              A tool that searches for relevant content from uploaded files. Learn more about the [file search tool](https://platform.openai.com/docs/guides/tools-file-search).

              - `type: "file_search"`

                The type of the file search tool. Always `file_search`.

                - `"file_search"`

              - `vector_store_ids: Array<string>`

                The IDs of the vector stores to search.

              - `filters?: ComparisonFilter | CompoundFilter | null`

                A filter to apply.

                - `ComparisonFilter`

                  A filter used to compare a specified attribute key to a given value using a defined comparison operation.

                  - `key: string`

                    The key to compare against the value.

                  - `type: "eq" | "ne" | "gt" | 5 more`

                    Specifies the comparison operator: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`, `in`, `nin`.

                    - `eq`: equals
                    - `ne`: not equal
                    - `gt`: greater than
                    - `gte`: greater than or equal
                    - `lt`: less than
                    - `lte`: less than or equal
                    - `in`: in
                    - `nin`: not in

                    - `"eq"`

                    - `"ne"`

                    - `"gt"`

                    - `"gte"`

                    - `"lt"`

                    - `"lte"`

                    - `"in"`

                    - `"nin"`

                  - `value: string | number | boolean | Array<string | number>`

                    The value to compare against the attribute key; supports string, number, or boolean types.

                    - `string`

                    - `number`

                    - `boolean`

                    - `Array<string | number>`

                      - `string`

                      - `number`

                - `CompoundFilter`

                  Combine multiple filters using `and` or `or`.

                  - `filters: Array<ComparisonFilter | unknown>`

                    Array of filters to combine. Items can be `ComparisonFilter` or `CompoundFilter`.

                    - `ComparisonFilter`

                      A filter used to compare a specified attribute key to a given value using a defined comparison operation.

                      - `key: string`

                        The key to compare against the value.

                      - `type: "eq" | "ne" | "gt" | 5 more`

                        Specifies the comparison operator: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`, `in`, `nin`.

                        - `eq`: equals
                        - `ne`: not equal
                        - `gt`: greater than
                        - `gte`: greater than or equal
                        - `lt`: less than
                        - `lte`: less than or equal
                        - `in`: in
                        - `nin`: not in

                        - `"eq"`

                        - `"ne"`

                        - `"gt"`

                        - `"gte"`

                        - `"lt"`

                        - `"lte"`

                        - `"in"`

                        - `"nin"`

                      - `value: string | number | boolean | Array<string | number>`

                        The value to compare against the attribute key; supports string, number, or boolean types.

                        - `string`

                        - `number`

                        - `boolean`

                        - `Array<string | number>`

                          - `string`

                          - `number`

                    - `unknown`

                  - `type: "and" | "or"`

                    Type of operation: `and` or `or`.

                    - `"and"`

                    - `"or"`

              - `max_num_results?: number`

                The maximum number of results to return. This number should be between 1 and 50 inclusive.

              - `ranking_options?: RankingOptions`

                Ranking options for search.

                - `hybrid_search?: HybridSearch`

                  Weights that control how reciprocal rank fusion balances semantic embedding matches versus sparse keyword matches when hybrid search is enabled.

                  - `embedding_weight: number`

                    The weight of the embedding in the reciprocal ranking fusion.

                  - `text_weight: number`

                    The weight of the text in the reciprocal ranking fusion.

                - `ranker?: "auto" | "default-2024-11-15"`

                  The ranker to use for the file search.

                  - `"auto"`

                  - `"default-2024-11-15"`

                - `score_threshold?: number`

                  The score threshold for the file search, a number between 0 and 1. Numbers closer to 1 will attempt to return only the most relevant results, but may return fewer results.

            - `BetaComputerTool`

              A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use).

              - `type: "computer"`

                The type of the computer tool. Always `computer`.

                - `"computer"`

            - `BetaComputerUsePreviewTool`

              A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use).

              - `display_height: number`

                The height of the computer display.

              - `display_width: number`

                The width of the computer display.

              - `environment: "windows" | "mac" | "linux" | 2 more`

                The type of computer environment to control.

                - `"windows"`

                - `"mac"`

                - `"linux"`

                - `"ubuntu"`

                - `"browser"`

              - `type: "computer_use_preview"`

                The type of the computer use tool. Always `computer_use_preview`.

                - `"computer_use_preview"`

            - `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"`

                The type of the web search tool. One of `web_search` or `web_search_2025_08_26`.

                - `"web_search"`

                - `"web_search_2025_08_26"`

              - `external_web_access?: boolean`

                Allow live internet access for web search. Defaults to true when omitted. When false, the web search tool runs in offline/cache-only mode and will not fetch new external content.

              - `filters?: Filters | null`

                Filters for the search.

                - `allowed_domains?: Array<string> | null`

                  Allowed domains for the search. If not provided, all domains are allowed.
                  Subdomains of the provided domains are allowed as well.

                  Example: `["pubmed.ncbi.nlm.nih.gov"]`

              - `search_context_size?: "low" | "medium" | "high"`

                High level guidance for the amount of context window space to use for the search. One of `low`, `medium`, or `high`. `medium` is the default.

                - `"low"`

                - `"medium"`

                - `"high"`

              - `user_location?: UserLocation | null`

                The approximate location of the user.

                - `city?: string | null`

                  Free text input for the city of the user, e.g. `San Francisco`.

                - `country?: string | null`

                  The two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of the user, e.g. `US`.

                - `region?: string | null`

                  Free text input for the region of the user, e.g. `California`.

                - `timezone?: string | null`

                  The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of the user, e.g. `America/Los_Angeles`.

                - `type?: "approximate"`

                  The type of location approximation. Always `approximate`.

                  - `"approximate"`

            - `Mcp`

              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).

              - `server_label: string`

                A label for this MCP server, used to identify it in tool calls.

              - `type: "mcp"`

                The type of the MCP tool. Always `mcp`.

                - `"mcp"`

              - `allowed_callers?: Array<"direct" | "programmatic"> | null`

                The tool invocation context(s).

                - `"direct"`

                - `"programmatic"`

              - `allowed_tools?: Array<string> | McpToolFilter | null`

                List of allowed tool names or a filter object.

                - `Array<string>`

                - `McpToolFilter`

                  A filter object to specify which tools are allowed.

                  - `read_only?: boolean`

                    Indicates whether or not a tool modifies data or is read-only. If an
                    MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint),
                    it will match this filter.

                  - `tool_names?: Array<string>`

                    List of allowed tool names.

              - `authorization?: string`

                An OAuth access token that can be used with a remote MCP server, either
                with a custom MCP server URL or a service connector. Your application
                must handle the OAuth authorization flow and provide the token here.

              - `connector_id?: "connector_dropbox" | "connector_gmail" | "connector_googlecalendar" | 5 more`

                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`

                - `"connector_dropbox"`

                - `"connector_gmail"`

                - `"connector_googlecalendar"`

                - `"connector_googledrive"`

                - `"connector_microsoftteams"`

                - `"connector_outlookcalendar"`

                - `"connector_outlookemail"`

                - `"connector_sharepoint"`

              - `defer_loading?: boolean`

                Whether this MCP tool is deferred and discovered via tool search.

              - `headers?: Record<string, string> | null`

                Optional HTTP headers to send to the MCP server. Use for authentication
                or other purposes.

              - `require_approval?: McpToolApprovalFilter | "always" | "never" | null`

                Specify which of the MCP server's tools require approval.

                - `McpToolApprovalFilter`

                  Specify which of the MCP server's tools require approval. Can be
                  `always`, `never`, or a filter object associated with tools
                  that require approval.

                  - `always?: Always`

                    A filter object to specify which tools are allowed.

                    - `read_only?: boolean`

                      Indicates whether or not a tool modifies data or is read-only. If an
                      MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint),
                      it will match this filter.

                    - `tool_names?: Array<string>`

                      List of allowed tool names.

                  - `never?: Never`

                    A filter object to specify which tools are allowed.

                    - `read_only?: boolean`

                      Indicates whether or not a tool modifies data or is read-only. If an
                      MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint),
                      it will match this filter.

                    - `tool_names?: Array<string>`

                      List of allowed tool names.

                - `"always" | "never"`

                  - `"always"`

                  - `"never"`

              - `server_description?: string`

                Optional description of the MCP server, used to provide more context.

              - `server_url?: string`

                The URL for the MCP server. One of `server_url`, `connector_id`, or
                `tunnel_id` must be provided.

              - `tunnel_id?: string`

                The Secure MCP Tunnel ID to use instead of a direct server URL. One of
                `server_url`, `connector_id`, or `tunnel_id` must be provided.

            - `CodeInterpreter`

              A tool that runs Python code to help generate a response to a prompt.

              - `container: string | CodeInterpreterToolAuto`

                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`

                - `CodeInterpreterToolAuto`

                  Configuration for a code interpreter container. Optionally specify the IDs of the files to run the code on.

                  - `type: "auto"`

                    Always `auto`.

                    - `"auto"`

                  - `file_ids?: Array<string>`

                    An optional list of uploaded files to make available to your code.

                  - `memory_limit?: "1g" | "4g" | "16g" | "64g" | null`

                    The memory limit for the code interpreter container.

                    - `"1g"`

                    - `"4g"`

                    - `"16g"`

                    - `"64g"`

                  - `network_policy?: BetaContainerNetworkPolicyDisabled | BetaContainerNetworkPolicyAllowlist`

                    Network access policy for the container.

                    - `BetaContainerNetworkPolicyDisabled`

                      - `type: "disabled"`

                        Disable outbound network access. Always `disabled`.

                        - `"disabled"`

                    - `BetaContainerNetworkPolicyAllowlist`

                      - `allowed_domains: Array<string>`

                        A list of allowed domains when type is `allowlist`.

                      - `type: "allowlist"`

                        Allow outbound network access only to specified domains. Always `allowlist`.

                        - `"allowlist"`

                      - `domain_secrets?: Array<BetaContainerNetworkPolicyDomainSecret>`

                        Optional domain-scoped secrets for allowlisted domains.

                        - `domain: string`

                          The domain associated with the secret.

                        - `name: string`

                          The name of the secret to inject for the domain.

                        - `value: string`

                          The secret value to inject for the domain.

              - `type: "code_interpreter"`

                The type of the code interpreter tool. Always `code_interpreter`.

                - `"code_interpreter"`

              - `allowed_callers?: Array<"direct" | "programmatic"> | null`

                The tool invocation context(s).

                - `"direct"`

                - `"programmatic"`

            - `ProgrammaticToolCalling`

              - `type: "programmatic_tool_calling"`

                The type of the tool. Always `programmatic_tool_calling`.

                - `"programmatic_tool_calling"`

            - `ImageGeneration`

              A tool that generates images using the GPT image models.

              - `type: "image_generation"`

                The type of the image generation tool. Always `image_generation`.

                - `"image_generation"`

              - `action?: "generate" | "edit" | "auto"`

                Whether to generate a new image or edit an existing image. Default: `auto`.

                - `"generate"`

                - `"edit"`

                - `"auto"`

              - `background?: "transparent" | "opaque" | "auto"`

                Allows to set transparency for the background of the generated image(s).
                Must be one of `transparent`, `opaque`, or `auto` (default value). When
                `auto` is used, the model will automatically determine the best
                background for the image.

                Transparent backgrounds are available for supported GPT Image models.
                For `gpt-image-2` and `gpt-image-2-2026-04-21`, this support is in
                preview. When using `transparent`, set the output format to `png` or
                `webp`.

                - `"transparent"`

                - `"opaque"`

                - `"auto"`

              - `input_fidelity?: "high" | "low" | null`

                Control how much effort the model will exert to match the style and features, especially facial features, of input images. This parameter is only supported for `gpt-image-1` and `gpt-image-1.5` and later models, unsupported for `gpt-image-1-mini`. Supports `high` and `low`. Defaults to `low`.

                - `"high"`

                - `"low"`

              - `input_image_mask?: InputImageMask`

                Optional mask for inpainting. Contains `image_url`
                (string, optional) and `file_id` (string, optional).

                - `file_id?: string`

                  File ID for the mask image.

                - `image_url?: string`

                  Base64-encoded mask image.

              - `model?: (string & {}) | "gpt-image-1" | "gpt-image-1-mini" | "gpt-image-2" | 3 more`

                The image generation model to use. One of `gpt-image-1`,
                `gpt-image-1-mini`, `gpt-image-1.5`, `gpt-image-2`,
                `gpt-image-2-2026-04-21`, or `chatgpt-image-latest`. Default:
                `gpt-image-1`.

                - `(string & {})`

                - `"gpt-image-1" | "gpt-image-1-mini" | "gpt-image-2" | 3 more`

                  - `"gpt-image-1"`

                  - `"gpt-image-1-mini"`

                  - `"gpt-image-2"`

                  - `"gpt-image-2-2026-04-21"`

                  - `"gpt-image-1.5"`

                  - `"chatgpt-image-latest"`

              - `moderation?: "auto" | "low"`

                Moderation level for the generated image. Default: `auto`.

                - `"auto"`

                - `"low"`

              - `output_compression?: number`

                Compression level for the output image. Default: 100.

              - `output_format?: "png" | "webp" | "jpeg"`

                The output format of the generated image. One of `png`, `webp`, or
                `jpeg`. Default: `png`.

                - `"png"`

                - `"webp"`

                - `"jpeg"`

              - `partial_images?: number`

                Number of partial images to generate in streaming mode, from 0 (default value) to 3.

              - `quality?: "low" | "medium" | "high" | "auto"`

                The quality of the generated image. One of `low`, `medium`, `high`,
                or `auto`. Default: `auto`.

                - `"low"`

                - `"medium"`

                - `"high"`

                - `"auto"`

              - `size?: (string & {}) | "1024x1024" | "1024x1536" | "1536x1024" | "auto"`

                The size of the generated images. For `gpt-image-2` and `gpt-image-2-2026-04-21`, arbitrary resolutions are supported as `WIDTHxHEIGHT` strings, for example `1536x864`. Width and height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above `2560x1440` are experimental, and the maximum supported resolution is `3840x2160`. The requested size must also satisfy the model's current pixel and edge limits. The standard sizes `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models; `auto` is supported for models that allow automatic sizing. For `dall-e-2`, use one of `256x256`, `512x512`, or `1024x1024`. For `dall-e-3`, use one of `1024x1024`, `1792x1024`, or `1024x1792`.

                - `(string & {})`

                - `"1024x1024" | "1024x1536" | "1536x1024" | "auto"`

                  - `"1024x1024"`

                  - `"1024x1536"`

                  - `"1536x1024"`

                  - `"auto"`

            - `LocalShell`

              A tool that allows the model to execute shell commands in a local environment.

              - `type: "local_shell"`

                The type of the local shell tool. Always `local_shell`.

                - `"local_shell"`

            - `BetaFunctionShellTool`

              A tool that allows the model to execute shell commands.

              - `type: "shell"`

                The type of the shell tool. Always `shell`.

                - `"shell"`

              - `allowed_callers?: Array<"direct" | "programmatic"> | null`

                The tool invocation context(s).

                - `"direct"`

                - `"programmatic"`

              - `environment?: BetaContainerAuto | BetaLocalEnvironment | BetaContainerReference | null`

                - `BetaContainerAuto`

                  - `type: "container_auto"`

                    Automatically creates a container for this request

                    - `"container_auto"`

                  - `file_ids?: Array<string>`

                    An optional list of uploaded files to make available to your code.

                  - `memory_limit?: "1g" | "4g" | "16g" | "64g" | null`

                    The memory limit for the container.

                    - `"1g"`

                    - `"4g"`

                    - `"16g"`

                    - `"64g"`

                  - `network_policy?: BetaContainerNetworkPolicyDisabled | BetaContainerNetworkPolicyAllowlist`

                    Network access policy for the container.

                    - `BetaContainerNetworkPolicyDisabled`

                    - `BetaContainerNetworkPolicyAllowlist`

                  - `skills?: Array<BetaSkillReference | BetaInlineSkill>`

                    An optional list of skills referenced by id or inline data.

                    - `BetaSkillReference`

                      - `skill_id: string`

                        The ID of the referenced skill.

                      - `type: "skill_reference"`

                        References a skill created with the /v1/skills endpoint.

                        - `"skill_reference"`

                      - `version?: string`

                        Optional skill version. Use a positive integer or 'latest'. Omit for default.

                    - `BetaInlineSkill`

                      - `description: string`

                        The description of the skill.

                      - `name: string`

                        The name of the skill.

                      - `source: BetaInlineSkillSource`

                        Inline skill payload

                        - `data: string`

                          Base64-encoded skill zip bundle.

                        - `media_type: "application/zip"`

                          The media type of the inline skill payload. Must be `application/zip`.

                          - `"application/zip"`

                        - `type: "base64"`

                          The type of the inline skill source. Must be `base64`.

                          - `"base64"`

                      - `type: "inline"`

                        Defines an inline skill for this request.

                        - `"inline"`

                - `BetaLocalEnvironment`

                  - `type: "local"`

                    Use a local computer environment.

                    - `"local"`

                  - `skills?: Array<BetaLocalSkill>`

                    An optional list of skills.

                    - `description: string`

                      The description of the skill.

                    - `name: string`

                      The name of the skill.

                    - `path: string`

                      The path to the directory containing the skill.

                - `BetaContainerReference`

                  - `container_id: string`

                    The ID of the referenced container.

                  - `type: "container_reference"`

                    References a container created with the /v1/containers endpoint

                    - `"container_reference"`

            - `BetaCustomTool`

              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)

              - `name: string`

                The name of the custom tool, used to identify it in tool calls.

              - `type: "custom"`

                The type of the custom tool. Always `custom`.

                - `"custom"`

              - `allowed_callers?: Array<"direct" | "programmatic"> | null`

                The tool invocation context(s).

                - `"direct"`

                - `"programmatic"`

              - `defer_loading?: boolean`

                Whether this tool should be deferred and discovered via tool search.

              - `description?: string`

                Optional description of the custom tool, used to provide more context.

              - `format?: Text | Grammar`

                The input format for the custom tool. Default is unconstrained text.

                - `Text`

                  Unconstrained free-form text.

                  - `type: "text"`

                    Unconstrained text format. Always `text`.

                    - `"text"`

                - `Grammar`

                  A grammar defined by the user.

                  - `definition: string`

                    The grammar definition.

                  - `syntax: "lark" | "regex"`

                    The syntax of the grammar definition. One of `lark` or `regex`.

                    - `"lark"`

                    - `"regex"`

                  - `type: "grammar"`

                    Grammar format. Always `grammar`.

                    - `"grammar"`

            - `BetaNamespaceTool`

              Groups function/custom tools under a shared namespace.

              - `description: string`

                A description of the namespace shown to the model.

              - `name: string`

                The namespace name used in tool calls (for example, `crm`).

              - `tools: Array<Function | BetaCustomTool>`

                The function/custom tools available inside this namespace.

                - `Function`

                  - `name: string`

                  - `type: "function"`

                    - `"function"`

                  - `allowed_callers?: Array<"direct" | "programmatic"> | null`

                    The tool invocation context(s).

                    - `"direct"`

                    - `"programmatic"`

                  - `defer_loading?: boolean`

                    Whether this function should be deferred and discovered via tool search.

                  - `description?: string | null`

                  - `output_schema?: Record<string, unknown> | null`

                    A JSON Schema describing the JSON value encoded in string outputs for this function tool. This does not describe content-array outputs.

                  - `parameters?: unknown`

                  - `strict?: boolean | null`

                    Whether to enforce strict parameter validation. If omitted, Responses attempts to use strict validation when the schema is compatible, and falls back to non-strict validation otherwise.

                - `BetaCustomTool`

                  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: "namespace"`

                The type of the tool. Always `namespace`.

                - `"namespace"`

            - `BetaToolSearchTool`

              Hosted or BYOT tool search configuration for deferred tools.

              - `type: "tool_search"`

                The type of the tool. Always `tool_search`.

                - `"tool_search"`

              - `description?: string | null`

                Description shown to the model for a client-executed tool search tool.

              - `execution?: "server" | "client"`

                Whether tool search is executed by the server or by the client.

                - `"server"`

                - `"client"`

              - `parameters?: unknown`

                Parameter schema for a client-executed tool search tool.

            - `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"`

                The type of the web search tool. One of `web_search_preview` or `web_search_preview_2025_03_11`.

                - `"web_search_preview"`

                - `"web_search_preview_2025_03_11"`

              - `search_content_types?: Array<"text" | "image">`

                - `"text"`

                - `"image"`

              - `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.

                - `"low"`

                - `"medium"`

                - `"high"`

              - `user_location?: UserLocation | null`

                The user's location.

                - `type: "approximate"`

                  The type of location approximation. Always `approximate`.

                  - `"approximate"`

                - `city?: string | null`

                  Free text input for the city of the user, e.g. `San Francisco`.

                - `country?: string | null`

                  The two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of the user, e.g. `US`.

                - `region?: string | null`

                  Free text input for the region of the user, e.g. `California`.

                - `timezone?: string | null`

                  The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of the user, e.g. `America/Los_Angeles`.

            - `BetaApplyPatchTool`

              Allows the assistant to create, delete, or update files using unified diffs.

              - `type: "apply_patch"`

                The type of the tool. Always `apply_patch`.

                - `"apply_patch"`

              - `allowed_callers?: Array<"direct" | "programmatic"> | null`

                The tool invocation context(s).

                - `"direct"`

                - `"programmatic"`

          - `type: "tool_search_output"`

            The item type. Always `tool_search_output`.

            - `"tool_search_output"`

          - `id?: string | null`

            The unique ID of this tool search output.

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

          - `call_id?: string | null`

            The unique ID of the tool search call generated by the model.

          - `execution?: "server" | "client"`

            Whether tool search was executed by the server or by the client.

            - `"server"`

            - `"client"`

          - `status?: "in_progress" | "completed" | "incomplete" | null`

            The status of the tool search output.

            - `"in_progress"`

            - `"completed"`

            - `"incomplete"`

        - `AdditionalTools`

          - `role: "developer"`

            The role that provided the additional tools. Only `developer` is supported.

            - `"developer"`

          - `tools: Array<BetaTool>`

            A list of additional tools made available at this item.

            - `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).

            - `Mcp`

              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).

            - `CodeInterpreter`

              A tool that runs Python code to help generate a response to a prompt.

            - `ProgrammaticToolCalling`

            - `ImageGeneration`

              A tool that generates images using the GPT image models.

            - `LocalShell`

              A tool that allows the model to execute shell commands in a local environment.

            - `BetaFunctionShellTool`

              A tool that allows the model to execute shell commands.

            - `BetaCustomTool`

              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)

            - `BetaNamespaceTool`

              Groups function/custom tools under a shared namespace.

            - `BetaToolSearchTool`

              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).

            - `BetaApplyPatchTool`

              Allows the assistant to create, delete, or update files using unified diffs.

          - `type: "additional_tools"`

            The item type. Always `additional_tools`.

            - `"additional_tools"`

          - `id?: string | null`

            The unique ID of this additional tools item.

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

        - `BetaResponseReasoningItem`

          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).

          - `id: string`

            The unique identifier of the reasoning content.

          - `summary: Array<Summary>`

            Reasoning summary content.

            - `text: string`

              A summary of the reasoning output from the model so far.

            - `type: "summary_text"`

              The type of the object. Always `summary_text`.

              - `"summary_text"`

          - `type: "reasoning"`

            The type of the object. Always `reasoning`.

            - `"reasoning"`

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

          - `content?: Array<Content>`

            Reasoning text content.

            - `text: string`

              The reasoning text from the model.

            - `type: "reasoning_text"`

              The type of the reasoning text. Always `reasoning_text`.

              - `"reasoning_text"`

          - `encrypted_content?: string | null`

            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.

            When streaming, use the completed reasoning item and its
            `encrypted_content` from the `response.output_item.done` event in
            subsequent requests. The `encrypted_content` in
            `response.output_item.added` may be incomplete. This is especially
            important when `store` is `false` or when using Zero Data Retention.

          - `status?: "in_progress" | "completed" | "incomplete"`

            The status of the item. One of `in_progress`, `completed`, or
            `incomplete`. Populated when items are returned via API.

            - `"in_progress"`

            - `"completed"`

            - `"incomplete"`

        - `BetaResponseCompactionItemParam`

          A compaction item generated by the [`v1/responses/compact` API](https://platform.openai.com/docs/api-reference/responses/compact).

          - `encrypted_content: string`

            The encrypted content of the compaction summary.

          - `type: "compaction"`

            The type of the item. Always `compaction`.

            - `"compaction"`

          - `id?: string | null`

            The ID of the compaction item.

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

        - `ImageGenerationCall`

          An image generation request made by the model.

          - `id: string`

            The unique ID of the image generation call.

          - `result: string | null`

            The generated image encoded in base64.

          - `status: "in_progress" | "completed" | "generating" | "failed"`

            The status of the image generation call.

            - `"in_progress"`

            - `"completed"`

            - `"generating"`

            - `"failed"`

          - `type: "image_generation_call"`

            The type of the image generation call. Always `image_generation_call`.

            - `"image_generation_call"`

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

        - `BetaResponseCodeInterpreterToolCall`

          A tool call to run code.

          - `id: string`

            The unique ID of the code interpreter tool call.

          - `code: string | null`

            The code to run, or null if not available.

          - `container_id: string`

            The ID of the container used to run the code.

          - `outputs: Array<Logs | Image> | null`

            The outputs generated by the code interpreter, such as logs or images.
            Can be null if no outputs are available.

            - `Logs`

              The logs output from the code interpreter.

              - `logs: string`

                The logs output from the code interpreter.

              - `type: "logs"`

                The type of the output. Always `logs`.

                - `"logs"`

            - `Image`

              The image output from the code interpreter.

              - `type: "image"`

                The type of the output. Always `image`.

                - `"image"`

              - `url: string`

                The URL of the image output from the code interpreter.

          - `status: "in_progress" | "completed" | "incomplete" | 2 more`

            The status of the code interpreter tool call. Valid values are `in_progress`, `completed`, `incomplete`, `interpreting`, and `failed`.

            - `"in_progress"`

            - `"completed"`

            - `"incomplete"`

            - `"interpreting"`

            - `"failed"`

          - `type: "code_interpreter_call"`

            The type of the code interpreter tool call. Always `code_interpreter_call`.

            - `"code_interpreter_call"`

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

        - `LocalShellCall`

          A tool call to run a command on the local shell.

          - `id: string`

            The unique ID of the local shell call.

          - `action: Action`

            Execute a shell command on the server.

            - `command: Array<string>`

              The command to run.

            - `env: Record<string, string>`

              Environment variables to set for the command.

            - `type: "exec"`

              The type of the local shell action. Always `exec`.

              - `"exec"`

            - `timeout_ms?: number | null`

              Optional timeout in milliseconds for the command.

            - `user?: string | null`

              Optional user to run the command as.

            - `working_directory?: string | null`

              Optional working directory to run the command in.

          - `call_id: string`

            The unique ID of the local shell tool call generated by the model.

          - `status: "in_progress" | "completed" | "incomplete"`

            The status of the local shell call.

            - `"in_progress"`

            - `"completed"`

            - `"incomplete"`

          - `type: "local_shell_call"`

            The type of the local shell call. Always `local_shell_call`.

            - `"local_shell_call"`

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

        - `LocalShellCallOutput`

          The output of a local shell tool call.

          - `id: string`

            The unique ID of the local shell tool call generated by the model.

          - `output: string`

            A JSON string of the output of the local shell tool call.

          - `type: "local_shell_call_output"`

            The type of the local shell tool call output. Always `local_shell_call_output`.

            - `"local_shell_call_output"`

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

          - `status?: "in_progress" | "completed" | "incomplete" | null`

            The status of the item. One of `in_progress`, `completed`, or `incomplete`.

            - `"in_progress"`

            - `"completed"`

            - `"incomplete"`

        - `ShellCall`

          A tool representing a request to execute one or more shell commands.

          - `action: Action`

            The shell commands and limits that describe how to run the tool call.

            - `commands: Array<string>`

              Ordered shell commands for the execution environment to run.

            - `max_output_length?: number | null`

              Maximum number of UTF-8 characters to capture from combined stdout and stderr output.

            - `timeout_ms?: number | null`

              Maximum wall-clock time in milliseconds to allow the shell commands to run.

          - `call_id: string`

            The unique ID of the shell tool call generated by the model.

          - `type: "shell_call"`

            The type of the item. Always `shell_call`.

            - `"shell_call"`

          - `id?: string | null`

            The unique ID of the shell tool call. Populated when this item is returned via API.

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

          - `caller?: Direct | Program | null`

            The execution context that produced this tool call.

            - `Direct`

              - `type: "direct"`

                The caller type. Always `direct`.

                - `"direct"`

            - `Program`

              - `caller_id: string`

                The call ID of the program item that produced this tool call.

              - `type: "program"`

                The caller type. Always `program`.

                - `"program"`

          - `environment?: BetaLocalEnvironment | BetaContainerReference | null`

            The environment to execute the shell commands in.

            - `BetaLocalEnvironment`

            - `BetaContainerReference`

          - `status?: "in_progress" | "completed" | "incomplete" | null`

            The status of the shell call. One of `in_progress`, `completed`, or `incomplete`.

            - `"in_progress"`

            - `"completed"`

            - `"incomplete"`

        - `ShellCallOutput`

          The streamed output items emitted by a shell tool call.

          - `call_id: string`

            The unique ID of the shell tool call generated by the model.

          - `output: Array<BetaResponseFunctionShellCallOutputContent>`

            Captured chunks of stdout and stderr output, along with their associated outcomes.

            - `outcome: Timeout | Exit`

              The exit or timeout outcome associated with this shell call.

              - `Timeout`

                Indicates that the shell call exceeded its configured time limit.

                - `type: "timeout"`

                  The outcome type. Always `timeout`.

                  - `"timeout"`

              - `Exit`

                Indicates that the shell commands finished and returned an exit code.

                - `exit_code: number`

                  The exit code returned by the shell process.

                - `type: "exit"`

                  The outcome type. Always `exit`.

                  - `"exit"`

            - `stderr: string`

              Captured stderr output for the shell call.

            - `stdout: string`

              Captured stdout output for the shell call.

          - `type: "shell_call_output"`

            The type of the item. Always `shell_call_output`.

            - `"shell_call_output"`

          - `id?: string | null`

            The unique ID of the shell tool call output. Populated when this item is returned via API.

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

          - `caller?: Direct | Program | null`

            The execution context that produced this tool call.

            - `Direct`

              - `type: "direct"`

                The caller type. Always `direct`.

                - `"direct"`

            - `Program`

              - `caller_id: string`

                The call ID of the program item that produced this tool call.

              - `type: "program"`

                The caller type. Always `program`.

                - `"program"`

          - `max_output_length?: number | null`

            The maximum number of UTF-8 characters captured for this shell call's combined output.

          - `status?: "in_progress" | "completed" | "incomplete" | null`

            The status of the shell call output.

            - `"in_progress"`

            - `"completed"`

            - `"incomplete"`

        - `ApplyPatchCall`

          A tool call representing a request to create, delete, or update files using diff patches.

          - `call_id: string`

            The unique ID of the apply patch tool call generated by the model.

          - `operation: CreateFile | DeleteFile | UpdateFile`

            The specific create, delete, or update instruction for the apply_patch tool call.

            - `CreateFile`

              Instruction for creating a new file via the apply_patch tool.

              - `diff: string`

                Unified diff content to apply when creating the file.

              - `path: string`

                Path of the file to create relative to the workspace root.

              - `type: "create_file"`

                The operation type. Always `create_file`.

                - `"create_file"`

            - `DeleteFile`

              Instruction for deleting an existing file via the apply_patch tool.

              - `path: string`

                Path of the file to delete relative to the workspace root.

              - `type: "delete_file"`

                The operation type. Always `delete_file`.

                - `"delete_file"`

            - `UpdateFile`

              Instruction for updating an existing file via the apply_patch tool.

              - `diff: string`

                Unified diff content to apply to the existing file.

              - `path: string`

                Path of the file to update relative to the workspace root.

              - `type: "update_file"`

                The operation type. Always `update_file`.

                - `"update_file"`

          - `status: "in_progress" | "completed"`

            The status of the apply patch tool call. One of `in_progress` or `completed`.

            - `"in_progress"`

            - `"completed"`

          - `type: "apply_patch_call"`

            The type of the item. Always `apply_patch_call`.

            - `"apply_patch_call"`

          - `id?: string | null`

            The unique ID of the apply patch tool call. Populated when this item is returned via API.

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

          - `caller?: Direct | Program | null`

            The execution context that produced this tool call.

            - `Direct`

              - `type: "direct"`

                The caller type. Always `direct`.

                - `"direct"`

            - `Program`

              - `caller_id: string`

                The call ID of the program item that produced this tool call.

              - `type: "program"`

                The caller type. Always `program`.

                - `"program"`

        - `ApplyPatchCallOutput`

          The streamed output emitted by an apply patch tool call.

          - `call_id: string`

            The unique ID of the apply patch tool call generated by the model.

          - `status: "completed" | "failed"`

            The status of the apply patch tool call output. One of `completed` or `failed`.

            - `"completed"`

            - `"failed"`

          - `type: "apply_patch_call_output"`

            The type of the item. Always `apply_patch_call_output`.

            - `"apply_patch_call_output"`

          - `id?: string | null`

            The unique ID of the apply patch tool call output. Populated when this item is returned via API.

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

          - `caller?: Direct | Program | null`

            The execution context that produced this tool call.

            - `Direct`

              - `type: "direct"`

                The caller type. Always `direct`.

                - `"direct"`

            - `Program`

              - `caller_id: string`

                The call ID of the program item that produced this tool call.

              - `type: "program"`

                The caller type. Always `program`.

                - `"program"`

          - `output?: string | null`

            Optional human-readable log text from the apply patch tool (e.g., patch results or errors).

        - `McpListTools`

          A list of tools available on an MCP server.

          - `id: string`

            The unique ID of the list.

          - `server_label: string`

            The label of the MCP server.

          - `tools: Array<Tool>`

            The tools available on the server.

            - `input_schema: unknown`

              The JSON schema describing the tool's input.

            - `name: string`

              The name of the tool.

            - `annotations?: unknown`

              Additional annotations about the tool.

            - `description?: string | null`

              The description of the tool.

          - `type: "mcp_list_tools"`

            The type of the item. Always `mcp_list_tools`.

            - `"mcp_list_tools"`

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

          - `error?: string | null`

            Error message if the server could not list tools.

        - `McpApprovalRequest`

          A request for human approval of a tool invocation.

          - `id: string`

            The unique ID of the approval request.

          - `arguments: string`

            A JSON string of arguments for the tool.

          - `name: string`

            The name of the tool to run.

          - `server_label: string`

            The label of the MCP server making the request.

          - `type: "mcp_approval_request"`

            The type of the item. Always `mcp_approval_request`.

            - `"mcp_approval_request"`

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

        - `McpApprovalResponse`

          A response to an MCP approval request.

          - `approval_request_id: string`

            The ID of the approval request being answered.

          - `approve: boolean`

            Whether the request was approved.

          - `type: "mcp_approval_response"`

            The type of the item. Always `mcp_approval_response`.

            - `"mcp_approval_response"`

          - `id?: string | null`

            The unique ID of the approval response

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

          - `reason?: string | null`

            Optional reason for the decision.

        - `McpCall`

          An invocation of a tool on an MCP server.

          - `id: string`

            The unique ID of the tool call.

          - `arguments: string`

            A JSON string of the arguments passed to the tool.

          - `name: string`

            The name of the tool that was run.

          - `server_label: string`

            The label of the MCP server running the tool.

          - `type: "mcp_call"`

            The type of the item. Always `mcp_call`.

            - `"mcp_call"`

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

          - `approval_request_id?: string | null`

            Unique identifier for the MCP tool call approval request.
            Include this value in a subsequent `mcp_approval_response` input to approve or reject the corresponding tool call.

          - `error?: BetaMcpToolCallError | null`

            The error from the tool call, if any.

            - `McpProtocolError`

              - `code: number`

              - `message: string`

              - `type: "mcp_protocol_error"`

                - `"mcp_protocol_error"`

            - `McpToolExecutionError`

              - `content: unknown`

              - `type: "mcp_tool_execution_error"`

                - `"mcp_tool_execution_error"`

            - `HTTPError`

              - `code: number`

              - `message: string`

              - `type: "http_error"`

                - `"http_error"`

          - `output?: string | null`

            The output from the tool call.

          - `status?: "in_progress" | "completed" | "incomplete" | 2 more`

            The status of the tool call. One of `in_progress`, `completed`, `incomplete`, `calling`, or `failed`.

            - `"in_progress"`

            - `"completed"`

            - `"incomplete"`

            - `"calling"`

            - `"failed"`

        - `BetaResponseCustomToolCallOutput`

          The output of a custom tool call from your code, being sent back to the model.

          - `call_id: string`

            The call ID, used to map this custom tool call output to a custom tool call.

          - `output: string | Array<BetaResponseInputText | BetaResponseInputImage | BetaResponseInputFile>`

            The output from the custom tool call generated by your code.
            Can be a string or an list of output content.

            - `string`

            - `Array<BetaResponseInputText | BetaResponseInputImage | BetaResponseInputFile>`

              - `BetaResponseInputText`

                A text input to the model.

              - `BetaResponseInputImage`

                An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision).

              - `BetaResponseInputFile`

                A file input to the model.

          - `type: "custom_tool_call_output"`

            The type of the custom tool call output. Always `custom_tool_call_output`.

            - `"custom_tool_call_output"`

          - `id?: string`

            The unique ID of the custom tool call output in the OpenAI platform.

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

          - `caller?: Direct | Program | null`

            The execution context that produced this tool call.

            - `Direct`

              - `type: "direct"`

                The caller type. Always `direct`.

                - `"direct"`

            - `Program`

              - `caller_id: string`

                The call ID of the program item that produced this tool call.

              - `type: "program"`

                The caller type. Always `program`.

                - `"program"`

        - `BetaResponseCustomToolCall`

          A call to a custom tool created by the model.

          - `call_id: string`

            An identifier used to map this custom tool call to a tool call output.

          - `input: string`

            The input for the custom tool call generated by the model.

          - `name: string`

            The name of the custom tool being called.

          - `type: "custom_tool_call"`

            The type of the custom tool call. Always `custom_tool_call`.

            - `"custom_tool_call"`

          - `id?: string`

            The unique ID of the custom tool call in the OpenAI platform.

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

          - `caller?: Direct | Program | null`

            The execution context that produced this tool call.

            - `Direct`

              - `type: "direct"`

                - `"direct"`

            - `Program`

              - `caller_id: string`

                The call ID of the program item that produced this tool call.

              - `type: "program"`

                - `"program"`

          - `namespace?: string`

            The namespace of the custom tool being called.

        - `CompactionTrigger`

          Compacts the current context. Must be the final input item.

          - `type: "compaction_trigger"`

            The type of the item. Always `compaction_trigger`.

            - `"compaction_trigger"`

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

        - `ItemReference`

          An internal identifier for an item to reference.

          - `id: string`

            The ID of the item to reference.

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

          - `type?: "item_reference" | null`

            The type of item to reference. Always `item_reference`.

            - `"item_reference"`

        - `Program`

          - `id: string`

            The unique ID of this program item.

          - `call_id: string`

            The stable call ID of the program item.

          - `code: string`

            The JavaScript source executed by programmatic tool calling.

          - `fingerprint: string`

            Opaque program replay fingerprint that must be round-tripped.

          - `type: "program"`

            The item type. Always `program`.

            - `"program"`

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

        - `ProgramOutput`

          - `id: string`

            The unique ID of this program output item.

          - `call_id: string`

            The call ID of the program item.

          - `result: string`

            The result produced by the program item.

          - `status: "completed" | "incomplete"`

            The terminal status of the program output.

            - `"completed"`

            - `"incomplete"`

          - `type: "program_output"`

            The item type. Always `program_output`.

            - `"program_output"`

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

    - `metadata: Record<string, string> | null`

      Set of 16 key-value pairs that can be attached to an object. This can be
      useful for storing additional information about the object in a structured
      format, and querying for objects via API or the dashboard.

      Keys are strings with a maximum length of 64 characters. Values are strings
      with a maximum length of 512 characters.

    - `model: "gpt-5.6-sol" | "gpt-5.6-terra" | "gpt-5.6-luna" | 99 more | (string & {})`

      Model ID used to generate the response, like `gpt-4o` or `o3`. OpenAI
      offers a wide range of models with different capabilities, performance
      characteristics, and price points. Refer to the [model guide](https://platform.openai.com/docs/models)
      to browse and compare available models.

      - `"gpt-5.6-sol" | "gpt-5.6-terra" | "gpt-5.6-luna" | 99 more`

        - `"gpt-5.6-sol"`

        - `"gpt-5.6-terra"`

        - `"gpt-5.6-luna"`

        - `"gpt-5.5"`

        - `"gpt-5.5-2026-04-23"`

        - `"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.5-pro"`

        - `"gpt-5.5-pro-2026-04-23"`

        - `"gpt-5-codex"`

        - `"gpt-5-pro"`

        - `"gpt-5-pro-2025-10-06"`

        - `"gpt-5.1-codex-max"`

        - `"gpt-daybreak-blue-latest"`

        - `"gpt-daybreak-red-latest"`

        - `"gpt-5.6-cyber"`

      - `(string & {})`

    - `object: "response"`

      The object type of this resource - always set to `response`.

      - `"response"`

    - `output: Array<BetaResponseOutputItem>`

      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.

      - `BetaResponseOutputMessage`

        An output message from the model.

      - `BetaResponseFileSearchToolCall`

        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.

      - `BetaResponseFunctionToolCall`

        A tool call to run a function. See the
        [function calling guide](https://platform.openai.com/docs/guides/function-calling) for more information.

      - `BetaResponseFunctionToolCallOutputItem`

        - `id: string`

          The unique ID of the function call tool output.

        - `call_id: string`

          The unique ID of the function tool call generated by the model.

        - `output: string | Array<BetaResponseInputText | BetaResponseInputImage | BetaResponseInputFile>`

          The output from the function call generated by your code.
          Can be a string or an list of output content.

          - `string`

          - `Array<BetaResponseInputText | BetaResponseInputImage | BetaResponseInputFile>`

            - `BetaResponseInputText`

              A text input to the model.

            - `BetaResponseInputImage`

              An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision).

            - `BetaResponseInputFile`

              A file input to 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.

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

        - `type: "function_call_output"`

          The type of the function tool call output. Always `function_call_output`.

          - `"function_call_output"`

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `caller?: Direct | Program | null`

          The execution context that produced this tool call.

          - `Direct`

            - `type: "direct"`

              The caller type. Always `direct`.

              - `"direct"`

          - `Program`

            - `caller_id: string`

              The call ID of the program item that produced this tool call.

            - `type: "program"`

              The caller type. Always `program`.

              - `"program"`

        - `created_by?: string`

          The identifier of the actor that created the item.

        - `name?: string`

          The name of the tool that produced the output.

        - `namespace?: string`

          The namespace of the tool that produced the output.

      - `AgentMessage`

        - `id: string`

          The unique ID of the agent message.

        - `author: string`

          The sending agent identity.

        - `content: Array<BetaResponseInputText | BetaResponseOutputText | Text | 7 more>`

          Encrypted content sent between agents.

          - `BetaResponseInputText`

            A text input to the model.

          - `BetaResponseOutputText`

            A text output from the model.

          - `Text`

            A text content.

            - `text: string`

            - `type: "text"`

              - `"text"`

          - `SummaryText`

            A summary text from the model.

            - `text: string`

              A summary of the reasoning output from the model so far.

            - `type: "summary_text"`

              The type of the object. Always `summary_text`.

              - `"summary_text"`

          - `ReasoningText`

            Reasoning text from the model.

            - `text: string`

              The reasoning text from the model.

            - `type: "reasoning_text"`

              The type of the reasoning text. Always `reasoning_text`.

              - `"reasoning_text"`

          - `BetaResponseOutputRefusal`

            A refusal from the model.

          - `BetaResponseInputImage`

            An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision).

          - `ComputerScreenshot`

            A screenshot of a computer.

            - `detail: BetaImageDetail`

              The detail level of the screenshot image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`.

            - `file_id: string | null`

              The identifier of an uploaded file that contains the screenshot.

            - `image_url: string | null`

              The URL of the screenshot image.

            - `type: "computer_screenshot"`

              Specifies the event type. For a computer screenshot, this property is always set to `computer_screenshot`.

              - `"computer_screenshot"`

            - `prompt_cache_breakpoint?: PromptCacheBreakpoint`

              Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.

              - `mode: "explicit"`

                The breakpoint mode. Always `explicit`.

                - `"explicit"`

          - `BetaResponseInputFile`

            A file input to the model.

          - `EncryptedContent`

            Opaque encrypted content that Responses API decrypts inside trusted model execution.

            - `encrypted_content: string`

              Opaque encrypted content.

            - `type: "encrypted_content"`

              The type of the input item. Always `encrypted_content`.

              - `"encrypted_content"`

        - `recipient: string`

          The destination agent identity.

        - `type: "agent_message"`

          The type of the item. Always `agent_message`.

          - `"agent_message"`

        - `agent?: Agent`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

      - `MultiAgentCall`

        - `id: string`

          The unique ID of the multi-agent call item.

        - `action: "spawn_agent" | "interrupt_agent" | "list_agents" | 3 more`

          The multi-agent action to execute.

          - `"spawn_agent"`

          - `"interrupt_agent"`

          - `"list_agents"`

          - `"send_message"`

          - `"followup_task"`

          - `"wait_agent"`

        - `arguments: string`

          The JSON string of arguments generated for the action.

        - `call_id: string`

          The unique ID linking this call to its output.

        - `type: "multi_agent_call"`

          The type of the multi-agent call. Always `multi_agent_call`.

          - `"multi_agent_call"`

        - `agent?: Agent`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

      - `MultiAgentCallOutput`

        - `id: string`

          The unique ID of the multi-agent call output item.

        - `action: "spawn_agent" | "interrupt_agent" | "list_agents" | 3 more`

          The multi-agent action that produced this result.

          - `"spawn_agent"`

          - `"interrupt_agent"`

          - `"list_agents"`

          - `"send_message"`

          - `"followup_task"`

          - `"wait_agent"`

        - `call_id: string`

          The unique ID of the multi-agent call.

        - `output: Array<BetaResponseOutputText>`

          Text output returned by the multi-agent action.

          - `annotations: Array<FileCitation | URLCitation | ContainerFileCitation | FilePath>`

            The annotations of the text output.

          - `text: string`

            The text output from the model.

          - `type: "output_text"`

            The type of the output text. Always `output_text`.

          - `logprobs?: Array<Logprob>`

        - `type: "multi_agent_call_output"`

          The type of the multi-agent result. Always `multi_agent_call_output`.

          - `"multi_agent_call_output"`

        - `agent?: Agent`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

      - `BetaResponseFunctionWebSearch`

        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.

      - `BetaResponseComputerToolCall`

        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.

      - `BetaResponseComputerToolCallOutputItem`

        - `id: string`

          The unique ID of the computer call tool output.

        - `call_id: string`

          The ID of the computer tool call that produced the output.

        - `output: BetaResponseComputerToolCallOutputScreenshot`

          A computer screenshot image used with the computer use tool.

        - `status: "completed" | "incomplete" | "failed" | "in_progress"`

          The status of the message input. One of `in_progress`, `completed`, or
          `incomplete`. Populated when input items are returned via API.

          - `"completed"`

          - `"incomplete"`

          - `"failed"`

          - `"in_progress"`

        - `type: "computer_call_output"`

          The type of the computer tool call output. Always `computer_call_output`.

          - `"computer_call_output"`

        - `acknowledged_safety_checks?: Array<AcknowledgedSafetyCheck>`

          The safety checks reported by the API that have been acknowledged by the
          developer.

          - `id: string`

            The ID of the pending safety check.

          - `code?: string | null`

            The type of the pending safety check.

          - `message?: string | null`

            Details about the pending safety check.

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `created_by?: string`

          The identifier of the actor that created the item.

      - `BetaResponseReasoningItem`

        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).

      - `Program`

        - `id: string`

          The unique ID of the program item.

        - `call_id: string`

          The stable call ID of the program item.

        - `code: string`

          The JavaScript source executed by programmatic tool calling.

        - `fingerprint: string`

          Opaque program replay fingerprint that must be round-tripped.

        - `type: "program"`

          The type of the item. Always `program`.

          - `"program"`

        - `agent?: Agent`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

      - `ProgramOutput`

        - `id: string`

          The unique ID of the program output item.

        - `call_id: string`

          The call ID of the program item.

        - `result: string`

          The result produced by the program item.

        - `status: "completed" | "incomplete"`

          The terminal status of the program output item.

          - `"completed"`

          - `"incomplete"`

        - `type: "program_output"`

          The type of the item. Always `program_output`.

          - `"program_output"`

        - `agent?: Agent`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

      - `BetaResponseToolSearchCall`

        - `id: string`

          The unique ID of the tool search call item.

        - `arguments: unknown`

          Arguments used for the tool search call.

        - `call_id: string | null`

          The unique ID of the tool search call generated by the model.

        - `execution: "server" | "client"`

          Whether tool search was executed by the server or by the client.

          - `"server"`

          - `"client"`

        - `status: "in_progress" | "completed" | "incomplete"`

          The status of the tool search call item that was recorded.

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

        - `type: "tool_search_call"`

          The type of the item. Always `tool_search_call`.

          - `"tool_search_call"`

        - `agent?: Agent`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `created_by?: string`

          The identifier of the actor that created the item.

      - `BetaResponseToolSearchOutputItem`

        - `id: string`

          The unique ID of the tool search output item.

        - `call_id: string | null`

          The unique ID of the tool search call generated by the model.

        - `execution: "server" | "client"`

          Whether tool search was executed by the server or by the client.

          - `"server"`

          - `"client"`

        - `status: "in_progress" | "completed" | "incomplete"`

          The status of the tool search output item that was recorded.

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

        - `tools: Array<BetaTool>`

          The loaded tool definitions returned by tool search.

          - `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).

          - `Mcp`

            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).

          - `CodeInterpreter`

            A tool that runs Python code to help generate a response to a prompt.

          - `ProgrammaticToolCalling`

          - `ImageGeneration`

            A tool that generates images using the GPT image models.

          - `LocalShell`

            A tool that allows the model to execute shell commands in a local environment.

          - `BetaFunctionShellTool`

            A tool that allows the model to execute shell commands.

          - `BetaCustomTool`

            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)

          - `BetaNamespaceTool`

            Groups function/custom tools under a shared namespace.

          - `BetaToolSearchTool`

            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).

          - `BetaApplyPatchTool`

            Allows the assistant to create, delete, or update files using unified diffs.

        - `type: "tool_search_output"`

          The type of the item. Always `tool_search_output`.

          - `"tool_search_output"`

        - `agent?: Agent`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `created_by?: string`

          The identifier of the actor that created the item.

      - `AdditionalTools`

        - `id: string`

          The unique ID of the additional tools item.

        - `role: "unknown" | "user" | "assistant" | 5 more`

          The role that provided the additional tools.

          - `"unknown"`

          - `"user"`

          - `"assistant"`

          - `"system"`

          - `"critic"`

          - `"discriminator"`

          - `"developer"`

          - `"tool"`

        - `tools: Array<BetaTool>`

          The additional tool definitions made available at this item.

          - `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).

          - `Mcp`

            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).

          - `CodeInterpreter`

            A tool that runs Python code to help generate a response to a prompt.

          - `ProgrammaticToolCalling`

          - `ImageGeneration`

            A tool that generates images using the GPT image models.

          - `LocalShell`

            A tool that allows the model to execute shell commands in a local environment.

          - `BetaFunctionShellTool`

            A tool that allows the model to execute shell commands.

          - `BetaCustomTool`

            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)

          - `BetaNamespaceTool`

            Groups function/custom tools under a shared namespace.

          - `BetaToolSearchTool`

            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).

          - `BetaApplyPatchTool`

            Allows the assistant to create, delete, or update files using unified diffs.

        - `type: "additional_tools"`

          The type of the item. Always `additional_tools`.

          - `"additional_tools"`

        - `agent?: Agent`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

      - `BetaResponseCompactionItem`

        A compaction item generated by the [`v1/responses/compact` API](https://platform.openai.com/docs/api-reference/responses/compact).

        - `id: string`

          The unique ID of the compaction item.

        - `encrypted_content: string`

          The encrypted content that was produced by compaction.

        - `type: "compaction"`

          The type of the item. Always `compaction`.

          - `"compaction"`

        - `agent?: Agent`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `created_by?: string`

          The identifier of the actor that created the item.

      - `ImageGenerationCall`

        An image generation request made by the model.

        - `id: string`

          The unique ID of the image generation call.

        - `result: string | null`

          The generated image encoded in base64.

        - `status: "in_progress" | "completed" | "generating" | "failed"`

          The status of the image generation call.

          - `"in_progress"`

          - `"completed"`

          - `"generating"`

          - `"failed"`

        - `type: "image_generation_call"`

          The type of the image generation call. Always `image_generation_call`.

          - `"image_generation_call"`

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

      - `BetaResponseCodeInterpreterToolCall`

        A tool call to run code.

      - `LocalShellCall`

        A tool call to run a command on the local shell.

        - `id: string`

          The unique ID of the local shell call.

        - `action: Action`

          Execute a shell command on the server.

          - `command: Array<string>`

            The command to run.

          - `env: Record<string, string>`

            Environment variables to set for the command.

          - `type: "exec"`

            The type of the local shell action. Always `exec`.

            - `"exec"`

          - `timeout_ms?: number | null`

            Optional timeout in milliseconds for the command.

          - `user?: string | null`

            Optional user to run the command as.

          - `working_directory?: string | null`

            Optional working directory to run the command in.

        - `call_id: string`

          The unique ID of the local shell tool call generated by the model.

        - `status: "in_progress" | "completed" | "incomplete"`

          The status of the local shell call.

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

        - `type: "local_shell_call"`

          The type of the local shell call. Always `local_shell_call`.

          - `"local_shell_call"`

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

      - `LocalShellCallOutput`

        The output of a local shell tool call.

        - `id: string`

          The unique ID of the local shell tool call generated by the model.

        - `output: string`

          A JSON string of the output of the local shell tool call.

        - `type: "local_shell_call_output"`

          The type of the local shell tool call output. Always `local_shell_call_output`.

          - `"local_shell_call_output"`

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `status?: "in_progress" | "completed" | "incomplete" | null`

          The status of the item. One of `in_progress`, `completed`, or `incomplete`.

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

      - `BetaResponseFunctionShellToolCall`

        A tool call that executes one or more shell commands in a managed environment.

        - `id: string`

          The unique ID of the shell tool call. Populated when this item is returned via API.

        - `action: Action`

          The shell commands and limits that describe how to run the tool call.

          - `commands: Array<string>`

          - `max_output_length: number | null`

            Optional maximum number of characters to return from each command.

          - `timeout_ms: number | null`

            Optional timeout in milliseconds for the commands.

        - `call_id: string`

          The unique ID of the shell tool call generated by the model.

        - `environment: BetaResponseLocalEnvironment | BetaResponseContainerReference | null`

          Represents the use of a local environment to perform shell actions.

          - `BetaResponseLocalEnvironment`

            Represents the use of a local environment to perform shell actions.

            - `type: "local"`

              The environment type. Always `local`.

              - `"local"`

          - `BetaResponseContainerReference`

            Represents a container created with /v1/containers.

            - `container_id: string`

            - `type: "container_reference"`

              The environment type. Always `container_reference`.

              - `"container_reference"`

        - `status: "in_progress" | "completed" | "incomplete"`

          The status of the shell call. One of `in_progress`, `completed`, or `incomplete`.

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

        - `type: "shell_call"`

          The type of the item. Always `shell_call`.

          - `"shell_call"`

        - `agent?: Agent`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `caller?: Direct | Program | null`

          The execution context that produced this tool call.

          - `Direct`

            - `type: "direct"`

              - `"direct"`

          - `Program`

            - `caller_id: string`

              The call ID of the program item that produced this tool call.

            - `type: "program"`

              - `"program"`

        - `created_by?: string`

          The ID of the entity that created this tool call.

      - `BetaResponseFunctionShellToolCallOutput`

        The output of a shell tool call that was emitted.

        - `id: string`

          The unique ID of the shell call output. Populated when this item is returned via API.

        - `call_id: string`

          The unique ID of the shell tool call generated by the model.

        - `max_output_length: number | null`

          The maximum length of the shell command output. This is generated by the model and should be passed back with the raw output.

        - `output: Array<Output>`

          An array of shell call output contents

          - `outcome: Timeout | Exit`

            Represents either an exit outcome (with an exit code) or a timeout outcome for a shell call output chunk.

            - `Timeout`

              Indicates that the shell call exceeded its configured time limit.

              - `type: "timeout"`

                The outcome type. Always `timeout`.

                - `"timeout"`

            - `Exit`

              Indicates that the shell commands finished and returned an exit code.

              - `exit_code: number`

                Exit code from the shell process.

              - `type: "exit"`

                The outcome type. Always `exit`.

                - `"exit"`

          - `stderr: string`

            The standard error output that was captured.

          - `stdout: string`

            The standard output that was captured.

          - `created_by?: string`

            The identifier of the actor that created the item.

        - `status: "in_progress" | "completed" | "incomplete"`

          The status of the shell call output. One of `in_progress`, `completed`, or `incomplete`.

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

        - `type: "shell_call_output"`

          The type of the shell call output. Always `shell_call_output`.

          - `"shell_call_output"`

        - `agent?: Agent`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `caller?: Direct | Program | null`

          The execution context that produced this tool call.

          - `Direct`

            - `type: "direct"`

              - `"direct"`

          - `Program`

            - `caller_id: string`

              The call ID of the program item that produced this tool call.

            - `type: "program"`

              - `"program"`

        - `created_by?: string`

          The identifier of the actor that created the item.

      - `BetaResponseApplyPatchToolCall`

        A tool call that applies file diffs by creating, deleting, or updating files.

        - `id: string`

          The unique ID of the apply patch tool call. Populated when this item is returned via API.

        - `call_id: string`

          The unique ID of the apply patch tool call generated by the model.

        - `operation: CreateFile | DeleteFile | UpdateFile`

          One of the create_file, delete_file, or update_file operations applied via apply_patch.

          - `CreateFile`

            Instruction describing how to create a file via the apply_patch tool.

            - `diff: string`

              Diff to apply.

            - `path: string`

              Path of the file to create.

            - `type: "create_file"`

              Create a new file with the provided diff.

              - `"create_file"`

          - `DeleteFile`

            Instruction describing how to delete a file via the apply_patch tool.

            - `path: string`

              Path of the file to delete.

            - `type: "delete_file"`

              Delete the specified file.

              - `"delete_file"`

          - `UpdateFile`

            Instruction describing how to update a file via the apply_patch tool.

            - `diff: string`

              Diff to apply.

            - `path: string`

              Path of the file to update.

            - `type: "update_file"`

              Update an existing file with the provided diff.

              - `"update_file"`

        - `status: "in_progress" | "completed"`

          The status of the apply patch tool call. One of `in_progress` or `completed`.

          - `"in_progress"`

          - `"completed"`

        - `type: "apply_patch_call"`

          The type of the item. Always `apply_patch_call`.

          - `"apply_patch_call"`

        - `agent?: Agent`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `caller?: Direct | Program | null`

          The execution context that produced this tool call.

          - `Direct`

            - `type: "direct"`

              - `"direct"`

          - `Program`

            - `caller_id: string`

              The call ID of the program item that produced this tool call.

            - `type: "program"`

              - `"program"`

        - `created_by?: string`

          The ID of the entity that created this tool call.

      - `BetaResponseApplyPatchToolCallOutput`

        The output emitted by an apply patch tool call.

        - `id: string`

          The unique ID of the apply patch tool call output. Populated when this item is returned via API.

        - `call_id: string`

          The unique ID of the apply patch tool call generated by the model.

        - `status: "completed" | "failed"`

          The status of the apply patch tool call output. One of `completed` or `failed`.

          - `"completed"`

          - `"failed"`

        - `type: "apply_patch_call_output"`

          The type of the item. Always `apply_patch_call_output`.

          - `"apply_patch_call_output"`

        - `agent?: Agent`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `caller?: Direct | Program | null`

          The execution context that produced this tool call.

          - `Direct`

            - `type: "direct"`

              - `"direct"`

          - `Program`

            - `caller_id: string`

              The call ID of the program item that produced this tool call.

            - `type: "program"`

              - `"program"`

        - `created_by?: string`

          The ID of the entity that created this tool call output.

        - `output?: string | null`

          Optional textual output returned by the apply patch tool.

      - `McpCall`

        An invocation of a tool on an MCP server.

        - `id: string`

          The unique ID of the tool call.

        - `arguments: string`

          A JSON string of the arguments passed to the tool.

        - `name: string`

          The name of the tool that was run.

        - `server_label: string`

          The label of the MCP server running the tool.

        - `type: "mcp_call"`

          The type of the item. Always `mcp_call`.

          - `"mcp_call"`

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `approval_request_id?: string | null`

          Unique identifier for the MCP tool call approval request.
          Include this value in a subsequent `mcp_approval_response` input to approve or reject the corresponding tool call.

        - `error?: BetaMcpToolCallError | null`

          The error from the tool call, if any.

        - `output?: string | null`

          The output from the tool call.

        - `status?: "in_progress" | "completed" | "incomplete" | 2 more`

          The status of the tool call. One of `in_progress`, `completed`, `incomplete`, `calling`, or `failed`.

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

          - `"calling"`

          - `"failed"`

      - `McpListTools`

        A list of tools available on an MCP server.

        - `id: string`

          The unique ID of the list.

        - `server_label: string`

          The label of the MCP server.

        - `tools: Array<Tool>`

          The tools available on the server.

          - `input_schema: unknown`

            The JSON schema describing the tool's input.

          - `name: string`

            The name of the tool.

          - `annotations?: unknown`

            Additional annotations about the tool.

          - `description?: string | null`

            The description of the tool.

        - `type: "mcp_list_tools"`

          The type of the item. Always `mcp_list_tools`.

          - `"mcp_list_tools"`

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `error?: string | null`

          Error message if the server could not list tools.

      - `McpApprovalRequest`

        A request for human approval of a tool invocation.

        - `id: string`

          The unique ID of the approval request.

        - `arguments: string`

          A JSON string of arguments for the tool.

        - `name: string`

          The name of the tool to run.

        - `server_label: string`

          The label of the MCP server making the request.

        - `type: "mcp_approval_request"`

          The type of the item. Always `mcp_approval_request`.

          - `"mcp_approval_request"`

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

      - `McpApprovalResponse`

        A response to an MCP approval request.

        - `id: string`

          The unique ID of the approval response

        - `approval_request_id: string`

          The ID of the approval request being answered.

        - `approve: boolean`

          Whether the request was approved.

        - `type: "mcp_approval_response"`

          The type of the item. Always `mcp_approval_response`.

          - `"mcp_approval_response"`

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `reason?: string | null`

          Optional reason for the decision.

      - `BetaResponseCustomToolCall`

        A call to a custom tool created by the model.

      - `BetaResponseCustomToolCallOutputItem extends BetaResponseCustomToolCallOutput`

        The output of a custom tool call from your code, being sent back to the model.

        - `id: string`

          The unique ID of the custom tool call output item.

        - `status: "in_progress" | "completed" | "incomplete"`

          The status of the item. One of `in_progress`, `completed`, or
          `incomplete`. Populated when items are returned via API.

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

        - `created_by?: string`

          The identifier of the actor that created the item.

    - `parallel_tool_calls: boolean`

      Whether to allow the model to run tool calls in parallel.

    - `temperature: number | null`

      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.

    - `tool_choice: BetaToolChoiceOptions | BetaToolChoiceAllowed | BetaToolChoiceTypes | 6 more`

      How the model should select which tool (or tools) to use when generating
      a response. See the `tools` parameter to see how to specify which tools
      the model can call.

      - `BetaToolChoiceOptions = "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.

        - `"none"`

        - `"auto"`

        - `"required"`

      - `BetaToolChoiceAllowed`

        Constrains the tools available to the model to a pre-defined set.

        - `mode: "auto" | "required"`

          Constrains the tools available to the model to a pre-defined set.

          `auto` allows the model to pick from among the allowed tools and generate a
          message.

          `required` requires the model to call one or more of the allowed tools.

          - `"auto"`

          - `"required"`

        - `tools: Array<Record<string, unknown>>`

          A list of tool definitions that the model should be allowed to call.

          For the Responses API, the list of tool definitions might look like:

          ```json
          [
            { "type": "function", "name": "get_weather" },
            { "type": "mcp", "server_label": "deepwiki" },
            { "type": "image_generation" }
          ]
          ```

        - `type: "allowed_tools"`

          Allowed tool configuration type. Always `allowed_tools`.

          - `"allowed_tools"`

      - `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" | 5 more`

          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`

          - `"file_search"`

          - `"web_search_preview"`

          - `"computer"`

          - `"computer_use_preview"`

          - `"computer_use"`

          - `"web_search_preview_2025_03_11"`

          - `"image_generation"`

          - `"code_interpreter"`

      - `BetaToolChoiceFunction`

        Use this option to force the model to call a specific function.

        - `name: string`

          The name of the function to call.

        - `type: "function"`

          For function calling, the type is always `function`.

          - `"function"`

      - `BetaToolChoiceMcp`

        Use this option to force the model to call a specific tool on a remote MCP server.

        - `server_label: string`

          The label of the MCP server to use.

        - `type: "mcp"`

          For MCP tools, the type is always `mcp`.

          - `"mcp"`

        - `name?: string | null`

          The name of the tool to call on the server.

      - `BetaToolChoiceCustom`

        Use this option to force the model to call a specific custom tool.

        - `name: string`

          The name of the custom tool to call.

        - `type: "custom"`

          For custom tool calling, the type is always `custom`.

          - `"custom"`

      - `BetaSpecificProgrammaticToolCallingParam`

        - `type: "programmatic_tool_calling"`

          The tool to call. Always `programmatic_tool_calling`.

          - `"programmatic_tool_calling"`

      - `BetaToolChoiceApplyPatch`

        Forces the model to call the apply_patch tool when executing a tool call.

        - `type: "apply_patch"`

          The tool to call. Always `apply_patch`.

          - `"apply_patch"`

      - `BetaToolChoiceShell`

        Forces the model to call the shell tool when a tool call is required.

        - `type: "shell"`

          The tool to call. Always `shell`.

          - `"shell"`

    - `tools: Array<BetaTool>`

      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.

      - `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).

      - `Mcp`

        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).

      - `CodeInterpreter`

        A tool that runs Python code to help generate a response to a prompt.

      - `ProgrammaticToolCalling`

      - `ImageGeneration`

        A tool that generates images using the GPT image models.

      - `LocalShell`

        A tool that allows the model to execute shell commands in a local environment.

      - `BetaFunctionShellTool`

        A tool that allows the model to execute shell commands.

      - `BetaCustomTool`

        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)

      - `BetaNamespaceTool`

        Groups function/custom tools under a shared namespace.

      - `BetaToolSearchTool`

        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).

      - `BetaApplyPatchTool`

        Allows the assistant to create, delete, or update files using unified diffs.

    - `top_p: number | null`

      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.

    - `background?: boolean | null`

      Whether to run the model response in the background.
      [Learn more](https://platform.openai.com/docs/guides/background).

    - `completed_at?: number | null`

      Unix timestamp (in seconds) of when this Response was completed.
      Only present when the status is `completed`.

    - `conversation?: Conversation | null`

      The conversation that this response belonged to. Input items and output items from this response were automatically added to this conversation.

      - `id: string`

        The unique ID of the conversation that this response was associated with.

    - `max_output_tokens?: number | null`

      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).

    - `max_tool_calls?: number | null`

      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.

    - `moderation?: Moderation | null`

      Moderation results for the response input and output, if moderated completions were requested.

      - `input: ModerationResult | Error`

        Moderation for the response input.

        - `ModerationResult`

          A moderation result produced for the response input or output.

          - `categories: Record<string, boolean>`

            A dictionary of moderation categories to booleans, True if the input is flagged under this category.

          - `category_applied_input_types: Record<string, Array<"text" | "image">>`

            Which modalities of input are reflected by the score for each category.

            - `"text"`

            - `"image"`

          - `category_scores: Record<string, number>`

            A dictionary of moderation categories to scores.

          - `flagged: boolean`

            A boolean indicating whether the content was flagged by any category.

          - `model: string`

            The moderation model that produced this result.

          - `type: "moderation_result"`

            The object type, which was always `moderation_result` for successful moderation results.

            - `"moderation_result"`

        - `Error`

          An error produced while attempting moderation for the response input or output.

          - `code: string`

            The error code.

          - `message: string`

            The error message.

          - `type: "error"`

            The object type, which was always `error` for moderation failures.

            - `"error"`

      - `output: ModerationResult | Error`

        Moderation for the response output.

        - `ModerationResult`

          A moderation result produced for the response input or output.

          - `categories: Record<string, boolean>`

            A dictionary of moderation categories to booleans, True if the input is flagged under this category.

          - `category_applied_input_types: Record<string, Array<"text" | "image">>`

            Which modalities of input are reflected by the score for each category.

            - `"text"`

            - `"image"`

          - `category_scores: Record<string, number>`

            A dictionary of moderation categories to scores.

          - `flagged: boolean`

            A boolean indicating whether the content was flagged by any category.

          - `model: string`

            The moderation model that produced this result.

          - `type: "moderation_result"`

            The object type, which was always `moderation_result` for successful moderation results.

            - `"moderation_result"`

        - `Error`

          An error produced while attempting moderation for the response input or output.

          - `code: string`

            The error code.

          - `message: string`

            The error message.

          - `type: "error"`

            The object type, which was always `error` for moderation failures.

            - `"error"`

    - `previous_response_id?: string | null`

      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`.

    - `prompt?: BetaResponsePrompt | null`

      Reference to a prompt template and its variables.
      [Learn more](https://platform.openai.com/docs/guides/text?api-mode=responses#reusable-prompts).

      - `id: string`

        The unique identifier of the prompt template to use.

      - `variables?: Record<string, string | BetaResponseInputText | BetaResponseInputImage | BetaResponseInputFile> | null`

        Optional map of values to substitute in for variables in your
        prompt. The substitution values can either be strings, or other
        Response input types like images or files.

        - `string`

        - `BetaResponseInputText`

          A text input to the model.

        - `BetaResponseInputImage`

          An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision).

        - `BetaResponseInputFile`

          A file input to the model.

      - `version?: string | null`

        Optional version of the prompt template.

    - `prompt_cache_key?: string | null`

      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).

    - `prompt_cache_options?: PromptCacheOptions`

      The prompt-caching options that were applied to the response. Supported for `gpt-5.6` and later models.

      - `mode: "implicit" | "explicit"`

        Whether implicit prompt-cache breakpoints were enabled.

        - `"implicit"`

        - `"explicit"`

      - `ttl: "30m"`

        The minimum lifetime applied to each cache breakpoint.

        - `"30m"`

    - `prompt_cache_retention?: "in_memory" | "24h" | null`

      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.

      - `"in_memory"`

      - `"24h"`

    - `reasoning?: Reasoning | null`

      **gpt-5 and o-series models only**

      Configuration options for
      [reasoning models](https://platform.openai.com/docs/guides/reasoning).

      - `context?: "auto" | "current_turn" | "all_turns" | null`

        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.

        - `"auto"`

        - `"current_turn"`

        - `"all_turns"`

      - `effort?: "none" | "minimal" | "low" | 4 more | null`

        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.

        - `"none"`

        - `"minimal"`

        - `"low"`

        - `"medium"`

        - `"high"`

        - `"xhigh"`

        - `"max"`

      - `generate_summary?: "auto" | "concise" | "detailed" | null`

        **Deprecated:** use `summary` instead.

        A summary of the reasoning performed by the model. This can be
        useful for debugging and understanding the model's reasoning process.
        One of `auto`, `concise`, or `detailed`.

        - `"auto"`

        - `"concise"`

        - `"detailed"`

      - `mode?: (string & {}) | "standard" | "pro"`

        Controls the reasoning execution mode for the request.

        When returned on a response, this is the effective execution mode.

        - `(string & {})`

        - `"standard" | "pro"`

          - `"standard"`

          - `"pro"`

      - `summary?: "auto" | "concise" | "detailed" | null`

        A summary of the reasoning performed by the model. This can be
        useful for debugging and understanding the model's reasoning process.
        One of `auto`, `concise`, or `detailed`.

        `concise` is supported for `computer-use-preview` models and all reasoning models after `gpt-5`.

        - `"auto"`

        - `"concise"`

        - `"detailed"`

    - `safety_identifier?: string | null`

      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).

    - `service_tier?: BetaServiceTier | null`

      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.
      - If set to 'ultrafast', then the request will be processed with the access-controlled Ultrafast Processing service tier. This tier is currently available for `gpt-5.6-sol`; a response served through it will show `service_tier=ultrafast`.
      - When not set, the default behavior is 'auto'.

      When the `service_tier` parameter is set, the response body will include the `service_tier` value based on the processing mode actually used to serve the request. This response value may be different from the value set in the parameter.

      - `"auto"`

      - `"default"`

      - `"flex"`

      - `"scale"`

      - `"priority"`

      - `"fast"`

      - `"ultrafast"`

    - `status?: BetaResponseStatus`

      The status of the response generation. One of `completed`, `failed`,
      `in_progress`, `cancelled`, `queued`, or `incomplete`.

      - `"completed"`

      - `"failed"`

      - `"in_progress"`

      - `"cancelled"`

      - `"queued"`

      - `"incomplete"`

    - `text?: BetaResponseTextConfig`

      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?: BetaResponseFormatTextConfig`

        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.

        - `Text`

          Default response format. Used to generate text responses.

          - `type: "text"`

            The type of response format being defined. Always `text`.

            - `"text"`

        - `BetaResponseFormatTextJSONSchemaConfig`

          JSON Schema response format. Used to generate structured JSON responses.
          Learn more about [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs).

          - `name: string`

            The name of the response format. Must be a-z, A-Z, 0-9, or contain
            underscores and dashes, with a maximum length of 64.

          - `schema: Record<string, unknown>`

            The schema for the response format, described as a JSON Schema object.
            Learn how to build JSON schemas [here](https://json-schema.org/).

          - `type: "json_schema"`

            The type of response format being defined. Always `json_schema`.

            - `"json_schema"`

          - `description?: string`

            A description of what the response format is for, used by the model to
            determine how to respond in the format.

          - `strict?: boolean | null`

            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).

        - `JSONObject`

          JSON object response format. An older method of generating JSON responses.
          Using `json_schema` is recommended for models that support it. Note that the
          model will not generate JSON without a system or user message instructing it
          to do so.

          - `type: "json_object"`

            The type of response format being defined. Always `json_object`.

            - `"json_object"`

      - `verbosity?: "low" | "medium" | "high" | null`

        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`.

        - `"low"`

        - `"medium"`

        - `"high"`

    - `top_logprobs?: number | null`

      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.

    - `truncation?: "auto" | "disabled" | null`

      The truncation strategy to use for the model response.

      - `auto`: If the input to this Response exceeds
        the model's context window size, the model will truncate the
        response to fit the context window by dropping items from the beginning of the conversation.
      - `disabled` (default): If the input size will exceed the context window
        size for a model, the request will fail with a 400 error.

      - `"auto"`

      - `"disabled"`

    - `usage?: BetaResponseUsage`

      Represents token usage details including input tokens, output tokens,
      a breakdown of output tokens, and the total tokens used.

      - `input_tokens: number`

        The number of input tokens.

      - `input_tokens_details: InputTokensDetails`

        A detailed breakdown of the input tokens.

        - `cache_write_tokens: number`

          The number of input tokens that were written to the cache.

        - `cached_tokens: number`

          The number of tokens that were retrieved from the cache.
          [More on prompt caching](https://platform.openai.com/docs/guides/prompt-caching).

      - `output_tokens: number`

        The number of output tokens.

      - `output_tokens_details: OutputTokensDetails`

        A detailed breakdown of the output tokens.

        - `reasoning_tokens: number`

          The number of reasoning tokens.

      - `total_tokens: number`

        The total number of tokens used.

    - `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).

  - `sequence_number: number`

    The sequence number of this event.

  - `type: "response.in_progress"`

    The type of the event. Always `response.in_progress`.

    - `"response.in_progress"`

  - `agent?: Agent | null`

    The agent that owns this multi-agent streaming event.

    - `agent_name: string`

      The canonical name of the agent that produced this item.

### Beta Response Includable

- `BetaResponseIncludable = "file_search_call.results" | "web_search_call.results" | "web_search_call.action.sources" | 5 more`

  Specify additional output data to include in the model response. Currently supported values are:

  - `web_search_call.results`: Include the search results of the web search tool call.
  - `web_search_call.action.sources`: Include the sources of the web search tool call.
  - `code_interpreter_call.outputs`: Includes the outputs of python code execution in code interpreter tool call items.
  - `computer_call_output.output.image_url`: Include image urls from the computer call output.
  - `file_search_call.results`: Include the search results of the file search tool call.
  - `message.input_image.image_url`: Include image urls from the input message.
  - `message.output_text.logprobs`: Include logprobs with assistant messages.
  - `reasoning.encrypted_content`: Includes an encrypted version of reasoning tokens in reasoning item outputs. This enables reasoning items to be used in multi-turn conversations when using the Responses API statelessly (like when the `store` parameter is set to `false`, or when an organization is enrolled in the zero data retention program).

  - `"file_search_call.results"`

  - `"web_search_call.results"`

  - `"web_search_call.action.sources"`

  - `"message.input_image.image_url"`

  - `"computer_call_output.output.image_url"`

  - `"code_interpreter_call.outputs"`

  - `"reasoning.encrypted_content"`

  - `"message.output_text.logprobs"`

### Beta Response Incomplete Event

- `BetaResponseIncompleteEvent`

  An event that is emitted when a response finishes as incomplete.

  - `response: BetaResponse`

    The response that was incomplete.

    - `id: string`

      Unique identifier for this Response.

    - `created_at: number`

      Unix timestamp (in seconds) of when this Response was created.

    - `error: BetaResponseError | null`

      An error object returned when the model fails to generate a Response.

      - `code: "server_error" | "rate_limit_exceeded" | "invalid_prompt" | 17 more`

        The error code for the response.

        - `"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"`

      - `message: string`

        A human-readable description of the error.

    - `incomplete_details: IncompleteDetails | null`

      Details about why the response is incomplete.

      - `reason?: "max_output_tokens" | "content_filter"`

        The reason why the response is incomplete.

        - `"max_output_tokens"`

        - `"content_filter"`

    - `instructions: string | Array<BetaResponseInputItem> | null`

      A system (or developer) message inserted into the model's context.

      When using along with `previous_response_id`, the instructions from a previous
      response will not be carried over to the next response. This makes it simple
      to swap out system (or developer) messages in new responses.

      - `string`

      - `Array<BetaResponseInputItem>`

        - `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.

          - `content: string | BetaResponseInputMessageContentList`

            Text, image, or audio input to the model, used to generate a response.
            Can also contain previous assistant responses.

            - `string`

            - `BetaResponseInputMessageContentList = Array<BetaResponseInputContent>`

              A list of one or many input items to the model, containing different content
              types.

              - `BetaResponseInputText`

                A text input to the model.

                - `text: string`

                  The text input to the model.

                - `type: "input_text"`

                  The type of the input item. Always `input_text`.

                  - `"input_text"`

                - `prompt_cache_breakpoint?: PromptCacheBreakpoint`

                  Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.

                  - `mode: "explicit"`

                    The breakpoint mode. Always `explicit`.

                    - `"explicit"`

              - `BetaResponseInputImage`

                An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision).

                - `detail: BetaImageDetail`

                  The detail level of the image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`.

                  - `"low"`

                  - `"high"`

                  - `"auto"`

                  - `"original"`

                - `type: "input_image"`

                  The type of the input item. Always `input_image`.

                  - `"input_image"`

                - `file_id?: string | null`

                  The ID of the file to be sent to the model.

                - `image_url?: string | null`

                  The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.

                - `prompt_cache_breakpoint?: PromptCacheBreakpoint`

                  Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.

                  - `mode: "explicit"`

                    The breakpoint mode. Always `explicit`.

                    - `"explicit"`

              - `BetaResponseInputFile`

                A file input to the model.

                - `type: "input_file"`

                  The type of the input item. Always `input_file`.

                  - `"input_file"`

                - `detail?: "auto" | "low" | "high"`

                  The detail level of the file to be sent to the model. Use `auto` to let the system select the detail level; for GPT-5.6 and later models, `auto` uses high-quality rendering, which may increase input token usage. Use `low` for lower-cost rendering, or `high` to render the file at higher quality. Defaults to `auto`.

                  - `"auto"`

                  - `"low"`

                  - `"high"`

                - `file_data?: string`

                  The content of the file to be sent to the model.

                - `file_id?: string | null`

                  The ID of the file to be sent to the model.

                - `file_url?: string`

                  The URL of the file to be sent to the model.

                - `filename?: string`

                  The name of the file to be sent to the model.

                - `prompt_cache_breakpoint?: PromptCacheBreakpoint`

                  Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.

                  - `mode: "explicit"`

                    The breakpoint mode. Always `explicit`.

                    - `"explicit"`

          - `role: "user" | "assistant" | "system" | "developer"`

            The role of the message input. One of `user`, `assistant`, `system`, or
            `developer`.

            - `"user"`

            - `"assistant"`

            - `"system"`

            - `"developer"`

          - `phase?: "commentary" | "final_answer" | null`

            Labels an `assistant` message as intermediate commentary (`commentary`) or the final answer (`final_answer`).
            For models like `gpt-5.3-codex` and beyond, when sending follow-up requests, preserve and resend
            phase on all assistant messages — dropping it can degrade performance. Not used for user messages.

            - `"commentary"`

            - `"final_answer"`

          - `type?: "message"`

            The type of the message input. Always `message`.

            - `"message"`

        - `Message`

          A message input to the model with a role indicating instruction following
          hierarchy. Instructions given with the `developer` or `system` role take
          precedence over instructions given with the `user` role.

          - `content: BetaResponseInputMessageContentList`

            A list of one or many input items to the model, containing different content
            types.

          - `role: "user" | "system" | "developer"`

            The role of the message input. One of `user`, `system`, or `developer`.

            - `"user"`

            - `"system"`

            - `"developer"`

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

          - `status?: "in_progress" | "completed" | "incomplete"`

            The status of item. One of `in_progress`, `completed`, or
            `incomplete`. Populated when items are returned via API.

            - `"in_progress"`

            - `"completed"`

            - `"incomplete"`

          - `type?: "message"`

            The type of the message input. Always set to `message`.

            - `"message"`

        - `BetaResponseOutputMessage`

          An output message from the model.

          - `id: string`

            The unique ID of the output message.

          - `content: Array<BetaResponseOutputText | BetaResponseOutputRefusal>`

            The content of the output message.

            - `BetaResponseOutputText`

              A text output from the model.

              - `annotations: Array<FileCitation | URLCitation | ContainerFileCitation | FilePath>`

                The annotations of the text output.

                - `FileCitation`

                  A citation to a file.

                  - `file_id: string`

                    The ID of the file.

                  - `filename: string`

                    The filename of the file cited.

                  - `index: number`

                    The index of the file in the list of files.

                  - `type: "file_citation"`

                    The type of the file citation. Always `file_citation`.

                    - `"file_citation"`

                - `URLCitation`

                  A citation for a web resource used to generate a model response.

                  - `end_index: number`

                    The index of the last character of the URL citation in the message.

                  - `start_index: number`

                    The index of the first character of the URL citation in the message.

                  - `title: string`

                    The title of the web resource.

                  - `type: "url_citation"`

                    The type of the URL citation. Always `url_citation`.

                    - `"url_citation"`

                  - `url: string`

                    The URL of the web resource.

                - `ContainerFileCitation`

                  A citation for a container file used to generate a model response.

                  - `container_id: string`

                    The ID of the container file.

                  - `end_index: number`

                    The index of the last character of the container file citation in the message.

                  - `file_id: string`

                    The ID of the file.

                  - `filename: string`

                    The filename of the container file cited.

                  - `start_index: number`

                    The index of the first character of the container file citation in the message.

                  - `type: "container_file_citation"`

                    The type of the container file citation. Always `container_file_citation`.

                    - `"container_file_citation"`

                - `FilePath`

                  A path to a file.

                  - `file_id: string`

                    The ID of the file.

                  - `index: number`

                    The index of the file in the list of files.

                  - `type: "file_path"`

                    The type of the file path. Always `file_path`.

                    - `"file_path"`

              - `text: string`

                The text output from the model.

              - `type: "output_text"`

                The type of the output text. Always `output_text`.

                - `"output_text"`

              - `logprobs?: Array<Logprob>`

                - `token: string`

                - `bytes: Array<number>`

                - `logprob: number`

                - `top_logprobs: Array<TopLogprob>`

                  - `token: string`

                  - `bytes: Array<number>`

                  - `logprob: number`

            - `BetaResponseOutputRefusal`

              A refusal from the model.

              - `refusal: string`

                The refusal explanation from the model.

              - `type: "refusal"`

                The type of the refusal. Always `refusal`.

                - `"refusal"`

          - `role: "assistant"`

            The role of the output message. Always `assistant`.

            - `"assistant"`

          - `status: "in_progress" | "completed" | "incomplete"`

            The status of the message input. One of `in_progress`, `completed`, or
            `incomplete`. Populated when input items are returned via API.

            - `"in_progress"`

            - `"completed"`

            - `"incomplete"`

          - `type: "message"`

            The type of the output message. Always `message`.

            - `"message"`

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

          - `phase?: "commentary" | "final_answer" | null`

            Labels an `assistant` message as intermediate commentary (`commentary`) or the final answer (`final_answer`).
            For models like `gpt-5.3-codex` and beyond, when sending follow-up requests, preserve and resend
            phase on all assistant messages — dropping it can degrade performance. Not used for user messages.

            - `"commentary"`

            - `"final_answer"`

        - `BetaResponseFileSearchToolCall`

          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.

          - `id: string`

            The unique ID of the file search tool call.

          - `queries: Array<string>`

            The queries used to search for files.

          - `status: "in_progress" | "searching" | "completed" | 2 more`

            The status of the file search tool call. One of `in_progress`,
            `searching`, `incomplete` or `failed`,

            - `"in_progress"`

            - `"searching"`

            - `"completed"`

            - `"incomplete"`

            - `"failed"`

          - `type: "file_search_call"`

            The type of the file search tool call. Always `file_search_call`.

            - `"file_search_call"`

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

          - `results?: Array<Result> | null`

            The results of the file search tool call.

            - `attributes?: Record<string, string | number | boolean> | null`

              Set of 16 key-value pairs that can be attached to an object. This can be
              useful for storing additional information about the object in a structured
              format, and querying for objects via API or the dashboard. Keys are strings
              with a maximum length of 64 characters. Values are strings with a maximum
              length of 512 characters, booleans, or numbers.

              - `string`

              - `number`

              - `boolean`

            - `file_id?: string`

              The unique ID of the file.

            - `filename?: string`

              The name of the file.

            - `score?: number`

              The relevance score of the file - a value between 0 and 1.

            - `text?: string`

              The text that was retrieved from the file.

        - `BetaResponseComputerToolCall`

          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.

          - `id: string`

            The unique ID of the computer call.

          - `call_id: string`

            An identifier used when responding to the tool call with output.

          - `pending_safety_checks: Array<PendingSafetyCheck>`

            The pending safety checks for the computer call.

            - `id: string`

              The ID of the pending safety check.

            - `code?: string | null`

              The type of the pending safety check.

            - `message?: string | null`

              Details about the pending safety check.

          - `status: "in_progress" | "completed" | "incomplete"`

            The status of the item. One of `in_progress`, `completed`, or
            `incomplete`. Populated when items are returned via API.

            - `"in_progress"`

            - `"completed"`

            - `"incomplete"`

          - `type: "computer_call"`

            The type of the computer call. Always `computer_call`.

            - `"computer_call"`

          - `action?: BetaComputerAction`

            A click action.

            - `Click`

              A click action.

              - `button: "left" | "right" | "wheel" | 2 more`

                Indicates which mouse button was pressed during the click. One of `left`, `right`, `wheel`, `back`, or `forward`.

                - `"left"`

                - `"right"`

                - `"wheel"`

                - `"back"`

                - `"forward"`

              - `type: "click"`

                Specifies the event type. For a click action, this property is always `click`.

                - `"click"`

              - `x: number`

                The x-coordinate where the click occurred.

              - `y: number`

                The y-coordinate where the click occurred.

              - `keys?: Array<string> | null`

                The keys being held while clicking.

            - `DoubleClick`

              A double click action.

              - `keys: Array<string> | null`

                The keys being held while double-clicking.

              - `type: "double_click"`

                Specifies the event type. For a double click action, this property is always set to `double_click`.

                - `"double_click"`

              - `x: number`

                The x-coordinate where the double click occurred.

              - `y: number`

                The y-coordinate where the double click occurred.

            - `Drag`

              A drag action.

              - `path: Array<Path>`

                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 }
                ]
                ```

                - `x: number`

                  The x-coordinate.

                - `y: number`

                  The y-coordinate.

              - `type: "drag"`

                Specifies the event type. For a drag action, this property is always set to `drag`.

                - `"drag"`

              - `keys?: Array<string> | null`

                The keys being held while dragging the mouse.

            - `Keypress`

              A collection of keypresses the model would like to perform.

              - `keys: Array<string>`

                The combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key.

              - `type: "keypress"`

                Specifies the event type. For a keypress action, this property is always set to `keypress`.

                - `"keypress"`

            - `Move`

              A mouse move action.

              - `type: "move"`

                Specifies the event type. For a move action, this property is always set to `move`.

                - `"move"`

              - `x: number`

                The x-coordinate to move to.

              - `y: number`

                The y-coordinate to move to.

              - `keys?: Array<string> | null`

                The keys being held while moving the mouse.

            - `Screenshot`

              A screenshot action.

              - `type: "screenshot"`

                Specifies the event type. For a screenshot action, this property is always set to `screenshot`.

                - `"screenshot"`

            - `Scroll`

              A scroll action.

              - `scroll_x: number`

                The horizontal scroll distance.

              - `scroll_y: number`

                The vertical scroll distance.

              - `type: "scroll"`

                Specifies the event type. For a scroll action, this property is always set to `scroll`.

                - `"scroll"`

              - `x: number`

                The x-coordinate where the scroll occurred.

              - `y: number`

                The y-coordinate where the scroll occurred.

              - `keys?: Array<string> | null`

                The keys being held while scrolling.

            - `Type`

              An action to type in text.

              - `text: string`

                The text to type.

              - `type: "type"`

                Specifies the event type. For a type action, this property is always set to `type`.

                - `"type"`

            - `Wait`

              A wait action.

              - `type: "wait"`

                Specifies the event type. For a wait action, this property is always set to `wait`.

                - `"wait"`

          - `actions?: BetaComputerActionList`

            Flattened batched actions for `computer_use`. Each action includes an
            `type` discriminator and action-specific fields.

            - `Click`

              A click action.

            - `DoubleClick`

              A double click action.

            - `Drag`

              A drag action.

            - `Keypress`

              A collection of keypresses the model would like to perform.

            - `Move`

              A mouse move action.

            - `Screenshot`

              A screenshot action.

            - `Scroll`

              A scroll action.

            - `Type`

              An action to type in text.

            - `Wait`

              A wait action.

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

        - `ComputerCallOutput`

          The output of a computer tool call.

          - `call_id: string`

            The ID of the computer tool call that produced the output.

          - `output: BetaResponseComputerToolCallOutputScreenshot`

            A computer screenshot image used with the computer use tool.

            - `type: "computer_screenshot"`

              Specifies the event type. For a computer screenshot, this property is
              always set to `computer_screenshot`.

              - `"computer_screenshot"`

            - `file_id?: string`

              The identifier of an uploaded file that contains the screenshot.

            - `image_url?: string`

              The URL of the screenshot image.

          - `type: "computer_call_output"`

            The type of the computer tool call output. Always `computer_call_output`.

            - `"computer_call_output"`

          - `id?: string | null`

            The ID of the computer tool call output.

          - `acknowledged_safety_checks?: Array<AcknowledgedSafetyCheck> | null`

            The safety checks reported by the API that have been acknowledged by the developer.

            - `id: string`

              The ID of the pending safety check.

            - `code?: string | null`

              The type of the pending safety check.

            - `message?: string | null`

              Details about the pending safety check.

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

          - `status?: "in_progress" | "completed" | "incomplete" | null`

            The status of the message input. One of `in_progress`, `completed`, or `incomplete`. Populated when input items are returned via API.

            - `"in_progress"`

            - `"completed"`

            - `"incomplete"`

        - `BetaResponseFunctionWebSearch`

          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.

          - `id: string`

            The unique ID of the web search tool call.

          - `action: Search | OpenPage | FindInPage`

            An object describing the specific action taken in this web search call.
            Includes details on how the model used the web (search, open_page, find_in_page).

            - `Search`

              Action type "search" - Performs a web search query.

              - `type: "search"`

                The action type.

                - `"search"`

              - `queries?: Array<string>`

                The search queries.

              - `query?: string`

                The search query.

              - `sources?: Array<Source>`

                The sources used in the search.

                - `type: "url"`

                  The type of source. Always `url`.

                  - `"url"`

                - `url: string`

                  The URL of the source.

            - `OpenPage`

              Action type "open_page" - Opens a specific URL from search results.

              - `type: "open_page"`

                The action type.

                - `"open_page"`

              - `url?: string | null`

                The URL opened by the model.

            - `FindInPage`

              Action type "find_in_page": Searches for a pattern within a loaded page.

              - `pattern: string`

                The pattern or text to search for within the page.

              - `type: "find_in_page"`

                The action type.

                - `"find_in_page"`

              - `url: string`

                The URL of the page searched for the pattern.

          - `status: "in_progress" | "searching" | "completed" | "failed"`

            The status of the web search tool call.

            - `"in_progress"`

            - `"searching"`

            - `"completed"`

            - `"failed"`

          - `type: "web_search_call"`

            The type of the web search tool call. Always `web_search_call`.

            - `"web_search_call"`

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

        - `BetaResponseFunctionToolCall`

          A tool call to run a function. See the
          [function calling guide](https://platform.openai.com/docs/guides/function-calling) for more information.

          - `arguments: string`

            A JSON string of the arguments to pass to the function.

          - `call_id: string`

            The unique ID of the function tool call generated by the model.

          - `name: string`

            The name of the function to run.

          - `type: "function_call"`

            The type of the function tool call. Always `function_call`.

            - `"function_call"`

          - `id?: string`

            The unique ID of the function tool call.

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

          - `caller?: Direct | Program | null`

            The execution context that produced this tool call.

            - `Direct`

              - `type: "direct"`

                - `"direct"`

            - `Program`

              - `caller_id: string`

                The call ID of the program item that produced this tool call.

              - `type: "program"`

                - `"program"`

          - `namespace?: string`

            The namespace of the function to run.

          - `status?: "in_progress" | "completed" | "incomplete"`

            The status of the item. One of `in_progress`, `completed`, or
            `incomplete`. Populated when items are returned via API.

            - `"in_progress"`

            - `"completed"`

            - `"incomplete"`

        - `FunctionCallOutput`

          The output of a function tool call.

          - `call_id: string`

            The unique ID of the function tool call generated by the model.

          - `output: string | BetaResponseFunctionCallOutputItemList`

            Text, image, or file output of the function tool call.

            - `string`

            - `BetaResponseFunctionCallOutputItemList = Array<BetaResponseFunctionCallOutputItem>`

              An array of content outputs (text, image, file) for the function tool call.

              - `BetaResponseInputTextContent`

                A text input to the model.

                - `text: string`

                  The text input to the model.

                - `type: "input_text"`

                  The type of the input item. Always `input_text`.

                  - `"input_text"`

                - `prompt_cache_breakpoint?: PromptCacheBreakpoint | null`

                  Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.

                  - `mode: "explicit"`

                    The breakpoint mode. Always `explicit`.

                    - `"explicit"`

              - `BetaResponseInputImageContent`

                An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision)

                - `type: "input_image"`

                  The type of the input item. Always `input_image`.

                  - `"input_image"`

                - `detail?: BetaImageDetail | null`

                  The detail level of the image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`.

                - `file_id?: string | null`

                  The ID of the file to be sent to the model.

                - `image_url?: string | null`

                  The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.

                - `prompt_cache_breakpoint?: PromptCacheBreakpoint | null`

                  Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.

                  - `mode: "explicit"`

                    The breakpoint mode. Always `explicit`.

                    - `"explicit"`

              - `BetaResponseInputFileContent`

                A file input to the model.

                - `type: "input_file"`

                  The type of the input item. Always `input_file`.

                  - `"input_file"`

                - `detail?: "auto" | "low" | "high"`

                  The detail level of the file to be sent to the model. Use `auto` to let the system select the detail level; for GPT-5.6 and later models, `auto` uses high-quality rendering, which may increase input token usage. Use `low` for lower-cost rendering, or `high` to render the file at higher quality. Defaults to `auto`.

                  - `"auto"`

                  - `"low"`

                  - `"high"`

                - `file_data?: string | null`

                  The base64-encoded data of the file to be sent to the model.

                - `file_id?: string | null`

                  The ID of the file to be sent to the model.

                - `file_url?: string | null`

                  The URL of the file to be sent to the model.

                - `filename?: string | null`

                  The name of the file to be sent to the model.

                - `prompt_cache_breakpoint?: PromptCacheBreakpoint | null`

                  Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.

                  - `mode: "explicit"`

                    The breakpoint mode. Always `explicit`.

                    - `"explicit"`

          - `type: "function_call_output"`

            The type of the function tool call output. Always `function_call_output`.

            - `"function_call_output"`

          - `id?: string | null`

            The unique ID of the function tool call output. Populated when this item is returned via API.

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

          - `caller?: Direct | Program | null`

            The execution context that produced this tool call.

            - `Direct`

              - `type: "direct"`

                The caller type. Always `direct`.

                - `"direct"`

            - `Program`

              - `caller_id: string`

                The call ID of the program item that produced this tool call.

              - `type: "program"`

                The caller type. Always `program`.

                - `"program"`

          - `name?: string | null`

            The name of the tool that produced the output.

          - `namespace?: string | null`

            The namespace of the tool that produced the output.

          - `status?: "in_progress" | "completed" | "incomplete" | null`

            The status of the item. One of `in_progress`, `completed`, or `incomplete`. Populated when items are returned via API.

            - `"in_progress"`

            - `"completed"`

            - `"incomplete"`

        - `AgentMessage`

          A message routed between agents.

          - `author: string`

            The sending agent identity.

          - `content: Array<BetaResponseInputTextContent | BetaResponseInputImageContent | EncryptedContent>`

            Plaintext, image, or encrypted content sent between agents.

            - `BetaResponseInputTextContent`

              A text input to the model.

            - `BetaResponseInputImageContent`

              An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision)

            - `EncryptedContent`

              Opaque encrypted content that Responses API decrypts inside trusted model execution.

              - `encrypted_content: string`

                Opaque encrypted content.

              - `type: "encrypted_content"`

                The type of the input item. Always `encrypted_content`.

                - `"encrypted_content"`

          - `recipient: string`

            The destination agent identity.

          - `type: "agent_message"`

            The item type. Always `agent_message`.

            - `"agent_message"`

          - `id?: string | null`

            The unique ID of this agent message item.

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

        - `MultiAgentCall`

          - `action: "spawn_agent" | "interrupt_agent" | "list_agents" | 3 more`

            The multi-agent action that was executed.

            - `"spawn_agent"`

            - `"interrupt_agent"`

            - `"list_agents"`

            - `"send_message"`

            - `"followup_task"`

            - `"wait_agent"`

          - `arguments: string`

            The action arguments as a JSON string.

          - `call_id: string`

            The unique ID linking this call to its output.

          - `type: "multi_agent_call"`

            The item type. Always `multi_agent_call`.

            - `"multi_agent_call"`

          - `id?: string | null`

            The unique ID of this multi-agent call.

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

        - `MultiAgentCallOutput`

          - `action: "spawn_agent" | "interrupt_agent" | "list_agents" | 3 more`

            The multi-agent action that produced this result.

            - `"spawn_agent"`

            - `"interrupt_agent"`

            - `"list_agents"`

            - `"send_message"`

            - `"followup_task"`

            - `"wait_agent"`

          - `call_id: string`

            The unique ID of the multi-agent call.

          - `output: Array<Output>`

            Text output returned by the multi-agent action.

            - `text: string`

              The text content.

            - `type: "output_text"`

              The content type. Always `output_text`.

              - `"output_text"`

            - `annotations?: Array<FileCitation | URLCitation | ContainerFileCitation>`

              Citations associated with the text content.

              - `FileCitation`

                - `file_id: string`

                  The ID of the file.

                - `filename: string`

                  The filename of the file cited.

                - `index: number`

                  The index of the file in the list of files.

                - `type: "file_citation"`

                  The citation type. Always `file_citation`.

                  - `"file_citation"`

              - `URLCitation`

                - `end_index: number`

                  The index of the last character of the citation in the message.

                - `start_index: number`

                  The index of the first character of the citation in the message.

                - `title: string`

                  The title of the cited resource.

                - `type: "url_citation"`

                  The citation type. Always `url_citation`.

                  - `"url_citation"`

                - `url: string`

                  The URL of the cited resource.

              - `ContainerFileCitation`

                - `container_id: string`

                  The ID of the container.

                - `end_index: number`

                  The index of the last character of the citation in the message.

                - `file_id: string`

                  The ID of the container file.

                - `filename: string`

                  The filename of the container file cited.

                - `start_index: number`

                  The index of the first character of the citation in the message.

                - `type: "container_file_citation"`

                  The citation type. Always `container_file_citation`.

                  - `"container_file_citation"`

          - `type: "multi_agent_call_output"`

            The item type. Always `multi_agent_call_output`.

            - `"multi_agent_call_output"`

          - `id?: string | null`

            The unique ID of this multi-agent call output.

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

        - `ToolSearchCall`

          - `arguments: unknown`

            The arguments supplied to the tool search call.

          - `type: "tool_search_call"`

            The item type. Always `tool_search_call`.

            - `"tool_search_call"`

          - `id?: string | null`

            The unique ID of this tool search call.

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

          - `call_id?: string | null`

            The unique ID of the tool search call generated by the model.

          - `execution?: "server" | "client"`

            Whether tool search was executed by the server or by the client.

            - `"server"`

            - `"client"`

          - `status?: "in_progress" | "completed" | "incomplete" | null`

            The status of the tool search call.

            - `"in_progress"`

            - `"completed"`

            - `"incomplete"`

        - `BetaResponseToolSearchOutputItemParam`

          - `tools: Array<BetaTool>`

            The loaded tool definitions returned by the tool search output.

            - `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).

              - `name: string`

                The name of the function to call.

              - `parameters: Record<string, unknown> | null`

                A JSON schema object describing the parameters of the function.

              - `strict: boolean | null`

                Whether strict parameter validation is enforced for this function tool.

              - `type: "function"`

                The type of the function tool. Always `function`.

                - `"function"`

              - `allowed_callers?: Array<"direct" | "programmatic"> | null`

                The tool invocation context(s).

                - `"direct"`

                - `"programmatic"`

              - `defer_loading?: boolean`

                Whether this function is deferred and loaded via tool search.

              - `description?: string | null`

                A description of the function. Used by the model to determine whether or not to call the function.

              - `output_schema?: Record<string, unknown> | null`

                A JSON schema object describing the JSON value encoded in string outputs for this function.

            - `BetaFileSearchTool`

              A tool that searches for relevant content from uploaded files. Learn more about the [file search tool](https://platform.openai.com/docs/guides/tools-file-search).

              - `type: "file_search"`

                The type of the file search tool. Always `file_search`.

                - `"file_search"`

              - `vector_store_ids: Array<string>`

                The IDs of the vector stores to search.

              - `filters?: ComparisonFilter | CompoundFilter | null`

                A filter to apply.

                - `ComparisonFilter`

                  A filter used to compare a specified attribute key to a given value using a defined comparison operation.

                  - `key: string`

                    The key to compare against the value.

                  - `type: "eq" | "ne" | "gt" | 5 more`

                    Specifies the comparison operator: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`, `in`, `nin`.

                    - `eq`: equals
                    - `ne`: not equal
                    - `gt`: greater than
                    - `gte`: greater than or equal
                    - `lt`: less than
                    - `lte`: less than or equal
                    - `in`: in
                    - `nin`: not in

                    - `"eq"`

                    - `"ne"`

                    - `"gt"`

                    - `"gte"`

                    - `"lt"`

                    - `"lte"`

                    - `"in"`

                    - `"nin"`

                  - `value: string | number | boolean | Array<string | number>`

                    The value to compare against the attribute key; supports string, number, or boolean types.

                    - `string`

                    - `number`

                    - `boolean`

                    - `Array<string | number>`

                      - `string`

                      - `number`

                - `CompoundFilter`

                  Combine multiple filters using `and` or `or`.

                  - `filters: Array<ComparisonFilter | unknown>`

                    Array of filters to combine. Items can be `ComparisonFilter` or `CompoundFilter`.

                    - `ComparisonFilter`

                      A filter used to compare a specified attribute key to a given value using a defined comparison operation.

                      - `key: string`

                        The key to compare against the value.

                      - `type: "eq" | "ne" | "gt" | 5 more`

                        Specifies the comparison operator: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`, `in`, `nin`.

                        - `eq`: equals
                        - `ne`: not equal
                        - `gt`: greater than
                        - `gte`: greater than or equal
                        - `lt`: less than
                        - `lte`: less than or equal
                        - `in`: in
                        - `nin`: not in

                        - `"eq"`

                        - `"ne"`

                        - `"gt"`

                        - `"gte"`

                        - `"lt"`

                        - `"lte"`

                        - `"in"`

                        - `"nin"`

                      - `value: string | number | boolean | Array<string | number>`

                        The value to compare against the attribute key; supports string, number, or boolean types.

                        - `string`

                        - `number`

                        - `boolean`

                        - `Array<string | number>`

                          - `string`

                          - `number`

                    - `unknown`

                  - `type: "and" | "or"`

                    Type of operation: `and` or `or`.

                    - `"and"`

                    - `"or"`

              - `max_num_results?: number`

                The maximum number of results to return. This number should be between 1 and 50 inclusive.

              - `ranking_options?: RankingOptions`

                Ranking options for search.

                - `hybrid_search?: HybridSearch`

                  Weights that control how reciprocal rank fusion balances semantic embedding matches versus sparse keyword matches when hybrid search is enabled.

                  - `embedding_weight: number`

                    The weight of the embedding in the reciprocal ranking fusion.

                  - `text_weight: number`

                    The weight of the text in the reciprocal ranking fusion.

                - `ranker?: "auto" | "default-2024-11-15"`

                  The ranker to use for the file search.

                  - `"auto"`

                  - `"default-2024-11-15"`

                - `score_threshold?: number`

                  The score threshold for the file search, a number between 0 and 1. Numbers closer to 1 will attempt to return only the most relevant results, but may return fewer results.

            - `BetaComputerTool`

              A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use).

              - `type: "computer"`

                The type of the computer tool. Always `computer`.

                - `"computer"`

            - `BetaComputerUsePreviewTool`

              A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use).

              - `display_height: number`

                The height of the computer display.

              - `display_width: number`

                The width of the computer display.

              - `environment: "windows" | "mac" | "linux" | 2 more`

                The type of computer environment to control.

                - `"windows"`

                - `"mac"`

                - `"linux"`

                - `"ubuntu"`

                - `"browser"`

              - `type: "computer_use_preview"`

                The type of the computer use tool. Always `computer_use_preview`.

                - `"computer_use_preview"`

            - `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"`

                The type of the web search tool. One of `web_search` or `web_search_2025_08_26`.

                - `"web_search"`

                - `"web_search_2025_08_26"`

              - `external_web_access?: boolean`

                Allow live internet access for web search. Defaults to true when omitted. When false, the web search tool runs in offline/cache-only mode and will not fetch new external content.

              - `filters?: Filters | null`

                Filters for the search.

                - `allowed_domains?: Array<string> | null`

                  Allowed domains for the search. If not provided, all domains are allowed.
                  Subdomains of the provided domains are allowed as well.

                  Example: `["pubmed.ncbi.nlm.nih.gov"]`

              - `search_context_size?: "low" | "medium" | "high"`

                High level guidance for the amount of context window space to use for the search. One of `low`, `medium`, or `high`. `medium` is the default.

                - `"low"`

                - `"medium"`

                - `"high"`

              - `user_location?: UserLocation | null`

                The approximate location of the user.

                - `city?: string | null`

                  Free text input for the city of the user, e.g. `San Francisco`.

                - `country?: string | null`

                  The two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of the user, e.g. `US`.

                - `region?: string | null`

                  Free text input for the region of the user, e.g. `California`.

                - `timezone?: string | null`

                  The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of the user, e.g. `America/Los_Angeles`.

                - `type?: "approximate"`

                  The type of location approximation. Always `approximate`.

                  - `"approximate"`

            - `Mcp`

              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).

              - `server_label: string`

                A label for this MCP server, used to identify it in tool calls.

              - `type: "mcp"`

                The type of the MCP tool. Always `mcp`.

                - `"mcp"`

              - `allowed_callers?: Array<"direct" | "programmatic"> | null`

                The tool invocation context(s).

                - `"direct"`

                - `"programmatic"`

              - `allowed_tools?: Array<string> | McpToolFilter | null`

                List of allowed tool names or a filter object.

                - `Array<string>`

                - `McpToolFilter`

                  A filter object to specify which tools are allowed.

                  - `read_only?: boolean`

                    Indicates whether or not a tool modifies data or is read-only. If an
                    MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint),
                    it will match this filter.

                  - `tool_names?: Array<string>`

                    List of allowed tool names.

              - `authorization?: string`

                An OAuth access token that can be used with a remote MCP server, either
                with a custom MCP server URL or a service connector. Your application
                must handle the OAuth authorization flow and provide the token here.

              - `connector_id?: "connector_dropbox" | "connector_gmail" | "connector_googlecalendar" | 5 more`

                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`

                - `"connector_dropbox"`

                - `"connector_gmail"`

                - `"connector_googlecalendar"`

                - `"connector_googledrive"`

                - `"connector_microsoftteams"`

                - `"connector_outlookcalendar"`

                - `"connector_outlookemail"`

                - `"connector_sharepoint"`

              - `defer_loading?: boolean`

                Whether this MCP tool is deferred and discovered via tool search.

              - `headers?: Record<string, string> | null`

                Optional HTTP headers to send to the MCP server. Use for authentication
                or other purposes.

              - `require_approval?: McpToolApprovalFilter | "always" | "never" | null`

                Specify which of the MCP server's tools require approval.

                - `McpToolApprovalFilter`

                  Specify which of the MCP server's tools require approval. Can be
                  `always`, `never`, or a filter object associated with tools
                  that require approval.

                  - `always?: Always`

                    A filter object to specify which tools are allowed.

                    - `read_only?: boolean`

                      Indicates whether or not a tool modifies data or is read-only. If an
                      MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint),
                      it will match this filter.

                    - `tool_names?: Array<string>`

                      List of allowed tool names.

                  - `never?: Never`

                    A filter object to specify which tools are allowed.

                    - `read_only?: boolean`

                      Indicates whether or not a tool modifies data or is read-only. If an
                      MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint),
                      it will match this filter.

                    - `tool_names?: Array<string>`

                      List of allowed tool names.

                - `"always" | "never"`

                  - `"always"`

                  - `"never"`

              - `server_description?: string`

                Optional description of the MCP server, used to provide more context.

              - `server_url?: string`

                The URL for the MCP server. One of `server_url`, `connector_id`, or
                `tunnel_id` must be provided.

              - `tunnel_id?: string`

                The Secure MCP Tunnel ID to use instead of a direct server URL. One of
                `server_url`, `connector_id`, or `tunnel_id` must be provided.

            - `CodeInterpreter`

              A tool that runs Python code to help generate a response to a prompt.

              - `container: string | CodeInterpreterToolAuto`

                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`

                - `CodeInterpreterToolAuto`

                  Configuration for a code interpreter container. Optionally specify the IDs of the files to run the code on.

                  - `type: "auto"`

                    Always `auto`.

                    - `"auto"`

                  - `file_ids?: Array<string>`

                    An optional list of uploaded files to make available to your code.

                  - `memory_limit?: "1g" | "4g" | "16g" | "64g" | null`

                    The memory limit for the code interpreter container.

                    - `"1g"`

                    - `"4g"`

                    - `"16g"`

                    - `"64g"`

                  - `network_policy?: BetaContainerNetworkPolicyDisabled | BetaContainerNetworkPolicyAllowlist`

                    Network access policy for the container.

                    - `BetaContainerNetworkPolicyDisabled`

                      - `type: "disabled"`

                        Disable outbound network access. Always `disabled`.

                        - `"disabled"`

                    - `BetaContainerNetworkPolicyAllowlist`

                      - `allowed_domains: Array<string>`

                        A list of allowed domains when type is `allowlist`.

                      - `type: "allowlist"`

                        Allow outbound network access only to specified domains. Always `allowlist`.

                        - `"allowlist"`

                      - `domain_secrets?: Array<BetaContainerNetworkPolicyDomainSecret>`

                        Optional domain-scoped secrets for allowlisted domains.

                        - `domain: string`

                          The domain associated with the secret.

                        - `name: string`

                          The name of the secret to inject for the domain.

                        - `value: string`

                          The secret value to inject for the domain.

              - `type: "code_interpreter"`

                The type of the code interpreter tool. Always `code_interpreter`.

                - `"code_interpreter"`

              - `allowed_callers?: Array<"direct" | "programmatic"> | null`

                The tool invocation context(s).

                - `"direct"`

                - `"programmatic"`

            - `ProgrammaticToolCalling`

              - `type: "programmatic_tool_calling"`

                The type of the tool. Always `programmatic_tool_calling`.

                - `"programmatic_tool_calling"`

            - `ImageGeneration`

              A tool that generates images using the GPT image models.

              - `type: "image_generation"`

                The type of the image generation tool. Always `image_generation`.

                - `"image_generation"`

              - `action?: "generate" | "edit" | "auto"`

                Whether to generate a new image or edit an existing image. Default: `auto`.

                - `"generate"`

                - `"edit"`

                - `"auto"`

              - `background?: "transparent" | "opaque" | "auto"`

                Allows to set transparency for the background of the generated image(s).
                Must be one of `transparent`, `opaque`, or `auto` (default value). When
                `auto` is used, the model will automatically determine the best
                background for the image.

                Transparent backgrounds are available for supported GPT Image models.
                For `gpt-image-2` and `gpt-image-2-2026-04-21`, this support is in
                preview. When using `transparent`, set the output format to `png` or
                `webp`.

                - `"transparent"`

                - `"opaque"`

                - `"auto"`

              - `input_fidelity?: "high" | "low" | null`

                Control how much effort the model will exert to match the style and features, especially facial features, of input images. This parameter is only supported for `gpt-image-1` and `gpt-image-1.5` and later models, unsupported for `gpt-image-1-mini`. Supports `high` and `low`. Defaults to `low`.

                - `"high"`

                - `"low"`

              - `input_image_mask?: InputImageMask`

                Optional mask for inpainting. Contains `image_url`
                (string, optional) and `file_id` (string, optional).

                - `file_id?: string`

                  File ID for the mask image.

                - `image_url?: string`

                  Base64-encoded mask image.

              - `model?: (string & {}) | "gpt-image-1" | "gpt-image-1-mini" | "gpt-image-2" | 3 more`

                The image generation model to use. One of `gpt-image-1`,
                `gpt-image-1-mini`, `gpt-image-1.5`, `gpt-image-2`,
                `gpt-image-2-2026-04-21`, or `chatgpt-image-latest`. Default:
                `gpt-image-1`.

                - `(string & {})`

                - `"gpt-image-1" | "gpt-image-1-mini" | "gpt-image-2" | 3 more`

                  - `"gpt-image-1"`

                  - `"gpt-image-1-mini"`

                  - `"gpt-image-2"`

                  - `"gpt-image-2-2026-04-21"`

                  - `"gpt-image-1.5"`

                  - `"chatgpt-image-latest"`

              - `moderation?: "auto" | "low"`

                Moderation level for the generated image. Default: `auto`.

                - `"auto"`

                - `"low"`

              - `output_compression?: number`

                Compression level for the output image. Default: 100.

              - `output_format?: "png" | "webp" | "jpeg"`

                The output format of the generated image. One of `png`, `webp`, or
                `jpeg`. Default: `png`.

                - `"png"`

                - `"webp"`

                - `"jpeg"`

              - `partial_images?: number`

                Number of partial images to generate in streaming mode, from 0 (default value) to 3.

              - `quality?: "low" | "medium" | "high" | "auto"`

                The quality of the generated image. One of `low`, `medium`, `high`,
                or `auto`. Default: `auto`.

                - `"low"`

                - `"medium"`

                - `"high"`

                - `"auto"`

              - `size?: (string & {}) | "1024x1024" | "1024x1536" | "1536x1024" | "auto"`

                The size of the generated images. For `gpt-image-2` and `gpt-image-2-2026-04-21`, arbitrary resolutions are supported as `WIDTHxHEIGHT` strings, for example `1536x864`. Width and height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above `2560x1440` are experimental, and the maximum supported resolution is `3840x2160`. The requested size must also satisfy the model's current pixel and edge limits. The standard sizes `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models; `auto` is supported for models that allow automatic sizing. For `dall-e-2`, use one of `256x256`, `512x512`, or `1024x1024`. For `dall-e-3`, use one of `1024x1024`, `1792x1024`, or `1024x1792`.

                - `(string & {})`

                - `"1024x1024" | "1024x1536" | "1536x1024" | "auto"`

                  - `"1024x1024"`

                  - `"1024x1536"`

                  - `"1536x1024"`

                  - `"auto"`

            - `LocalShell`

              A tool that allows the model to execute shell commands in a local environment.

              - `type: "local_shell"`

                The type of the local shell tool. Always `local_shell`.

                - `"local_shell"`

            - `BetaFunctionShellTool`

              A tool that allows the model to execute shell commands.

              - `type: "shell"`

                The type of the shell tool. Always `shell`.

                - `"shell"`

              - `allowed_callers?: Array<"direct" | "programmatic"> | null`

                The tool invocation context(s).

                - `"direct"`

                - `"programmatic"`

              - `environment?: BetaContainerAuto | BetaLocalEnvironment | BetaContainerReference | null`

                - `BetaContainerAuto`

                  - `type: "container_auto"`

                    Automatically creates a container for this request

                    - `"container_auto"`

                  - `file_ids?: Array<string>`

                    An optional list of uploaded files to make available to your code.

                  - `memory_limit?: "1g" | "4g" | "16g" | "64g" | null`

                    The memory limit for the container.

                    - `"1g"`

                    - `"4g"`

                    - `"16g"`

                    - `"64g"`

                  - `network_policy?: BetaContainerNetworkPolicyDisabled | BetaContainerNetworkPolicyAllowlist`

                    Network access policy for the container.

                    - `BetaContainerNetworkPolicyDisabled`

                    - `BetaContainerNetworkPolicyAllowlist`

                  - `skills?: Array<BetaSkillReference | BetaInlineSkill>`

                    An optional list of skills referenced by id or inline data.

                    - `BetaSkillReference`

                      - `skill_id: string`

                        The ID of the referenced skill.

                      - `type: "skill_reference"`

                        References a skill created with the /v1/skills endpoint.

                        - `"skill_reference"`

                      - `version?: string`

                        Optional skill version. Use a positive integer or 'latest'. Omit for default.

                    - `BetaInlineSkill`

                      - `description: string`

                        The description of the skill.

                      - `name: string`

                        The name of the skill.

                      - `source: BetaInlineSkillSource`

                        Inline skill payload

                        - `data: string`

                          Base64-encoded skill zip bundle.

                        - `media_type: "application/zip"`

                          The media type of the inline skill payload. Must be `application/zip`.

                          - `"application/zip"`

                        - `type: "base64"`

                          The type of the inline skill source. Must be `base64`.

                          - `"base64"`

                      - `type: "inline"`

                        Defines an inline skill for this request.

                        - `"inline"`

                - `BetaLocalEnvironment`

                  - `type: "local"`

                    Use a local computer environment.

                    - `"local"`

                  - `skills?: Array<BetaLocalSkill>`

                    An optional list of skills.

                    - `description: string`

                      The description of the skill.

                    - `name: string`

                      The name of the skill.

                    - `path: string`

                      The path to the directory containing the skill.

                - `BetaContainerReference`

                  - `container_id: string`

                    The ID of the referenced container.

                  - `type: "container_reference"`

                    References a container created with the /v1/containers endpoint

                    - `"container_reference"`

            - `BetaCustomTool`

              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)

              - `name: string`

                The name of the custom tool, used to identify it in tool calls.

              - `type: "custom"`

                The type of the custom tool. Always `custom`.

                - `"custom"`

              - `allowed_callers?: Array<"direct" | "programmatic"> | null`

                The tool invocation context(s).

                - `"direct"`

                - `"programmatic"`

              - `defer_loading?: boolean`

                Whether this tool should be deferred and discovered via tool search.

              - `description?: string`

                Optional description of the custom tool, used to provide more context.

              - `format?: Text | Grammar`

                The input format for the custom tool. Default is unconstrained text.

                - `Text`

                  Unconstrained free-form text.

                  - `type: "text"`

                    Unconstrained text format. Always `text`.

                    - `"text"`

                - `Grammar`

                  A grammar defined by the user.

                  - `definition: string`

                    The grammar definition.

                  - `syntax: "lark" | "regex"`

                    The syntax of the grammar definition. One of `lark` or `regex`.

                    - `"lark"`

                    - `"regex"`

                  - `type: "grammar"`

                    Grammar format. Always `grammar`.

                    - `"grammar"`

            - `BetaNamespaceTool`

              Groups function/custom tools under a shared namespace.

              - `description: string`

                A description of the namespace shown to the model.

              - `name: string`

                The namespace name used in tool calls (for example, `crm`).

              - `tools: Array<Function | BetaCustomTool>`

                The function/custom tools available inside this namespace.

                - `Function`

                  - `name: string`

                  - `type: "function"`

                    - `"function"`

                  - `allowed_callers?: Array<"direct" | "programmatic"> | null`

                    The tool invocation context(s).

                    - `"direct"`

                    - `"programmatic"`

                  - `defer_loading?: boolean`

                    Whether this function should be deferred and discovered via tool search.

                  - `description?: string | null`

                  - `output_schema?: Record<string, unknown> | null`

                    A JSON Schema describing the JSON value encoded in string outputs for this function tool. This does not describe content-array outputs.

                  - `parameters?: unknown`

                  - `strict?: boolean | null`

                    Whether to enforce strict parameter validation. If omitted, Responses attempts to use strict validation when the schema is compatible, and falls back to non-strict validation otherwise.

                - `BetaCustomTool`

                  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: "namespace"`

                The type of the tool. Always `namespace`.

                - `"namespace"`

            - `BetaToolSearchTool`

              Hosted or BYOT tool search configuration for deferred tools.

              - `type: "tool_search"`

                The type of the tool. Always `tool_search`.

                - `"tool_search"`

              - `description?: string | null`

                Description shown to the model for a client-executed tool search tool.

              - `execution?: "server" | "client"`

                Whether tool search is executed by the server or by the client.

                - `"server"`

                - `"client"`

              - `parameters?: unknown`

                Parameter schema for a client-executed tool search tool.

            - `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"`

                The type of the web search tool. One of `web_search_preview` or `web_search_preview_2025_03_11`.

                - `"web_search_preview"`

                - `"web_search_preview_2025_03_11"`

              - `search_content_types?: Array<"text" | "image">`

                - `"text"`

                - `"image"`

              - `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.

                - `"low"`

                - `"medium"`

                - `"high"`

              - `user_location?: UserLocation | null`

                The user's location.

                - `type: "approximate"`

                  The type of location approximation. Always `approximate`.

                  - `"approximate"`

                - `city?: string | null`

                  Free text input for the city of the user, e.g. `San Francisco`.

                - `country?: string | null`

                  The two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of the user, e.g. `US`.

                - `region?: string | null`

                  Free text input for the region of the user, e.g. `California`.

                - `timezone?: string | null`

                  The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of the user, e.g. `America/Los_Angeles`.

            - `BetaApplyPatchTool`

              Allows the assistant to create, delete, or update files using unified diffs.

              - `type: "apply_patch"`

                The type of the tool. Always `apply_patch`.

                - `"apply_patch"`

              - `allowed_callers?: Array<"direct" | "programmatic"> | null`

                The tool invocation context(s).

                - `"direct"`

                - `"programmatic"`

          - `type: "tool_search_output"`

            The item type. Always `tool_search_output`.

            - `"tool_search_output"`

          - `id?: string | null`

            The unique ID of this tool search output.

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

          - `call_id?: string | null`

            The unique ID of the tool search call generated by the model.

          - `execution?: "server" | "client"`

            Whether tool search was executed by the server or by the client.

            - `"server"`

            - `"client"`

          - `status?: "in_progress" | "completed" | "incomplete" | null`

            The status of the tool search output.

            - `"in_progress"`

            - `"completed"`

            - `"incomplete"`

        - `AdditionalTools`

          - `role: "developer"`

            The role that provided the additional tools. Only `developer` is supported.

            - `"developer"`

          - `tools: Array<BetaTool>`

            A list of additional tools made available at this item.

            - `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).

            - `Mcp`

              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).

            - `CodeInterpreter`

              A tool that runs Python code to help generate a response to a prompt.

            - `ProgrammaticToolCalling`

            - `ImageGeneration`

              A tool that generates images using the GPT image models.

            - `LocalShell`

              A tool that allows the model to execute shell commands in a local environment.

            - `BetaFunctionShellTool`

              A tool that allows the model to execute shell commands.

            - `BetaCustomTool`

              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)

            - `BetaNamespaceTool`

              Groups function/custom tools under a shared namespace.

            - `BetaToolSearchTool`

              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).

            - `BetaApplyPatchTool`

              Allows the assistant to create, delete, or update files using unified diffs.

          - `type: "additional_tools"`

            The item type. Always `additional_tools`.

            - `"additional_tools"`

          - `id?: string | null`

            The unique ID of this additional tools item.

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

        - `BetaResponseReasoningItem`

          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).

          - `id: string`

            The unique identifier of the reasoning content.

          - `summary: Array<Summary>`

            Reasoning summary content.

            - `text: string`

              A summary of the reasoning output from the model so far.

            - `type: "summary_text"`

              The type of the object. Always `summary_text`.

              - `"summary_text"`

          - `type: "reasoning"`

            The type of the object. Always `reasoning`.

            - `"reasoning"`

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

          - `content?: Array<Content>`

            Reasoning text content.

            - `text: string`

              The reasoning text from the model.

            - `type: "reasoning_text"`

              The type of the reasoning text. Always `reasoning_text`.

              - `"reasoning_text"`

          - `encrypted_content?: string | null`

            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.

            When streaming, use the completed reasoning item and its
            `encrypted_content` from the `response.output_item.done` event in
            subsequent requests. The `encrypted_content` in
            `response.output_item.added` may be incomplete. This is especially
            important when `store` is `false` or when using Zero Data Retention.

          - `status?: "in_progress" | "completed" | "incomplete"`

            The status of the item. One of `in_progress`, `completed`, or
            `incomplete`. Populated when items are returned via API.

            - `"in_progress"`

            - `"completed"`

            - `"incomplete"`

        - `BetaResponseCompactionItemParam`

          A compaction item generated by the [`v1/responses/compact` API](https://platform.openai.com/docs/api-reference/responses/compact).

          - `encrypted_content: string`

            The encrypted content of the compaction summary.

          - `type: "compaction"`

            The type of the item. Always `compaction`.

            - `"compaction"`

          - `id?: string | null`

            The ID of the compaction item.

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

        - `ImageGenerationCall`

          An image generation request made by the model.

          - `id: string`

            The unique ID of the image generation call.

          - `result: string | null`

            The generated image encoded in base64.

          - `status: "in_progress" | "completed" | "generating" | "failed"`

            The status of the image generation call.

            - `"in_progress"`

            - `"completed"`

            - `"generating"`

            - `"failed"`

          - `type: "image_generation_call"`

            The type of the image generation call. Always `image_generation_call`.

            - `"image_generation_call"`

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

        - `BetaResponseCodeInterpreterToolCall`

          A tool call to run code.

          - `id: string`

            The unique ID of the code interpreter tool call.

          - `code: string | null`

            The code to run, or null if not available.

          - `container_id: string`

            The ID of the container used to run the code.

          - `outputs: Array<Logs | Image> | null`

            The outputs generated by the code interpreter, such as logs or images.
            Can be null if no outputs are available.

            - `Logs`

              The logs output from the code interpreter.

              - `logs: string`

                The logs output from the code interpreter.

              - `type: "logs"`

                The type of the output. Always `logs`.

                - `"logs"`

            - `Image`

              The image output from the code interpreter.

              - `type: "image"`

                The type of the output. Always `image`.

                - `"image"`

              - `url: string`

                The URL of the image output from the code interpreter.

          - `status: "in_progress" | "completed" | "incomplete" | 2 more`

            The status of the code interpreter tool call. Valid values are `in_progress`, `completed`, `incomplete`, `interpreting`, and `failed`.

            - `"in_progress"`

            - `"completed"`

            - `"incomplete"`

            - `"interpreting"`

            - `"failed"`

          - `type: "code_interpreter_call"`

            The type of the code interpreter tool call. Always `code_interpreter_call`.

            - `"code_interpreter_call"`

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

        - `LocalShellCall`

          A tool call to run a command on the local shell.

          - `id: string`

            The unique ID of the local shell call.

          - `action: Action`

            Execute a shell command on the server.

            - `command: Array<string>`

              The command to run.

            - `env: Record<string, string>`

              Environment variables to set for the command.

            - `type: "exec"`

              The type of the local shell action. Always `exec`.

              - `"exec"`

            - `timeout_ms?: number | null`

              Optional timeout in milliseconds for the command.

            - `user?: string | null`

              Optional user to run the command as.

            - `working_directory?: string | null`

              Optional working directory to run the command in.

          - `call_id: string`

            The unique ID of the local shell tool call generated by the model.

          - `status: "in_progress" | "completed" | "incomplete"`

            The status of the local shell call.

            - `"in_progress"`

            - `"completed"`

            - `"incomplete"`

          - `type: "local_shell_call"`

            The type of the local shell call. Always `local_shell_call`.

            - `"local_shell_call"`

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

        - `LocalShellCallOutput`

          The output of a local shell tool call.

          - `id: string`

            The unique ID of the local shell tool call generated by the model.

          - `output: string`

            A JSON string of the output of the local shell tool call.

          - `type: "local_shell_call_output"`

            The type of the local shell tool call output. Always `local_shell_call_output`.

            - `"local_shell_call_output"`

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

          - `status?: "in_progress" | "completed" | "incomplete" | null`

            The status of the item. One of `in_progress`, `completed`, or `incomplete`.

            - `"in_progress"`

            - `"completed"`

            - `"incomplete"`

        - `ShellCall`

          A tool representing a request to execute one or more shell commands.

          - `action: Action`

            The shell commands and limits that describe how to run the tool call.

            - `commands: Array<string>`

              Ordered shell commands for the execution environment to run.

            - `max_output_length?: number | null`

              Maximum number of UTF-8 characters to capture from combined stdout and stderr output.

            - `timeout_ms?: number | null`

              Maximum wall-clock time in milliseconds to allow the shell commands to run.

          - `call_id: string`

            The unique ID of the shell tool call generated by the model.

          - `type: "shell_call"`

            The type of the item. Always `shell_call`.

            - `"shell_call"`

          - `id?: string | null`

            The unique ID of the shell tool call. Populated when this item is returned via API.

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

          - `caller?: Direct | Program | null`

            The execution context that produced this tool call.

            - `Direct`

              - `type: "direct"`

                The caller type. Always `direct`.

                - `"direct"`

            - `Program`

              - `caller_id: string`

                The call ID of the program item that produced this tool call.

              - `type: "program"`

                The caller type. Always `program`.

                - `"program"`

          - `environment?: BetaLocalEnvironment | BetaContainerReference | null`

            The environment to execute the shell commands in.

            - `BetaLocalEnvironment`

            - `BetaContainerReference`

          - `status?: "in_progress" | "completed" | "incomplete" | null`

            The status of the shell call. One of `in_progress`, `completed`, or `incomplete`.

            - `"in_progress"`

            - `"completed"`

            - `"incomplete"`

        - `ShellCallOutput`

          The streamed output items emitted by a shell tool call.

          - `call_id: string`

            The unique ID of the shell tool call generated by the model.

          - `output: Array<BetaResponseFunctionShellCallOutputContent>`

            Captured chunks of stdout and stderr output, along with their associated outcomes.

            - `outcome: Timeout | Exit`

              The exit or timeout outcome associated with this shell call.

              - `Timeout`

                Indicates that the shell call exceeded its configured time limit.

                - `type: "timeout"`

                  The outcome type. Always `timeout`.

                  - `"timeout"`

              - `Exit`

                Indicates that the shell commands finished and returned an exit code.

                - `exit_code: number`

                  The exit code returned by the shell process.

                - `type: "exit"`

                  The outcome type. Always `exit`.

                  - `"exit"`

            - `stderr: string`

              Captured stderr output for the shell call.

            - `stdout: string`

              Captured stdout output for the shell call.

          - `type: "shell_call_output"`

            The type of the item. Always `shell_call_output`.

            - `"shell_call_output"`

          - `id?: string | null`

            The unique ID of the shell tool call output. Populated when this item is returned via API.

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

          - `caller?: Direct | Program | null`

            The execution context that produced this tool call.

            - `Direct`

              - `type: "direct"`

                The caller type. Always `direct`.

                - `"direct"`

            - `Program`

              - `caller_id: string`

                The call ID of the program item that produced this tool call.

              - `type: "program"`

                The caller type. Always `program`.

                - `"program"`

          - `max_output_length?: number | null`

            The maximum number of UTF-8 characters captured for this shell call's combined output.

          - `status?: "in_progress" | "completed" | "incomplete" | null`

            The status of the shell call output.

            - `"in_progress"`

            - `"completed"`

            - `"incomplete"`

        - `ApplyPatchCall`

          A tool call representing a request to create, delete, or update files using diff patches.

          - `call_id: string`

            The unique ID of the apply patch tool call generated by the model.

          - `operation: CreateFile | DeleteFile | UpdateFile`

            The specific create, delete, or update instruction for the apply_patch tool call.

            - `CreateFile`

              Instruction for creating a new file via the apply_patch tool.

              - `diff: string`

                Unified diff content to apply when creating the file.

              - `path: string`

                Path of the file to create relative to the workspace root.

              - `type: "create_file"`

                The operation type. Always `create_file`.

                - `"create_file"`

            - `DeleteFile`

              Instruction for deleting an existing file via the apply_patch tool.

              - `path: string`

                Path of the file to delete relative to the workspace root.

              - `type: "delete_file"`

                The operation type. Always `delete_file`.

                - `"delete_file"`

            - `UpdateFile`

              Instruction for updating an existing file via the apply_patch tool.

              - `diff: string`

                Unified diff content to apply to the existing file.

              - `path: string`

                Path of the file to update relative to the workspace root.

              - `type: "update_file"`

                The operation type. Always `update_file`.

                - `"update_file"`

          - `status: "in_progress" | "completed"`

            The status of the apply patch tool call. One of `in_progress` or `completed`.

            - `"in_progress"`

            - `"completed"`

          - `type: "apply_patch_call"`

            The type of the item. Always `apply_patch_call`.

            - `"apply_patch_call"`

          - `id?: string | null`

            The unique ID of the apply patch tool call. Populated when this item is returned via API.

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

          - `caller?: Direct | Program | null`

            The execution context that produced this tool call.

            - `Direct`

              - `type: "direct"`

                The caller type. Always `direct`.

                - `"direct"`

            - `Program`

              - `caller_id: string`

                The call ID of the program item that produced this tool call.

              - `type: "program"`

                The caller type. Always `program`.

                - `"program"`

        - `ApplyPatchCallOutput`

          The streamed output emitted by an apply patch tool call.

          - `call_id: string`

            The unique ID of the apply patch tool call generated by the model.

          - `status: "completed" | "failed"`

            The status of the apply patch tool call output. One of `completed` or `failed`.

            - `"completed"`

            - `"failed"`

          - `type: "apply_patch_call_output"`

            The type of the item. Always `apply_patch_call_output`.

            - `"apply_patch_call_output"`

          - `id?: string | null`

            The unique ID of the apply patch tool call output. Populated when this item is returned via API.

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

          - `caller?: Direct | Program | null`

            The execution context that produced this tool call.

            - `Direct`

              - `type: "direct"`

                The caller type. Always `direct`.

                - `"direct"`

            - `Program`

              - `caller_id: string`

                The call ID of the program item that produced this tool call.

              - `type: "program"`

                The caller type. Always `program`.

                - `"program"`

          - `output?: string | null`

            Optional human-readable log text from the apply patch tool (e.g., patch results or errors).

        - `McpListTools`

          A list of tools available on an MCP server.

          - `id: string`

            The unique ID of the list.

          - `server_label: string`

            The label of the MCP server.

          - `tools: Array<Tool>`

            The tools available on the server.

            - `input_schema: unknown`

              The JSON schema describing the tool's input.

            - `name: string`

              The name of the tool.

            - `annotations?: unknown`

              Additional annotations about the tool.

            - `description?: string | null`

              The description of the tool.

          - `type: "mcp_list_tools"`

            The type of the item. Always `mcp_list_tools`.

            - `"mcp_list_tools"`

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

          - `error?: string | null`

            Error message if the server could not list tools.

        - `McpApprovalRequest`

          A request for human approval of a tool invocation.

          - `id: string`

            The unique ID of the approval request.

          - `arguments: string`

            A JSON string of arguments for the tool.

          - `name: string`

            The name of the tool to run.

          - `server_label: string`

            The label of the MCP server making the request.

          - `type: "mcp_approval_request"`

            The type of the item. Always `mcp_approval_request`.

            - `"mcp_approval_request"`

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

        - `McpApprovalResponse`

          A response to an MCP approval request.

          - `approval_request_id: string`

            The ID of the approval request being answered.

          - `approve: boolean`

            Whether the request was approved.

          - `type: "mcp_approval_response"`

            The type of the item. Always `mcp_approval_response`.

            - `"mcp_approval_response"`

          - `id?: string | null`

            The unique ID of the approval response

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

          - `reason?: string | null`

            Optional reason for the decision.

        - `McpCall`

          An invocation of a tool on an MCP server.

          - `id: string`

            The unique ID of the tool call.

          - `arguments: string`

            A JSON string of the arguments passed to the tool.

          - `name: string`

            The name of the tool that was run.

          - `server_label: string`

            The label of the MCP server running the tool.

          - `type: "mcp_call"`

            The type of the item. Always `mcp_call`.

            - `"mcp_call"`

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

          - `approval_request_id?: string | null`

            Unique identifier for the MCP tool call approval request.
            Include this value in a subsequent `mcp_approval_response` input to approve or reject the corresponding tool call.

          - `error?: BetaMcpToolCallError | null`

            The error from the tool call, if any.

            - `McpProtocolError`

              - `code: number`

              - `message: string`

              - `type: "mcp_protocol_error"`

                - `"mcp_protocol_error"`

            - `McpToolExecutionError`

              - `content: unknown`

              - `type: "mcp_tool_execution_error"`

                - `"mcp_tool_execution_error"`

            - `HTTPError`

              - `code: number`

              - `message: string`

              - `type: "http_error"`

                - `"http_error"`

          - `output?: string | null`

            The output from the tool call.

          - `status?: "in_progress" | "completed" | "incomplete" | 2 more`

            The status of the tool call. One of `in_progress`, `completed`, `incomplete`, `calling`, or `failed`.

            - `"in_progress"`

            - `"completed"`

            - `"incomplete"`

            - `"calling"`

            - `"failed"`

        - `BetaResponseCustomToolCallOutput`

          The output of a custom tool call from your code, being sent back to the model.

          - `call_id: string`

            The call ID, used to map this custom tool call output to a custom tool call.

          - `output: string | Array<BetaResponseInputText | BetaResponseInputImage | BetaResponseInputFile>`

            The output from the custom tool call generated by your code.
            Can be a string or an list of output content.

            - `string`

            - `Array<BetaResponseInputText | BetaResponseInputImage | BetaResponseInputFile>`

              - `BetaResponseInputText`

                A text input to the model.

              - `BetaResponseInputImage`

                An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision).

              - `BetaResponseInputFile`

                A file input to the model.

          - `type: "custom_tool_call_output"`

            The type of the custom tool call output. Always `custom_tool_call_output`.

            - `"custom_tool_call_output"`

          - `id?: string`

            The unique ID of the custom tool call output in the OpenAI platform.

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

          - `caller?: Direct | Program | null`

            The execution context that produced this tool call.

            - `Direct`

              - `type: "direct"`

                The caller type. Always `direct`.

                - `"direct"`

            - `Program`

              - `caller_id: string`

                The call ID of the program item that produced this tool call.

              - `type: "program"`

                The caller type. Always `program`.

                - `"program"`

        - `BetaResponseCustomToolCall`

          A call to a custom tool created by the model.

          - `call_id: string`

            An identifier used to map this custom tool call to a tool call output.

          - `input: string`

            The input for the custom tool call generated by the model.

          - `name: string`

            The name of the custom tool being called.

          - `type: "custom_tool_call"`

            The type of the custom tool call. Always `custom_tool_call`.

            - `"custom_tool_call"`

          - `id?: string`

            The unique ID of the custom tool call in the OpenAI platform.

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

          - `caller?: Direct | Program | null`

            The execution context that produced this tool call.

            - `Direct`

              - `type: "direct"`

                - `"direct"`

            - `Program`

              - `caller_id: string`

                The call ID of the program item that produced this tool call.

              - `type: "program"`

                - `"program"`

          - `namespace?: string`

            The namespace of the custom tool being called.

        - `CompactionTrigger`

          Compacts the current context. Must be the final input item.

          - `type: "compaction_trigger"`

            The type of the item. Always `compaction_trigger`.

            - `"compaction_trigger"`

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

        - `ItemReference`

          An internal identifier for an item to reference.

          - `id: string`

            The ID of the item to reference.

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

          - `type?: "item_reference" | null`

            The type of item to reference. Always `item_reference`.

            - `"item_reference"`

        - `Program`

          - `id: string`

            The unique ID of this program item.

          - `call_id: string`

            The stable call ID of the program item.

          - `code: string`

            The JavaScript source executed by programmatic tool calling.

          - `fingerprint: string`

            Opaque program replay fingerprint that must be round-tripped.

          - `type: "program"`

            The item type. Always `program`.

            - `"program"`

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

        - `ProgramOutput`

          - `id: string`

            The unique ID of this program output item.

          - `call_id: string`

            The call ID of the program item.

          - `result: string`

            The result produced by the program item.

          - `status: "completed" | "incomplete"`

            The terminal status of the program output.

            - `"completed"`

            - `"incomplete"`

          - `type: "program_output"`

            The item type. Always `program_output`.

            - `"program_output"`

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

    - `metadata: Record<string, string> | null`

      Set of 16 key-value pairs that can be attached to an object. This can be
      useful for storing additional information about the object in a structured
      format, and querying for objects via API or the dashboard.

      Keys are strings with a maximum length of 64 characters. Values are strings
      with a maximum length of 512 characters.

    - `model: "gpt-5.6-sol" | "gpt-5.6-terra" | "gpt-5.6-luna" | 99 more | (string & {})`

      Model ID used to generate the response, like `gpt-4o` or `o3`. OpenAI
      offers a wide range of models with different capabilities, performance
      characteristics, and price points. Refer to the [model guide](https://platform.openai.com/docs/models)
      to browse and compare available models.

      - `"gpt-5.6-sol" | "gpt-5.6-terra" | "gpt-5.6-luna" | 99 more`

        - `"gpt-5.6-sol"`

        - `"gpt-5.6-terra"`

        - `"gpt-5.6-luna"`

        - `"gpt-5.5"`

        - `"gpt-5.5-2026-04-23"`

        - `"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.5-pro"`

        - `"gpt-5.5-pro-2026-04-23"`

        - `"gpt-5-codex"`

        - `"gpt-5-pro"`

        - `"gpt-5-pro-2025-10-06"`

        - `"gpt-5.1-codex-max"`

        - `"gpt-daybreak-blue-latest"`

        - `"gpt-daybreak-red-latest"`

        - `"gpt-5.6-cyber"`

      - `(string & {})`

    - `object: "response"`

      The object type of this resource - always set to `response`.

      - `"response"`

    - `output: Array<BetaResponseOutputItem>`

      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.

      - `BetaResponseOutputMessage`

        An output message from the model.

      - `BetaResponseFileSearchToolCall`

        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.

      - `BetaResponseFunctionToolCall`

        A tool call to run a function. See the
        [function calling guide](https://platform.openai.com/docs/guides/function-calling) for more information.

      - `BetaResponseFunctionToolCallOutputItem`

        - `id: string`

          The unique ID of the function call tool output.

        - `call_id: string`

          The unique ID of the function tool call generated by the model.

        - `output: string | Array<BetaResponseInputText | BetaResponseInputImage | BetaResponseInputFile>`

          The output from the function call generated by your code.
          Can be a string or an list of output content.

          - `string`

          - `Array<BetaResponseInputText | BetaResponseInputImage | BetaResponseInputFile>`

            - `BetaResponseInputText`

              A text input to the model.

            - `BetaResponseInputImage`

              An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision).

            - `BetaResponseInputFile`

              A file input to 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.

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

        - `type: "function_call_output"`

          The type of the function tool call output. Always `function_call_output`.

          - `"function_call_output"`

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `caller?: Direct | Program | null`

          The execution context that produced this tool call.

          - `Direct`

            - `type: "direct"`

              The caller type. Always `direct`.

              - `"direct"`

          - `Program`

            - `caller_id: string`

              The call ID of the program item that produced this tool call.

            - `type: "program"`

              The caller type. Always `program`.

              - `"program"`

        - `created_by?: string`

          The identifier of the actor that created the item.

        - `name?: string`

          The name of the tool that produced the output.

        - `namespace?: string`

          The namespace of the tool that produced the output.

      - `AgentMessage`

        - `id: string`

          The unique ID of the agent message.

        - `author: string`

          The sending agent identity.

        - `content: Array<BetaResponseInputText | BetaResponseOutputText | Text | 7 more>`

          Encrypted content sent between agents.

          - `BetaResponseInputText`

            A text input to the model.

          - `BetaResponseOutputText`

            A text output from the model.

          - `Text`

            A text content.

            - `text: string`

            - `type: "text"`

              - `"text"`

          - `SummaryText`

            A summary text from the model.

            - `text: string`

              A summary of the reasoning output from the model so far.

            - `type: "summary_text"`

              The type of the object. Always `summary_text`.

              - `"summary_text"`

          - `ReasoningText`

            Reasoning text from the model.

            - `text: string`

              The reasoning text from the model.

            - `type: "reasoning_text"`

              The type of the reasoning text. Always `reasoning_text`.

              - `"reasoning_text"`

          - `BetaResponseOutputRefusal`

            A refusal from the model.

          - `BetaResponseInputImage`

            An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision).

          - `ComputerScreenshot`

            A screenshot of a computer.

            - `detail: BetaImageDetail`

              The detail level of the screenshot image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`.

            - `file_id: string | null`

              The identifier of an uploaded file that contains the screenshot.

            - `image_url: string | null`

              The URL of the screenshot image.

            - `type: "computer_screenshot"`

              Specifies the event type. For a computer screenshot, this property is always set to `computer_screenshot`.

              - `"computer_screenshot"`

            - `prompt_cache_breakpoint?: PromptCacheBreakpoint`

              Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.

              - `mode: "explicit"`

                The breakpoint mode. Always `explicit`.

                - `"explicit"`

          - `BetaResponseInputFile`

            A file input to the model.

          - `EncryptedContent`

            Opaque encrypted content that Responses API decrypts inside trusted model execution.

            - `encrypted_content: string`

              Opaque encrypted content.

            - `type: "encrypted_content"`

              The type of the input item. Always `encrypted_content`.

              - `"encrypted_content"`

        - `recipient: string`

          The destination agent identity.

        - `type: "agent_message"`

          The type of the item. Always `agent_message`.

          - `"agent_message"`

        - `agent?: Agent`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

      - `MultiAgentCall`

        - `id: string`

          The unique ID of the multi-agent call item.

        - `action: "spawn_agent" | "interrupt_agent" | "list_agents" | 3 more`

          The multi-agent action to execute.

          - `"spawn_agent"`

          - `"interrupt_agent"`

          - `"list_agents"`

          - `"send_message"`

          - `"followup_task"`

          - `"wait_agent"`

        - `arguments: string`

          The JSON string of arguments generated for the action.

        - `call_id: string`

          The unique ID linking this call to its output.

        - `type: "multi_agent_call"`

          The type of the multi-agent call. Always `multi_agent_call`.

          - `"multi_agent_call"`

        - `agent?: Agent`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

      - `MultiAgentCallOutput`

        - `id: string`

          The unique ID of the multi-agent call output item.

        - `action: "spawn_agent" | "interrupt_agent" | "list_agents" | 3 more`

          The multi-agent action that produced this result.

          - `"spawn_agent"`

          - `"interrupt_agent"`

          - `"list_agents"`

          - `"send_message"`

          - `"followup_task"`

          - `"wait_agent"`

        - `call_id: string`

          The unique ID of the multi-agent call.

        - `output: Array<BetaResponseOutputText>`

          Text output returned by the multi-agent action.

          - `annotations: Array<FileCitation | URLCitation | ContainerFileCitation | FilePath>`

            The annotations of the text output.

          - `text: string`

            The text output from the model.

          - `type: "output_text"`

            The type of the output text. Always `output_text`.

          - `logprobs?: Array<Logprob>`

        - `type: "multi_agent_call_output"`

          The type of the multi-agent result. Always `multi_agent_call_output`.

          - `"multi_agent_call_output"`

        - `agent?: Agent`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

      - `BetaResponseFunctionWebSearch`

        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.

      - `BetaResponseComputerToolCall`

        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.

      - `BetaResponseComputerToolCallOutputItem`

        - `id: string`

          The unique ID of the computer call tool output.

        - `call_id: string`

          The ID of the computer tool call that produced the output.

        - `output: BetaResponseComputerToolCallOutputScreenshot`

          A computer screenshot image used with the computer use tool.

        - `status: "completed" | "incomplete" | "failed" | "in_progress"`

          The status of the message input. One of `in_progress`, `completed`, or
          `incomplete`. Populated when input items are returned via API.

          - `"completed"`

          - `"incomplete"`

          - `"failed"`

          - `"in_progress"`

        - `type: "computer_call_output"`

          The type of the computer tool call output. Always `computer_call_output`.

          - `"computer_call_output"`

        - `acknowledged_safety_checks?: Array<AcknowledgedSafetyCheck>`

          The safety checks reported by the API that have been acknowledged by the
          developer.

          - `id: string`

            The ID of the pending safety check.

          - `code?: string | null`

            The type of the pending safety check.

          - `message?: string | null`

            Details about the pending safety check.

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `created_by?: string`

          The identifier of the actor that created the item.

      - `BetaResponseReasoningItem`

        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).

      - `Program`

        - `id: string`

          The unique ID of the program item.

        - `call_id: string`

          The stable call ID of the program item.

        - `code: string`

          The JavaScript source executed by programmatic tool calling.

        - `fingerprint: string`

          Opaque program replay fingerprint that must be round-tripped.

        - `type: "program"`

          The type of the item. Always `program`.

          - `"program"`

        - `agent?: Agent`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

      - `ProgramOutput`

        - `id: string`

          The unique ID of the program output item.

        - `call_id: string`

          The call ID of the program item.

        - `result: string`

          The result produced by the program item.

        - `status: "completed" | "incomplete"`

          The terminal status of the program output item.

          - `"completed"`

          - `"incomplete"`

        - `type: "program_output"`

          The type of the item. Always `program_output`.

          - `"program_output"`

        - `agent?: Agent`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

      - `BetaResponseToolSearchCall`

        - `id: string`

          The unique ID of the tool search call item.

        - `arguments: unknown`

          Arguments used for the tool search call.

        - `call_id: string | null`

          The unique ID of the tool search call generated by the model.

        - `execution: "server" | "client"`

          Whether tool search was executed by the server or by the client.

          - `"server"`

          - `"client"`

        - `status: "in_progress" | "completed" | "incomplete"`

          The status of the tool search call item that was recorded.

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

        - `type: "tool_search_call"`

          The type of the item. Always `tool_search_call`.

          - `"tool_search_call"`

        - `agent?: Agent`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `created_by?: string`

          The identifier of the actor that created the item.

      - `BetaResponseToolSearchOutputItem`

        - `id: string`

          The unique ID of the tool search output item.

        - `call_id: string | null`

          The unique ID of the tool search call generated by the model.

        - `execution: "server" | "client"`

          Whether tool search was executed by the server or by the client.

          - `"server"`

          - `"client"`

        - `status: "in_progress" | "completed" | "incomplete"`

          The status of the tool search output item that was recorded.

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

        - `tools: Array<BetaTool>`

          The loaded tool definitions returned by tool search.

          - `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).

          - `Mcp`

            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).

          - `CodeInterpreter`

            A tool that runs Python code to help generate a response to a prompt.

          - `ProgrammaticToolCalling`

          - `ImageGeneration`

            A tool that generates images using the GPT image models.

          - `LocalShell`

            A tool that allows the model to execute shell commands in a local environment.

          - `BetaFunctionShellTool`

            A tool that allows the model to execute shell commands.

          - `BetaCustomTool`

            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)

          - `BetaNamespaceTool`

            Groups function/custom tools under a shared namespace.

          - `BetaToolSearchTool`

            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).

          - `BetaApplyPatchTool`

            Allows the assistant to create, delete, or update files using unified diffs.

        - `type: "tool_search_output"`

          The type of the item. Always `tool_search_output`.

          - `"tool_search_output"`

        - `agent?: Agent`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `created_by?: string`

          The identifier of the actor that created the item.

      - `AdditionalTools`

        - `id: string`

          The unique ID of the additional tools item.

        - `role: "unknown" | "user" | "assistant" | 5 more`

          The role that provided the additional tools.

          - `"unknown"`

          - `"user"`

          - `"assistant"`

          - `"system"`

          - `"critic"`

          - `"discriminator"`

          - `"developer"`

          - `"tool"`

        - `tools: Array<BetaTool>`

          The additional tool definitions made available at this item.

          - `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).

          - `Mcp`

            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).

          - `CodeInterpreter`

            A tool that runs Python code to help generate a response to a prompt.

          - `ProgrammaticToolCalling`

          - `ImageGeneration`

            A tool that generates images using the GPT image models.

          - `LocalShell`

            A tool that allows the model to execute shell commands in a local environment.

          - `BetaFunctionShellTool`

            A tool that allows the model to execute shell commands.

          - `BetaCustomTool`

            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)

          - `BetaNamespaceTool`

            Groups function/custom tools under a shared namespace.

          - `BetaToolSearchTool`

            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).

          - `BetaApplyPatchTool`

            Allows the assistant to create, delete, or update files using unified diffs.

        - `type: "additional_tools"`

          The type of the item. Always `additional_tools`.

          - `"additional_tools"`

        - `agent?: Agent`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

      - `BetaResponseCompactionItem`

        A compaction item generated by the [`v1/responses/compact` API](https://platform.openai.com/docs/api-reference/responses/compact).

        - `id: string`

          The unique ID of the compaction item.

        - `encrypted_content: string`

          The encrypted content that was produced by compaction.

        - `type: "compaction"`

          The type of the item. Always `compaction`.

          - `"compaction"`

        - `agent?: Agent`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `created_by?: string`

          The identifier of the actor that created the item.

      - `ImageGenerationCall`

        An image generation request made by the model.

        - `id: string`

          The unique ID of the image generation call.

        - `result: string | null`

          The generated image encoded in base64.

        - `status: "in_progress" | "completed" | "generating" | "failed"`

          The status of the image generation call.

          - `"in_progress"`

          - `"completed"`

          - `"generating"`

          - `"failed"`

        - `type: "image_generation_call"`

          The type of the image generation call. Always `image_generation_call`.

          - `"image_generation_call"`

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

      - `BetaResponseCodeInterpreterToolCall`

        A tool call to run code.

      - `LocalShellCall`

        A tool call to run a command on the local shell.

        - `id: string`

          The unique ID of the local shell call.

        - `action: Action`

          Execute a shell command on the server.

          - `command: Array<string>`

            The command to run.

          - `env: Record<string, string>`

            Environment variables to set for the command.

          - `type: "exec"`

            The type of the local shell action. Always `exec`.

            - `"exec"`

          - `timeout_ms?: number | null`

            Optional timeout in milliseconds for the command.

          - `user?: string | null`

            Optional user to run the command as.

          - `working_directory?: string | null`

            Optional working directory to run the command in.

        - `call_id: string`

          The unique ID of the local shell tool call generated by the model.

        - `status: "in_progress" | "completed" | "incomplete"`

          The status of the local shell call.

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

        - `type: "local_shell_call"`

          The type of the local shell call. Always `local_shell_call`.

          - `"local_shell_call"`

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

      - `LocalShellCallOutput`

        The output of a local shell tool call.

        - `id: string`

          The unique ID of the local shell tool call generated by the model.

        - `output: string`

          A JSON string of the output of the local shell tool call.

        - `type: "local_shell_call_output"`

          The type of the local shell tool call output. Always `local_shell_call_output`.

          - `"local_shell_call_output"`

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `status?: "in_progress" | "completed" | "incomplete" | null`

          The status of the item. One of `in_progress`, `completed`, or `incomplete`.

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

      - `BetaResponseFunctionShellToolCall`

        A tool call that executes one or more shell commands in a managed environment.

        - `id: string`

          The unique ID of the shell tool call. Populated when this item is returned via API.

        - `action: Action`

          The shell commands and limits that describe how to run the tool call.

          - `commands: Array<string>`

          - `max_output_length: number | null`

            Optional maximum number of characters to return from each command.

          - `timeout_ms: number | null`

            Optional timeout in milliseconds for the commands.

        - `call_id: string`

          The unique ID of the shell tool call generated by the model.

        - `environment: BetaResponseLocalEnvironment | BetaResponseContainerReference | null`

          Represents the use of a local environment to perform shell actions.

          - `BetaResponseLocalEnvironment`

            Represents the use of a local environment to perform shell actions.

            - `type: "local"`

              The environment type. Always `local`.

              - `"local"`

          - `BetaResponseContainerReference`

            Represents a container created with /v1/containers.

            - `container_id: string`

            - `type: "container_reference"`

              The environment type. Always `container_reference`.

              - `"container_reference"`

        - `status: "in_progress" | "completed" | "incomplete"`

          The status of the shell call. One of `in_progress`, `completed`, or `incomplete`.

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

        - `type: "shell_call"`

          The type of the item. Always `shell_call`.

          - `"shell_call"`

        - `agent?: Agent`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `caller?: Direct | Program | null`

          The execution context that produced this tool call.

          - `Direct`

            - `type: "direct"`

              - `"direct"`

          - `Program`

            - `caller_id: string`

              The call ID of the program item that produced this tool call.

            - `type: "program"`

              - `"program"`

        - `created_by?: string`

          The ID of the entity that created this tool call.

      - `BetaResponseFunctionShellToolCallOutput`

        The output of a shell tool call that was emitted.

        - `id: string`

          The unique ID of the shell call output. Populated when this item is returned via API.

        - `call_id: string`

          The unique ID of the shell tool call generated by the model.

        - `max_output_length: number | null`

          The maximum length of the shell command output. This is generated by the model and should be passed back with the raw output.

        - `output: Array<Output>`

          An array of shell call output contents

          - `outcome: Timeout | Exit`

            Represents either an exit outcome (with an exit code) or a timeout outcome for a shell call output chunk.

            - `Timeout`

              Indicates that the shell call exceeded its configured time limit.

              - `type: "timeout"`

                The outcome type. Always `timeout`.

                - `"timeout"`

            - `Exit`

              Indicates that the shell commands finished and returned an exit code.

              - `exit_code: number`

                Exit code from the shell process.

              - `type: "exit"`

                The outcome type. Always `exit`.

                - `"exit"`

          - `stderr: string`

            The standard error output that was captured.

          - `stdout: string`

            The standard output that was captured.

          - `created_by?: string`

            The identifier of the actor that created the item.

        - `status: "in_progress" | "completed" | "incomplete"`

          The status of the shell call output. One of `in_progress`, `completed`, or `incomplete`.

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

        - `type: "shell_call_output"`

          The type of the shell call output. Always `shell_call_output`.

          - `"shell_call_output"`

        - `agent?: Agent`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `caller?: Direct | Program | null`

          The execution context that produced this tool call.

          - `Direct`

            - `type: "direct"`

              - `"direct"`

          - `Program`

            - `caller_id: string`

              The call ID of the program item that produced this tool call.

            - `type: "program"`

              - `"program"`

        - `created_by?: string`

          The identifier of the actor that created the item.

      - `BetaResponseApplyPatchToolCall`

        A tool call that applies file diffs by creating, deleting, or updating files.

        - `id: string`

          The unique ID of the apply patch tool call. Populated when this item is returned via API.

        - `call_id: string`

          The unique ID of the apply patch tool call generated by the model.

        - `operation: CreateFile | DeleteFile | UpdateFile`

          One of the create_file, delete_file, or update_file operations applied via apply_patch.

          - `CreateFile`

            Instruction describing how to create a file via the apply_patch tool.

            - `diff: string`

              Diff to apply.

            - `path: string`

              Path of the file to create.

            - `type: "create_file"`

              Create a new file with the provided diff.

              - `"create_file"`

          - `DeleteFile`

            Instruction describing how to delete a file via the apply_patch tool.

            - `path: string`

              Path of the file to delete.

            - `type: "delete_file"`

              Delete the specified file.

              - `"delete_file"`

          - `UpdateFile`

            Instruction describing how to update a file via the apply_patch tool.

            - `diff: string`

              Diff to apply.

            - `path: string`

              Path of the file to update.

            - `type: "update_file"`

              Update an existing file with the provided diff.

              - `"update_file"`

        - `status: "in_progress" | "completed"`

          The status of the apply patch tool call. One of `in_progress` or `completed`.

          - `"in_progress"`

          - `"completed"`

        - `type: "apply_patch_call"`

          The type of the item. Always `apply_patch_call`.

          - `"apply_patch_call"`

        - `agent?: Agent`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `caller?: Direct | Program | null`

          The execution context that produced this tool call.

          - `Direct`

            - `type: "direct"`

              - `"direct"`

          - `Program`

            - `caller_id: string`

              The call ID of the program item that produced this tool call.

            - `type: "program"`

              - `"program"`

        - `created_by?: string`

          The ID of the entity that created this tool call.

      - `BetaResponseApplyPatchToolCallOutput`

        The output emitted by an apply patch tool call.

        - `id: string`

          The unique ID of the apply patch tool call output. Populated when this item is returned via API.

        - `call_id: string`

          The unique ID of the apply patch tool call generated by the model.

        - `status: "completed" | "failed"`

          The status of the apply patch tool call output. One of `completed` or `failed`.

          - `"completed"`

          - `"failed"`

        - `type: "apply_patch_call_output"`

          The type of the item. Always `apply_patch_call_output`.

          - `"apply_patch_call_output"`

        - `agent?: Agent`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `caller?: Direct | Program | null`

          The execution context that produced this tool call.

          - `Direct`

            - `type: "direct"`

              - `"direct"`

          - `Program`

            - `caller_id: string`

              The call ID of the program item that produced this tool call.

            - `type: "program"`

              - `"program"`

        - `created_by?: string`

          The ID of the entity that created this tool call output.

        - `output?: string | null`

          Optional textual output returned by the apply patch tool.

      - `McpCall`

        An invocation of a tool on an MCP server.

        - `id: string`

          The unique ID of the tool call.

        - `arguments: string`

          A JSON string of the arguments passed to the tool.

        - `name: string`

          The name of the tool that was run.

        - `server_label: string`

          The label of the MCP server running the tool.

        - `type: "mcp_call"`

          The type of the item. Always `mcp_call`.

          - `"mcp_call"`

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `approval_request_id?: string | null`

          Unique identifier for the MCP tool call approval request.
          Include this value in a subsequent `mcp_approval_response` input to approve or reject the corresponding tool call.

        - `error?: BetaMcpToolCallError | null`

          The error from the tool call, if any.

        - `output?: string | null`

          The output from the tool call.

        - `status?: "in_progress" | "completed" | "incomplete" | 2 more`

          The status of the tool call. One of `in_progress`, `completed`, `incomplete`, `calling`, or `failed`.

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

          - `"calling"`

          - `"failed"`

      - `McpListTools`

        A list of tools available on an MCP server.

        - `id: string`

          The unique ID of the list.

        - `server_label: string`

          The label of the MCP server.

        - `tools: Array<Tool>`

          The tools available on the server.

          - `input_schema: unknown`

            The JSON schema describing the tool's input.

          - `name: string`

            The name of the tool.

          - `annotations?: unknown`

            Additional annotations about the tool.

          - `description?: string | null`

            The description of the tool.

        - `type: "mcp_list_tools"`

          The type of the item. Always `mcp_list_tools`.

          - `"mcp_list_tools"`

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `error?: string | null`

          Error message if the server could not list tools.

      - `McpApprovalRequest`

        A request for human approval of a tool invocation.

        - `id: string`

          The unique ID of the approval request.

        - `arguments: string`

          A JSON string of arguments for the tool.

        - `name: string`

          The name of the tool to run.

        - `server_label: string`

          The label of the MCP server making the request.

        - `type: "mcp_approval_request"`

          The type of the item. Always `mcp_approval_request`.

          - `"mcp_approval_request"`

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

      - `McpApprovalResponse`

        A response to an MCP approval request.

        - `id: string`

          The unique ID of the approval response

        - `approval_request_id: string`

          The ID of the approval request being answered.

        - `approve: boolean`

          Whether the request was approved.

        - `type: "mcp_approval_response"`

          The type of the item. Always `mcp_approval_response`.

          - `"mcp_approval_response"`

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `reason?: string | null`

          Optional reason for the decision.

      - `BetaResponseCustomToolCall`

        A call to a custom tool created by the model.

      - `BetaResponseCustomToolCallOutputItem extends BetaResponseCustomToolCallOutput`

        The output of a custom tool call from your code, being sent back to the model.

        - `id: string`

          The unique ID of the custom tool call output item.

        - `status: "in_progress" | "completed" | "incomplete"`

          The status of the item. One of `in_progress`, `completed`, or
          `incomplete`. Populated when items are returned via API.

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

        - `created_by?: string`

          The identifier of the actor that created the item.

    - `parallel_tool_calls: boolean`

      Whether to allow the model to run tool calls in parallel.

    - `temperature: number | null`

      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.

    - `tool_choice: BetaToolChoiceOptions | BetaToolChoiceAllowed | BetaToolChoiceTypes | 6 more`

      How the model should select which tool (or tools) to use when generating
      a response. See the `tools` parameter to see how to specify which tools
      the model can call.

      - `BetaToolChoiceOptions = "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.

        - `"none"`

        - `"auto"`

        - `"required"`

      - `BetaToolChoiceAllowed`

        Constrains the tools available to the model to a pre-defined set.

        - `mode: "auto" | "required"`

          Constrains the tools available to the model to a pre-defined set.

          `auto` allows the model to pick from among the allowed tools and generate a
          message.

          `required` requires the model to call one or more of the allowed tools.

          - `"auto"`

          - `"required"`

        - `tools: Array<Record<string, unknown>>`

          A list of tool definitions that the model should be allowed to call.

          For the Responses API, the list of tool definitions might look like:

          ```json
          [
            { "type": "function", "name": "get_weather" },
            { "type": "mcp", "server_label": "deepwiki" },
            { "type": "image_generation" }
          ]
          ```

        - `type: "allowed_tools"`

          Allowed tool configuration type. Always `allowed_tools`.

          - `"allowed_tools"`

      - `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" | 5 more`

          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`

          - `"file_search"`

          - `"web_search_preview"`

          - `"computer"`

          - `"computer_use_preview"`

          - `"computer_use"`

          - `"web_search_preview_2025_03_11"`

          - `"image_generation"`

          - `"code_interpreter"`

      - `BetaToolChoiceFunction`

        Use this option to force the model to call a specific function.

        - `name: string`

          The name of the function to call.

        - `type: "function"`

          For function calling, the type is always `function`.

          - `"function"`

      - `BetaToolChoiceMcp`

        Use this option to force the model to call a specific tool on a remote MCP server.

        - `server_label: string`

          The label of the MCP server to use.

        - `type: "mcp"`

          For MCP tools, the type is always `mcp`.

          - `"mcp"`

        - `name?: string | null`

          The name of the tool to call on the server.

      - `BetaToolChoiceCustom`

        Use this option to force the model to call a specific custom tool.

        - `name: string`

          The name of the custom tool to call.

        - `type: "custom"`

          For custom tool calling, the type is always `custom`.

          - `"custom"`

      - `BetaSpecificProgrammaticToolCallingParam`

        - `type: "programmatic_tool_calling"`

          The tool to call. Always `programmatic_tool_calling`.

          - `"programmatic_tool_calling"`

      - `BetaToolChoiceApplyPatch`

        Forces the model to call the apply_patch tool when executing a tool call.

        - `type: "apply_patch"`

          The tool to call. Always `apply_patch`.

          - `"apply_patch"`

      - `BetaToolChoiceShell`

        Forces the model to call the shell tool when a tool call is required.

        - `type: "shell"`

          The tool to call. Always `shell`.

          - `"shell"`

    - `tools: Array<BetaTool>`

      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.

      - `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).

      - `Mcp`

        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).

      - `CodeInterpreter`

        A tool that runs Python code to help generate a response to a prompt.

      - `ProgrammaticToolCalling`

      - `ImageGeneration`

        A tool that generates images using the GPT image models.

      - `LocalShell`

        A tool that allows the model to execute shell commands in a local environment.

      - `BetaFunctionShellTool`

        A tool that allows the model to execute shell commands.

      - `BetaCustomTool`

        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)

      - `BetaNamespaceTool`

        Groups function/custom tools under a shared namespace.

      - `BetaToolSearchTool`

        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).

      - `BetaApplyPatchTool`

        Allows the assistant to create, delete, or update files using unified diffs.

    - `top_p: number | null`

      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.

    - `background?: boolean | null`

      Whether to run the model response in the background.
      [Learn more](https://platform.openai.com/docs/guides/background).

    - `completed_at?: number | null`

      Unix timestamp (in seconds) of when this Response was completed.
      Only present when the status is `completed`.

    - `conversation?: Conversation | null`

      The conversation that this response belonged to. Input items and output items from this response were automatically added to this conversation.

      - `id: string`

        The unique ID of the conversation that this response was associated with.

    - `max_output_tokens?: number | null`

      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).

    - `max_tool_calls?: number | null`

      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.

    - `moderation?: Moderation | null`

      Moderation results for the response input and output, if moderated completions were requested.

      - `input: ModerationResult | Error`

        Moderation for the response input.

        - `ModerationResult`

          A moderation result produced for the response input or output.

          - `categories: Record<string, boolean>`

            A dictionary of moderation categories to booleans, True if the input is flagged under this category.

          - `category_applied_input_types: Record<string, Array<"text" | "image">>`

            Which modalities of input are reflected by the score for each category.

            - `"text"`

            - `"image"`

          - `category_scores: Record<string, number>`

            A dictionary of moderation categories to scores.

          - `flagged: boolean`

            A boolean indicating whether the content was flagged by any category.

          - `model: string`

            The moderation model that produced this result.

          - `type: "moderation_result"`

            The object type, which was always `moderation_result` for successful moderation results.

            - `"moderation_result"`

        - `Error`

          An error produced while attempting moderation for the response input or output.

          - `code: string`

            The error code.

          - `message: string`

            The error message.

          - `type: "error"`

            The object type, which was always `error` for moderation failures.

            - `"error"`

      - `output: ModerationResult | Error`

        Moderation for the response output.

        - `ModerationResult`

          A moderation result produced for the response input or output.

          - `categories: Record<string, boolean>`

            A dictionary of moderation categories to booleans, True if the input is flagged under this category.

          - `category_applied_input_types: Record<string, Array<"text" | "image">>`

            Which modalities of input are reflected by the score for each category.

            - `"text"`

            - `"image"`

          - `category_scores: Record<string, number>`

            A dictionary of moderation categories to scores.

          - `flagged: boolean`

            A boolean indicating whether the content was flagged by any category.

          - `model: string`

            The moderation model that produced this result.

          - `type: "moderation_result"`

            The object type, which was always `moderation_result` for successful moderation results.

            - `"moderation_result"`

        - `Error`

          An error produced while attempting moderation for the response input or output.

          - `code: string`

            The error code.

          - `message: string`

            The error message.

          - `type: "error"`

            The object type, which was always `error` for moderation failures.

            - `"error"`

    - `previous_response_id?: string | null`

      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`.

    - `prompt?: BetaResponsePrompt | null`

      Reference to a prompt template and its variables.
      [Learn more](https://platform.openai.com/docs/guides/text?api-mode=responses#reusable-prompts).

      - `id: string`

        The unique identifier of the prompt template to use.

      - `variables?: Record<string, string | BetaResponseInputText | BetaResponseInputImage | BetaResponseInputFile> | null`

        Optional map of values to substitute in for variables in your
        prompt. The substitution values can either be strings, or other
        Response input types like images or files.

        - `string`

        - `BetaResponseInputText`

          A text input to the model.

        - `BetaResponseInputImage`

          An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision).

        - `BetaResponseInputFile`

          A file input to the model.

      - `version?: string | null`

        Optional version of the prompt template.

    - `prompt_cache_key?: string | null`

      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).

    - `prompt_cache_options?: PromptCacheOptions`

      The prompt-caching options that were applied to the response. Supported for `gpt-5.6` and later models.

      - `mode: "implicit" | "explicit"`

        Whether implicit prompt-cache breakpoints were enabled.

        - `"implicit"`

        - `"explicit"`

      - `ttl: "30m"`

        The minimum lifetime applied to each cache breakpoint.

        - `"30m"`

    - `prompt_cache_retention?: "in_memory" | "24h" | null`

      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.

      - `"in_memory"`

      - `"24h"`

    - `reasoning?: Reasoning | null`

      **gpt-5 and o-series models only**

      Configuration options for
      [reasoning models](https://platform.openai.com/docs/guides/reasoning).

      - `context?: "auto" | "current_turn" | "all_turns" | null`

        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.

        - `"auto"`

        - `"current_turn"`

        - `"all_turns"`

      - `effort?: "none" | "minimal" | "low" | 4 more | null`

        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.

        - `"none"`

        - `"minimal"`

        - `"low"`

        - `"medium"`

        - `"high"`

        - `"xhigh"`

        - `"max"`

      - `generate_summary?: "auto" | "concise" | "detailed" | null`

        **Deprecated:** use `summary` instead.

        A summary of the reasoning performed by the model. This can be
        useful for debugging and understanding the model's reasoning process.
        One of `auto`, `concise`, or `detailed`.

        - `"auto"`

        - `"concise"`

        - `"detailed"`

      - `mode?: (string & {}) | "standard" | "pro"`

        Controls the reasoning execution mode for the request.

        When returned on a response, this is the effective execution mode.

        - `(string & {})`

        - `"standard" | "pro"`

          - `"standard"`

          - `"pro"`

      - `summary?: "auto" | "concise" | "detailed" | null`

        A summary of the reasoning performed by the model. This can be
        useful for debugging and understanding the model's reasoning process.
        One of `auto`, `concise`, or `detailed`.

        `concise` is supported for `computer-use-preview` models and all reasoning models after `gpt-5`.

        - `"auto"`

        - `"concise"`

        - `"detailed"`

    - `safety_identifier?: string | null`

      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).

    - `service_tier?: BetaServiceTier | null`

      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.
      - If set to 'ultrafast', then the request will be processed with the access-controlled Ultrafast Processing service tier. This tier is currently available for `gpt-5.6-sol`; a response served through it will show `service_tier=ultrafast`.
      - When not set, the default behavior is 'auto'.

      When the `service_tier` parameter is set, the response body will include the `service_tier` value based on the processing mode actually used to serve the request. This response value may be different from the value set in the parameter.

      - `"auto"`

      - `"default"`

      - `"flex"`

      - `"scale"`

      - `"priority"`

      - `"fast"`

      - `"ultrafast"`

    - `status?: BetaResponseStatus`

      The status of the response generation. One of `completed`, `failed`,
      `in_progress`, `cancelled`, `queued`, or `incomplete`.

      - `"completed"`

      - `"failed"`

      - `"in_progress"`

      - `"cancelled"`

      - `"queued"`

      - `"incomplete"`

    - `text?: BetaResponseTextConfig`

      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?: BetaResponseFormatTextConfig`

        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.

        - `Text`

          Default response format. Used to generate text responses.

          - `type: "text"`

            The type of response format being defined. Always `text`.

            - `"text"`

        - `BetaResponseFormatTextJSONSchemaConfig`

          JSON Schema response format. Used to generate structured JSON responses.
          Learn more about [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs).

          - `name: string`

            The name of the response format. Must be a-z, A-Z, 0-9, or contain
            underscores and dashes, with a maximum length of 64.

          - `schema: Record<string, unknown>`

            The schema for the response format, described as a JSON Schema object.
            Learn how to build JSON schemas [here](https://json-schema.org/).

          - `type: "json_schema"`

            The type of response format being defined. Always `json_schema`.

            - `"json_schema"`

          - `description?: string`

            A description of what the response format is for, used by the model to
            determine how to respond in the format.

          - `strict?: boolean | null`

            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).

        - `JSONObject`

          JSON object response format. An older method of generating JSON responses.
          Using `json_schema` is recommended for models that support it. Note that the
          model will not generate JSON without a system or user message instructing it
          to do so.

          - `type: "json_object"`

            The type of response format being defined. Always `json_object`.

            - `"json_object"`

      - `verbosity?: "low" | "medium" | "high" | null`

        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`.

        - `"low"`

        - `"medium"`

        - `"high"`

    - `top_logprobs?: number | null`

      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.

    - `truncation?: "auto" | "disabled" | null`

      The truncation strategy to use for the model response.

      - `auto`: If the input to this Response exceeds
        the model's context window size, the model will truncate the
        response to fit the context window by dropping items from the beginning of the conversation.
      - `disabled` (default): If the input size will exceed the context window
        size for a model, the request will fail with a 400 error.

      - `"auto"`

      - `"disabled"`

    - `usage?: BetaResponseUsage`

      Represents token usage details including input tokens, output tokens,
      a breakdown of output tokens, and the total tokens used.

      - `input_tokens: number`

        The number of input tokens.

      - `input_tokens_details: InputTokensDetails`

        A detailed breakdown of the input tokens.

        - `cache_write_tokens: number`

          The number of input tokens that were written to the cache.

        - `cached_tokens: number`

          The number of tokens that were retrieved from the cache.
          [More on prompt caching](https://platform.openai.com/docs/guides/prompt-caching).

      - `output_tokens: number`

        The number of output tokens.

      - `output_tokens_details: OutputTokensDetails`

        A detailed breakdown of the output tokens.

        - `reasoning_tokens: number`

          The number of reasoning tokens.

      - `total_tokens: number`

        The total number of tokens used.

    - `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).

  - `sequence_number: number`

    The sequence number of this event.

  - `type: "response.incomplete"`

    The type of the event. Always `response.incomplete`.

    - `"response.incomplete"`

  - `agent?: Agent | null`

    The agent that owns this multi-agent streaming event.

    - `agent_name: string`

      The canonical name of the agent that produced this item.

### Beta Response Inject Created Event

- `BetaResponseInjectCreatedEvent`

  Emitted when all injected input items were validated and committed to the
  active response.

  - `response_id: string`

    The ID of the response that accepted the input.

  - `sequence_number: number`

    The sequence number for this event.

  - `type: "response.inject.created"`

    The event discriminator. Always `response.inject.created`.

    - `"response.inject.created"`

  - `stream_id?: string`

    The multiplexed WebSocket stream that emitted the event. This field is
    present only when WebSocket multiplexing is enabled separately.

### Beta Response Inject Event

- `BetaResponseInjectEvent`

  Injects input items into an active response over a WebSocket connection.
  The items are validated and committed atomically. Currently, the server
  accepts client-owned tool outputs that resume a waiting agent.

  - `input: Array<BetaResponseInputItem>`

    Input items to inject into the active response.

    - `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.

      - `content: string | BetaResponseInputMessageContentList`

        Text, image, or audio input to the model, used to generate a response.
        Can also contain previous assistant responses.

        - `string`

        - `BetaResponseInputMessageContentList = Array<BetaResponseInputContent>`

          A list of one or many input items to the model, containing different content
          types.

          - `BetaResponseInputText`

            A text input to the model.

            - `text: string`

              The text input to the model.

            - `type: "input_text"`

              The type of the input item. Always `input_text`.

              - `"input_text"`

            - `prompt_cache_breakpoint?: PromptCacheBreakpoint`

              Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.

              - `mode: "explicit"`

                The breakpoint mode. Always `explicit`.

                - `"explicit"`

          - `BetaResponseInputImage`

            An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision).

            - `detail: BetaImageDetail`

              The detail level of the image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`.

              - `"low"`

              - `"high"`

              - `"auto"`

              - `"original"`

            - `type: "input_image"`

              The type of the input item. Always `input_image`.

              - `"input_image"`

            - `file_id?: string | null`

              The ID of the file to be sent to the model.

            - `image_url?: string | null`

              The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.

            - `prompt_cache_breakpoint?: PromptCacheBreakpoint`

              Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.

              - `mode: "explicit"`

                The breakpoint mode. Always `explicit`.

                - `"explicit"`

          - `BetaResponseInputFile`

            A file input to the model.

            - `type: "input_file"`

              The type of the input item. Always `input_file`.

              - `"input_file"`

            - `detail?: "auto" | "low" | "high"`

              The detail level of the file to be sent to the model. Use `auto` to let the system select the detail level; for GPT-5.6 and later models, `auto` uses high-quality rendering, which may increase input token usage. Use `low` for lower-cost rendering, or `high` to render the file at higher quality. Defaults to `auto`.

              - `"auto"`

              - `"low"`

              - `"high"`

            - `file_data?: string`

              The content of the file to be sent to the model.

            - `file_id?: string | null`

              The ID of the file to be sent to the model.

            - `file_url?: string`

              The URL of the file to be sent to the model.

            - `filename?: string`

              The name of the file to be sent to the model.

            - `prompt_cache_breakpoint?: PromptCacheBreakpoint`

              Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.

              - `mode: "explicit"`

                The breakpoint mode. Always `explicit`.

                - `"explicit"`

      - `role: "user" | "assistant" | "system" | "developer"`

        The role of the message input. One of `user`, `assistant`, `system`, or
        `developer`.

        - `"user"`

        - `"assistant"`

        - `"system"`

        - `"developer"`

      - `phase?: "commentary" | "final_answer" | null`

        Labels an `assistant` message as intermediate commentary (`commentary`) or the final answer (`final_answer`).
        For models like `gpt-5.3-codex` and beyond, when sending follow-up requests, preserve and resend
        phase on all assistant messages — dropping it can degrade performance. Not used for user messages.

        - `"commentary"`

        - `"final_answer"`

      - `type?: "message"`

        The type of the message input. Always `message`.

        - `"message"`

    - `Message`

      A message input to the model with a role indicating instruction following
      hierarchy. Instructions given with the `developer` or `system` role take
      precedence over instructions given with the `user` role.

      - `content: BetaResponseInputMessageContentList`

        A list of one or many input items to the model, containing different content
        types.

      - `role: "user" | "system" | "developer"`

        The role of the message input. One of `user`, `system`, or `developer`.

        - `"user"`

        - `"system"`

        - `"developer"`

      - `agent?: Agent | null`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

      - `status?: "in_progress" | "completed" | "incomplete"`

        The status of item. One of `in_progress`, `completed`, or
        `incomplete`. Populated when items are returned via API.

        - `"in_progress"`

        - `"completed"`

        - `"incomplete"`

      - `type?: "message"`

        The type of the message input. Always set to `message`.

        - `"message"`

    - `BetaResponseOutputMessage`

      An output message from the model.

      - `id: string`

        The unique ID of the output message.

      - `content: Array<BetaResponseOutputText | BetaResponseOutputRefusal>`

        The content of the output message.

        - `BetaResponseOutputText`

          A text output from the model.

          - `annotations: Array<FileCitation | URLCitation | ContainerFileCitation | FilePath>`

            The annotations of the text output.

            - `FileCitation`

              A citation to a file.

              - `file_id: string`

                The ID of the file.

              - `filename: string`

                The filename of the file cited.

              - `index: number`

                The index of the file in the list of files.

              - `type: "file_citation"`

                The type of the file citation. Always `file_citation`.

                - `"file_citation"`

            - `URLCitation`

              A citation for a web resource used to generate a model response.

              - `end_index: number`

                The index of the last character of the URL citation in the message.

              - `start_index: number`

                The index of the first character of the URL citation in the message.

              - `title: string`

                The title of the web resource.

              - `type: "url_citation"`

                The type of the URL citation. Always `url_citation`.

                - `"url_citation"`

              - `url: string`

                The URL of the web resource.

            - `ContainerFileCitation`

              A citation for a container file used to generate a model response.

              - `container_id: string`

                The ID of the container file.

              - `end_index: number`

                The index of the last character of the container file citation in the message.

              - `file_id: string`

                The ID of the file.

              - `filename: string`

                The filename of the container file cited.

              - `start_index: number`

                The index of the first character of the container file citation in the message.

              - `type: "container_file_citation"`

                The type of the container file citation. Always `container_file_citation`.

                - `"container_file_citation"`

            - `FilePath`

              A path to a file.

              - `file_id: string`

                The ID of the file.

              - `index: number`

                The index of the file in the list of files.

              - `type: "file_path"`

                The type of the file path. Always `file_path`.

                - `"file_path"`

          - `text: string`

            The text output from the model.

          - `type: "output_text"`

            The type of the output text. Always `output_text`.

            - `"output_text"`

          - `logprobs?: Array<Logprob>`

            - `token: string`

            - `bytes: Array<number>`

            - `logprob: number`

            - `top_logprobs: Array<TopLogprob>`

              - `token: string`

              - `bytes: Array<number>`

              - `logprob: number`

        - `BetaResponseOutputRefusal`

          A refusal from the model.

          - `refusal: string`

            The refusal explanation from the model.

          - `type: "refusal"`

            The type of the refusal. Always `refusal`.

            - `"refusal"`

      - `role: "assistant"`

        The role of the output message. Always `assistant`.

        - `"assistant"`

      - `status: "in_progress" | "completed" | "incomplete"`

        The status of the message input. One of `in_progress`, `completed`, or
        `incomplete`. Populated when input items are returned via API.

        - `"in_progress"`

        - `"completed"`

        - `"incomplete"`

      - `type: "message"`

        The type of the output message. Always `message`.

        - `"message"`

      - `agent?: Agent | null`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

      - `phase?: "commentary" | "final_answer" | null`

        Labels an `assistant` message as intermediate commentary (`commentary`) or the final answer (`final_answer`).
        For models like `gpt-5.3-codex` and beyond, when sending follow-up requests, preserve and resend
        phase on all assistant messages — dropping it can degrade performance. Not used for user messages.

        - `"commentary"`

        - `"final_answer"`

    - `BetaResponseFileSearchToolCall`

      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.

      - `id: string`

        The unique ID of the file search tool call.

      - `queries: Array<string>`

        The queries used to search for files.

      - `status: "in_progress" | "searching" | "completed" | 2 more`

        The status of the file search tool call. One of `in_progress`,
        `searching`, `incomplete` or `failed`,

        - `"in_progress"`

        - `"searching"`

        - `"completed"`

        - `"incomplete"`

        - `"failed"`

      - `type: "file_search_call"`

        The type of the file search tool call. Always `file_search_call`.

        - `"file_search_call"`

      - `agent?: Agent | null`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

      - `results?: Array<Result> | null`

        The results of the file search tool call.

        - `attributes?: Record<string, string | number | boolean> | null`

          Set of 16 key-value pairs that can be attached to an object. This can be
          useful for storing additional information about the object in a structured
          format, and querying for objects via API or the dashboard. Keys are strings
          with a maximum length of 64 characters. Values are strings with a maximum
          length of 512 characters, booleans, or numbers.

          - `string`

          - `number`

          - `boolean`

        - `file_id?: string`

          The unique ID of the file.

        - `filename?: string`

          The name of the file.

        - `score?: number`

          The relevance score of the file - a value between 0 and 1.

        - `text?: string`

          The text that was retrieved from the file.

    - `BetaResponseComputerToolCall`

      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.

      - `id: string`

        The unique ID of the computer call.

      - `call_id: string`

        An identifier used when responding to the tool call with output.

      - `pending_safety_checks: Array<PendingSafetyCheck>`

        The pending safety checks for the computer call.

        - `id: string`

          The ID of the pending safety check.

        - `code?: string | null`

          The type of the pending safety check.

        - `message?: string | null`

          Details about the pending safety check.

      - `status: "in_progress" | "completed" | "incomplete"`

        The status of the item. One of `in_progress`, `completed`, or
        `incomplete`. Populated when items are returned via API.

        - `"in_progress"`

        - `"completed"`

        - `"incomplete"`

      - `type: "computer_call"`

        The type of the computer call. Always `computer_call`.

        - `"computer_call"`

      - `action?: BetaComputerAction`

        A click action.

        - `Click`

          A click action.

          - `button: "left" | "right" | "wheel" | 2 more`

            Indicates which mouse button was pressed during the click. One of `left`, `right`, `wheel`, `back`, or `forward`.

            - `"left"`

            - `"right"`

            - `"wheel"`

            - `"back"`

            - `"forward"`

          - `type: "click"`

            Specifies the event type. For a click action, this property is always `click`.

            - `"click"`

          - `x: number`

            The x-coordinate where the click occurred.

          - `y: number`

            The y-coordinate where the click occurred.

          - `keys?: Array<string> | null`

            The keys being held while clicking.

        - `DoubleClick`

          A double click action.

          - `keys: Array<string> | null`

            The keys being held while double-clicking.

          - `type: "double_click"`

            Specifies the event type. For a double click action, this property is always set to `double_click`.

            - `"double_click"`

          - `x: number`

            The x-coordinate where the double click occurred.

          - `y: number`

            The y-coordinate where the double click occurred.

        - `Drag`

          A drag action.

          - `path: Array<Path>`

            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 }
            ]
            ```

            - `x: number`

              The x-coordinate.

            - `y: number`

              The y-coordinate.

          - `type: "drag"`

            Specifies the event type. For a drag action, this property is always set to `drag`.

            - `"drag"`

          - `keys?: Array<string> | null`

            The keys being held while dragging the mouse.

        - `Keypress`

          A collection of keypresses the model would like to perform.

          - `keys: Array<string>`

            The combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key.

          - `type: "keypress"`

            Specifies the event type. For a keypress action, this property is always set to `keypress`.

            - `"keypress"`

        - `Move`

          A mouse move action.

          - `type: "move"`

            Specifies the event type. For a move action, this property is always set to `move`.

            - `"move"`

          - `x: number`

            The x-coordinate to move to.

          - `y: number`

            The y-coordinate to move to.

          - `keys?: Array<string> | null`

            The keys being held while moving the mouse.

        - `Screenshot`

          A screenshot action.

          - `type: "screenshot"`

            Specifies the event type. For a screenshot action, this property is always set to `screenshot`.

            - `"screenshot"`

        - `Scroll`

          A scroll action.

          - `scroll_x: number`

            The horizontal scroll distance.

          - `scroll_y: number`

            The vertical scroll distance.

          - `type: "scroll"`

            Specifies the event type. For a scroll action, this property is always set to `scroll`.

            - `"scroll"`

          - `x: number`

            The x-coordinate where the scroll occurred.

          - `y: number`

            The y-coordinate where the scroll occurred.

          - `keys?: Array<string> | null`

            The keys being held while scrolling.

        - `Type`

          An action to type in text.

          - `text: string`

            The text to type.

          - `type: "type"`

            Specifies the event type. For a type action, this property is always set to `type`.

            - `"type"`

        - `Wait`

          A wait action.

          - `type: "wait"`

            Specifies the event type. For a wait action, this property is always set to `wait`.

            - `"wait"`

      - `actions?: BetaComputerActionList`

        Flattened batched actions for `computer_use`. Each action includes an
        `type` discriminator and action-specific fields.

        - `Click`

          A click action.

        - `DoubleClick`

          A double click action.

        - `Drag`

          A drag action.

        - `Keypress`

          A collection of keypresses the model would like to perform.

        - `Move`

          A mouse move action.

        - `Screenshot`

          A screenshot action.

        - `Scroll`

          A scroll action.

        - `Type`

          An action to type in text.

        - `Wait`

          A wait action.

      - `agent?: Agent | null`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

    - `ComputerCallOutput`

      The output of a computer tool call.

      - `call_id: string`

        The ID of the computer tool call that produced the output.

      - `output: BetaResponseComputerToolCallOutputScreenshot`

        A computer screenshot image used with the computer use tool.

        - `type: "computer_screenshot"`

          Specifies the event type. For a computer screenshot, this property is
          always set to `computer_screenshot`.

          - `"computer_screenshot"`

        - `file_id?: string`

          The identifier of an uploaded file that contains the screenshot.

        - `image_url?: string`

          The URL of the screenshot image.

      - `type: "computer_call_output"`

        The type of the computer tool call output. Always `computer_call_output`.

        - `"computer_call_output"`

      - `id?: string | null`

        The ID of the computer tool call output.

      - `acknowledged_safety_checks?: Array<AcknowledgedSafetyCheck> | null`

        The safety checks reported by the API that have been acknowledged by the developer.

        - `id: string`

          The ID of the pending safety check.

        - `code?: string | null`

          The type of the pending safety check.

        - `message?: string | null`

          Details about the pending safety check.

      - `agent?: Agent | null`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

      - `status?: "in_progress" | "completed" | "incomplete" | null`

        The status of the message input. One of `in_progress`, `completed`, or `incomplete`. Populated when input items are returned via API.

        - `"in_progress"`

        - `"completed"`

        - `"incomplete"`

    - `BetaResponseFunctionWebSearch`

      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.

      - `id: string`

        The unique ID of the web search tool call.

      - `action: Search | OpenPage | FindInPage`

        An object describing the specific action taken in this web search call.
        Includes details on how the model used the web (search, open_page, find_in_page).

        - `Search`

          Action type "search" - Performs a web search query.

          - `type: "search"`

            The action type.

            - `"search"`

          - `queries?: Array<string>`

            The search queries.

          - `query?: string`

            The search query.

          - `sources?: Array<Source>`

            The sources used in the search.

            - `type: "url"`

              The type of source. Always `url`.

              - `"url"`

            - `url: string`

              The URL of the source.

        - `OpenPage`

          Action type "open_page" - Opens a specific URL from search results.

          - `type: "open_page"`

            The action type.

            - `"open_page"`

          - `url?: string | null`

            The URL opened by the model.

        - `FindInPage`

          Action type "find_in_page": Searches for a pattern within a loaded page.

          - `pattern: string`

            The pattern or text to search for within the page.

          - `type: "find_in_page"`

            The action type.

            - `"find_in_page"`

          - `url: string`

            The URL of the page searched for the pattern.

      - `status: "in_progress" | "searching" | "completed" | "failed"`

        The status of the web search tool call.

        - `"in_progress"`

        - `"searching"`

        - `"completed"`

        - `"failed"`

      - `type: "web_search_call"`

        The type of the web search tool call. Always `web_search_call`.

        - `"web_search_call"`

      - `agent?: Agent | null`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

    - `BetaResponseFunctionToolCall`

      A tool call to run a function. See the
      [function calling guide](https://platform.openai.com/docs/guides/function-calling) for more information.

      - `arguments: string`

        A JSON string of the arguments to pass to the function.

      - `call_id: string`

        The unique ID of the function tool call generated by the model.

      - `name: string`

        The name of the function to run.

      - `type: "function_call"`

        The type of the function tool call. Always `function_call`.

        - `"function_call"`

      - `id?: string`

        The unique ID of the function tool call.

      - `agent?: Agent | null`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

      - `caller?: Direct | Program | null`

        The execution context that produced this tool call.

        - `Direct`

          - `type: "direct"`

            - `"direct"`

        - `Program`

          - `caller_id: string`

            The call ID of the program item that produced this tool call.

          - `type: "program"`

            - `"program"`

      - `namespace?: string`

        The namespace of the function to run.

      - `status?: "in_progress" | "completed" | "incomplete"`

        The status of the item. One of `in_progress`, `completed`, or
        `incomplete`. Populated when items are returned via API.

        - `"in_progress"`

        - `"completed"`

        - `"incomplete"`

    - `FunctionCallOutput`

      The output of a function tool call.

      - `call_id: string`

        The unique ID of the function tool call generated by the model.

      - `output: string | BetaResponseFunctionCallOutputItemList`

        Text, image, or file output of the function tool call.

        - `string`

        - `BetaResponseFunctionCallOutputItemList = Array<BetaResponseFunctionCallOutputItem>`

          An array of content outputs (text, image, file) for the function tool call.

          - `BetaResponseInputTextContent`

            A text input to the model.

            - `text: string`

              The text input to the model.

            - `type: "input_text"`

              The type of the input item. Always `input_text`.

              - `"input_text"`

            - `prompt_cache_breakpoint?: PromptCacheBreakpoint | null`

              Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.

              - `mode: "explicit"`

                The breakpoint mode. Always `explicit`.

                - `"explicit"`

          - `BetaResponseInputImageContent`

            An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision)

            - `type: "input_image"`

              The type of the input item. Always `input_image`.

              - `"input_image"`

            - `detail?: BetaImageDetail | null`

              The detail level of the image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`.

            - `file_id?: string | null`

              The ID of the file to be sent to the model.

            - `image_url?: string | null`

              The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.

            - `prompt_cache_breakpoint?: PromptCacheBreakpoint | null`

              Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.

              - `mode: "explicit"`

                The breakpoint mode. Always `explicit`.

                - `"explicit"`

          - `BetaResponseInputFileContent`

            A file input to the model.

            - `type: "input_file"`

              The type of the input item. Always `input_file`.

              - `"input_file"`

            - `detail?: "auto" | "low" | "high"`

              The detail level of the file to be sent to the model. Use `auto` to let the system select the detail level; for GPT-5.6 and later models, `auto` uses high-quality rendering, which may increase input token usage. Use `low` for lower-cost rendering, or `high` to render the file at higher quality. Defaults to `auto`.

              - `"auto"`

              - `"low"`

              - `"high"`

            - `file_data?: string | null`

              The base64-encoded data of the file to be sent to the model.

            - `file_id?: string | null`

              The ID of the file to be sent to the model.

            - `file_url?: string | null`

              The URL of the file to be sent to the model.

            - `filename?: string | null`

              The name of the file to be sent to the model.

            - `prompt_cache_breakpoint?: PromptCacheBreakpoint | null`

              Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.

              - `mode: "explicit"`

                The breakpoint mode. Always `explicit`.

                - `"explicit"`

      - `type: "function_call_output"`

        The type of the function tool call output. Always `function_call_output`.

        - `"function_call_output"`

      - `id?: string | null`

        The unique ID of the function tool call output. Populated when this item is returned via API.

      - `agent?: Agent | null`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

      - `caller?: Direct | Program | null`

        The execution context that produced this tool call.

        - `Direct`

          - `type: "direct"`

            The caller type. Always `direct`.

            - `"direct"`

        - `Program`

          - `caller_id: string`

            The call ID of the program item that produced this tool call.

          - `type: "program"`

            The caller type. Always `program`.

            - `"program"`

      - `name?: string | null`

        The name of the tool that produced the output.

      - `namespace?: string | null`

        The namespace of the tool that produced the output.

      - `status?: "in_progress" | "completed" | "incomplete" | null`

        The status of the item. One of `in_progress`, `completed`, or `incomplete`. Populated when items are returned via API.

        - `"in_progress"`

        - `"completed"`

        - `"incomplete"`

    - `AgentMessage`

      A message routed between agents.

      - `author: string`

        The sending agent identity.

      - `content: Array<BetaResponseInputTextContent | BetaResponseInputImageContent | EncryptedContent>`

        Plaintext, image, or encrypted content sent between agents.

        - `BetaResponseInputTextContent`

          A text input to the model.

        - `BetaResponseInputImageContent`

          An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision)

        - `EncryptedContent`

          Opaque encrypted content that Responses API decrypts inside trusted model execution.

          - `encrypted_content: string`

            Opaque encrypted content.

          - `type: "encrypted_content"`

            The type of the input item. Always `encrypted_content`.

            - `"encrypted_content"`

      - `recipient: string`

        The destination agent identity.

      - `type: "agent_message"`

        The item type. Always `agent_message`.

        - `"agent_message"`

      - `id?: string | null`

        The unique ID of this agent message item.

      - `agent?: Agent | null`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

    - `MultiAgentCall`

      - `action: "spawn_agent" | "interrupt_agent" | "list_agents" | 3 more`

        The multi-agent action that was executed.

        - `"spawn_agent"`

        - `"interrupt_agent"`

        - `"list_agents"`

        - `"send_message"`

        - `"followup_task"`

        - `"wait_agent"`

      - `arguments: string`

        The action arguments as a JSON string.

      - `call_id: string`

        The unique ID linking this call to its output.

      - `type: "multi_agent_call"`

        The item type. Always `multi_agent_call`.

        - `"multi_agent_call"`

      - `id?: string | null`

        The unique ID of this multi-agent call.

      - `agent?: Agent | null`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

    - `MultiAgentCallOutput`

      - `action: "spawn_agent" | "interrupt_agent" | "list_agents" | 3 more`

        The multi-agent action that produced this result.

        - `"spawn_agent"`

        - `"interrupt_agent"`

        - `"list_agents"`

        - `"send_message"`

        - `"followup_task"`

        - `"wait_agent"`

      - `call_id: string`

        The unique ID of the multi-agent call.

      - `output: Array<Output>`

        Text output returned by the multi-agent action.

        - `text: string`

          The text content.

        - `type: "output_text"`

          The content type. Always `output_text`.

          - `"output_text"`

        - `annotations?: Array<FileCitation | URLCitation | ContainerFileCitation>`

          Citations associated with the text content.

          - `FileCitation`

            - `file_id: string`

              The ID of the file.

            - `filename: string`

              The filename of the file cited.

            - `index: number`

              The index of the file in the list of files.

            - `type: "file_citation"`

              The citation type. Always `file_citation`.

              - `"file_citation"`

          - `URLCitation`

            - `end_index: number`

              The index of the last character of the citation in the message.

            - `start_index: number`

              The index of the first character of the citation in the message.

            - `title: string`

              The title of the cited resource.

            - `type: "url_citation"`

              The citation type. Always `url_citation`.

              - `"url_citation"`

            - `url: string`

              The URL of the cited resource.

          - `ContainerFileCitation`

            - `container_id: string`

              The ID of the container.

            - `end_index: number`

              The index of the last character of the citation in the message.

            - `file_id: string`

              The ID of the container file.

            - `filename: string`

              The filename of the container file cited.

            - `start_index: number`

              The index of the first character of the citation in the message.

            - `type: "container_file_citation"`

              The citation type. Always `container_file_citation`.

              - `"container_file_citation"`

      - `type: "multi_agent_call_output"`

        The item type. Always `multi_agent_call_output`.

        - `"multi_agent_call_output"`

      - `id?: string | null`

        The unique ID of this multi-agent call output.

      - `agent?: Agent | null`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

    - `ToolSearchCall`

      - `arguments: unknown`

        The arguments supplied to the tool search call.

      - `type: "tool_search_call"`

        The item type. Always `tool_search_call`.

        - `"tool_search_call"`

      - `id?: string | null`

        The unique ID of this tool search call.

      - `agent?: Agent | null`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

      - `call_id?: string | null`

        The unique ID of the tool search call generated by the model.

      - `execution?: "server" | "client"`

        Whether tool search was executed by the server or by the client.

        - `"server"`

        - `"client"`

      - `status?: "in_progress" | "completed" | "incomplete" | null`

        The status of the tool search call.

        - `"in_progress"`

        - `"completed"`

        - `"incomplete"`

    - `BetaResponseToolSearchOutputItemParam`

      - `tools: Array<BetaTool>`

        The loaded tool definitions returned by the tool search output.

        - `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).

          - `name: string`

            The name of the function to call.

          - `parameters: Record<string, unknown> | null`

            A JSON schema object describing the parameters of the function.

          - `strict: boolean | null`

            Whether strict parameter validation is enforced for this function tool.

          - `type: "function"`

            The type of the function tool. Always `function`.

            - `"function"`

          - `allowed_callers?: Array<"direct" | "programmatic"> | null`

            The tool invocation context(s).

            - `"direct"`

            - `"programmatic"`

          - `defer_loading?: boolean`

            Whether this function is deferred and loaded via tool search.

          - `description?: string | null`

            A description of the function. Used by the model to determine whether or not to call the function.

          - `output_schema?: Record<string, unknown> | null`

            A JSON schema object describing the JSON value encoded in string outputs for this function.

        - `BetaFileSearchTool`

          A tool that searches for relevant content from uploaded files. Learn more about the [file search tool](https://platform.openai.com/docs/guides/tools-file-search).

          - `type: "file_search"`

            The type of the file search tool. Always `file_search`.

            - `"file_search"`

          - `vector_store_ids: Array<string>`

            The IDs of the vector stores to search.

          - `filters?: ComparisonFilter | CompoundFilter | null`

            A filter to apply.

            - `ComparisonFilter`

              A filter used to compare a specified attribute key to a given value using a defined comparison operation.

              - `key: string`

                The key to compare against the value.

              - `type: "eq" | "ne" | "gt" | 5 more`

                Specifies the comparison operator: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`, `in`, `nin`.

                - `eq`: equals
                - `ne`: not equal
                - `gt`: greater than
                - `gte`: greater than or equal
                - `lt`: less than
                - `lte`: less than or equal
                - `in`: in
                - `nin`: not in

                - `"eq"`

                - `"ne"`

                - `"gt"`

                - `"gte"`

                - `"lt"`

                - `"lte"`

                - `"in"`

                - `"nin"`

              - `value: string | number | boolean | Array<string | number>`

                The value to compare against the attribute key; supports string, number, or boolean types.

                - `string`

                - `number`

                - `boolean`

                - `Array<string | number>`

                  - `string`

                  - `number`

            - `CompoundFilter`

              Combine multiple filters using `and` or `or`.

              - `filters: Array<ComparisonFilter | unknown>`

                Array of filters to combine. Items can be `ComparisonFilter` or `CompoundFilter`.

                - `ComparisonFilter`

                  A filter used to compare a specified attribute key to a given value using a defined comparison operation.

                  - `key: string`

                    The key to compare against the value.

                  - `type: "eq" | "ne" | "gt" | 5 more`

                    Specifies the comparison operator: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`, `in`, `nin`.

                    - `eq`: equals
                    - `ne`: not equal
                    - `gt`: greater than
                    - `gte`: greater than or equal
                    - `lt`: less than
                    - `lte`: less than or equal
                    - `in`: in
                    - `nin`: not in

                    - `"eq"`

                    - `"ne"`

                    - `"gt"`

                    - `"gte"`

                    - `"lt"`

                    - `"lte"`

                    - `"in"`

                    - `"nin"`

                  - `value: string | number | boolean | Array<string | number>`

                    The value to compare against the attribute key; supports string, number, or boolean types.

                    - `string`

                    - `number`

                    - `boolean`

                    - `Array<string | number>`

                      - `string`

                      - `number`

                - `unknown`

              - `type: "and" | "or"`

                Type of operation: `and` or `or`.

                - `"and"`

                - `"or"`

          - `max_num_results?: number`

            The maximum number of results to return. This number should be between 1 and 50 inclusive.

          - `ranking_options?: RankingOptions`

            Ranking options for search.

            - `hybrid_search?: HybridSearch`

              Weights that control how reciprocal rank fusion balances semantic embedding matches versus sparse keyword matches when hybrid search is enabled.

              - `embedding_weight: number`

                The weight of the embedding in the reciprocal ranking fusion.

              - `text_weight: number`

                The weight of the text in the reciprocal ranking fusion.

            - `ranker?: "auto" | "default-2024-11-15"`

              The ranker to use for the file search.

              - `"auto"`

              - `"default-2024-11-15"`

            - `score_threshold?: number`

              The score threshold for the file search, a number between 0 and 1. Numbers closer to 1 will attempt to return only the most relevant results, but may return fewer results.

        - `BetaComputerTool`

          A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use).

          - `type: "computer"`

            The type of the computer tool. Always `computer`.

            - `"computer"`

        - `BetaComputerUsePreviewTool`

          A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use).

          - `display_height: number`

            The height of the computer display.

          - `display_width: number`

            The width of the computer display.

          - `environment: "windows" | "mac" | "linux" | 2 more`

            The type of computer environment to control.

            - `"windows"`

            - `"mac"`

            - `"linux"`

            - `"ubuntu"`

            - `"browser"`

          - `type: "computer_use_preview"`

            The type of the computer use tool. Always `computer_use_preview`.

            - `"computer_use_preview"`

        - `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"`

            The type of the web search tool. One of `web_search` or `web_search_2025_08_26`.

            - `"web_search"`

            - `"web_search_2025_08_26"`

          - `external_web_access?: boolean`

            Allow live internet access for web search. Defaults to true when omitted. When false, the web search tool runs in offline/cache-only mode and will not fetch new external content.

          - `filters?: Filters | null`

            Filters for the search.

            - `allowed_domains?: Array<string> | null`

              Allowed domains for the search. If not provided, all domains are allowed.
              Subdomains of the provided domains are allowed as well.

              Example: `["pubmed.ncbi.nlm.nih.gov"]`

          - `search_context_size?: "low" | "medium" | "high"`

            High level guidance for the amount of context window space to use for the search. One of `low`, `medium`, or `high`. `medium` is the default.

            - `"low"`

            - `"medium"`

            - `"high"`

          - `user_location?: UserLocation | null`

            The approximate location of the user.

            - `city?: string | null`

              Free text input for the city of the user, e.g. `San Francisco`.

            - `country?: string | null`

              The two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of the user, e.g. `US`.

            - `region?: string | null`

              Free text input for the region of the user, e.g. `California`.

            - `timezone?: string | null`

              The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of the user, e.g. `America/Los_Angeles`.

            - `type?: "approximate"`

              The type of location approximation. Always `approximate`.

              - `"approximate"`

        - `Mcp`

          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).

          - `server_label: string`

            A label for this MCP server, used to identify it in tool calls.

          - `type: "mcp"`

            The type of the MCP tool. Always `mcp`.

            - `"mcp"`

          - `allowed_callers?: Array<"direct" | "programmatic"> | null`

            The tool invocation context(s).

            - `"direct"`

            - `"programmatic"`

          - `allowed_tools?: Array<string> | McpToolFilter | null`

            List of allowed tool names or a filter object.

            - `Array<string>`

            - `McpToolFilter`

              A filter object to specify which tools are allowed.

              - `read_only?: boolean`

                Indicates whether or not a tool modifies data or is read-only. If an
                MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint),
                it will match this filter.

              - `tool_names?: Array<string>`

                List of allowed tool names.

          - `authorization?: string`

            An OAuth access token that can be used with a remote MCP server, either
            with a custom MCP server URL or a service connector. Your application
            must handle the OAuth authorization flow and provide the token here.

          - `connector_id?: "connector_dropbox" | "connector_gmail" | "connector_googlecalendar" | 5 more`

            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`

            - `"connector_dropbox"`

            - `"connector_gmail"`

            - `"connector_googlecalendar"`

            - `"connector_googledrive"`

            - `"connector_microsoftteams"`

            - `"connector_outlookcalendar"`

            - `"connector_outlookemail"`

            - `"connector_sharepoint"`

          - `defer_loading?: boolean`

            Whether this MCP tool is deferred and discovered via tool search.

          - `headers?: Record<string, string> | null`

            Optional HTTP headers to send to the MCP server. Use for authentication
            or other purposes.

          - `require_approval?: McpToolApprovalFilter | "always" | "never" | null`

            Specify which of the MCP server's tools require approval.

            - `McpToolApprovalFilter`

              Specify which of the MCP server's tools require approval. Can be
              `always`, `never`, or a filter object associated with tools
              that require approval.

              - `always?: Always`

                A filter object to specify which tools are allowed.

                - `read_only?: boolean`

                  Indicates whether or not a tool modifies data or is read-only. If an
                  MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint),
                  it will match this filter.

                - `tool_names?: Array<string>`

                  List of allowed tool names.

              - `never?: Never`

                A filter object to specify which tools are allowed.

                - `read_only?: boolean`

                  Indicates whether or not a tool modifies data or is read-only. If an
                  MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint),
                  it will match this filter.

                - `tool_names?: Array<string>`

                  List of allowed tool names.

            - `"always" | "never"`

              - `"always"`

              - `"never"`

          - `server_description?: string`

            Optional description of the MCP server, used to provide more context.

          - `server_url?: string`

            The URL for the MCP server. One of `server_url`, `connector_id`, or
            `tunnel_id` must be provided.

          - `tunnel_id?: string`

            The Secure MCP Tunnel ID to use instead of a direct server URL. One of
            `server_url`, `connector_id`, or `tunnel_id` must be provided.

        - `CodeInterpreter`

          A tool that runs Python code to help generate a response to a prompt.

          - `container: string | CodeInterpreterToolAuto`

            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`

            - `CodeInterpreterToolAuto`

              Configuration for a code interpreter container. Optionally specify the IDs of the files to run the code on.

              - `type: "auto"`

                Always `auto`.

                - `"auto"`

              - `file_ids?: Array<string>`

                An optional list of uploaded files to make available to your code.

              - `memory_limit?: "1g" | "4g" | "16g" | "64g" | null`

                The memory limit for the code interpreter container.

                - `"1g"`

                - `"4g"`

                - `"16g"`

                - `"64g"`

              - `network_policy?: BetaContainerNetworkPolicyDisabled | BetaContainerNetworkPolicyAllowlist`

                Network access policy for the container.

                - `BetaContainerNetworkPolicyDisabled`

                  - `type: "disabled"`

                    Disable outbound network access. Always `disabled`.

                    - `"disabled"`

                - `BetaContainerNetworkPolicyAllowlist`

                  - `allowed_domains: Array<string>`

                    A list of allowed domains when type is `allowlist`.

                  - `type: "allowlist"`

                    Allow outbound network access only to specified domains. Always `allowlist`.

                    - `"allowlist"`

                  - `domain_secrets?: Array<BetaContainerNetworkPolicyDomainSecret>`

                    Optional domain-scoped secrets for allowlisted domains.

                    - `domain: string`

                      The domain associated with the secret.

                    - `name: string`

                      The name of the secret to inject for the domain.

                    - `value: string`

                      The secret value to inject for the domain.

          - `type: "code_interpreter"`

            The type of the code interpreter tool. Always `code_interpreter`.

            - `"code_interpreter"`

          - `allowed_callers?: Array<"direct" | "programmatic"> | null`

            The tool invocation context(s).

            - `"direct"`

            - `"programmatic"`

        - `ProgrammaticToolCalling`

          - `type: "programmatic_tool_calling"`

            The type of the tool. Always `programmatic_tool_calling`.

            - `"programmatic_tool_calling"`

        - `ImageGeneration`

          A tool that generates images using the GPT image models.

          - `type: "image_generation"`

            The type of the image generation tool. Always `image_generation`.

            - `"image_generation"`

          - `action?: "generate" | "edit" | "auto"`

            Whether to generate a new image or edit an existing image. Default: `auto`.

            - `"generate"`

            - `"edit"`

            - `"auto"`

          - `background?: "transparent" | "opaque" | "auto"`

            Allows to set transparency for the background of the generated image(s).
            Must be one of `transparent`, `opaque`, or `auto` (default value). When
            `auto` is used, the model will automatically determine the best
            background for the image.

            Transparent backgrounds are available for supported GPT Image models.
            For `gpt-image-2` and `gpt-image-2-2026-04-21`, this support is in
            preview. When using `transparent`, set the output format to `png` or
            `webp`.

            - `"transparent"`

            - `"opaque"`

            - `"auto"`

          - `input_fidelity?: "high" | "low" | null`

            Control how much effort the model will exert to match the style and features, especially facial features, of input images. This parameter is only supported for `gpt-image-1` and `gpt-image-1.5` and later models, unsupported for `gpt-image-1-mini`. Supports `high` and `low`. Defaults to `low`.

            - `"high"`

            - `"low"`

          - `input_image_mask?: InputImageMask`

            Optional mask for inpainting. Contains `image_url`
            (string, optional) and `file_id` (string, optional).

            - `file_id?: string`

              File ID for the mask image.

            - `image_url?: string`

              Base64-encoded mask image.

          - `model?: (string & {}) | "gpt-image-1" | "gpt-image-1-mini" | "gpt-image-2" | 3 more`

            The image generation model to use. One of `gpt-image-1`,
            `gpt-image-1-mini`, `gpt-image-1.5`, `gpt-image-2`,
            `gpt-image-2-2026-04-21`, or `chatgpt-image-latest`. Default:
            `gpt-image-1`.

            - `(string & {})`

            - `"gpt-image-1" | "gpt-image-1-mini" | "gpt-image-2" | 3 more`

              - `"gpt-image-1"`

              - `"gpt-image-1-mini"`

              - `"gpt-image-2"`

              - `"gpt-image-2-2026-04-21"`

              - `"gpt-image-1.5"`

              - `"chatgpt-image-latest"`

          - `moderation?: "auto" | "low"`

            Moderation level for the generated image. Default: `auto`.

            - `"auto"`

            - `"low"`

          - `output_compression?: number`

            Compression level for the output image. Default: 100.

          - `output_format?: "png" | "webp" | "jpeg"`

            The output format of the generated image. One of `png`, `webp`, or
            `jpeg`. Default: `png`.

            - `"png"`

            - `"webp"`

            - `"jpeg"`

          - `partial_images?: number`

            Number of partial images to generate in streaming mode, from 0 (default value) to 3.

          - `quality?: "low" | "medium" | "high" | "auto"`

            The quality of the generated image. One of `low`, `medium`, `high`,
            or `auto`. Default: `auto`.

            - `"low"`

            - `"medium"`

            - `"high"`

            - `"auto"`

          - `size?: (string & {}) | "1024x1024" | "1024x1536" | "1536x1024" | "auto"`

            The size of the generated images. For `gpt-image-2` and `gpt-image-2-2026-04-21`, arbitrary resolutions are supported as `WIDTHxHEIGHT` strings, for example `1536x864`. Width and height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above `2560x1440` are experimental, and the maximum supported resolution is `3840x2160`. The requested size must also satisfy the model's current pixel and edge limits. The standard sizes `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models; `auto` is supported for models that allow automatic sizing. For `dall-e-2`, use one of `256x256`, `512x512`, or `1024x1024`. For `dall-e-3`, use one of `1024x1024`, `1792x1024`, or `1024x1792`.

            - `(string & {})`

            - `"1024x1024" | "1024x1536" | "1536x1024" | "auto"`

              - `"1024x1024"`

              - `"1024x1536"`

              - `"1536x1024"`

              - `"auto"`

        - `LocalShell`

          A tool that allows the model to execute shell commands in a local environment.

          - `type: "local_shell"`

            The type of the local shell tool. Always `local_shell`.

            - `"local_shell"`

        - `BetaFunctionShellTool`

          A tool that allows the model to execute shell commands.

          - `type: "shell"`

            The type of the shell tool. Always `shell`.

            - `"shell"`

          - `allowed_callers?: Array<"direct" | "programmatic"> | null`

            The tool invocation context(s).

            - `"direct"`

            - `"programmatic"`

          - `environment?: BetaContainerAuto | BetaLocalEnvironment | BetaContainerReference | null`

            - `BetaContainerAuto`

              - `type: "container_auto"`

                Automatically creates a container for this request

                - `"container_auto"`

              - `file_ids?: Array<string>`

                An optional list of uploaded files to make available to your code.

              - `memory_limit?: "1g" | "4g" | "16g" | "64g" | null`

                The memory limit for the container.

                - `"1g"`

                - `"4g"`

                - `"16g"`

                - `"64g"`

              - `network_policy?: BetaContainerNetworkPolicyDisabled | BetaContainerNetworkPolicyAllowlist`

                Network access policy for the container.

                - `BetaContainerNetworkPolicyDisabled`

                - `BetaContainerNetworkPolicyAllowlist`

              - `skills?: Array<BetaSkillReference | BetaInlineSkill>`

                An optional list of skills referenced by id or inline data.

                - `BetaSkillReference`

                  - `skill_id: string`

                    The ID of the referenced skill.

                  - `type: "skill_reference"`

                    References a skill created with the /v1/skills endpoint.

                    - `"skill_reference"`

                  - `version?: string`

                    Optional skill version. Use a positive integer or 'latest'. Omit for default.

                - `BetaInlineSkill`

                  - `description: string`

                    The description of the skill.

                  - `name: string`

                    The name of the skill.

                  - `source: BetaInlineSkillSource`

                    Inline skill payload

                    - `data: string`

                      Base64-encoded skill zip bundle.

                    - `media_type: "application/zip"`

                      The media type of the inline skill payload. Must be `application/zip`.

                      - `"application/zip"`

                    - `type: "base64"`

                      The type of the inline skill source. Must be `base64`.

                      - `"base64"`

                  - `type: "inline"`

                    Defines an inline skill for this request.

                    - `"inline"`

            - `BetaLocalEnvironment`

              - `type: "local"`

                Use a local computer environment.

                - `"local"`

              - `skills?: Array<BetaLocalSkill>`

                An optional list of skills.

                - `description: string`

                  The description of the skill.

                - `name: string`

                  The name of the skill.

                - `path: string`

                  The path to the directory containing the skill.

            - `BetaContainerReference`

              - `container_id: string`

                The ID of the referenced container.

              - `type: "container_reference"`

                References a container created with the /v1/containers endpoint

                - `"container_reference"`

        - `BetaCustomTool`

          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)

          - `name: string`

            The name of the custom tool, used to identify it in tool calls.

          - `type: "custom"`

            The type of the custom tool. Always `custom`.

            - `"custom"`

          - `allowed_callers?: Array<"direct" | "programmatic"> | null`

            The tool invocation context(s).

            - `"direct"`

            - `"programmatic"`

          - `defer_loading?: boolean`

            Whether this tool should be deferred and discovered via tool search.

          - `description?: string`

            Optional description of the custom tool, used to provide more context.

          - `format?: Text | Grammar`

            The input format for the custom tool. Default is unconstrained text.

            - `Text`

              Unconstrained free-form text.

              - `type: "text"`

                Unconstrained text format. Always `text`.

                - `"text"`

            - `Grammar`

              A grammar defined by the user.

              - `definition: string`

                The grammar definition.

              - `syntax: "lark" | "regex"`

                The syntax of the grammar definition. One of `lark` or `regex`.

                - `"lark"`

                - `"regex"`

              - `type: "grammar"`

                Grammar format. Always `grammar`.

                - `"grammar"`

        - `BetaNamespaceTool`

          Groups function/custom tools under a shared namespace.

          - `description: string`

            A description of the namespace shown to the model.

          - `name: string`

            The namespace name used in tool calls (for example, `crm`).

          - `tools: Array<Function | BetaCustomTool>`

            The function/custom tools available inside this namespace.

            - `Function`

              - `name: string`

              - `type: "function"`

                - `"function"`

              - `allowed_callers?: Array<"direct" | "programmatic"> | null`

                The tool invocation context(s).

                - `"direct"`

                - `"programmatic"`

              - `defer_loading?: boolean`

                Whether this function should be deferred and discovered via tool search.

              - `description?: string | null`

              - `output_schema?: Record<string, unknown> | null`

                A JSON Schema describing the JSON value encoded in string outputs for this function tool. This does not describe content-array outputs.

              - `parameters?: unknown`

              - `strict?: boolean | null`

                Whether to enforce strict parameter validation. If omitted, Responses attempts to use strict validation when the schema is compatible, and falls back to non-strict validation otherwise.

            - `BetaCustomTool`

              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: "namespace"`

            The type of the tool. Always `namespace`.

            - `"namespace"`

        - `BetaToolSearchTool`

          Hosted or BYOT tool search configuration for deferred tools.

          - `type: "tool_search"`

            The type of the tool. Always `tool_search`.

            - `"tool_search"`

          - `description?: string | null`

            Description shown to the model for a client-executed tool search tool.

          - `execution?: "server" | "client"`

            Whether tool search is executed by the server or by the client.

            - `"server"`

            - `"client"`

          - `parameters?: unknown`

            Parameter schema for a client-executed tool search tool.

        - `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"`

            The type of the web search tool. One of `web_search_preview` or `web_search_preview_2025_03_11`.

            - `"web_search_preview"`

            - `"web_search_preview_2025_03_11"`

          - `search_content_types?: Array<"text" | "image">`

            - `"text"`

            - `"image"`

          - `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.

            - `"low"`

            - `"medium"`

            - `"high"`

          - `user_location?: UserLocation | null`

            The user's location.

            - `type: "approximate"`

              The type of location approximation. Always `approximate`.

              - `"approximate"`

            - `city?: string | null`

              Free text input for the city of the user, e.g. `San Francisco`.

            - `country?: string | null`

              The two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of the user, e.g. `US`.

            - `region?: string | null`

              Free text input for the region of the user, e.g. `California`.

            - `timezone?: string | null`

              The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of the user, e.g. `America/Los_Angeles`.

        - `BetaApplyPatchTool`

          Allows the assistant to create, delete, or update files using unified diffs.

          - `type: "apply_patch"`

            The type of the tool. Always `apply_patch`.

            - `"apply_patch"`

          - `allowed_callers?: Array<"direct" | "programmatic"> | null`

            The tool invocation context(s).

            - `"direct"`

            - `"programmatic"`

      - `type: "tool_search_output"`

        The item type. Always `tool_search_output`.

        - `"tool_search_output"`

      - `id?: string | null`

        The unique ID of this tool search output.

      - `agent?: Agent | null`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

      - `call_id?: string | null`

        The unique ID of the tool search call generated by the model.

      - `execution?: "server" | "client"`

        Whether tool search was executed by the server or by the client.

        - `"server"`

        - `"client"`

      - `status?: "in_progress" | "completed" | "incomplete" | null`

        The status of the tool search output.

        - `"in_progress"`

        - `"completed"`

        - `"incomplete"`

    - `AdditionalTools`

      - `role: "developer"`

        The role that provided the additional tools. Only `developer` is supported.

        - `"developer"`

      - `tools: Array<BetaTool>`

        A list of additional tools made available at this item.

        - `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).

        - `Mcp`

          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).

        - `CodeInterpreter`

          A tool that runs Python code to help generate a response to a prompt.

        - `ProgrammaticToolCalling`

        - `ImageGeneration`

          A tool that generates images using the GPT image models.

        - `LocalShell`

          A tool that allows the model to execute shell commands in a local environment.

        - `BetaFunctionShellTool`

          A tool that allows the model to execute shell commands.

        - `BetaCustomTool`

          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)

        - `BetaNamespaceTool`

          Groups function/custom tools under a shared namespace.

        - `BetaToolSearchTool`

          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).

        - `BetaApplyPatchTool`

          Allows the assistant to create, delete, or update files using unified diffs.

      - `type: "additional_tools"`

        The item type. Always `additional_tools`.

        - `"additional_tools"`

      - `id?: string | null`

        The unique ID of this additional tools item.

      - `agent?: Agent | null`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

    - `BetaResponseReasoningItem`

      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).

      - `id: string`

        The unique identifier of the reasoning content.

      - `summary: Array<Summary>`

        Reasoning summary content.

        - `text: string`

          A summary of the reasoning output from the model so far.

        - `type: "summary_text"`

          The type of the object. Always `summary_text`.

          - `"summary_text"`

      - `type: "reasoning"`

        The type of the object. Always `reasoning`.

        - `"reasoning"`

      - `agent?: Agent | null`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

      - `content?: Array<Content>`

        Reasoning text content.

        - `text: string`

          The reasoning text from the model.

        - `type: "reasoning_text"`

          The type of the reasoning text. Always `reasoning_text`.

          - `"reasoning_text"`

      - `encrypted_content?: string | null`

        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.

        When streaming, use the completed reasoning item and its
        `encrypted_content` from the `response.output_item.done` event in
        subsequent requests. The `encrypted_content` in
        `response.output_item.added` may be incomplete. This is especially
        important when `store` is `false` or when using Zero Data Retention.

      - `status?: "in_progress" | "completed" | "incomplete"`

        The status of the item. One of `in_progress`, `completed`, or
        `incomplete`. Populated when items are returned via API.

        - `"in_progress"`

        - `"completed"`

        - `"incomplete"`

    - `BetaResponseCompactionItemParam`

      A compaction item generated by the [`v1/responses/compact` API](https://platform.openai.com/docs/api-reference/responses/compact).

      - `encrypted_content: string`

        The encrypted content of the compaction summary.

      - `type: "compaction"`

        The type of the item. Always `compaction`.

        - `"compaction"`

      - `id?: string | null`

        The ID of the compaction item.

      - `agent?: Agent | null`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

    - `ImageGenerationCall`

      An image generation request made by the model.

      - `id: string`

        The unique ID of the image generation call.

      - `result: string | null`

        The generated image encoded in base64.

      - `status: "in_progress" | "completed" | "generating" | "failed"`

        The status of the image generation call.

        - `"in_progress"`

        - `"completed"`

        - `"generating"`

        - `"failed"`

      - `type: "image_generation_call"`

        The type of the image generation call. Always `image_generation_call`.

        - `"image_generation_call"`

      - `agent?: Agent | null`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

    - `BetaResponseCodeInterpreterToolCall`

      A tool call to run code.

      - `id: string`

        The unique ID of the code interpreter tool call.

      - `code: string | null`

        The code to run, or null if not available.

      - `container_id: string`

        The ID of the container used to run the code.

      - `outputs: Array<Logs | Image> | null`

        The outputs generated by the code interpreter, such as logs or images.
        Can be null if no outputs are available.

        - `Logs`

          The logs output from the code interpreter.

          - `logs: string`

            The logs output from the code interpreter.

          - `type: "logs"`

            The type of the output. Always `logs`.

            - `"logs"`

        - `Image`

          The image output from the code interpreter.

          - `type: "image"`

            The type of the output. Always `image`.

            - `"image"`

          - `url: string`

            The URL of the image output from the code interpreter.

      - `status: "in_progress" | "completed" | "incomplete" | 2 more`

        The status of the code interpreter tool call. Valid values are `in_progress`, `completed`, `incomplete`, `interpreting`, and `failed`.

        - `"in_progress"`

        - `"completed"`

        - `"incomplete"`

        - `"interpreting"`

        - `"failed"`

      - `type: "code_interpreter_call"`

        The type of the code interpreter tool call. Always `code_interpreter_call`.

        - `"code_interpreter_call"`

      - `agent?: Agent | null`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

    - `LocalShellCall`

      A tool call to run a command on the local shell.

      - `id: string`

        The unique ID of the local shell call.

      - `action: Action`

        Execute a shell command on the server.

        - `command: Array<string>`

          The command to run.

        - `env: Record<string, string>`

          Environment variables to set for the command.

        - `type: "exec"`

          The type of the local shell action. Always `exec`.

          - `"exec"`

        - `timeout_ms?: number | null`

          Optional timeout in milliseconds for the command.

        - `user?: string | null`

          Optional user to run the command as.

        - `working_directory?: string | null`

          Optional working directory to run the command in.

      - `call_id: string`

        The unique ID of the local shell tool call generated by the model.

      - `status: "in_progress" | "completed" | "incomplete"`

        The status of the local shell call.

        - `"in_progress"`

        - `"completed"`

        - `"incomplete"`

      - `type: "local_shell_call"`

        The type of the local shell call. Always `local_shell_call`.

        - `"local_shell_call"`

      - `agent?: Agent | null`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

    - `LocalShellCallOutput`

      The output of a local shell tool call.

      - `id: string`

        The unique ID of the local shell tool call generated by the model.

      - `output: string`

        A JSON string of the output of the local shell tool call.

      - `type: "local_shell_call_output"`

        The type of the local shell tool call output. Always `local_shell_call_output`.

        - `"local_shell_call_output"`

      - `agent?: Agent | null`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

      - `status?: "in_progress" | "completed" | "incomplete" | null`

        The status of the item. One of `in_progress`, `completed`, or `incomplete`.

        - `"in_progress"`

        - `"completed"`

        - `"incomplete"`

    - `ShellCall`

      A tool representing a request to execute one or more shell commands.

      - `action: Action`

        The shell commands and limits that describe how to run the tool call.

        - `commands: Array<string>`

          Ordered shell commands for the execution environment to run.

        - `max_output_length?: number | null`

          Maximum number of UTF-8 characters to capture from combined stdout and stderr output.

        - `timeout_ms?: number | null`

          Maximum wall-clock time in milliseconds to allow the shell commands to run.

      - `call_id: string`

        The unique ID of the shell tool call generated by the model.

      - `type: "shell_call"`

        The type of the item. Always `shell_call`.

        - `"shell_call"`

      - `id?: string | null`

        The unique ID of the shell tool call. Populated when this item is returned via API.

      - `agent?: Agent | null`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

      - `caller?: Direct | Program | null`

        The execution context that produced this tool call.

        - `Direct`

          - `type: "direct"`

            The caller type. Always `direct`.

            - `"direct"`

        - `Program`

          - `caller_id: string`

            The call ID of the program item that produced this tool call.

          - `type: "program"`

            The caller type. Always `program`.

            - `"program"`

      - `environment?: BetaLocalEnvironment | BetaContainerReference | null`

        The environment to execute the shell commands in.

        - `BetaLocalEnvironment`

        - `BetaContainerReference`

      - `status?: "in_progress" | "completed" | "incomplete" | null`

        The status of the shell call. One of `in_progress`, `completed`, or `incomplete`.

        - `"in_progress"`

        - `"completed"`

        - `"incomplete"`

    - `ShellCallOutput`

      The streamed output items emitted by a shell tool call.

      - `call_id: string`

        The unique ID of the shell tool call generated by the model.

      - `output: Array<BetaResponseFunctionShellCallOutputContent>`

        Captured chunks of stdout and stderr output, along with their associated outcomes.

        - `outcome: Timeout | Exit`

          The exit or timeout outcome associated with this shell call.

          - `Timeout`

            Indicates that the shell call exceeded its configured time limit.

            - `type: "timeout"`

              The outcome type. Always `timeout`.

              - `"timeout"`

          - `Exit`

            Indicates that the shell commands finished and returned an exit code.

            - `exit_code: number`

              The exit code returned by the shell process.

            - `type: "exit"`

              The outcome type. Always `exit`.

              - `"exit"`

        - `stderr: string`

          Captured stderr output for the shell call.

        - `stdout: string`

          Captured stdout output for the shell call.

      - `type: "shell_call_output"`

        The type of the item. Always `shell_call_output`.

        - `"shell_call_output"`

      - `id?: string | null`

        The unique ID of the shell tool call output. Populated when this item is returned via API.

      - `agent?: Agent | null`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

      - `caller?: Direct | Program | null`

        The execution context that produced this tool call.

        - `Direct`

          - `type: "direct"`

            The caller type. Always `direct`.

            - `"direct"`

        - `Program`

          - `caller_id: string`

            The call ID of the program item that produced this tool call.

          - `type: "program"`

            The caller type. Always `program`.

            - `"program"`

      - `max_output_length?: number | null`

        The maximum number of UTF-8 characters captured for this shell call's combined output.

      - `status?: "in_progress" | "completed" | "incomplete" | null`

        The status of the shell call output.

        - `"in_progress"`

        - `"completed"`

        - `"incomplete"`

    - `ApplyPatchCall`

      A tool call representing a request to create, delete, or update files using diff patches.

      - `call_id: string`

        The unique ID of the apply patch tool call generated by the model.

      - `operation: CreateFile | DeleteFile | UpdateFile`

        The specific create, delete, or update instruction for the apply_patch tool call.

        - `CreateFile`

          Instruction for creating a new file via the apply_patch tool.

          - `diff: string`

            Unified diff content to apply when creating the file.

          - `path: string`

            Path of the file to create relative to the workspace root.

          - `type: "create_file"`

            The operation type. Always `create_file`.

            - `"create_file"`

        - `DeleteFile`

          Instruction for deleting an existing file via the apply_patch tool.

          - `path: string`

            Path of the file to delete relative to the workspace root.

          - `type: "delete_file"`

            The operation type. Always `delete_file`.

            - `"delete_file"`

        - `UpdateFile`

          Instruction for updating an existing file via the apply_patch tool.

          - `diff: string`

            Unified diff content to apply to the existing file.

          - `path: string`

            Path of the file to update relative to the workspace root.

          - `type: "update_file"`

            The operation type. Always `update_file`.

            - `"update_file"`

      - `status: "in_progress" | "completed"`

        The status of the apply patch tool call. One of `in_progress` or `completed`.

        - `"in_progress"`

        - `"completed"`

      - `type: "apply_patch_call"`

        The type of the item. Always `apply_patch_call`.

        - `"apply_patch_call"`

      - `id?: string | null`

        The unique ID of the apply patch tool call. Populated when this item is returned via API.

      - `agent?: Agent | null`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

      - `caller?: Direct | Program | null`

        The execution context that produced this tool call.

        - `Direct`

          - `type: "direct"`

            The caller type. Always `direct`.

            - `"direct"`

        - `Program`

          - `caller_id: string`

            The call ID of the program item that produced this tool call.

          - `type: "program"`

            The caller type. Always `program`.

            - `"program"`

    - `ApplyPatchCallOutput`

      The streamed output emitted by an apply patch tool call.

      - `call_id: string`

        The unique ID of the apply patch tool call generated by the model.

      - `status: "completed" | "failed"`

        The status of the apply patch tool call output. One of `completed` or `failed`.

        - `"completed"`

        - `"failed"`

      - `type: "apply_patch_call_output"`

        The type of the item. Always `apply_patch_call_output`.

        - `"apply_patch_call_output"`

      - `id?: string | null`

        The unique ID of the apply patch tool call output. Populated when this item is returned via API.

      - `agent?: Agent | null`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

      - `caller?: Direct | Program | null`

        The execution context that produced this tool call.

        - `Direct`

          - `type: "direct"`

            The caller type. Always `direct`.

            - `"direct"`

        - `Program`

          - `caller_id: string`

            The call ID of the program item that produced this tool call.

          - `type: "program"`

            The caller type. Always `program`.

            - `"program"`

      - `output?: string | null`

        Optional human-readable log text from the apply patch tool (e.g., patch results or errors).

    - `McpListTools`

      A list of tools available on an MCP server.

      - `id: string`

        The unique ID of the list.

      - `server_label: string`

        The label of the MCP server.

      - `tools: Array<Tool>`

        The tools available on the server.

        - `input_schema: unknown`

          The JSON schema describing the tool's input.

        - `name: string`

          The name of the tool.

        - `annotations?: unknown`

          Additional annotations about the tool.

        - `description?: string | null`

          The description of the tool.

      - `type: "mcp_list_tools"`

        The type of the item. Always `mcp_list_tools`.

        - `"mcp_list_tools"`

      - `agent?: Agent | null`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

      - `error?: string | null`

        Error message if the server could not list tools.

    - `McpApprovalRequest`

      A request for human approval of a tool invocation.

      - `id: string`

        The unique ID of the approval request.

      - `arguments: string`

        A JSON string of arguments for the tool.

      - `name: string`

        The name of the tool to run.

      - `server_label: string`

        The label of the MCP server making the request.

      - `type: "mcp_approval_request"`

        The type of the item. Always `mcp_approval_request`.

        - `"mcp_approval_request"`

      - `agent?: Agent | null`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

    - `McpApprovalResponse`

      A response to an MCP approval request.

      - `approval_request_id: string`

        The ID of the approval request being answered.

      - `approve: boolean`

        Whether the request was approved.

      - `type: "mcp_approval_response"`

        The type of the item. Always `mcp_approval_response`.

        - `"mcp_approval_response"`

      - `id?: string | null`

        The unique ID of the approval response

      - `agent?: Agent | null`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

      - `reason?: string | null`

        Optional reason for the decision.

    - `McpCall`

      An invocation of a tool on an MCP server.

      - `id: string`

        The unique ID of the tool call.

      - `arguments: string`

        A JSON string of the arguments passed to the tool.

      - `name: string`

        The name of the tool that was run.

      - `server_label: string`

        The label of the MCP server running the tool.

      - `type: "mcp_call"`

        The type of the item. Always `mcp_call`.

        - `"mcp_call"`

      - `agent?: Agent | null`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

      - `approval_request_id?: string | null`

        Unique identifier for the MCP tool call approval request.
        Include this value in a subsequent `mcp_approval_response` input to approve or reject the corresponding tool call.

      - `error?: BetaMcpToolCallError | null`

        The error from the tool call, if any.

        - `McpProtocolError`

          - `code: number`

          - `message: string`

          - `type: "mcp_protocol_error"`

            - `"mcp_protocol_error"`

        - `McpToolExecutionError`

          - `content: unknown`

          - `type: "mcp_tool_execution_error"`

            - `"mcp_tool_execution_error"`

        - `HTTPError`

          - `code: number`

          - `message: string`

          - `type: "http_error"`

            - `"http_error"`

      - `output?: string | null`

        The output from the tool call.

      - `status?: "in_progress" | "completed" | "incomplete" | 2 more`

        The status of the tool call. One of `in_progress`, `completed`, `incomplete`, `calling`, or `failed`.

        - `"in_progress"`

        - `"completed"`

        - `"incomplete"`

        - `"calling"`

        - `"failed"`

    - `BetaResponseCustomToolCallOutput`

      The output of a custom tool call from your code, being sent back to the model.

      - `call_id: string`

        The call ID, used to map this custom tool call output to a custom tool call.

      - `output: string | Array<BetaResponseInputText | BetaResponseInputImage | BetaResponseInputFile>`

        The output from the custom tool call generated by your code.
        Can be a string or an list of output content.

        - `string`

        - `Array<BetaResponseInputText | BetaResponseInputImage | BetaResponseInputFile>`

          - `BetaResponseInputText`

            A text input to the model.

          - `BetaResponseInputImage`

            An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision).

          - `BetaResponseInputFile`

            A file input to the model.

      - `type: "custom_tool_call_output"`

        The type of the custom tool call output. Always `custom_tool_call_output`.

        - `"custom_tool_call_output"`

      - `id?: string`

        The unique ID of the custom tool call output in the OpenAI platform.

      - `agent?: Agent | null`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

      - `caller?: Direct | Program | null`

        The execution context that produced this tool call.

        - `Direct`

          - `type: "direct"`

            The caller type. Always `direct`.

            - `"direct"`

        - `Program`

          - `caller_id: string`

            The call ID of the program item that produced this tool call.

          - `type: "program"`

            The caller type. Always `program`.

            - `"program"`

    - `BetaResponseCustomToolCall`

      A call to a custom tool created by the model.

      - `call_id: string`

        An identifier used to map this custom tool call to a tool call output.

      - `input: string`

        The input for the custom tool call generated by the model.

      - `name: string`

        The name of the custom tool being called.

      - `type: "custom_tool_call"`

        The type of the custom tool call. Always `custom_tool_call`.

        - `"custom_tool_call"`

      - `id?: string`

        The unique ID of the custom tool call in the OpenAI platform.

      - `agent?: Agent | null`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

      - `caller?: Direct | Program | null`

        The execution context that produced this tool call.

        - `Direct`

          - `type: "direct"`

            - `"direct"`

        - `Program`

          - `caller_id: string`

            The call ID of the program item that produced this tool call.

          - `type: "program"`

            - `"program"`

      - `namespace?: string`

        The namespace of the custom tool being called.

    - `CompactionTrigger`

      Compacts the current context. Must be the final input item.

      - `type: "compaction_trigger"`

        The type of the item. Always `compaction_trigger`.

        - `"compaction_trigger"`

      - `agent?: Agent | null`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

    - `ItemReference`

      An internal identifier for an item to reference.

      - `id: string`

        The ID of the item to reference.

      - `agent?: Agent | null`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

      - `type?: "item_reference" | null`

        The type of item to reference. Always `item_reference`.

        - `"item_reference"`

    - `Program`

      - `id: string`

        The unique ID of this program item.

      - `call_id: string`

        The stable call ID of the program item.

      - `code: string`

        The JavaScript source executed by programmatic tool calling.

      - `fingerprint: string`

        Opaque program replay fingerprint that must be round-tripped.

      - `type: "program"`

        The item type. Always `program`.

        - `"program"`

      - `agent?: Agent | null`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

    - `ProgramOutput`

      - `id: string`

        The unique ID of this program output item.

      - `call_id: string`

        The call ID of the program item.

      - `result: string`

        The result produced by the program item.

      - `status: "completed" | "incomplete"`

        The terminal status of the program output.

        - `"completed"`

        - `"incomplete"`

      - `type: "program_output"`

        The item type. Always `program_output`.

        - `"program_output"`

      - `agent?: Agent | null`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

  - `response_id: string`

    The ID of the active response that should receive the input.

  - `type: "response.inject"`

    The event discriminator. Always `response.inject`.

    - `"response.inject"`

### Beta Response Inject Failed Event

- `BetaResponseInjectFailedEvent`

  Emitted when injected input could not be committed to a response. The event
  returns the uncommitted raw input so the client can retry it in another
  response when appropriate.

  - `error: Error`

    Information about why the input was not committed.

    - `code: "response_already_completed" | "response_not_found"`

      A machine-readable error code.

      - `"response_already_completed"`

      - `"response_not_found"`

    - `message: string`

      A human-readable description of the error.

  - `input: Array<BetaResponseInputItem>`

    The raw input items that were not committed.

    - `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.

      - `content: string | BetaResponseInputMessageContentList`

        Text, image, or audio input to the model, used to generate a response.
        Can also contain previous assistant responses.

        - `string`

        - `BetaResponseInputMessageContentList = Array<BetaResponseInputContent>`

          A list of one or many input items to the model, containing different content
          types.

          - `BetaResponseInputText`

            A text input to the model.

            - `text: string`

              The text input to the model.

            - `type: "input_text"`

              The type of the input item. Always `input_text`.

              - `"input_text"`

            - `prompt_cache_breakpoint?: PromptCacheBreakpoint`

              Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.

              - `mode: "explicit"`

                The breakpoint mode. Always `explicit`.

                - `"explicit"`

          - `BetaResponseInputImage`

            An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision).

            - `detail: BetaImageDetail`

              The detail level of the image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`.

              - `"low"`

              - `"high"`

              - `"auto"`

              - `"original"`

            - `type: "input_image"`

              The type of the input item. Always `input_image`.

              - `"input_image"`

            - `file_id?: string | null`

              The ID of the file to be sent to the model.

            - `image_url?: string | null`

              The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.

            - `prompt_cache_breakpoint?: PromptCacheBreakpoint`

              Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.

              - `mode: "explicit"`

                The breakpoint mode. Always `explicit`.

                - `"explicit"`

          - `BetaResponseInputFile`

            A file input to the model.

            - `type: "input_file"`

              The type of the input item. Always `input_file`.

              - `"input_file"`

            - `detail?: "auto" | "low" | "high"`

              The detail level of the file to be sent to the model. Use `auto` to let the system select the detail level; for GPT-5.6 and later models, `auto` uses high-quality rendering, which may increase input token usage. Use `low` for lower-cost rendering, or `high` to render the file at higher quality. Defaults to `auto`.

              - `"auto"`

              - `"low"`

              - `"high"`

            - `file_data?: string`

              The content of the file to be sent to the model.

            - `file_id?: string | null`

              The ID of the file to be sent to the model.

            - `file_url?: string`

              The URL of the file to be sent to the model.

            - `filename?: string`

              The name of the file to be sent to the model.

            - `prompt_cache_breakpoint?: PromptCacheBreakpoint`

              Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.

              - `mode: "explicit"`

                The breakpoint mode. Always `explicit`.

                - `"explicit"`

      - `role: "user" | "assistant" | "system" | "developer"`

        The role of the message input. One of `user`, `assistant`, `system`, or
        `developer`.

        - `"user"`

        - `"assistant"`

        - `"system"`

        - `"developer"`

      - `phase?: "commentary" | "final_answer" | null`

        Labels an `assistant` message as intermediate commentary (`commentary`) or the final answer (`final_answer`).
        For models like `gpt-5.3-codex` and beyond, when sending follow-up requests, preserve and resend
        phase on all assistant messages — dropping it can degrade performance. Not used for user messages.

        - `"commentary"`

        - `"final_answer"`

      - `type?: "message"`

        The type of the message input. Always `message`.

        - `"message"`

    - `Message`

      A message input to the model with a role indicating instruction following
      hierarchy. Instructions given with the `developer` or `system` role take
      precedence over instructions given with the `user` role.

      - `content: BetaResponseInputMessageContentList`

        A list of one or many input items to the model, containing different content
        types.

      - `role: "user" | "system" | "developer"`

        The role of the message input. One of `user`, `system`, or `developer`.

        - `"user"`

        - `"system"`

        - `"developer"`

      - `agent?: Agent | null`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

      - `status?: "in_progress" | "completed" | "incomplete"`

        The status of item. One of `in_progress`, `completed`, or
        `incomplete`. Populated when items are returned via API.

        - `"in_progress"`

        - `"completed"`

        - `"incomplete"`

      - `type?: "message"`

        The type of the message input. Always set to `message`.

        - `"message"`

    - `BetaResponseOutputMessage`

      An output message from the model.

      - `id: string`

        The unique ID of the output message.

      - `content: Array<BetaResponseOutputText | BetaResponseOutputRefusal>`

        The content of the output message.

        - `BetaResponseOutputText`

          A text output from the model.

          - `annotations: Array<FileCitation | URLCitation | ContainerFileCitation | FilePath>`

            The annotations of the text output.

            - `FileCitation`

              A citation to a file.

              - `file_id: string`

                The ID of the file.

              - `filename: string`

                The filename of the file cited.

              - `index: number`

                The index of the file in the list of files.

              - `type: "file_citation"`

                The type of the file citation. Always `file_citation`.

                - `"file_citation"`

            - `URLCitation`

              A citation for a web resource used to generate a model response.

              - `end_index: number`

                The index of the last character of the URL citation in the message.

              - `start_index: number`

                The index of the first character of the URL citation in the message.

              - `title: string`

                The title of the web resource.

              - `type: "url_citation"`

                The type of the URL citation. Always `url_citation`.

                - `"url_citation"`

              - `url: string`

                The URL of the web resource.

            - `ContainerFileCitation`

              A citation for a container file used to generate a model response.

              - `container_id: string`

                The ID of the container file.

              - `end_index: number`

                The index of the last character of the container file citation in the message.

              - `file_id: string`

                The ID of the file.

              - `filename: string`

                The filename of the container file cited.

              - `start_index: number`

                The index of the first character of the container file citation in the message.

              - `type: "container_file_citation"`

                The type of the container file citation. Always `container_file_citation`.

                - `"container_file_citation"`

            - `FilePath`

              A path to a file.

              - `file_id: string`

                The ID of the file.

              - `index: number`

                The index of the file in the list of files.

              - `type: "file_path"`

                The type of the file path. Always `file_path`.

                - `"file_path"`

          - `text: string`

            The text output from the model.

          - `type: "output_text"`

            The type of the output text. Always `output_text`.

            - `"output_text"`

          - `logprobs?: Array<Logprob>`

            - `token: string`

            - `bytes: Array<number>`

            - `logprob: number`

            - `top_logprobs: Array<TopLogprob>`

              - `token: string`

              - `bytes: Array<number>`

              - `logprob: number`

        - `BetaResponseOutputRefusal`

          A refusal from the model.

          - `refusal: string`

            The refusal explanation from the model.

          - `type: "refusal"`

            The type of the refusal. Always `refusal`.

            - `"refusal"`

      - `role: "assistant"`

        The role of the output message. Always `assistant`.

        - `"assistant"`

      - `status: "in_progress" | "completed" | "incomplete"`

        The status of the message input. One of `in_progress`, `completed`, or
        `incomplete`. Populated when input items are returned via API.

        - `"in_progress"`

        - `"completed"`

        - `"incomplete"`

      - `type: "message"`

        The type of the output message. Always `message`.

        - `"message"`

      - `agent?: Agent | null`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

      - `phase?: "commentary" | "final_answer" | null`

        Labels an `assistant` message as intermediate commentary (`commentary`) or the final answer (`final_answer`).
        For models like `gpt-5.3-codex` and beyond, when sending follow-up requests, preserve and resend
        phase on all assistant messages — dropping it can degrade performance. Not used for user messages.

        - `"commentary"`

        - `"final_answer"`

    - `BetaResponseFileSearchToolCall`

      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.

      - `id: string`

        The unique ID of the file search tool call.

      - `queries: Array<string>`

        The queries used to search for files.

      - `status: "in_progress" | "searching" | "completed" | 2 more`

        The status of the file search tool call. One of `in_progress`,
        `searching`, `incomplete` or `failed`,

        - `"in_progress"`

        - `"searching"`

        - `"completed"`

        - `"incomplete"`

        - `"failed"`

      - `type: "file_search_call"`

        The type of the file search tool call. Always `file_search_call`.

        - `"file_search_call"`

      - `agent?: Agent | null`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

      - `results?: Array<Result> | null`

        The results of the file search tool call.

        - `attributes?: Record<string, string | number | boolean> | null`

          Set of 16 key-value pairs that can be attached to an object. This can be
          useful for storing additional information about the object in a structured
          format, and querying for objects via API or the dashboard. Keys are strings
          with a maximum length of 64 characters. Values are strings with a maximum
          length of 512 characters, booleans, or numbers.

          - `string`

          - `number`

          - `boolean`

        - `file_id?: string`

          The unique ID of the file.

        - `filename?: string`

          The name of the file.

        - `score?: number`

          The relevance score of the file - a value between 0 and 1.

        - `text?: string`

          The text that was retrieved from the file.

    - `BetaResponseComputerToolCall`

      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.

      - `id: string`

        The unique ID of the computer call.

      - `call_id: string`

        An identifier used when responding to the tool call with output.

      - `pending_safety_checks: Array<PendingSafetyCheck>`

        The pending safety checks for the computer call.

        - `id: string`

          The ID of the pending safety check.

        - `code?: string | null`

          The type of the pending safety check.

        - `message?: string | null`

          Details about the pending safety check.

      - `status: "in_progress" | "completed" | "incomplete"`

        The status of the item. One of `in_progress`, `completed`, or
        `incomplete`. Populated when items are returned via API.

        - `"in_progress"`

        - `"completed"`

        - `"incomplete"`

      - `type: "computer_call"`

        The type of the computer call. Always `computer_call`.

        - `"computer_call"`

      - `action?: BetaComputerAction`

        A click action.

        - `Click`

          A click action.

          - `button: "left" | "right" | "wheel" | 2 more`

            Indicates which mouse button was pressed during the click. One of `left`, `right`, `wheel`, `back`, or `forward`.

            - `"left"`

            - `"right"`

            - `"wheel"`

            - `"back"`

            - `"forward"`

          - `type: "click"`

            Specifies the event type. For a click action, this property is always `click`.

            - `"click"`

          - `x: number`

            The x-coordinate where the click occurred.

          - `y: number`

            The y-coordinate where the click occurred.

          - `keys?: Array<string> | null`

            The keys being held while clicking.

        - `DoubleClick`

          A double click action.

          - `keys: Array<string> | null`

            The keys being held while double-clicking.

          - `type: "double_click"`

            Specifies the event type. For a double click action, this property is always set to `double_click`.

            - `"double_click"`

          - `x: number`

            The x-coordinate where the double click occurred.

          - `y: number`

            The y-coordinate where the double click occurred.

        - `Drag`

          A drag action.

          - `path: Array<Path>`

            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 }
            ]
            ```

            - `x: number`

              The x-coordinate.

            - `y: number`

              The y-coordinate.

          - `type: "drag"`

            Specifies the event type. For a drag action, this property is always set to `drag`.

            - `"drag"`

          - `keys?: Array<string> | null`

            The keys being held while dragging the mouse.

        - `Keypress`

          A collection of keypresses the model would like to perform.

          - `keys: Array<string>`

            The combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key.

          - `type: "keypress"`

            Specifies the event type. For a keypress action, this property is always set to `keypress`.

            - `"keypress"`

        - `Move`

          A mouse move action.

          - `type: "move"`

            Specifies the event type. For a move action, this property is always set to `move`.

            - `"move"`

          - `x: number`

            The x-coordinate to move to.

          - `y: number`

            The y-coordinate to move to.

          - `keys?: Array<string> | null`

            The keys being held while moving the mouse.

        - `Screenshot`

          A screenshot action.

          - `type: "screenshot"`

            Specifies the event type. For a screenshot action, this property is always set to `screenshot`.

            - `"screenshot"`

        - `Scroll`

          A scroll action.

          - `scroll_x: number`

            The horizontal scroll distance.

          - `scroll_y: number`

            The vertical scroll distance.

          - `type: "scroll"`

            Specifies the event type. For a scroll action, this property is always set to `scroll`.

            - `"scroll"`

          - `x: number`

            The x-coordinate where the scroll occurred.

          - `y: number`

            The y-coordinate where the scroll occurred.

          - `keys?: Array<string> | null`

            The keys being held while scrolling.

        - `Type`

          An action to type in text.

          - `text: string`

            The text to type.

          - `type: "type"`

            Specifies the event type. For a type action, this property is always set to `type`.

            - `"type"`

        - `Wait`

          A wait action.

          - `type: "wait"`

            Specifies the event type. For a wait action, this property is always set to `wait`.

            - `"wait"`

      - `actions?: BetaComputerActionList`

        Flattened batched actions for `computer_use`. Each action includes an
        `type` discriminator and action-specific fields.

        - `Click`

          A click action.

        - `DoubleClick`

          A double click action.

        - `Drag`

          A drag action.

        - `Keypress`

          A collection of keypresses the model would like to perform.

        - `Move`

          A mouse move action.

        - `Screenshot`

          A screenshot action.

        - `Scroll`

          A scroll action.

        - `Type`

          An action to type in text.

        - `Wait`

          A wait action.

      - `agent?: Agent | null`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

    - `ComputerCallOutput`

      The output of a computer tool call.

      - `call_id: string`

        The ID of the computer tool call that produced the output.

      - `output: BetaResponseComputerToolCallOutputScreenshot`

        A computer screenshot image used with the computer use tool.

        - `type: "computer_screenshot"`

          Specifies the event type. For a computer screenshot, this property is
          always set to `computer_screenshot`.

          - `"computer_screenshot"`

        - `file_id?: string`

          The identifier of an uploaded file that contains the screenshot.

        - `image_url?: string`

          The URL of the screenshot image.

      - `type: "computer_call_output"`

        The type of the computer tool call output. Always `computer_call_output`.

        - `"computer_call_output"`

      - `id?: string | null`

        The ID of the computer tool call output.

      - `acknowledged_safety_checks?: Array<AcknowledgedSafetyCheck> | null`

        The safety checks reported by the API that have been acknowledged by the developer.

        - `id: string`

          The ID of the pending safety check.

        - `code?: string | null`

          The type of the pending safety check.

        - `message?: string | null`

          Details about the pending safety check.

      - `agent?: Agent | null`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

      - `status?: "in_progress" | "completed" | "incomplete" | null`

        The status of the message input. One of `in_progress`, `completed`, or `incomplete`. Populated when input items are returned via API.

        - `"in_progress"`

        - `"completed"`

        - `"incomplete"`

    - `BetaResponseFunctionWebSearch`

      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.

      - `id: string`

        The unique ID of the web search tool call.

      - `action: Search | OpenPage | FindInPage`

        An object describing the specific action taken in this web search call.
        Includes details on how the model used the web (search, open_page, find_in_page).

        - `Search`

          Action type "search" - Performs a web search query.

          - `type: "search"`

            The action type.

            - `"search"`

          - `queries?: Array<string>`

            The search queries.

          - `query?: string`

            The search query.

          - `sources?: Array<Source>`

            The sources used in the search.

            - `type: "url"`

              The type of source. Always `url`.

              - `"url"`

            - `url: string`

              The URL of the source.

        - `OpenPage`

          Action type "open_page" - Opens a specific URL from search results.

          - `type: "open_page"`

            The action type.

            - `"open_page"`

          - `url?: string | null`

            The URL opened by the model.

        - `FindInPage`

          Action type "find_in_page": Searches for a pattern within a loaded page.

          - `pattern: string`

            The pattern or text to search for within the page.

          - `type: "find_in_page"`

            The action type.

            - `"find_in_page"`

          - `url: string`

            The URL of the page searched for the pattern.

      - `status: "in_progress" | "searching" | "completed" | "failed"`

        The status of the web search tool call.

        - `"in_progress"`

        - `"searching"`

        - `"completed"`

        - `"failed"`

      - `type: "web_search_call"`

        The type of the web search tool call. Always `web_search_call`.

        - `"web_search_call"`

      - `agent?: Agent | null`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

    - `BetaResponseFunctionToolCall`

      A tool call to run a function. See the
      [function calling guide](https://platform.openai.com/docs/guides/function-calling) for more information.

      - `arguments: string`

        A JSON string of the arguments to pass to the function.

      - `call_id: string`

        The unique ID of the function tool call generated by the model.

      - `name: string`

        The name of the function to run.

      - `type: "function_call"`

        The type of the function tool call. Always `function_call`.

        - `"function_call"`

      - `id?: string`

        The unique ID of the function tool call.

      - `agent?: Agent | null`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

      - `caller?: Direct | Program | null`

        The execution context that produced this tool call.

        - `Direct`

          - `type: "direct"`

            - `"direct"`

        - `Program`

          - `caller_id: string`

            The call ID of the program item that produced this tool call.

          - `type: "program"`

            - `"program"`

      - `namespace?: string`

        The namespace of the function to run.

      - `status?: "in_progress" | "completed" | "incomplete"`

        The status of the item. One of `in_progress`, `completed`, or
        `incomplete`. Populated when items are returned via API.

        - `"in_progress"`

        - `"completed"`

        - `"incomplete"`

    - `FunctionCallOutput`

      The output of a function tool call.

      - `call_id: string`

        The unique ID of the function tool call generated by the model.

      - `output: string | BetaResponseFunctionCallOutputItemList`

        Text, image, or file output of the function tool call.

        - `string`

        - `BetaResponseFunctionCallOutputItemList = Array<BetaResponseFunctionCallOutputItem>`

          An array of content outputs (text, image, file) for the function tool call.

          - `BetaResponseInputTextContent`

            A text input to the model.

            - `text: string`

              The text input to the model.

            - `type: "input_text"`

              The type of the input item. Always `input_text`.

              - `"input_text"`

            - `prompt_cache_breakpoint?: PromptCacheBreakpoint | null`

              Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.

              - `mode: "explicit"`

                The breakpoint mode. Always `explicit`.

                - `"explicit"`

          - `BetaResponseInputImageContent`

            An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision)

            - `type: "input_image"`

              The type of the input item. Always `input_image`.

              - `"input_image"`

            - `detail?: BetaImageDetail | null`

              The detail level of the image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`.

            - `file_id?: string | null`

              The ID of the file to be sent to the model.

            - `image_url?: string | null`

              The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.

            - `prompt_cache_breakpoint?: PromptCacheBreakpoint | null`

              Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.

              - `mode: "explicit"`

                The breakpoint mode. Always `explicit`.

                - `"explicit"`

          - `BetaResponseInputFileContent`

            A file input to the model.

            - `type: "input_file"`

              The type of the input item. Always `input_file`.

              - `"input_file"`

            - `detail?: "auto" | "low" | "high"`

              The detail level of the file to be sent to the model. Use `auto` to let the system select the detail level; for GPT-5.6 and later models, `auto` uses high-quality rendering, which may increase input token usage. Use `low` for lower-cost rendering, or `high` to render the file at higher quality. Defaults to `auto`.

              - `"auto"`

              - `"low"`

              - `"high"`

            - `file_data?: string | null`

              The base64-encoded data of the file to be sent to the model.

            - `file_id?: string | null`

              The ID of the file to be sent to the model.

            - `file_url?: string | null`

              The URL of the file to be sent to the model.

            - `filename?: string | null`

              The name of the file to be sent to the model.

            - `prompt_cache_breakpoint?: PromptCacheBreakpoint | null`

              Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.

              - `mode: "explicit"`

                The breakpoint mode. Always `explicit`.

                - `"explicit"`

      - `type: "function_call_output"`

        The type of the function tool call output. Always `function_call_output`.

        - `"function_call_output"`

      - `id?: string | null`

        The unique ID of the function tool call output. Populated when this item is returned via API.

      - `agent?: Agent | null`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

      - `caller?: Direct | Program | null`

        The execution context that produced this tool call.

        - `Direct`

          - `type: "direct"`

            The caller type. Always `direct`.

            - `"direct"`

        - `Program`

          - `caller_id: string`

            The call ID of the program item that produced this tool call.

          - `type: "program"`

            The caller type. Always `program`.

            - `"program"`

      - `name?: string | null`

        The name of the tool that produced the output.

      - `namespace?: string | null`

        The namespace of the tool that produced the output.

      - `status?: "in_progress" | "completed" | "incomplete" | null`

        The status of the item. One of `in_progress`, `completed`, or `incomplete`. Populated when items are returned via API.

        - `"in_progress"`

        - `"completed"`

        - `"incomplete"`

    - `AgentMessage`

      A message routed between agents.

      - `author: string`

        The sending agent identity.

      - `content: Array<BetaResponseInputTextContent | BetaResponseInputImageContent | EncryptedContent>`

        Plaintext, image, or encrypted content sent between agents.

        - `BetaResponseInputTextContent`

          A text input to the model.

        - `BetaResponseInputImageContent`

          An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision)

        - `EncryptedContent`

          Opaque encrypted content that Responses API decrypts inside trusted model execution.

          - `encrypted_content: string`

            Opaque encrypted content.

          - `type: "encrypted_content"`

            The type of the input item. Always `encrypted_content`.

            - `"encrypted_content"`

      - `recipient: string`

        The destination agent identity.

      - `type: "agent_message"`

        The item type. Always `agent_message`.

        - `"agent_message"`

      - `id?: string | null`

        The unique ID of this agent message item.

      - `agent?: Agent | null`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

    - `MultiAgentCall`

      - `action: "spawn_agent" | "interrupt_agent" | "list_agents" | 3 more`

        The multi-agent action that was executed.

        - `"spawn_agent"`

        - `"interrupt_agent"`

        - `"list_agents"`

        - `"send_message"`

        - `"followup_task"`

        - `"wait_agent"`

      - `arguments: string`

        The action arguments as a JSON string.

      - `call_id: string`

        The unique ID linking this call to its output.

      - `type: "multi_agent_call"`

        The item type. Always `multi_agent_call`.

        - `"multi_agent_call"`

      - `id?: string | null`

        The unique ID of this multi-agent call.

      - `agent?: Agent | null`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

    - `MultiAgentCallOutput`

      - `action: "spawn_agent" | "interrupt_agent" | "list_agents" | 3 more`

        The multi-agent action that produced this result.

        - `"spawn_agent"`

        - `"interrupt_agent"`

        - `"list_agents"`

        - `"send_message"`

        - `"followup_task"`

        - `"wait_agent"`

      - `call_id: string`

        The unique ID of the multi-agent call.

      - `output: Array<Output>`

        Text output returned by the multi-agent action.

        - `text: string`

          The text content.

        - `type: "output_text"`

          The content type. Always `output_text`.

          - `"output_text"`

        - `annotations?: Array<FileCitation | URLCitation | ContainerFileCitation>`

          Citations associated with the text content.

          - `FileCitation`

            - `file_id: string`

              The ID of the file.

            - `filename: string`

              The filename of the file cited.

            - `index: number`

              The index of the file in the list of files.

            - `type: "file_citation"`

              The citation type. Always `file_citation`.

              - `"file_citation"`

          - `URLCitation`

            - `end_index: number`

              The index of the last character of the citation in the message.

            - `start_index: number`

              The index of the first character of the citation in the message.

            - `title: string`

              The title of the cited resource.

            - `type: "url_citation"`

              The citation type. Always `url_citation`.

              - `"url_citation"`

            - `url: string`

              The URL of the cited resource.

          - `ContainerFileCitation`

            - `container_id: string`

              The ID of the container.

            - `end_index: number`

              The index of the last character of the citation in the message.

            - `file_id: string`

              The ID of the container file.

            - `filename: string`

              The filename of the container file cited.

            - `start_index: number`

              The index of the first character of the citation in the message.

            - `type: "container_file_citation"`

              The citation type. Always `container_file_citation`.

              - `"container_file_citation"`

      - `type: "multi_agent_call_output"`

        The item type. Always `multi_agent_call_output`.

        - `"multi_agent_call_output"`

      - `id?: string | null`

        The unique ID of this multi-agent call output.

      - `agent?: Agent | null`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

    - `ToolSearchCall`

      - `arguments: unknown`

        The arguments supplied to the tool search call.

      - `type: "tool_search_call"`

        The item type. Always `tool_search_call`.

        - `"tool_search_call"`

      - `id?: string | null`

        The unique ID of this tool search call.

      - `agent?: Agent | null`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

      - `call_id?: string | null`

        The unique ID of the tool search call generated by the model.

      - `execution?: "server" | "client"`

        Whether tool search was executed by the server or by the client.

        - `"server"`

        - `"client"`

      - `status?: "in_progress" | "completed" | "incomplete" | null`

        The status of the tool search call.

        - `"in_progress"`

        - `"completed"`

        - `"incomplete"`

    - `BetaResponseToolSearchOutputItemParam`

      - `tools: Array<BetaTool>`

        The loaded tool definitions returned by the tool search output.

        - `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).

          - `name: string`

            The name of the function to call.

          - `parameters: Record<string, unknown> | null`

            A JSON schema object describing the parameters of the function.

          - `strict: boolean | null`

            Whether strict parameter validation is enforced for this function tool.

          - `type: "function"`

            The type of the function tool. Always `function`.

            - `"function"`

          - `allowed_callers?: Array<"direct" | "programmatic"> | null`

            The tool invocation context(s).

            - `"direct"`

            - `"programmatic"`

          - `defer_loading?: boolean`

            Whether this function is deferred and loaded via tool search.

          - `description?: string | null`

            A description of the function. Used by the model to determine whether or not to call the function.

          - `output_schema?: Record<string, unknown> | null`

            A JSON schema object describing the JSON value encoded in string outputs for this function.

        - `BetaFileSearchTool`

          A tool that searches for relevant content from uploaded files. Learn more about the [file search tool](https://platform.openai.com/docs/guides/tools-file-search).

          - `type: "file_search"`

            The type of the file search tool. Always `file_search`.

            - `"file_search"`

          - `vector_store_ids: Array<string>`

            The IDs of the vector stores to search.

          - `filters?: ComparisonFilter | CompoundFilter | null`

            A filter to apply.

            - `ComparisonFilter`

              A filter used to compare a specified attribute key to a given value using a defined comparison operation.

              - `key: string`

                The key to compare against the value.

              - `type: "eq" | "ne" | "gt" | 5 more`

                Specifies the comparison operator: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`, `in`, `nin`.

                - `eq`: equals
                - `ne`: not equal
                - `gt`: greater than
                - `gte`: greater than or equal
                - `lt`: less than
                - `lte`: less than or equal
                - `in`: in
                - `nin`: not in

                - `"eq"`

                - `"ne"`

                - `"gt"`

                - `"gte"`

                - `"lt"`

                - `"lte"`

                - `"in"`

                - `"nin"`

              - `value: string | number | boolean | Array<string | number>`

                The value to compare against the attribute key; supports string, number, or boolean types.

                - `string`

                - `number`

                - `boolean`

                - `Array<string | number>`

                  - `string`

                  - `number`

            - `CompoundFilter`

              Combine multiple filters using `and` or `or`.

              - `filters: Array<ComparisonFilter | unknown>`

                Array of filters to combine. Items can be `ComparisonFilter` or `CompoundFilter`.

                - `ComparisonFilter`

                  A filter used to compare a specified attribute key to a given value using a defined comparison operation.

                  - `key: string`

                    The key to compare against the value.

                  - `type: "eq" | "ne" | "gt" | 5 more`

                    Specifies the comparison operator: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`, `in`, `nin`.

                    - `eq`: equals
                    - `ne`: not equal
                    - `gt`: greater than
                    - `gte`: greater than or equal
                    - `lt`: less than
                    - `lte`: less than or equal
                    - `in`: in
                    - `nin`: not in

                    - `"eq"`

                    - `"ne"`

                    - `"gt"`

                    - `"gte"`

                    - `"lt"`

                    - `"lte"`

                    - `"in"`

                    - `"nin"`

                  - `value: string | number | boolean | Array<string | number>`

                    The value to compare against the attribute key; supports string, number, or boolean types.

                    - `string`

                    - `number`

                    - `boolean`

                    - `Array<string | number>`

                      - `string`

                      - `number`

                - `unknown`

              - `type: "and" | "or"`

                Type of operation: `and` or `or`.

                - `"and"`

                - `"or"`

          - `max_num_results?: number`

            The maximum number of results to return. This number should be between 1 and 50 inclusive.

          - `ranking_options?: RankingOptions`

            Ranking options for search.

            - `hybrid_search?: HybridSearch`

              Weights that control how reciprocal rank fusion balances semantic embedding matches versus sparse keyword matches when hybrid search is enabled.

              - `embedding_weight: number`

                The weight of the embedding in the reciprocal ranking fusion.

              - `text_weight: number`

                The weight of the text in the reciprocal ranking fusion.

            - `ranker?: "auto" | "default-2024-11-15"`

              The ranker to use for the file search.

              - `"auto"`

              - `"default-2024-11-15"`

            - `score_threshold?: number`

              The score threshold for the file search, a number between 0 and 1. Numbers closer to 1 will attempt to return only the most relevant results, but may return fewer results.

        - `BetaComputerTool`

          A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use).

          - `type: "computer"`

            The type of the computer tool. Always `computer`.

            - `"computer"`

        - `BetaComputerUsePreviewTool`

          A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use).

          - `display_height: number`

            The height of the computer display.

          - `display_width: number`

            The width of the computer display.

          - `environment: "windows" | "mac" | "linux" | 2 more`

            The type of computer environment to control.

            - `"windows"`

            - `"mac"`

            - `"linux"`

            - `"ubuntu"`

            - `"browser"`

          - `type: "computer_use_preview"`

            The type of the computer use tool. Always `computer_use_preview`.

            - `"computer_use_preview"`

        - `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"`

            The type of the web search tool. One of `web_search` or `web_search_2025_08_26`.

            - `"web_search"`

            - `"web_search_2025_08_26"`

          - `external_web_access?: boolean`

            Allow live internet access for web search. Defaults to true when omitted. When false, the web search tool runs in offline/cache-only mode and will not fetch new external content.

          - `filters?: Filters | null`

            Filters for the search.

            - `allowed_domains?: Array<string> | null`

              Allowed domains for the search. If not provided, all domains are allowed.
              Subdomains of the provided domains are allowed as well.

              Example: `["pubmed.ncbi.nlm.nih.gov"]`

          - `search_context_size?: "low" | "medium" | "high"`

            High level guidance for the amount of context window space to use for the search. One of `low`, `medium`, or `high`. `medium` is the default.

            - `"low"`

            - `"medium"`

            - `"high"`

          - `user_location?: UserLocation | null`

            The approximate location of the user.

            - `city?: string | null`

              Free text input for the city of the user, e.g. `San Francisco`.

            - `country?: string | null`

              The two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of the user, e.g. `US`.

            - `region?: string | null`

              Free text input for the region of the user, e.g. `California`.

            - `timezone?: string | null`

              The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of the user, e.g. `America/Los_Angeles`.

            - `type?: "approximate"`

              The type of location approximation. Always `approximate`.

              - `"approximate"`

        - `Mcp`

          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).

          - `server_label: string`

            A label for this MCP server, used to identify it in tool calls.

          - `type: "mcp"`

            The type of the MCP tool. Always `mcp`.

            - `"mcp"`

          - `allowed_callers?: Array<"direct" | "programmatic"> | null`

            The tool invocation context(s).

            - `"direct"`

            - `"programmatic"`

          - `allowed_tools?: Array<string> | McpToolFilter | null`

            List of allowed tool names or a filter object.

            - `Array<string>`

            - `McpToolFilter`

              A filter object to specify which tools are allowed.

              - `read_only?: boolean`

                Indicates whether or not a tool modifies data or is read-only. If an
                MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint),
                it will match this filter.

              - `tool_names?: Array<string>`

                List of allowed tool names.

          - `authorization?: string`

            An OAuth access token that can be used with a remote MCP server, either
            with a custom MCP server URL or a service connector. Your application
            must handle the OAuth authorization flow and provide the token here.

          - `connector_id?: "connector_dropbox" | "connector_gmail" | "connector_googlecalendar" | 5 more`

            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`

            - `"connector_dropbox"`

            - `"connector_gmail"`

            - `"connector_googlecalendar"`

            - `"connector_googledrive"`

            - `"connector_microsoftteams"`

            - `"connector_outlookcalendar"`

            - `"connector_outlookemail"`

            - `"connector_sharepoint"`

          - `defer_loading?: boolean`

            Whether this MCP tool is deferred and discovered via tool search.

          - `headers?: Record<string, string> | null`

            Optional HTTP headers to send to the MCP server. Use for authentication
            or other purposes.

          - `require_approval?: McpToolApprovalFilter | "always" | "never" | null`

            Specify which of the MCP server's tools require approval.

            - `McpToolApprovalFilter`

              Specify which of the MCP server's tools require approval. Can be
              `always`, `never`, or a filter object associated with tools
              that require approval.

              - `always?: Always`

                A filter object to specify which tools are allowed.

                - `read_only?: boolean`

                  Indicates whether or not a tool modifies data or is read-only. If an
                  MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint),
                  it will match this filter.

                - `tool_names?: Array<string>`

                  List of allowed tool names.

              - `never?: Never`

                A filter object to specify which tools are allowed.

                - `read_only?: boolean`

                  Indicates whether or not a tool modifies data or is read-only. If an
                  MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint),
                  it will match this filter.

                - `tool_names?: Array<string>`

                  List of allowed tool names.

            - `"always" | "never"`

              - `"always"`

              - `"never"`

          - `server_description?: string`

            Optional description of the MCP server, used to provide more context.

          - `server_url?: string`

            The URL for the MCP server. One of `server_url`, `connector_id`, or
            `tunnel_id` must be provided.

          - `tunnel_id?: string`

            The Secure MCP Tunnel ID to use instead of a direct server URL. One of
            `server_url`, `connector_id`, or `tunnel_id` must be provided.

        - `CodeInterpreter`

          A tool that runs Python code to help generate a response to a prompt.

          - `container: string | CodeInterpreterToolAuto`

            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`

            - `CodeInterpreterToolAuto`

              Configuration for a code interpreter container. Optionally specify the IDs of the files to run the code on.

              - `type: "auto"`

                Always `auto`.

                - `"auto"`

              - `file_ids?: Array<string>`

                An optional list of uploaded files to make available to your code.

              - `memory_limit?: "1g" | "4g" | "16g" | "64g" | null`

                The memory limit for the code interpreter container.

                - `"1g"`

                - `"4g"`

                - `"16g"`

                - `"64g"`

              - `network_policy?: BetaContainerNetworkPolicyDisabled | BetaContainerNetworkPolicyAllowlist`

                Network access policy for the container.

                - `BetaContainerNetworkPolicyDisabled`

                  - `type: "disabled"`

                    Disable outbound network access. Always `disabled`.

                    - `"disabled"`

                - `BetaContainerNetworkPolicyAllowlist`

                  - `allowed_domains: Array<string>`

                    A list of allowed domains when type is `allowlist`.

                  - `type: "allowlist"`

                    Allow outbound network access only to specified domains. Always `allowlist`.

                    - `"allowlist"`

                  - `domain_secrets?: Array<BetaContainerNetworkPolicyDomainSecret>`

                    Optional domain-scoped secrets for allowlisted domains.

                    - `domain: string`

                      The domain associated with the secret.

                    - `name: string`

                      The name of the secret to inject for the domain.

                    - `value: string`

                      The secret value to inject for the domain.

          - `type: "code_interpreter"`

            The type of the code interpreter tool. Always `code_interpreter`.

            - `"code_interpreter"`

          - `allowed_callers?: Array<"direct" | "programmatic"> | null`

            The tool invocation context(s).

            - `"direct"`

            - `"programmatic"`

        - `ProgrammaticToolCalling`

          - `type: "programmatic_tool_calling"`

            The type of the tool. Always `programmatic_tool_calling`.

            - `"programmatic_tool_calling"`

        - `ImageGeneration`

          A tool that generates images using the GPT image models.

          - `type: "image_generation"`

            The type of the image generation tool. Always `image_generation`.

            - `"image_generation"`

          - `action?: "generate" | "edit" | "auto"`

            Whether to generate a new image or edit an existing image. Default: `auto`.

            - `"generate"`

            - `"edit"`

            - `"auto"`

          - `background?: "transparent" | "opaque" | "auto"`

            Allows to set transparency for the background of the generated image(s).
            Must be one of `transparent`, `opaque`, or `auto` (default value). When
            `auto` is used, the model will automatically determine the best
            background for the image.

            Transparent backgrounds are available for supported GPT Image models.
            For `gpt-image-2` and `gpt-image-2-2026-04-21`, this support is in
            preview. When using `transparent`, set the output format to `png` or
            `webp`.

            - `"transparent"`

            - `"opaque"`

            - `"auto"`

          - `input_fidelity?: "high" | "low" | null`

            Control how much effort the model will exert to match the style and features, especially facial features, of input images. This parameter is only supported for `gpt-image-1` and `gpt-image-1.5` and later models, unsupported for `gpt-image-1-mini`. Supports `high` and `low`. Defaults to `low`.

            - `"high"`

            - `"low"`

          - `input_image_mask?: InputImageMask`

            Optional mask for inpainting. Contains `image_url`
            (string, optional) and `file_id` (string, optional).

            - `file_id?: string`

              File ID for the mask image.

            - `image_url?: string`

              Base64-encoded mask image.

          - `model?: (string & {}) | "gpt-image-1" | "gpt-image-1-mini" | "gpt-image-2" | 3 more`

            The image generation model to use. One of `gpt-image-1`,
            `gpt-image-1-mini`, `gpt-image-1.5`, `gpt-image-2`,
            `gpt-image-2-2026-04-21`, or `chatgpt-image-latest`. Default:
            `gpt-image-1`.

            - `(string & {})`

            - `"gpt-image-1" | "gpt-image-1-mini" | "gpt-image-2" | 3 more`

              - `"gpt-image-1"`

              - `"gpt-image-1-mini"`

              - `"gpt-image-2"`

              - `"gpt-image-2-2026-04-21"`

              - `"gpt-image-1.5"`

              - `"chatgpt-image-latest"`

          - `moderation?: "auto" | "low"`

            Moderation level for the generated image. Default: `auto`.

            - `"auto"`

            - `"low"`

          - `output_compression?: number`

            Compression level for the output image. Default: 100.

          - `output_format?: "png" | "webp" | "jpeg"`

            The output format of the generated image. One of `png`, `webp`, or
            `jpeg`. Default: `png`.

            - `"png"`

            - `"webp"`

            - `"jpeg"`

          - `partial_images?: number`

            Number of partial images to generate in streaming mode, from 0 (default value) to 3.

          - `quality?: "low" | "medium" | "high" | "auto"`

            The quality of the generated image. One of `low`, `medium`, `high`,
            or `auto`. Default: `auto`.

            - `"low"`

            - `"medium"`

            - `"high"`

            - `"auto"`

          - `size?: (string & {}) | "1024x1024" | "1024x1536" | "1536x1024" | "auto"`

            The size of the generated images. For `gpt-image-2` and `gpt-image-2-2026-04-21`, arbitrary resolutions are supported as `WIDTHxHEIGHT` strings, for example `1536x864`. Width and height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above `2560x1440` are experimental, and the maximum supported resolution is `3840x2160`. The requested size must also satisfy the model's current pixel and edge limits. The standard sizes `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models; `auto` is supported for models that allow automatic sizing. For `dall-e-2`, use one of `256x256`, `512x512`, or `1024x1024`. For `dall-e-3`, use one of `1024x1024`, `1792x1024`, or `1024x1792`.

            - `(string & {})`

            - `"1024x1024" | "1024x1536" | "1536x1024" | "auto"`

              - `"1024x1024"`

              - `"1024x1536"`

              - `"1536x1024"`

              - `"auto"`

        - `LocalShell`

          A tool that allows the model to execute shell commands in a local environment.

          - `type: "local_shell"`

            The type of the local shell tool. Always `local_shell`.

            - `"local_shell"`

        - `BetaFunctionShellTool`

          A tool that allows the model to execute shell commands.

          - `type: "shell"`

            The type of the shell tool. Always `shell`.

            - `"shell"`

          - `allowed_callers?: Array<"direct" | "programmatic"> | null`

            The tool invocation context(s).

            - `"direct"`

            - `"programmatic"`

          - `environment?: BetaContainerAuto | BetaLocalEnvironment | BetaContainerReference | null`

            - `BetaContainerAuto`

              - `type: "container_auto"`

                Automatically creates a container for this request

                - `"container_auto"`

              - `file_ids?: Array<string>`

                An optional list of uploaded files to make available to your code.

              - `memory_limit?: "1g" | "4g" | "16g" | "64g" | null`

                The memory limit for the container.

                - `"1g"`

                - `"4g"`

                - `"16g"`

                - `"64g"`

              - `network_policy?: BetaContainerNetworkPolicyDisabled | BetaContainerNetworkPolicyAllowlist`

                Network access policy for the container.

                - `BetaContainerNetworkPolicyDisabled`

                - `BetaContainerNetworkPolicyAllowlist`

              - `skills?: Array<BetaSkillReference | BetaInlineSkill>`

                An optional list of skills referenced by id or inline data.

                - `BetaSkillReference`

                  - `skill_id: string`

                    The ID of the referenced skill.

                  - `type: "skill_reference"`

                    References a skill created with the /v1/skills endpoint.

                    - `"skill_reference"`

                  - `version?: string`

                    Optional skill version. Use a positive integer or 'latest'. Omit for default.

                - `BetaInlineSkill`

                  - `description: string`

                    The description of the skill.

                  - `name: string`

                    The name of the skill.

                  - `source: BetaInlineSkillSource`

                    Inline skill payload

                    - `data: string`

                      Base64-encoded skill zip bundle.

                    - `media_type: "application/zip"`

                      The media type of the inline skill payload. Must be `application/zip`.

                      - `"application/zip"`

                    - `type: "base64"`

                      The type of the inline skill source. Must be `base64`.

                      - `"base64"`

                  - `type: "inline"`

                    Defines an inline skill for this request.

                    - `"inline"`

            - `BetaLocalEnvironment`

              - `type: "local"`

                Use a local computer environment.

                - `"local"`

              - `skills?: Array<BetaLocalSkill>`

                An optional list of skills.

                - `description: string`

                  The description of the skill.

                - `name: string`

                  The name of the skill.

                - `path: string`

                  The path to the directory containing the skill.

            - `BetaContainerReference`

              - `container_id: string`

                The ID of the referenced container.

              - `type: "container_reference"`

                References a container created with the /v1/containers endpoint

                - `"container_reference"`

        - `BetaCustomTool`

          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)

          - `name: string`

            The name of the custom tool, used to identify it in tool calls.

          - `type: "custom"`

            The type of the custom tool. Always `custom`.

            - `"custom"`

          - `allowed_callers?: Array<"direct" | "programmatic"> | null`

            The tool invocation context(s).

            - `"direct"`

            - `"programmatic"`

          - `defer_loading?: boolean`

            Whether this tool should be deferred and discovered via tool search.

          - `description?: string`

            Optional description of the custom tool, used to provide more context.

          - `format?: Text | Grammar`

            The input format for the custom tool. Default is unconstrained text.

            - `Text`

              Unconstrained free-form text.

              - `type: "text"`

                Unconstrained text format. Always `text`.

                - `"text"`

            - `Grammar`

              A grammar defined by the user.

              - `definition: string`

                The grammar definition.

              - `syntax: "lark" | "regex"`

                The syntax of the grammar definition. One of `lark` or `regex`.

                - `"lark"`

                - `"regex"`

              - `type: "grammar"`

                Grammar format. Always `grammar`.

                - `"grammar"`

        - `BetaNamespaceTool`

          Groups function/custom tools under a shared namespace.

          - `description: string`

            A description of the namespace shown to the model.

          - `name: string`

            The namespace name used in tool calls (for example, `crm`).

          - `tools: Array<Function | BetaCustomTool>`

            The function/custom tools available inside this namespace.

            - `Function`

              - `name: string`

              - `type: "function"`

                - `"function"`

              - `allowed_callers?: Array<"direct" | "programmatic"> | null`

                The tool invocation context(s).

                - `"direct"`

                - `"programmatic"`

              - `defer_loading?: boolean`

                Whether this function should be deferred and discovered via tool search.

              - `description?: string | null`

              - `output_schema?: Record<string, unknown> | null`

                A JSON Schema describing the JSON value encoded in string outputs for this function tool. This does not describe content-array outputs.

              - `parameters?: unknown`

              - `strict?: boolean | null`

                Whether to enforce strict parameter validation. If omitted, Responses attempts to use strict validation when the schema is compatible, and falls back to non-strict validation otherwise.

            - `BetaCustomTool`

              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: "namespace"`

            The type of the tool. Always `namespace`.

            - `"namespace"`

        - `BetaToolSearchTool`

          Hosted or BYOT tool search configuration for deferred tools.

          - `type: "tool_search"`

            The type of the tool. Always `tool_search`.

            - `"tool_search"`

          - `description?: string | null`

            Description shown to the model for a client-executed tool search tool.

          - `execution?: "server" | "client"`

            Whether tool search is executed by the server or by the client.

            - `"server"`

            - `"client"`

          - `parameters?: unknown`

            Parameter schema for a client-executed tool search tool.

        - `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"`

            The type of the web search tool. One of `web_search_preview` or `web_search_preview_2025_03_11`.

            - `"web_search_preview"`

            - `"web_search_preview_2025_03_11"`

          - `search_content_types?: Array<"text" | "image">`

            - `"text"`

            - `"image"`

          - `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.

            - `"low"`

            - `"medium"`

            - `"high"`

          - `user_location?: UserLocation | null`

            The user's location.

            - `type: "approximate"`

              The type of location approximation. Always `approximate`.

              - `"approximate"`

            - `city?: string | null`

              Free text input for the city of the user, e.g. `San Francisco`.

            - `country?: string | null`

              The two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of the user, e.g. `US`.

            - `region?: string | null`

              Free text input for the region of the user, e.g. `California`.

            - `timezone?: string | null`

              The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of the user, e.g. `America/Los_Angeles`.

        - `BetaApplyPatchTool`

          Allows the assistant to create, delete, or update files using unified diffs.

          - `type: "apply_patch"`

            The type of the tool. Always `apply_patch`.

            - `"apply_patch"`

          - `allowed_callers?: Array<"direct" | "programmatic"> | null`

            The tool invocation context(s).

            - `"direct"`

            - `"programmatic"`

      - `type: "tool_search_output"`

        The item type. Always `tool_search_output`.

        - `"tool_search_output"`

      - `id?: string | null`

        The unique ID of this tool search output.

      - `agent?: Agent | null`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

      - `call_id?: string | null`

        The unique ID of the tool search call generated by the model.

      - `execution?: "server" | "client"`

        Whether tool search was executed by the server or by the client.

        - `"server"`

        - `"client"`

      - `status?: "in_progress" | "completed" | "incomplete" | null`

        The status of the tool search output.

        - `"in_progress"`

        - `"completed"`

        - `"incomplete"`

    - `AdditionalTools`

      - `role: "developer"`

        The role that provided the additional tools. Only `developer` is supported.

        - `"developer"`

      - `tools: Array<BetaTool>`

        A list of additional tools made available at this item.

        - `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).

        - `Mcp`

          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).

        - `CodeInterpreter`

          A tool that runs Python code to help generate a response to a prompt.

        - `ProgrammaticToolCalling`

        - `ImageGeneration`

          A tool that generates images using the GPT image models.

        - `LocalShell`

          A tool that allows the model to execute shell commands in a local environment.

        - `BetaFunctionShellTool`

          A tool that allows the model to execute shell commands.

        - `BetaCustomTool`

          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)

        - `BetaNamespaceTool`

          Groups function/custom tools under a shared namespace.

        - `BetaToolSearchTool`

          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).

        - `BetaApplyPatchTool`

          Allows the assistant to create, delete, or update files using unified diffs.

      - `type: "additional_tools"`

        The item type. Always `additional_tools`.

        - `"additional_tools"`

      - `id?: string | null`

        The unique ID of this additional tools item.

      - `agent?: Agent | null`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

    - `BetaResponseReasoningItem`

      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).

      - `id: string`

        The unique identifier of the reasoning content.

      - `summary: Array<Summary>`

        Reasoning summary content.

        - `text: string`

          A summary of the reasoning output from the model so far.

        - `type: "summary_text"`

          The type of the object. Always `summary_text`.

          - `"summary_text"`

      - `type: "reasoning"`

        The type of the object. Always `reasoning`.

        - `"reasoning"`

      - `agent?: Agent | null`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

      - `content?: Array<Content>`

        Reasoning text content.

        - `text: string`

          The reasoning text from the model.

        - `type: "reasoning_text"`

          The type of the reasoning text. Always `reasoning_text`.

          - `"reasoning_text"`

      - `encrypted_content?: string | null`

        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.

        When streaming, use the completed reasoning item and its
        `encrypted_content` from the `response.output_item.done` event in
        subsequent requests. The `encrypted_content` in
        `response.output_item.added` may be incomplete. This is especially
        important when `store` is `false` or when using Zero Data Retention.

      - `status?: "in_progress" | "completed" | "incomplete"`

        The status of the item. One of `in_progress`, `completed`, or
        `incomplete`. Populated when items are returned via API.

        - `"in_progress"`

        - `"completed"`

        - `"incomplete"`

    - `BetaResponseCompactionItemParam`

      A compaction item generated by the [`v1/responses/compact` API](https://platform.openai.com/docs/api-reference/responses/compact).

      - `encrypted_content: string`

        The encrypted content of the compaction summary.

      - `type: "compaction"`

        The type of the item. Always `compaction`.

        - `"compaction"`

      - `id?: string | null`

        The ID of the compaction item.

      - `agent?: Agent | null`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

    - `ImageGenerationCall`

      An image generation request made by the model.

      - `id: string`

        The unique ID of the image generation call.

      - `result: string | null`

        The generated image encoded in base64.

      - `status: "in_progress" | "completed" | "generating" | "failed"`

        The status of the image generation call.

        - `"in_progress"`

        - `"completed"`

        - `"generating"`

        - `"failed"`

      - `type: "image_generation_call"`

        The type of the image generation call. Always `image_generation_call`.

        - `"image_generation_call"`

      - `agent?: Agent | null`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

    - `BetaResponseCodeInterpreterToolCall`

      A tool call to run code.

      - `id: string`

        The unique ID of the code interpreter tool call.

      - `code: string | null`

        The code to run, or null if not available.

      - `container_id: string`

        The ID of the container used to run the code.

      - `outputs: Array<Logs | Image> | null`

        The outputs generated by the code interpreter, such as logs or images.
        Can be null if no outputs are available.

        - `Logs`

          The logs output from the code interpreter.

          - `logs: string`

            The logs output from the code interpreter.

          - `type: "logs"`

            The type of the output. Always `logs`.

            - `"logs"`

        - `Image`

          The image output from the code interpreter.

          - `type: "image"`

            The type of the output. Always `image`.

            - `"image"`

          - `url: string`

            The URL of the image output from the code interpreter.

      - `status: "in_progress" | "completed" | "incomplete" | 2 more`

        The status of the code interpreter tool call. Valid values are `in_progress`, `completed`, `incomplete`, `interpreting`, and `failed`.

        - `"in_progress"`

        - `"completed"`

        - `"incomplete"`

        - `"interpreting"`

        - `"failed"`

      - `type: "code_interpreter_call"`

        The type of the code interpreter tool call. Always `code_interpreter_call`.

        - `"code_interpreter_call"`

      - `agent?: Agent | null`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

    - `LocalShellCall`

      A tool call to run a command on the local shell.

      - `id: string`

        The unique ID of the local shell call.

      - `action: Action`

        Execute a shell command on the server.

        - `command: Array<string>`

          The command to run.

        - `env: Record<string, string>`

          Environment variables to set for the command.

        - `type: "exec"`

          The type of the local shell action. Always `exec`.

          - `"exec"`

        - `timeout_ms?: number | null`

          Optional timeout in milliseconds for the command.

        - `user?: string | null`

          Optional user to run the command as.

        - `working_directory?: string | null`

          Optional working directory to run the command in.

      - `call_id: string`

        The unique ID of the local shell tool call generated by the model.

      - `status: "in_progress" | "completed" | "incomplete"`

        The status of the local shell call.

        - `"in_progress"`

        - `"completed"`

        - `"incomplete"`

      - `type: "local_shell_call"`

        The type of the local shell call. Always `local_shell_call`.

        - `"local_shell_call"`

      - `agent?: Agent | null`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

    - `LocalShellCallOutput`

      The output of a local shell tool call.

      - `id: string`

        The unique ID of the local shell tool call generated by the model.

      - `output: string`

        A JSON string of the output of the local shell tool call.

      - `type: "local_shell_call_output"`

        The type of the local shell tool call output. Always `local_shell_call_output`.

        - `"local_shell_call_output"`

      - `agent?: Agent | null`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

      - `status?: "in_progress" | "completed" | "incomplete" | null`

        The status of the item. One of `in_progress`, `completed`, or `incomplete`.

        - `"in_progress"`

        - `"completed"`

        - `"incomplete"`

    - `ShellCall`

      A tool representing a request to execute one or more shell commands.

      - `action: Action`

        The shell commands and limits that describe how to run the tool call.

        - `commands: Array<string>`

          Ordered shell commands for the execution environment to run.

        - `max_output_length?: number | null`

          Maximum number of UTF-8 characters to capture from combined stdout and stderr output.

        - `timeout_ms?: number | null`

          Maximum wall-clock time in milliseconds to allow the shell commands to run.

      - `call_id: string`

        The unique ID of the shell tool call generated by the model.

      - `type: "shell_call"`

        The type of the item. Always `shell_call`.

        - `"shell_call"`

      - `id?: string | null`

        The unique ID of the shell tool call. Populated when this item is returned via API.

      - `agent?: Agent | null`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

      - `caller?: Direct | Program | null`

        The execution context that produced this tool call.

        - `Direct`

          - `type: "direct"`

            The caller type. Always `direct`.

            - `"direct"`

        - `Program`

          - `caller_id: string`

            The call ID of the program item that produced this tool call.

          - `type: "program"`

            The caller type. Always `program`.

            - `"program"`

      - `environment?: BetaLocalEnvironment | BetaContainerReference | null`

        The environment to execute the shell commands in.

        - `BetaLocalEnvironment`

        - `BetaContainerReference`

      - `status?: "in_progress" | "completed" | "incomplete" | null`

        The status of the shell call. One of `in_progress`, `completed`, or `incomplete`.

        - `"in_progress"`

        - `"completed"`

        - `"incomplete"`

    - `ShellCallOutput`

      The streamed output items emitted by a shell tool call.

      - `call_id: string`

        The unique ID of the shell tool call generated by the model.

      - `output: Array<BetaResponseFunctionShellCallOutputContent>`

        Captured chunks of stdout and stderr output, along with their associated outcomes.

        - `outcome: Timeout | Exit`

          The exit or timeout outcome associated with this shell call.

          - `Timeout`

            Indicates that the shell call exceeded its configured time limit.

            - `type: "timeout"`

              The outcome type. Always `timeout`.

              - `"timeout"`

          - `Exit`

            Indicates that the shell commands finished and returned an exit code.

            - `exit_code: number`

              The exit code returned by the shell process.

            - `type: "exit"`

              The outcome type. Always `exit`.

              - `"exit"`

        - `stderr: string`

          Captured stderr output for the shell call.

        - `stdout: string`

          Captured stdout output for the shell call.

      - `type: "shell_call_output"`

        The type of the item. Always `shell_call_output`.

        - `"shell_call_output"`

      - `id?: string | null`

        The unique ID of the shell tool call output. Populated when this item is returned via API.

      - `agent?: Agent | null`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

      - `caller?: Direct | Program | null`

        The execution context that produced this tool call.

        - `Direct`

          - `type: "direct"`

            The caller type. Always `direct`.

            - `"direct"`

        - `Program`

          - `caller_id: string`

            The call ID of the program item that produced this tool call.

          - `type: "program"`

            The caller type. Always `program`.

            - `"program"`

      - `max_output_length?: number | null`

        The maximum number of UTF-8 characters captured for this shell call's combined output.

      - `status?: "in_progress" | "completed" | "incomplete" | null`

        The status of the shell call output.

        - `"in_progress"`

        - `"completed"`

        - `"incomplete"`

    - `ApplyPatchCall`

      A tool call representing a request to create, delete, or update files using diff patches.

      - `call_id: string`

        The unique ID of the apply patch tool call generated by the model.

      - `operation: CreateFile | DeleteFile | UpdateFile`

        The specific create, delete, or update instruction for the apply_patch tool call.

        - `CreateFile`

          Instruction for creating a new file via the apply_patch tool.

          - `diff: string`

            Unified diff content to apply when creating the file.

          - `path: string`

            Path of the file to create relative to the workspace root.

          - `type: "create_file"`

            The operation type. Always `create_file`.

            - `"create_file"`

        - `DeleteFile`

          Instruction for deleting an existing file via the apply_patch tool.

          - `path: string`

            Path of the file to delete relative to the workspace root.

          - `type: "delete_file"`

            The operation type. Always `delete_file`.

            - `"delete_file"`

        - `UpdateFile`

          Instruction for updating an existing file via the apply_patch tool.

          - `diff: string`

            Unified diff content to apply to the existing file.

          - `path: string`

            Path of the file to update relative to the workspace root.

          - `type: "update_file"`

            The operation type. Always `update_file`.

            - `"update_file"`

      - `status: "in_progress" | "completed"`

        The status of the apply patch tool call. One of `in_progress` or `completed`.

        - `"in_progress"`

        - `"completed"`

      - `type: "apply_patch_call"`

        The type of the item. Always `apply_patch_call`.

        - `"apply_patch_call"`

      - `id?: string | null`

        The unique ID of the apply patch tool call. Populated when this item is returned via API.

      - `agent?: Agent | null`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

      - `caller?: Direct | Program | null`

        The execution context that produced this tool call.

        - `Direct`

          - `type: "direct"`

            The caller type. Always `direct`.

            - `"direct"`

        - `Program`

          - `caller_id: string`

            The call ID of the program item that produced this tool call.

          - `type: "program"`

            The caller type. Always `program`.

            - `"program"`

    - `ApplyPatchCallOutput`

      The streamed output emitted by an apply patch tool call.

      - `call_id: string`

        The unique ID of the apply patch tool call generated by the model.

      - `status: "completed" | "failed"`

        The status of the apply patch tool call output. One of `completed` or `failed`.

        - `"completed"`

        - `"failed"`

      - `type: "apply_patch_call_output"`

        The type of the item. Always `apply_patch_call_output`.

        - `"apply_patch_call_output"`

      - `id?: string | null`

        The unique ID of the apply patch tool call output. Populated when this item is returned via API.

      - `agent?: Agent | null`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

      - `caller?: Direct | Program | null`

        The execution context that produced this tool call.

        - `Direct`

          - `type: "direct"`

            The caller type. Always `direct`.

            - `"direct"`

        - `Program`

          - `caller_id: string`

            The call ID of the program item that produced this tool call.

          - `type: "program"`

            The caller type. Always `program`.

            - `"program"`

      - `output?: string | null`

        Optional human-readable log text from the apply patch tool (e.g., patch results or errors).

    - `McpListTools`

      A list of tools available on an MCP server.

      - `id: string`

        The unique ID of the list.

      - `server_label: string`

        The label of the MCP server.

      - `tools: Array<Tool>`

        The tools available on the server.

        - `input_schema: unknown`

          The JSON schema describing the tool's input.

        - `name: string`

          The name of the tool.

        - `annotations?: unknown`

          Additional annotations about the tool.

        - `description?: string | null`

          The description of the tool.

      - `type: "mcp_list_tools"`

        The type of the item. Always `mcp_list_tools`.

        - `"mcp_list_tools"`

      - `agent?: Agent | null`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

      - `error?: string | null`

        Error message if the server could not list tools.

    - `McpApprovalRequest`

      A request for human approval of a tool invocation.

      - `id: string`

        The unique ID of the approval request.

      - `arguments: string`

        A JSON string of arguments for the tool.

      - `name: string`

        The name of the tool to run.

      - `server_label: string`

        The label of the MCP server making the request.

      - `type: "mcp_approval_request"`

        The type of the item. Always `mcp_approval_request`.

        - `"mcp_approval_request"`

      - `agent?: Agent | null`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

    - `McpApprovalResponse`

      A response to an MCP approval request.

      - `approval_request_id: string`

        The ID of the approval request being answered.

      - `approve: boolean`

        Whether the request was approved.

      - `type: "mcp_approval_response"`

        The type of the item. Always `mcp_approval_response`.

        - `"mcp_approval_response"`

      - `id?: string | null`

        The unique ID of the approval response

      - `agent?: Agent | null`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

      - `reason?: string | null`

        Optional reason for the decision.

    - `McpCall`

      An invocation of a tool on an MCP server.

      - `id: string`

        The unique ID of the tool call.

      - `arguments: string`

        A JSON string of the arguments passed to the tool.

      - `name: string`

        The name of the tool that was run.

      - `server_label: string`

        The label of the MCP server running the tool.

      - `type: "mcp_call"`

        The type of the item. Always `mcp_call`.

        - `"mcp_call"`

      - `agent?: Agent | null`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

      - `approval_request_id?: string | null`

        Unique identifier for the MCP tool call approval request.
        Include this value in a subsequent `mcp_approval_response` input to approve or reject the corresponding tool call.

      - `error?: BetaMcpToolCallError | null`

        The error from the tool call, if any.

        - `McpProtocolError`

          - `code: number`

          - `message: string`

          - `type: "mcp_protocol_error"`

            - `"mcp_protocol_error"`

        - `McpToolExecutionError`

          - `content: unknown`

          - `type: "mcp_tool_execution_error"`

            - `"mcp_tool_execution_error"`

        - `HTTPError`

          - `code: number`

          - `message: string`

          - `type: "http_error"`

            - `"http_error"`

      - `output?: string | null`

        The output from the tool call.

      - `status?: "in_progress" | "completed" | "incomplete" | 2 more`

        The status of the tool call. One of `in_progress`, `completed`, `incomplete`, `calling`, or `failed`.

        - `"in_progress"`

        - `"completed"`

        - `"incomplete"`

        - `"calling"`

        - `"failed"`

    - `BetaResponseCustomToolCallOutput`

      The output of a custom tool call from your code, being sent back to the model.

      - `call_id: string`

        The call ID, used to map this custom tool call output to a custom tool call.

      - `output: string | Array<BetaResponseInputText | BetaResponseInputImage | BetaResponseInputFile>`

        The output from the custom tool call generated by your code.
        Can be a string or an list of output content.

        - `string`

        - `Array<BetaResponseInputText | BetaResponseInputImage | BetaResponseInputFile>`

          - `BetaResponseInputText`

            A text input to the model.

          - `BetaResponseInputImage`

            An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision).

          - `BetaResponseInputFile`

            A file input to the model.

      - `type: "custom_tool_call_output"`

        The type of the custom tool call output. Always `custom_tool_call_output`.

        - `"custom_tool_call_output"`

      - `id?: string`

        The unique ID of the custom tool call output in the OpenAI platform.

      - `agent?: Agent | null`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

      - `caller?: Direct | Program | null`

        The execution context that produced this tool call.

        - `Direct`

          - `type: "direct"`

            The caller type. Always `direct`.

            - `"direct"`

        - `Program`

          - `caller_id: string`

            The call ID of the program item that produced this tool call.

          - `type: "program"`

            The caller type. Always `program`.

            - `"program"`

    - `BetaResponseCustomToolCall`

      A call to a custom tool created by the model.

      - `call_id: string`

        An identifier used to map this custom tool call to a tool call output.

      - `input: string`

        The input for the custom tool call generated by the model.

      - `name: string`

        The name of the custom tool being called.

      - `type: "custom_tool_call"`

        The type of the custom tool call. Always `custom_tool_call`.

        - `"custom_tool_call"`

      - `id?: string`

        The unique ID of the custom tool call in the OpenAI platform.

      - `agent?: Agent | null`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

      - `caller?: Direct | Program | null`

        The execution context that produced this tool call.

        - `Direct`

          - `type: "direct"`

            - `"direct"`

        - `Program`

          - `caller_id: string`

            The call ID of the program item that produced this tool call.

          - `type: "program"`

            - `"program"`

      - `namespace?: string`

        The namespace of the custom tool being called.

    - `CompactionTrigger`

      Compacts the current context. Must be the final input item.

      - `type: "compaction_trigger"`

        The type of the item. Always `compaction_trigger`.

        - `"compaction_trigger"`

      - `agent?: Agent | null`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

    - `ItemReference`

      An internal identifier for an item to reference.

      - `id: string`

        The ID of the item to reference.

      - `agent?: Agent | null`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

      - `type?: "item_reference" | null`

        The type of item to reference. Always `item_reference`.

        - `"item_reference"`

    - `Program`

      - `id: string`

        The unique ID of this program item.

      - `call_id: string`

        The stable call ID of the program item.

      - `code: string`

        The JavaScript source executed by programmatic tool calling.

      - `fingerprint: string`

        Opaque program replay fingerprint that must be round-tripped.

      - `type: "program"`

        The item type. Always `program`.

        - `"program"`

      - `agent?: Agent | null`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

    - `ProgramOutput`

      - `id: string`

        The unique ID of this program output item.

      - `call_id: string`

        The call ID of the program item.

      - `result: string`

        The result produced by the program item.

      - `status: "completed" | "incomplete"`

        The terminal status of the program output.

        - `"completed"`

        - `"incomplete"`

      - `type: "program_output"`

        The item type. Always `program_output`.

        - `"program_output"`

      - `agent?: Agent | null`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

  - `response_id: string`

    The ID of the response that rejected the input.

  - `sequence_number: number`

    The sequence number for this event.

  - `type: "response.inject.failed"`

    The event discriminator. Always `response.inject.failed`.

    - `"response.inject.failed"`

  - `stream_id?: string`

    The multiplexed WebSocket stream that emitted the event. This field is
    present only when WebSocket multiplexing is enabled separately.

### Beta Response Input

- `BetaResponseInput = Array<BetaResponseInputItem>`

  A list of one or many input items to the model, containing
  different content types.

  - `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.

    - `content: string | BetaResponseInputMessageContentList`

      Text, image, or audio input to the model, used to generate a response.
      Can also contain previous assistant responses.

      - `string`

      - `BetaResponseInputMessageContentList = Array<BetaResponseInputContent>`

        A list of one or many input items to the model, containing different content
        types.

        - `BetaResponseInputText`

          A text input to the model.

          - `text: string`

            The text input to the model.

          - `type: "input_text"`

            The type of the input item. Always `input_text`.

            - `"input_text"`

          - `prompt_cache_breakpoint?: PromptCacheBreakpoint`

            Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.

            - `mode: "explicit"`

              The breakpoint mode. Always `explicit`.

              - `"explicit"`

        - `BetaResponseInputImage`

          An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision).

          - `detail: BetaImageDetail`

            The detail level of the image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`.

            - `"low"`

            - `"high"`

            - `"auto"`

            - `"original"`

          - `type: "input_image"`

            The type of the input item. Always `input_image`.

            - `"input_image"`

          - `file_id?: string | null`

            The ID of the file to be sent to the model.

          - `image_url?: string | null`

            The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.

          - `prompt_cache_breakpoint?: PromptCacheBreakpoint`

            Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.

            - `mode: "explicit"`

              The breakpoint mode. Always `explicit`.

              - `"explicit"`

        - `BetaResponseInputFile`

          A file input to the model.

          - `type: "input_file"`

            The type of the input item. Always `input_file`.

            - `"input_file"`

          - `detail?: "auto" | "low" | "high"`

            The detail level of the file to be sent to the model. Use `auto` to let the system select the detail level; for GPT-5.6 and later models, `auto` uses high-quality rendering, which may increase input token usage. Use `low` for lower-cost rendering, or `high` to render the file at higher quality. Defaults to `auto`.

            - `"auto"`

            - `"low"`

            - `"high"`

          - `file_data?: string`

            The content of the file to be sent to the model.

          - `file_id?: string | null`

            The ID of the file to be sent to the model.

          - `file_url?: string`

            The URL of the file to be sent to the model.

          - `filename?: string`

            The name of the file to be sent to the model.

          - `prompt_cache_breakpoint?: PromptCacheBreakpoint`

            Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.

            - `mode: "explicit"`

              The breakpoint mode. Always `explicit`.

              - `"explicit"`

    - `role: "user" | "assistant" | "system" | "developer"`

      The role of the message input. One of `user`, `assistant`, `system`, or
      `developer`.

      - `"user"`

      - `"assistant"`

      - `"system"`

      - `"developer"`

    - `phase?: "commentary" | "final_answer" | null`

      Labels an `assistant` message as intermediate commentary (`commentary`) or the final answer (`final_answer`).
      For models like `gpt-5.3-codex` and beyond, when sending follow-up requests, preserve and resend
      phase on all assistant messages — dropping it can degrade performance. Not used for user messages.

      - `"commentary"`

      - `"final_answer"`

    - `type?: "message"`

      The type of the message input. Always `message`.

      - `"message"`

  - `Message`

    A message input to the model with a role indicating instruction following
    hierarchy. Instructions given with the `developer` or `system` role take
    precedence over instructions given with the `user` role.

    - `content: BetaResponseInputMessageContentList`

      A list of one or many input items to the model, containing different content
      types.

    - `role: "user" | "system" | "developer"`

      The role of the message input. One of `user`, `system`, or `developer`.

      - `"user"`

      - `"system"`

      - `"developer"`

    - `agent?: Agent | null`

      The agent that produced this item.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

    - `status?: "in_progress" | "completed" | "incomplete"`

      The status of item. One of `in_progress`, `completed`, or
      `incomplete`. Populated when items are returned via API.

      - `"in_progress"`

      - `"completed"`

      - `"incomplete"`

    - `type?: "message"`

      The type of the message input. Always set to `message`.

      - `"message"`

  - `BetaResponseOutputMessage`

    An output message from the model.

    - `id: string`

      The unique ID of the output message.

    - `content: Array<BetaResponseOutputText | BetaResponseOutputRefusal>`

      The content of the output message.

      - `BetaResponseOutputText`

        A text output from the model.

        - `annotations: Array<FileCitation | URLCitation | ContainerFileCitation | FilePath>`

          The annotations of the text output.

          - `FileCitation`

            A citation to a file.

            - `file_id: string`

              The ID of the file.

            - `filename: string`

              The filename of the file cited.

            - `index: number`

              The index of the file in the list of files.

            - `type: "file_citation"`

              The type of the file citation. Always `file_citation`.

              - `"file_citation"`

          - `URLCitation`

            A citation for a web resource used to generate a model response.

            - `end_index: number`

              The index of the last character of the URL citation in the message.

            - `start_index: number`

              The index of the first character of the URL citation in the message.

            - `title: string`

              The title of the web resource.

            - `type: "url_citation"`

              The type of the URL citation. Always `url_citation`.

              - `"url_citation"`

            - `url: string`

              The URL of the web resource.

          - `ContainerFileCitation`

            A citation for a container file used to generate a model response.

            - `container_id: string`

              The ID of the container file.

            - `end_index: number`

              The index of the last character of the container file citation in the message.

            - `file_id: string`

              The ID of the file.

            - `filename: string`

              The filename of the container file cited.

            - `start_index: number`

              The index of the first character of the container file citation in the message.

            - `type: "container_file_citation"`

              The type of the container file citation. Always `container_file_citation`.

              - `"container_file_citation"`

          - `FilePath`

            A path to a file.

            - `file_id: string`

              The ID of the file.

            - `index: number`

              The index of the file in the list of files.

            - `type: "file_path"`

              The type of the file path. Always `file_path`.

              - `"file_path"`

        - `text: string`

          The text output from the model.

        - `type: "output_text"`

          The type of the output text. Always `output_text`.

          - `"output_text"`

        - `logprobs?: Array<Logprob>`

          - `token: string`

          - `bytes: Array<number>`

          - `logprob: number`

          - `top_logprobs: Array<TopLogprob>`

            - `token: string`

            - `bytes: Array<number>`

            - `logprob: number`

      - `BetaResponseOutputRefusal`

        A refusal from the model.

        - `refusal: string`

          The refusal explanation from the model.

        - `type: "refusal"`

          The type of the refusal. Always `refusal`.

          - `"refusal"`

    - `role: "assistant"`

      The role of the output message. Always `assistant`.

      - `"assistant"`

    - `status: "in_progress" | "completed" | "incomplete"`

      The status of the message input. One of `in_progress`, `completed`, or
      `incomplete`. Populated when input items are returned via API.

      - `"in_progress"`

      - `"completed"`

      - `"incomplete"`

    - `type: "message"`

      The type of the output message. Always `message`.

      - `"message"`

    - `agent?: Agent | null`

      The agent that produced this item.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

    - `phase?: "commentary" | "final_answer" | null`

      Labels an `assistant` message as intermediate commentary (`commentary`) or the final answer (`final_answer`).
      For models like `gpt-5.3-codex` and beyond, when sending follow-up requests, preserve and resend
      phase on all assistant messages — dropping it can degrade performance. Not used for user messages.

      - `"commentary"`

      - `"final_answer"`

  - `BetaResponseFileSearchToolCall`

    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.

    - `id: string`

      The unique ID of the file search tool call.

    - `queries: Array<string>`

      The queries used to search for files.

    - `status: "in_progress" | "searching" | "completed" | 2 more`

      The status of the file search tool call. One of `in_progress`,
      `searching`, `incomplete` or `failed`,

      - `"in_progress"`

      - `"searching"`

      - `"completed"`

      - `"incomplete"`

      - `"failed"`

    - `type: "file_search_call"`

      The type of the file search tool call. Always `file_search_call`.

      - `"file_search_call"`

    - `agent?: Agent | null`

      The agent that produced this item.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

    - `results?: Array<Result> | null`

      The results of the file search tool call.

      - `attributes?: Record<string, string | number | boolean> | null`

        Set of 16 key-value pairs that can be attached to an object. This can be
        useful for storing additional information about the object in a structured
        format, and querying for objects via API or the dashboard. Keys are strings
        with a maximum length of 64 characters. Values are strings with a maximum
        length of 512 characters, booleans, or numbers.

        - `string`

        - `number`

        - `boolean`

      - `file_id?: string`

        The unique ID of the file.

      - `filename?: string`

        The name of the file.

      - `score?: number`

        The relevance score of the file - a value between 0 and 1.

      - `text?: string`

        The text that was retrieved from the file.

  - `BetaResponseComputerToolCall`

    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.

    - `id: string`

      The unique ID of the computer call.

    - `call_id: string`

      An identifier used when responding to the tool call with output.

    - `pending_safety_checks: Array<PendingSafetyCheck>`

      The pending safety checks for the computer call.

      - `id: string`

        The ID of the pending safety check.

      - `code?: string | null`

        The type of the pending safety check.

      - `message?: string | null`

        Details about the pending safety check.

    - `status: "in_progress" | "completed" | "incomplete"`

      The status of the item. One of `in_progress`, `completed`, or
      `incomplete`. Populated when items are returned via API.

      - `"in_progress"`

      - `"completed"`

      - `"incomplete"`

    - `type: "computer_call"`

      The type of the computer call. Always `computer_call`.

      - `"computer_call"`

    - `action?: BetaComputerAction`

      A click action.

      - `Click`

        A click action.

        - `button: "left" | "right" | "wheel" | 2 more`

          Indicates which mouse button was pressed during the click. One of `left`, `right`, `wheel`, `back`, or `forward`.

          - `"left"`

          - `"right"`

          - `"wheel"`

          - `"back"`

          - `"forward"`

        - `type: "click"`

          Specifies the event type. For a click action, this property is always `click`.

          - `"click"`

        - `x: number`

          The x-coordinate where the click occurred.

        - `y: number`

          The y-coordinate where the click occurred.

        - `keys?: Array<string> | null`

          The keys being held while clicking.

      - `DoubleClick`

        A double click action.

        - `keys: Array<string> | null`

          The keys being held while double-clicking.

        - `type: "double_click"`

          Specifies the event type. For a double click action, this property is always set to `double_click`.

          - `"double_click"`

        - `x: number`

          The x-coordinate where the double click occurred.

        - `y: number`

          The y-coordinate where the double click occurred.

      - `Drag`

        A drag action.

        - `path: Array<Path>`

          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 }
          ]
          ```

          - `x: number`

            The x-coordinate.

          - `y: number`

            The y-coordinate.

        - `type: "drag"`

          Specifies the event type. For a drag action, this property is always set to `drag`.

          - `"drag"`

        - `keys?: Array<string> | null`

          The keys being held while dragging the mouse.

      - `Keypress`

        A collection of keypresses the model would like to perform.

        - `keys: Array<string>`

          The combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key.

        - `type: "keypress"`

          Specifies the event type. For a keypress action, this property is always set to `keypress`.

          - `"keypress"`

      - `Move`

        A mouse move action.

        - `type: "move"`

          Specifies the event type. For a move action, this property is always set to `move`.

          - `"move"`

        - `x: number`

          The x-coordinate to move to.

        - `y: number`

          The y-coordinate to move to.

        - `keys?: Array<string> | null`

          The keys being held while moving the mouse.

      - `Screenshot`

        A screenshot action.

        - `type: "screenshot"`

          Specifies the event type. For a screenshot action, this property is always set to `screenshot`.

          - `"screenshot"`

      - `Scroll`

        A scroll action.

        - `scroll_x: number`

          The horizontal scroll distance.

        - `scroll_y: number`

          The vertical scroll distance.

        - `type: "scroll"`

          Specifies the event type. For a scroll action, this property is always set to `scroll`.

          - `"scroll"`

        - `x: number`

          The x-coordinate where the scroll occurred.

        - `y: number`

          The y-coordinate where the scroll occurred.

        - `keys?: Array<string> | null`

          The keys being held while scrolling.

      - `Type`

        An action to type in text.

        - `text: string`

          The text to type.

        - `type: "type"`

          Specifies the event type. For a type action, this property is always set to `type`.

          - `"type"`

      - `Wait`

        A wait action.

        - `type: "wait"`

          Specifies the event type. For a wait action, this property is always set to `wait`.

          - `"wait"`

    - `actions?: BetaComputerActionList`

      Flattened batched actions for `computer_use`. Each action includes an
      `type` discriminator and action-specific fields.

      - `Click`

        A click action.

      - `DoubleClick`

        A double click action.

      - `Drag`

        A drag action.

      - `Keypress`

        A collection of keypresses the model would like to perform.

      - `Move`

        A mouse move action.

      - `Screenshot`

        A screenshot action.

      - `Scroll`

        A scroll action.

      - `Type`

        An action to type in text.

      - `Wait`

        A wait action.

    - `agent?: Agent | null`

      The agent that produced this item.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

  - `ComputerCallOutput`

    The output of a computer tool call.

    - `call_id: string`

      The ID of the computer tool call that produced the output.

    - `output: BetaResponseComputerToolCallOutputScreenshot`

      A computer screenshot image used with the computer use tool.

      - `type: "computer_screenshot"`

        Specifies the event type. For a computer screenshot, this property is
        always set to `computer_screenshot`.

        - `"computer_screenshot"`

      - `file_id?: string`

        The identifier of an uploaded file that contains the screenshot.

      - `image_url?: string`

        The URL of the screenshot image.

    - `type: "computer_call_output"`

      The type of the computer tool call output. Always `computer_call_output`.

      - `"computer_call_output"`

    - `id?: string | null`

      The ID of the computer tool call output.

    - `acknowledged_safety_checks?: Array<AcknowledgedSafetyCheck> | null`

      The safety checks reported by the API that have been acknowledged by the developer.

      - `id: string`

        The ID of the pending safety check.

      - `code?: string | null`

        The type of the pending safety check.

      - `message?: string | null`

        Details about the pending safety check.

    - `agent?: Agent | null`

      The agent that produced this item.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

    - `status?: "in_progress" | "completed" | "incomplete" | null`

      The status of the message input. One of `in_progress`, `completed`, or `incomplete`. Populated when input items are returned via API.

      - `"in_progress"`

      - `"completed"`

      - `"incomplete"`

  - `BetaResponseFunctionWebSearch`

    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.

    - `id: string`

      The unique ID of the web search tool call.

    - `action: Search | OpenPage | FindInPage`

      An object describing the specific action taken in this web search call.
      Includes details on how the model used the web (search, open_page, find_in_page).

      - `Search`

        Action type "search" - Performs a web search query.

        - `type: "search"`

          The action type.

          - `"search"`

        - `queries?: Array<string>`

          The search queries.

        - `query?: string`

          The search query.

        - `sources?: Array<Source>`

          The sources used in the search.

          - `type: "url"`

            The type of source. Always `url`.

            - `"url"`

          - `url: string`

            The URL of the source.

      - `OpenPage`

        Action type "open_page" - Opens a specific URL from search results.

        - `type: "open_page"`

          The action type.

          - `"open_page"`

        - `url?: string | null`

          The URL opened by the model.

      - `FindInPage`

        Action type "find_in_page": Searches for a pattern within a loaded page.

        - `pattern: string`

          The pattern or text to search for within the page.

        - `type: "find_in_page"`

          The action type.

          - `"find_in_page"`

        - `url: string`

          The URL of the page searched for the pattern.

    - `status: "in_progress" | "searching" | "completed" | "failed"`

      The status of the web search tool call.

      - `"in_progress"`

      - `"searching"`

      - `"completed"`

      - `"failed"`

    - `type: "web_search_call"`

      The type of the web search tool call. Always `web_search_call`.

      - `"web_search_call"`

    - `agent?: Agent | null`

      The agent that produced this item.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

  - `BetaResponseFunctionToolCall`

    A tool call to run a function. See the
    [function calling guide](https://platform.openai.com/docs/guides/function-calling) for more information.

    - `arguments: string`

      A JSON string of the arguments to pass to the function.

    - `call_id: string`

      The unique ID of the function tool call generated by the model.

    - `name: string`

      The name of the function to run.

    - `type: "function_call"`

      The type of the function tool call. Always `function_call`.

      - `"function_call"`

    - `id?: string`

      The unique ID of the function tool call.

    - `agent?: Agent | null`

      The agent that produced this item.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

    - `caller?: Direct | Program | null`

      The execution context that produced this tool call.

      - `Direct`

        - `type: "direct"`

          - `"direct"`

      - `Program`

        - `caller_id: string`

          The call ID of the program item that produced this tool call.

        - `type: "program"`

          - `"program"`

    - `namespace?: string`

      The namespace of the function to run.

    - `status?: "in_progress" | "completed" | "incomplete"`

      The status of the item. One of `in_progress`, `completed`, or
      `incomplete`. Populated when items are returned via API.

      - `"in_progress"`

      - `"completed"`

      - `"incomplete"`

  - `FunctionCallOutput`

    The output of a function tool call.

    - `call_id: string`

      The unique ID of the function tool call generated by the model.

    - `output: string | BetaResponseFunctionCallOutputItemList`

      Text, image, or file output of the function tool call.

      - `string`

      - `BetaResponseFunctionCallOutputItemList = Array<BetaResponseFunctionCallOutputItem>`

        An array of content outputs (text, image, file) for the function tool call.

        - `BetaResponseInputTextContent`

          A text input to the model.

          - `text: string`

            The text input to the model.

          - `type: "input_text"`

            The type of the input item. Always `input_text`.

            - `"input_text"`

          - `prompt_cache_breakpoint?: PromptCacheBreakpoint | null`

            Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.

            - `mode: "explicit"`

              The breakpoint mode. Always `explicit`.

              - `"explicit"`

        - `BetaResponseInputImageContent`

          An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision)

          - `type: "input_image"`

            The type of the input item. Always `input_image`.

            - `"input_image"`

          - `detail?: BetaImageDetail | null`

            The detail level of the image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`.

          - `file_id?: string | null`

            The ID of the file to be sent to the model.

          - `image_url?: string | null`

            The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.

          - `prompt_cache_breakpoint?: PromptCacheBreakpoint | null`

            Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.

            - `mode: "explicit"`

              The breakpoint mode. Always `explicit`.

              - `"explicit"`

        - `BetaResponseInputFileContent`

          A file input to the model.

          - `type: "input_file"`

            The type of the input item. Always `input_file`.

            - `"input_file"`

          - `detail?: "auto" | "low" | "high"`

            The detail level of the file to be sent to the model. Use `auto` to let the system select the detail level; for GPT-5.6 and later models, `auto` uses high-quality rendering, which may increase input token usage. Use `low` for lower-cost rendering, or `high` to render the file at higher quality. Defaults to `auto`.

            - `"auto"`

            - `"low"`

            - `"high"`

          - `file_data?: string | null`

            The base64-encoded data of the file to be sent to the model.

          - `file_id?: string | null`

            The ID of the file to be sent to the model.

          - `file_url?: string | null`

            The URL of the file to be sent to the model.

          - `filename?: string | null`

            The name of the file to be sent to the model.

          - `prompt_cache_breakpoint?: PromptCacheBreakpoint | null`

            Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.

            - `mode: "explicit"`

              The breakpoint mode. Always `explicit`.

              - `"explicit"`

    - `type: "function_call_output"`

      The type of the function tool call output. Always `function_call_output`.

      - `"function_call_output"`

    - `id?: string | null`

      The unique ID of the function tool call output. Populated when this item is returned via API.

    - `agent?: Agent | null`

      The agent that produced this item.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

    - `caller?: Direct | Program | null`

      The execution context that produced this tool call.

      - `Direct`

        - `type: "direct"`

          The caller type. Always `direct`.

          - `"direct"`

      - `Program`

        - `caller_id: string`

          The call ID of the program item that produced this tool call.

        - `type: "program"`

          The caller type. Always `program`.

          - `"program"`

    - `name?: string | null`

      The name of the tool that produced the output.

    - `namespace?: string | null`

      The namespace of the tool that produced the output.

    - `status?: "in_progress" | "completed" | "incomplete" | null`

      The status of the item. One of `in_progress`, `completed`, or `incomplete`. Populated when items are returned via API.

      - `"in_progress"`

      - `"completed"`

      - `"incomplete"`

  - `AgentMessage`

    A message routed between agents.

    - `author: string`

      The sending agent identity.

    - `content: Array<BetaResponseInputTextContent | BetaResponseInputImageContent | EncryptedContent>`

      Plaintext, image, or encrypted content sent between agents.

      - `BetaResponseInputTextContent`

        A text input to the model.

      - `BetaResponseInputImageContent`

        An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision)

      - `EncryptedContent`

        Opaque encrypted content that Responses API decrypts inside trusted model execution.

        - `encrypted_content: string`

          Opaque encrypted content.

        - `type: "encrypted_content"`

          The type of the input item. Always `encrypted_content`.

          - `"encrypted_content"`

    - `recipient: string`

      The destination agent identity.

    - `type: "agent_message"`

      The item type. Always `agent_message`.

      - `"agent_message"`

    - `id?: string | null`

      The unique ID of this agent message item.

    - `agent?: Agent | null`

      The agent that produced this item.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

  - `MultiAgentCall`

    - `action: "spawn_agent" | "interrupt_agent" | "list_agents" | 3 more`

      The multi-agent action that was executed.

      - `"spawn_agent"`

      - `"interrupt_agent"`

      - `"list_agents"`

      - `"send_message"`

      - `"followup_task"`

      - `"wait_agent"`

    - `arguments: string`

      The action arguments as a JSON string.

    - `call_id: string`

      The unique ID linking this call to its output.

    - `type: "multi_agent_call"`

      The item type. Always `multi_agent_call`.

      - `"multi_agent_call"`

    - `id?: string | null`

      The unique ID of this multi-agent call.

    - `agent?: Agent | null`

      The agent that produced this item.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

  - `MultiAgentCallOutput`

    - `action: "spawn_agent" | "interrupt_agent" | "list_agents" | 3 more`

      The multi-agent action that produced this result.

      - `"spawn_agent"`

      - `"interrupt_agent"`

      - `"list_agents"`

      - `"send_message"`

      - `"followup_task"`

      - `"wait_agent"`

    - `call_id: string`

      The unique ID of the multi-agent call.

    - `output: Array<Output>`

      Text output returned by the multi-agent action.

      - `text: string`

        The text content.

      - `type: "output_text"`

        The content type. Always `output_text`.

        - `"output_text"`

      - `annotations?: Array<FileCitation | URLCitation | ContainerFileCitation>`

        Citations associated with the text content.

        - `FileCitation`

          - `file_id: string`

            The ID of the file.

          - `filename: string`

            The filename of the file cited.

          - `index: number`

            The index of the file in the list of files.

          - `type: "file_citation"`

            The citation type. Always `file_citation`.

            - `"file_citation"`

        - `URLCitation`

          - `end_index: number`

            The index of the last character of the citation in the message.

          - `start_index: number`

            The index of the first character of the citation in the message.

          - `title: string`

            The title of the cited resource.

          - `type: "url_citation"`

            The citation type. Always `url_citation`.

            - `"url_citation"`

          - `url: string`

            The URL of the cited resource.

        - `ContainerFileCitation`

          - `container_id: string`

            The ID of the container.

          - `end_index: number`

            The index of the last character of the citation in the message.

          - `file_id: string`

            The ID of the container file.

          - `filename: string`

            The filename of the container file cited.

          - `start_index: number`

            The index of the first character of the citation in the message.

          - `type: "container_file_citation"`

            The citation type. Always `container_file_citation`.

            - `"container_file_citation"`

    - `type: "multi_agent_call_output"`

      The item type. Always `multi_agent_call_output`.

      - `"multi_agent_call_output"`

    - `id?: string | null`

      The unique ID of this multi-agent call output.

    - `agent?: Agent | null`

      The agent that produced this item.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

  - `ToolSearchCall`

    - `arguments: unknown`

      The arguments supplied to the tool search call.

    - `type: "tool_search_call"`

      The item type. Always `tool_search_call`.

      - `"tool_search_call"`

    - `id?: string | null`

      The unique ID of this tool search call.

    - `agent?: Agent | null`

      The agent that produced this item.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

    - `call_id?: string | null`

      The unique ID of the tool search call generated by the model.

    - `execution?: "server" | "client"`

      Whether tool search was executed by the server or by the client.

      - `"server"`

      - `"client"`

    - `status?: "in_progress" | "completed" | "incomplete" | null`

      The status of the tool search call.

      - `"in_progress"`

      - `"completed"`

      - `"incomplete"`

  - `BetaResponseToolSearchOutputItemParam`

    - `tools: Array<BetaTool>`

      The loaded tool definitions returned by the tool search output.

      - `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).

        - `name: string`

          The name of the function to call.

        - `parameters: Record<string, unknown> | null`

          A JSON schema object describing the parameters of the function.

        - `strict: boolean | null`

          Whether strict parameter validation is enforced for this function tool.

        - `type: "function"`

          The type of the function tool. Always `function`.

          - `"function"`

        - `allowed_callers?: Array<"direct" | "programmatic"> | null`

          The tool invocation context(s).

          - `"direct"`

          - `"programmatic"`

        - `defer_loading?: boolean`

          Whether this function is deferred and loaded via tool search.

        - `description?: string | null`

          A description of the function. Used by the model to determine whether or not to call the function.

        - `output_schema?: Record<string, unknown> | null`

          A JSON schema object describing the JSON value encoded in string outputs for this function.

      - `BetaFileSearchTool`

        A tool that searches for relevant content from uploaded files. Learn more about the [file search tool](https://platform.openai.com/docs/guides/tools-file-search).

        - `type: "file_search"`

          The type of the file search tool. Always `file_search`.

          - `"file_search"`

        - `vector_store_ids: Array<string>`

          The IDs of the vector stores to search.

        - `filters?: ComparisonFilter | CompoundFilter | null`

          A filter to apply.

          - `ComparisonFilter`

            A filter used to compare a specified attribute key to a given value using a defined comparison operation.

            - `key: string`

              The key to compare against the value.

            - `type: "eq" | "ne" | "gt" | 5 more`

              Specifies the comparison operator: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`, `in`, `nin`.

              - `eq`: equals
              - `ne`: not equal
              - `gt`: greater than
              - `gte`: greater than or equal
              - `lt`: less than
              - `lte`: less than or equal
              - `in`: in
              - `nin`: not in

              - `"eq"`

              - `"ne"`

              - `"gt"`

              - `"gte"`

              - `"lt"`

              - `"lte"`

              - `"in"`

              - `"nin"`

            - `value: string | number | boolean | Array<string | number>`

              The value to compare against the attribute key; supports string, number, or boolean types.

              - `string`

              - `number`

              - `boolean`

              - `Array<string | number>`

                - `string`

                - `number`

          - `CompoundFilter`

            Combine multiple filters using `and` or `or`.

            - `filters: Array<ComparisonFilter | unknown>`

              Array of filters to combine. Items can be `ComparisonFilter` or `CompoundFilter`.

              - `ComparisonFilter`

                A filter used to compare a specified attribute key to a given value using a defined comparison operation.

                - `key: string`

                  The key to compare against the value.

                - `type: "eq" | "ne" | "gt" | 5 more`

                  Specifies the comparison operator: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`, `in`, `nin`.

                  - `eq`: equals
                  - `ne`: not equal
                  - `gt`: greater than
                  - `gte`: greater than or equal
                  - `lt`: less than
                  - `lte`: less than or equal
                  - `in`: in
                  - `nin`: not in

                  - `"eq"`

                  - `"ne"`

                  - `"gt"`

                  - `"gte"`

                  - `"lt"`

                  - `"lte"`

                  - `"in"`

                  - `"nin"`

                - `value: string | number | boolean | Array<string | number>`

                  The value to compare against the attribute key; supports string, number, or boolean types.

                  - `string`

                  - `number`

                  - `boolean`

                  - `Array<string | number>`

                    - `string`

                    - `number`

              - `unknown`

            - `type: "and" | "or"`

              Type of operation: `and` or `or`.

              - `"and"`

              - `"or"`

        - `max_num_results?: number`

          The maximum number of results to return. This number should be between 1 and 50 inclusive.

        - `ranking_options?: RankingOptions`

          Ranking options for search.

          - `hybrid_search?: HybridSearch`

            Weights that control how reciprocal rank fusion balances semantic embedding matches versus sparse keyword matches when hybrid search is enabled.

            - `embedding_weight: number`

              The weight of the embedding in the reciprocal ranking fusion.

            - `text_weight: number`

              The weight of the text in the reciprocal ranking fusion.

          - `ranker?: "auto" | "default-2024-11-15"`

            The ranker to use for the file search.

            - `"auto"`

            - `"default-2024-11-15"`

          - `score_threshold?: number`

            The score threshold for the file search, a number between 0 and 1. Numbers closer to 1 will attempt to return only the most relevant results, but may return fewer results.

      - `BetaComputerTool`

        A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use).

        - `type: "computer"`

          The type of the computer tool. Always `computer`.

          - `"computer"`

      - `BetaComputerUsePreviewTool`

        A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use).

        - `display_height: number`

          The height of the computer display.

        - `display_width: number`

          The width of the computer display.

        - `environment: "windows" | "mac" | "linux" | 2 more`

          The type of computer environment to control.

          - `"windows"`

          - `"mac"`

          - `"linux"`

          - `"ubuntu"`

          - `"browser"`

        - `type: "computer_use_preview"`

          The type of the computer use tool. Always `computer_use_preview`.

          - `"computer_use_preview"`

      - `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"`

          The type of the web search tool. One of `web_search` or `web_search_2025_08_26`.

          - `"web_search"`

          - `"web_search_2025_08_26"`

        - `external_web_access?: boolean`

          Allow live internet access for web search. Defaults to true when omitted. When false, the web search tool runs in offline/cache-only mode and will not fetch new external content.

        - `filters?: Filters | null`

          Filters for the search.

          - `allowed_domains?: Array<string> | null`

            Allowed domains for the search. If not provided, all domains are allowed.
            Subdomains of the provided domains are allowed as well.

            Example: `["pubmed.ncbi.nlm.nih.gov"]`

        - `search_context_size?: "low" | "medium" | "high"`

          High level guidance for the amount of context window space to use for the search. One of `low`, `medium`, or `high`. `medium` is the default.

          - `"low"`

          - `"medium"`

          - `"high"`

        - `user_location?: UserLocation | null`

          The approximate location of the user.

          - `city?: string | null`

            Free text input for the city of the user, e.g. `San Francisco`.

          - `country?: string | null`

            The two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of the user, e.g. `US`.

          - `region?: string | null`

            Free text input for the region of the user, e.g. `California`.

          - `timezone?: string | null`

            The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of the user, e.g. `America/Los_Angeles`.

          - `type?: "approximate"`

            The type of location approximation. Always `approximate`.

            - `"approximate"`

      - `Mcp`

        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).

        - `server_label: string`

          A label for this MCP server, used to identify it in tool calls.

        - `type: "mcp"`

          The type of the MCP tool. Always `mcp`.

          - `"mcp"`

        - `allowed_callers?: Array<"direct" | "programmatic"> | null`

          The tool invocation context(s).

          - `"direct"`

          - `"programmatic"`

        - `allowed_tools?: Array<string> | McpToolFilter | null`

          List of allowed tool names or a filter object.

          - `Array<string>`

          - `McpToolFilter`

            A filter object to specify which tools are allowed.

            - `read_only?: boolean`

              Indicates whether or not a tool modifies data or is read-only. If an
              MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint),
              it will match this filter.

            - `tool_names?: Array<string>`

              List of allowed tool names.

        - `authorization?: string`

          An OAuth access token that can be used with a remote MCP server, either
          with a custom MCP server URL or a service connector. Your application
          must handle the OAuth authorization flow and provide the token here.

        - `connector_id?: "connector_dropbox" | "connector_gmail" | "connector_googlecalendar" | 5 more`

          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`

          - `"connector_dropbox"`

          - `"connector_gmail"`

          - `"connector_googlecalendar"`

          - `"connector_googledrive"`

          - `"connector_microsoftteams"`

          - `"connector_outlookcalendar"`

          - `"connector_outlookemail"`

          - `"connector_sharepoint"`

        - `defer_loading?: boolean`

          Whether this MCP tool is deferred and discovered via tool search.

        - `headers?: Record<string, string> | null`

          Optional HTTP headers to send to the MCP server. Use for authentication
          or other purposes.

        - `require_approval?: McpToolApprovalFilter | "always" | "never" | null`

          Specify which of the MCP server's tools require approval.

          - `McpToolApprovalFilter`

            Specify which of the MCP server's tools require approval. Can be
            `always`, `never`, or a filter object associated with tools
            that require approval.

            - `always?: Always`

              A filter object to specify which tools are allowed.

              - `read_only?: boolean`

                Indicates whether or not a tool modifies data or is read-only. If an
                MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint),
                it will match this filter.

              - `tool_names?: Array<string>`

                List of allowed tool names.

            - `never?: Never`

              A filter object to specify which tools are allowed.

              - `read_only?: boolean`

                Indicates whether or not a tool modifies data or is read-only. If an
                MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint),
                it will match this filter.

              - `tool_names?: Array<string>`

                List of allowed tool names.

          - `"always" | "never"`

            - `"always"`

            - `"never"`

        - `server_description?: string`

          Optional description of the MCP server, used to provide more context.

        - `server_url?: string`

          The URL for the MCP server. One of `server_url`, `connector_id`, or
          `tunnel_id` must be provided.

        - `tunnel_id?: string`

          The Secure MCP Tunnel ID to use instead of a direct server URL. One of
          `server_url`, `connector_id`, or `tunnel_id` must be provided.

      - `CodeInterpreter`

        A tool that runs Python code to help generate a response to a prompt.

        - `container: string | CodeInterpreterToolAuto`

          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`

          - `CodeInterpreterToolAuto`

            Configuration for a code interpreter container. Optionally specify the IDs of the files to run the code on.

            - `type: "auto"`

              Always `auto`.

              - `"auto"`

            - `file_ids?: Array<string>`

              An optional list of uploaded files to make available to your code.

            - `memory_limit?: "1g" | "4g" | "16g" | "64g" | null`

              The memory limit for the code interpreter container.

              - `"1g"`

              - `"4g"`

              - `"16g"`

              - `"64g"`

            - `network_policy?: BetaContainerNetworkPolicyDisabled | BetaContainerNetworkPolicyAllowlist`

              Network access policy for the container.

              - `BetaContainerNetworkPolicyDisabled`

                - `type: "disabled"`

                  Disable outbound network access. Always `disabled`.

                  - `"disabled"`

              - `BetaContainerNetworkPolicyAllowlist`

                - `allowed_domains: Array<string>`

                  A list of allowed domains when type is `allowlist`.

                - `type: "allowlist"`

                  Allow outbound network access only to specified domains. Always `allowlist`.

                  - `"allowlist"`

                - `domain_secrets?: Array<BetaContainerNetworkPolicyDomainSecret>`

                  Optional domain-scoped secrets for allowlisted domains.

                  - `domain: string`

                    The domain associated with the secret.

                  - `name: string`

                    The name of the secret to inject for the domain.

                  - `value: string`

                    The secret value to inject for the domain.

        - `type: "code_interpreter"`

          The type of the code interpreter tool. Always `code_interpreter`.

          - `"code_interpreter"`

        - `allowed_callers?: Array<"direct" | "programmatic"> | null`

          The tool invocation context(s).

          - `"direct"`

          - `"programmatic"`

      - `ProgrammaticToolCalling`

        - `type: "programmatic_tool_calling"`

          The type of the tool. Always `programmatic_tool_calling`.

          - `"programmatic_tool_calling"`

      - `ImageGeneration`

        A tool that generates images using the GPT image models.

        - `type: "image_generation"`

          The type of the image generation tool. Always `image_generation`.

          - `"image_generation"`

        - `action?: "generate" | "edit" | "auto"`

          Whether to generate a new image or edit an existing image. Default: `auto`.

          - `"generate"`

          - `"edit"`

          - `"auto"`

        - `background?: "transparent" | "opaque" | "auto"`

          Allows to set transparency for the background of the generated image(s).
          Must be one of `transparent`, `opaque`, or `auto` (default value). When
          `auto` is used, the model will automatically determine the best
          background for the image.

          Transparent backgrounds are available for supported GPT Image models.
          For `gpt-image-2` and `gpt-image-2-2026-04-21`, this support is in
          preview. When using `transparent`, set the output format to `png` or
          `webp`.

          - `"transparent"`

          - `"opaque"`

          - `"auto"`

        - `input_fidelity?: "high" | "low" | null`

          Control how much effort the model will exert to match the style and features, especially facial features, of input images. This parameter is only supported for `gpt-image-1` and `gpt-image-1.5` and later models, unsupported for `gpt-image-1-mini`. Supports `high` and `low`. Defaults to `low`.

          - `"high"`

          - `"low"`

        - `input_image_mask?: InputImageMask`

          Optional mask for inpainting. Contains `image_url`
          (string, optional) and `file_id` (string, optional).

          - `file_id?: string`

            File ID for the mask image.

          - `image_url?: string`

            Base64-encoded mask image.

        - `model?: (string & {}) | "gpt-image-1" | "gpt-image-1-mini" | "gpt-image-2" | 3 more`

          The image generation model to use. One of `gpt-image-1`,
          `gpt-image-1-mini`, `gpt-image-1.5`, `gpt-image-2`,
          `gpt-image-2-2026-04-21`, or `chatgpt-image-latest`. Default:
          `gpt-image-1`.

          - `(string & {})`

          - `"gpt-image-1" | "gpt-image-1-mini" | "gpt-image-2" | 3 more`

            - `"gpt-image-1"`

            - `"gpt-image-1-mini"`

            - `"gpt-image-2"`

            - `"gpt-image-2-2026-04-21"`

            - `"gpt-image-1.5"`

            - `"chatgpt-image-latest"`

        - `moderation?: "auto" | "low"`

          Moderation level for the generated image. Default: `auto`.

          - `"auto"`

          - `"low"`

        - `output_compression?: number`

          Compression level for the output image. Default: 100.

        - `output_format?: "png" | "webp" | "jpeg"`

          The output format of the generated image. One of `png`, `webp`, or
          `jpeg`. Default: `png`.

          - `"png"`

          - `"webp"`

          - `"jpeg"`

        - `partial_images?: number`

          Number of partial images to generate in streaming mode, from 0 (default value) to 3.

        - `quality?: "low" | "medium" | "high" | "auto"`

          The quality of the generated image. One of `low`, `medium`, `high`,
          or `auto`. Default: `auto`.

          - `"low"`

          - `"medium"`

          - `"high"`

          - `"auto"`

        - `size?: (string & {}) | "1024x1024" | "1024x1536" | "1536x1024" | "auto"`

          The size of the generated images. For `gpt-image-2` and `gpt-image-2-2026-04-21`, arbitrary resolutions are supported as `WIDTHxHEIGHT` strings, for example `1536x864`. Width and height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above `2560x1440` are experimental, and the maximum supported resolution is `3840x2160`. The requested size must also satisfy the model's current pixel and edge limits. The standard sizes `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models; `auto` is supported for models that allow automatic sizing. For `dall-e-2`, use one of `256x256`, `512x512`, or `1024x1024`. For `dall-e-3`, use one of `1024x1024`, `1792x1024`, or `1024x1792`.

          - `(string & {})`

          - `"1024x1024" | "1024x1536" | "1536x1024" | "auto"`

            - `"1024x1024"`

            - `"1024x1536"`

            - `"1536x1024"`

            - `"auto"`

      - `LocalShell`

        A tool that allows the model to execute shell commands in a local environment.

        - `type: "local_shell"`

          The type of the local shell tool. Always `local_shell`.

          - `"local_shell"`

      - `BetaFunctionShellTool`

        A tool that allows the model to execute shell commands.

        - `type: "shell"`

          The type of the shell tool. Always `shell`.

          - `"shell"`

        - `allowed_callers?: Array<"direct" | "programmatic"> | null`

          The tool invocation context(s).

          - `"direct"`

          - `"programmatic"`

        - `environment?: BetaContainerAuto | BetaLocalEnvironment | BetaContainerReference | null`

          - `BetaContainerAuto`

            - `type: "container_auto"`

              Automatically creates a container for this request

              - `"container_auto"`

            - `file_ids?: Array<string>`

              An optional list of uploaded files to make available to your code.

            - `memory_limit?: "1g" | "4g" | "16g" | "64g" | null`

              The memory limit for the container.

              - `"1g"`

              - `"4g"`

              - `"16g"`

              - `"64g"`

            - `network_policy?: BetaContainerNetworkPolicyDisabled | BetaContainerNetworkPolicyAllowlist`

              Network access policy for the container.

              - `BetaContainerNetworkPolicyDisabled`

              - `BetaContainerNetworkPolicyAllowlist`

            - `skills?: Array<BetaSkillReference | BetaInlineSkill>`

              An optional list of skills referenced by id or inline data.

              - `BetaSkillReference`

                - `skill_id: string`

                  The ID of the referenced skill.

                - `type: "skill_reference"`

                  References a skill created with the /v1/skills endpoint.

                  - `"skill_reference"`

                - `version?: string`

                  Optional skill version. Use a positive integer or 'latest'. Omit for default.

              - `BetaInlineSkill`

                - `description: string`

                  The description of the skill.

                - `name: string`

                  The name of the skill.

                - `source: BetaInlineSkillSource`

                  Inline skill payload

                  - `data: string`

                    Base64-encoded skill zip bundle.

                  - `media_type: "application/zip"`

                    The media type of the inline skill payload. Must be `application/zip`.

                    - `"application/zip"`

                  - `type: "base64"`

                    The type of the inline skill source. Must be `base64`.

                    - `"base64"`

                - `type: "inline"`

                  Defines an inline skill for this request.

                  - `"inline"`

          - `BetaLocalEnvironment`

            - `type: "local"`

              Use a local computer environment.

              - `"local"`

            - `skills?: Array<BetaLocalSkill>`

              An optional list of skills.

              - `description: string`

                The description of the skill.

              - `name: string`

                The name of the skill.

              - `path: string`

                The path to the directory containing the skill.

          - `BetaContainerReference`

            - `container_id: string`

              The ID of the referenced container.

            - `type: "container_reference"`

              References a container created with the /v1/containers endpoint

              - `"container_reference"`

      - `BetaCustomTool`

        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)

        - `name: string`

          The name of the custom tool, used to identify it in tool calls.

        - `type: "custom"`

          The type of the custom tool. Always `custom`.

          - `"custom"`

        - `allowed_callers?: Array<"direct" | "programmatic"> | null`

          The tool invocation context(s).

          - `"direct"`

          - `"programmatic"`

        - `defer_loading?: boolean`

          Whether this tool should be deferred and discovered via tool search.

        - `description?: string`

          Optional description of the custom tool, used to provide more context.

        - `format?: Text | Grammar`

          The input format for the custom tool. Default is unconstrained text.

          - `Text`

            Unconstrained free-form text.

            - `type: "text"`

              Unconstrained text format. Always `text`.

              - `"text"`

          - `Grammar`

            A grammar defined by the user.

            - `definition: string`

              The grammar definition.

            - `syntax: "lark" | "regex"`

              The syntax of the grammar definition. One of `lark` or `regex`.

              - `"lark"`

              - `"regex"`

            - `type: "grammar"`

              Grammar format. Always `grammar`.

              - `"grammar"`

      - `BetaNamespaceTool`

        Groups function/custom tools under a shared namespace.

        - `description: string`

          A description of the namespace shown to the model.

        - `name: string`

          The namespace name used in tool calls (for example, `crm`).

        - `tools: Array<Function | BetaCustomTool>`

          The function/custom tools available inside this namespace.

          - `Function`

            - `name: string`

            - `type: "function"`

              - `"function"`

            - `allowed_callers?: Array<"direct" | "programmatic"> | null`

              The tool invocation context(s).

              - `"direct"`

              - `"programmatic"`

            - `defer_loading?: boolean`

              Whether this function should be deferred and discovered via tool search.

            - `description?: string | null`

            - `output_schema?: Record<string, unknown> | null`

              A JSON Schema describing the JSON value encoded in string outputs for this function tool. This does not describe content-array outputs.

            - `parameters?: unknown`

            - `strict?: boolean | null`

              Whether to enforce strict parameter validation. If omitted, Responses attempts to use strict validation when the schema is compatible, and falls back to non-strict validation otherwise.

          - `BetaCustomTool`

            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: "namespace"`

          The type of the tool. Always `namespace`.

          - `"namespace"`

      - `BetaToolSearchTool`

        Hosted or BYOT tool search configuration for deferred tools.

        - `type: "tool_search"`

          The type of the tool. Always `tool_search`.

          - `"tool_search"`

        - `description?: string | null`

          Description shown to the model for a client-executed tool search tool.

        - `execution?: "server" | "client"`

          Whether tool search is executed by the server or by the client.

          - `"server"`

          - `"client"`

        - `parameters?: unknown`

          Parameter schema for a client-executed tool search tool.

      - `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"`

          The type of the web search tool. One of `web_search_preview` or `web_search_preview_2025_03_11`.

          - `"web_search_preview"`

          - `"web_search_preview_2025_03_11"`

        - `search_content_types?: Array<"text" | "image">`

          - `"text"`

          - `"image"`

        - `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.

          - `"low"`

          - `"medium"`

          - `"high"`

        - `user_location?: UserLocation | null`

          The user's location.

          - `type: "approximate"`

            The type of location approximation. Always `approximate`.

            - `"approximate"`

          - `city?: string | null`

            Free text input for the city of the user, e.g. `San Francisco`.

          - `country?: string | null`

            The two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of the user, e.g. `US`.

          - `region?: string | null`

            Free text input for the region of the user, e.g. `California`.

          - `timezone?: string | null`

            The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of the user, e.g. `America/Los_Angeles`.

      - `BetaApplyPatchTool`

        Allows the assistant to create, delete, or update files using unified diffs.

        - `type: "apply_patch"`

          The type of the tool. Always `apply_patch`.

          - `"apply_patch"`

        - `allowed_callers?: Array<"direct" | "programmatic"> | null`

          The tool invocation context(s).

          - `"direct"`

          - `"programmatic"`

    - `type: "tool_search_output"`

      The item type. Always `tool_search_output`.

      - `"tool_search_output"`

    - `id?: string | null`

      The unique ID of this tool search output.

    - `agent?: Agent | null`

      The agent that produced this item.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

    - `call_id?: string | null`

      The unique ID of the tool search call generated by the model.

    - `execution?: "server" | "client"`

      Whether tool search was executed by the server or by the client.

      - `"server"`

      - `"client"`

    - `status?: "in_progress" | "completed" | "incomplete" | null`

      The status of the tool search output.

      - `"in_progress"`

      - `"completed"`

      - `"incomplete"`

  - `AdditionalTools`

    - `role: "developer"`

      The role that provided the additional tools. Only `developer` is supported.

      - `"developer"`

    - `tools: Array<BetaTool>`

      A list of additional tools made available at this item.

      - `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).

      - `Mcp`

        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).

      - `CodeInterpreter`

        A tool that runs Python code to help generate a response to a prompt.

      - `ProgrammaticToolCalling`

      - `ImageGeneration`

        A tool that generates images using the GPT image models.

      - `LocalShell`

        A tool that allows the model to execute shell commands in a local environment.

      - `BetaFunctionShellTool`

        A tool that allows the model to execute shell commands.

      - `BetaCustomTool`

        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)

      - `BetaNamespaceTool`

        Groups function/custom tools under a shared namespace.

      - `BetaToolSearchTool`

        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).

      - `BetaApplyPatchTool`

        Allows the assistant to create, delete, or update files using unified diffs.

    - `type: "additional_tools"`

      The item type. Always `additional_tools`.

      - `"additional_tools"`

    - `id?: string | null`

      The unique ID of this additional tools item.

    - `agent?: Agent | null`

      The agent that produced this item.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

  - `BetaResponseReasoningItem`

    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).

    - `id: string`

      The unique identifier of the reasoning content.

    - `summary: Array<Summary>`

      Reasoning summary content.

      - `text: string`

        A summary of the reasoning output from the model so far.

      - `type: "summary_text"`

        The type of the object. Always `summary_text`.

        - `"summary_text"`

    - `type: "reasoning"`

      The type of the object. Always `reasoning`.

      - `"reasoning"`

    - `agent?: Agent | null`

      The agent that produced this item.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

    - `content?: Array<Content>`

      Reasoning text content.

      - `text: string`

        The reasoning text from the model.

      - `type: "reasoning_text"`

        The type of the reasoning text. Always `reasoning_text`.

        - `"reasoning_text"`

    - `encrypted_content?: string | null`

      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.

      When streaming, use the completed reasoning item and its
      `encrypted_content` from the `response.output_item.done` event in
      subsequent requests. The `encrypted_content` in
      `response.output_item.added` may be incomplete. This is especially
      important when `store` is `false` or when using Zero Data Retention.

    - `status?: "in_progress" | "completed" | "incomplete"`

      The status of the item. One of `in_progress`, `completed`, or
      `incomplete`. Populated when items are returned via API.

      - `"in_progress"`

      - `"completed"`

      - `"incomplete"`

  - `BetaResponseCompactionItemParam`

    A compaction item generated by the [`v1/responses/compact` API](https://platform.openai.com/docs/api-reference/responses/compact).

    - `encrypted_content: string`

      The encrypted content of the compaction summary.

    - `type: "compaction"`

      The type of the item. Always `compaction`.

      - `"compaction"`

    - `id?: string | null`

      The ID of the compaction item.

    - `agent?: Agent | null`

      The agent that produced this item.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

  - `ImageGenerationCall`

    An image generation request made by the model.

    - `id: string`

      The unique ID of the image generation call.

    - `result: string | null`

      The generated image encoded in base64.

    - `status: "in_progress" | "completed" | "generating" | "failed"`

      The status of the image generation call.

      - `"in_progress"`

      - `"completed"`

      - `"generating"`

      - `"failed"`

    - `type: "image_generation_call"`

      The type of the image generation call. Always `image_generation_call`.

      - `"image_generation_call"`

    - `agent?: Agent | null`

      The agent that produced this item.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

  - `BetaResponseCodeInterpreterToolCall`

    A tool call to run code.

    - `id: string`

      The unique ID of the code interpreter tool call.

    - `code: string | null`

      The code to run, or null if not available.

    - `container_id: string`

      The ID of the container used to run the code.

    - `outputs: Array<Logs | Image> | null`

      The outputs generated by the code interpreter, such as logs or images.
      Can be null if no outputs are available.

      - `Logs`

        The logs output from the code interpreter.

        - `logs: string`

          The logs output from the code interpreter.

        - `type: "logs"`

          The type of the output. Always `logs`.

          - `"logs"`

      - `Image`

        The image output from the code interpreter.

        - `type: "image"`

          The type of the output. Always `image`.

          - `"image"`

        - `url: string`

          The URL of the image output from the code interpreter.

    - `status: "in_progress" | "completed" | "incomplete" | 2 more`

      The status of the code interpreter tool call. Valid values are `in_progress`, `completed`, `incomplete`, `interpreting`, and `failed`.

      - `"in_progress"`

      - `"completed"`

      - `"incomplete"`

      - `"interpreting"`

      - `"failed"`

    - `type: "code_interpreter_call"`

      The type of the code interpreter tool call. Always `code_interpreter_call`.

      - `"code_interpreter_call"`

    - `agent?: Agent | null`

      The agent that produced this item.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

  - `LocalShellCall`

    A tool call to run a command on the local shell.

    - `id: string`

      The unique ID of the local shell call.

    - `action: Action`

      Execute a shell command on the server.

      - `command: Array<string>`

        The command to run.

      - `env: Record<string, string>`

        Environment variables to set for the command.

      - `type: "exec"`

        The type of the local shell action. Always `exec`.

        - `"exec"`

      - `timeout_ms?: number | null`

        Optional timeout in milliseconds for the command.

      - `user?: string | null`

        Optional user to run the command as.

      - `working_directory?: string | null`

        Optional working directory to run the command in.

    - `call_id: string`

      The unique ID of the local shell tool call generated by the model.

    - `status: "in_progress" | "completed" | "incomplete"`

      The status of the local shell call.

      - `"in_progress"`

      - `"completed"`

      - `"incomplete"`

    - `type: "local_shell_call"`

      The type of the local shell call. Always `local_shell_call`.

      - `"local_shell_call"`

    - `agent?: Agent | null`

      The agent that produced this item.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

  - `LocalShellCallOutput`

    The output of a local shell tool call.

    - `id: string`

      The unique ID of the local shell tool call generated by the model.

    - `output: string`

      A JSON string of the output of the local shell tool call.

    - `type: "local_shell_call_output"`

      The type of the local shell tool call output. Always `local_shell_call_output`.

      - `"local_shell_call_output"`

    - `agent?: Agent | null`

      The agent that produced this item.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

    - `status?: "in_progress" | "completed" | "incomplete" | null`

      The status of the item. One of `in_progress`, `completed`, or `incomplete`.

      - `"in_progress"`

      - `"completed"`

      - `"incomplete"`

  - `ShellCall`

    A tool representing a request to execute one or more shell commands.

    - `action: Action`

      The shell commands and limits that describe how to run the tool call.

      - `commands: Array<string>`

        Ordered shell commands for the execution environment to run.

      - `max_output_length?: number | null`

        Maximum number of UTF-8 characters to capture from combined stdout and stderr output.

      - `timeout_ms?: number | null`

        Maximum wall-clock time in milliseconds to allow the shell commands to run.

    - `call_id: string`

      The unique ID of the shell tool call generated by the model.

    - `type: "shell_call"`

      The type of the item. Always `shell_call`.

      - `"shell_call"`

    - `id?: string | null`

      The unique ID of the shell tool call. Populated when this item is returned via API.

    - `agent?: Agent | null`

      The agent that produced this item.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

    - `caller?: Direct | Program | null`

      The execution context that produced this tool call.

      - `Direct`

        - `type: "direct"`

          The caller type. Always `direct`.

          - `"direct"`

      - `Program`

        - `caller_id: string`

          The call ID of the program item that produced this tool call.

        - `type: "program"`

          The caller type. Always `program`.

          - `"program"`

    - `environment?: BetaLocalEnvironment | BetaContainerReference | null`

      The environment to execute the shell commands in.

      - `BetaLocalEnvironment`

      - `BetaContainerReference`

    - `status?: "in_progress" | "completed" | "incomplete" | null`

      The status of the shell call. One of `in_progress`, `completed`, or `incomplete`.

      - `"in_progress"`

      - `"completed"`

      - `"incomplete"`

  - `ShellCallOutput`

    The streamed output items emitted by a shell tool call.

    - `call_id: string`

      The unique ID of the shell tool call generated by the model.

    - `output: Array<BetaResponseFunctionShellCallOutputContent>`

      Captured chunks of stdout and stderr output, along with their associated outcomes.

      - `outcome: Timeout | Exit`

        The exit or timeout outcome associated with this shell call.

        - `Timeout`

          Indicates that the shell call exceeded its configured time limit.

          - `type: "timeout"`

            The outcome type. Always `timeout`.

            - `"timeout"`

        - `Exit`

          Indicates that the shell commands finished and returned an exit code.

          - `exit_code: number`

            The exit code returned by the shell process.

          - `type: "exit"`

            The outcome type. Always `exit`.

            - `"exit"`

      - `stderr: string`

        Captured stderr output for the shell call.

      - `stdout: string`

        Captured stdout output for the shell call.

    - `type: "shell_call_output"`

      The type of the item. Always `shell_call_output`.

      - `"shell_call_output"`

    - `id?: string | null`

      The unique ID of the shell tool call output. Populated when this item is returned via API.

    - `agent?: Agent | null`

      The agent that produced this item.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

    - `caller?: Direct | Program | null`

      The execution context that produced this tool call.

      - `Direct`

        - `type: "direct"`

          The caller type. Always `direct`.

          - `"direct"`

      - `Program`

        - `caller_id: string`

          The call ID of the program item that produced this tool call.

        - `type: "program"`

          The caller type. Always `program`.

          - `"program"`

    - `max_output_length?: number | null`

      The maximum number of UTF-8 characters captured for this shell call's combined output.

    - `status?: "in_progress" | "completed" | "incomplete" | null`

      The status of the shell call output.

      - `"in_progress"`

      - `"completed"`

      - `"incomplete"`

  - `ApplyPatchCall`

    A tool call representing a request to create, delete, or update files using diff patches.

    - `call_id: string`

      The unique ID of the apply patch tool call generated by the model.

    - `operation: CreateFile | DeleteFile | UpdateFile`

      The specific create, delete, or update instruction for the apply_patch tool call.

      - `CreateFile`

        Instruction for creating a new file via the apply_patch tool.

        - `diff: string`

          Unified diff content to apply when creating the file.

        - `path: string`

          Path of the file to create relative to the workspace root.

        - `type: "create_file"`

          The operation type. Always `create_file`.

          - `"create_file"`

      - `DeleteFile`

        Instruction for deleting an existing file via the apply_patch tool.

        - `path: string`

          Path of the file to delete relative to the workspace root.

        - `type: "delete_file"`

          The operation type. Always `delete_file`.

          - `"delete_file"`

      - `UpdateFile`

        Instruction for updating an existing file via the apply_patch tool.

        - `diff: string`

          Unified diff content to apply to the existing file.

        - `path: string`

          Path of the file to update relative to the workspace root.

        - `type: "update_file"`

          The operation type. Always `update_file`.

          - `"update_file"`

    - `status: "in_progress" | "completed"`

      The status of the apply patch tool call. One of `in_progress` or `completed`.

      - `"in_progress"`

      - `"completed"`

    - `type: "apply_patch_call"`

      The type of the item. Always `apply_patch_call`.

      - `"apply_patch_call"`

    - `id?: string | null`

      The unique ID of the apply patch tool call. Populated when this item is returned via API.

    - `agent?: Agent | null`

      The agent that produced this item.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

    - `caller?: Direct | Program | null`

      The execution context that produced this tool call.

      - `Direct`

        - `type: "direct"`

          The caller type. Always `direct`.

          - `"direct"`

      - `Program`

        - `caller_id: string`

          The call ID of the program item that produced this tool call.

        - `type: "program"`

          The caller type. Always `program`.

          - `"program"`

  - `ApplyPatchCallOutput`

    The streamed output emitted by an apply patch tool call.

    - `call_id: string`

      The unique ID of the apply patch tool call generated by the model.

    - `status: "completed" | "failed"`

      The status of the apply patch tool call output. One of `completed` or `failed`.

      - `"completed"`

      - `"failed"`

    - `type: "apply_patch_call_output"`

      The type of the item. Always `apply_patch_call_output`.

      - `"apply_patch_call_output"`

    - `id?: string | null`

      The unique ID of the apply patch tool call output. Populated when this item is returned via API.

    - `agent?: Agent | null`

      The agent that produced this item.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

    - `caller?: Direct | Program | null`

      The execution context that produced this tool call.

      - `Direct`

        - `type: "direct"`

          The caller type. Always `direct`.

          - `"direct"`

      - `Program`

        - `caller_id: string`

          The call ID of the program item that produced this tool call.

        - `type: "program"`

          The caller type. Always `program`.

          - `"program"`

    - `output?: string | null`

      Optional human-readable log text from the apply patch tool (e.g., patch results or errors).

  - `McpListTools`

    A list of tools available on an MCP server.

    - `id: string`

      The unique ID of the list.

    - `server_label: string`

      The label of the MCP server.

    - `tools: Array<Tool>`

      The tools available on the server.

      - `input_schema: unknown`

        The JSON schema describing the tool's input.

      - `name: string`

        The name of the tool.

      - `annotations?: unknown`

        Additional annotations about the tool.

      - `description?: string | null`

        The description of the tool.

    - `type: "mcp_list_tools"`

      The type of the item. Always `mcp_list_tools`.

      - `"mcp_list_tools"`

    - `agent?: Agent | null`

      The agent that produced this item.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

    - `error?: string | null`

      Error message if the server could not list tools.

  - `McpApprovalRequest`

    A request for human approval of a tool invocation.

    - `id: string`

      The unique ID of the approval request.

    - `arguments: string`

      A JSON string of arguments for the tool.

    - `name: string`

      The name of the tool to run.

    - `server_label: string`

      The label of the MCP server making the request.

    - `type: "mcp_approval_request"`

      The type of the item. Always `mcp_approval_request`.

      - `"mcp_approval_request"`

    - `agent?: Agent | null`

      The agent that produced this item.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

  - `McpApprovalResponse`

    A response to an MCP approval request.

    - `approval_request_id: string`

      The ID of the approval request being answered.

    - `approve: boolean`

      Whether the request was approved.

    - `type: "mcp_approval_response"`

      The type of the item. Always `mcp_approval_response`.

      - `"mcp_approval_response"`

    - `id?: string | null`

      The unique ID of the approval response

    - `agent?: Agent | null`

      The agent that produced this item.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

    - `reason?: string | null`

      Optional reason for the decision.

  - `McpCall`

    An invocation of a tool on an MCP server.

    - `id: string`

      The unique ID of the tool call.

    - `arguments: string`

      A JSON string of the arguments passed to the tool.

    - `name: string`

      The name of the tool that was run.

    - `server_label: string`

      The label of the MCP server running the tool.

    - `type: "mcp_call"`

      The type of the item. Always `mcp_call`.

      - `"mcp_call"`

    - `agent?: Agent | null`

      The agent that produced this item.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

    - `approval_request_id?: string | null`

      Unique identifier for the MCP tool call approval request.
      Include this value in a subsequent `mcp_approval_response` input to approve or reject the corresponding tool call.

    - `error?: BetaMcpToolCallError | null`

      The error from the tool call, if any.

      - `McpProtocolError`

        - `code: number`

        - `message: string`

        - `type: "mcp_protocol_error"`

          - `"mcp_protocol_error"`

      - `McpToolExecutionError`

        - `content: unknown`

        - `type: "mcp_tool_execution_error"`

          - `"mcp_tool_execution_error"`

      - `HTTPError`

        - `code: number`

        - `message: string`

        - `type: "http_error"`

          - `"http_error"`

    - `output?: string | null`

      The output from the tool call.

    - `status?: "in_progress" | "completed" | "incomplete" | 2 more`

      The status of the tool call. One of `in_progress`, `completed`, `incomplete`, `calling`, or `failed`.

      - `"in_progress"`

      - `"completed"`

      - `"incomplete"`

      - `"calling"`

      - `"failed"`

  - `BetaResponseCustomToolCallOutput`

    The output of a custom tool call from your code, being sent back to the model.

    - `call_id: string`

      The call ID, used to map this custom tool call output to a custom tool call.

    - `output: string | Array<BetaResponseInputText | BetaResponseInputImage | BetaResponseInputFile>`

      The output from the custom tool call generated by your code.
      Can be a string or an list of output content.

      - `string`

      - `Array<BetaResponseInputText | BetaResponseInputImage | BetaResponseInputFile>`

        - `BetaResponseInputText`

          A text input to the model.

        - `BetaResponseInputImage`

          An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision).

        - `BetaResponseInputFile`

          A file input to the model.

    - `type: "custom_tool_call_output"`

      The type of the custom tool call output. Always `custom_tool_call_output`.

      - `"custom_tool_call_output"`

    - `id?: string`

      The unique ID of the custom tool call output in the OpenAI platform.

    - `agent?: Agent | null`

      The agent that produced this item.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

    - `caller?: Direct | Program | null`

      The execution context that produced this tool call.

      - `Direct`

        - `type: "direct"`

          The caller type. Always `direct`.

          - `"direct"`

      - `Program`

        - `caller_id: string`

          The call ID of the program item that produced this tool call.

        - `type: "program"`

          The caller type. Always `program`.

          - `"program"`

  - `BetaResponseCustomToolCall`

    A call to a custom tool created by the model.

    - `call_id: string`

      An identifier used to map this custom tool call to a tool call output.

    - `input: string`

      The input for the custom tool call generated by the model.

    - `name: string`

      The name of the custom tool being called.

    - `type: "custom_tool_call"`

      The type of the custom tool call. Always `custom_tool_call`.

      - `"custom_tool_call"`

    - `id?: string`

      The unique ID of the custom tool call in the OpenAI platform.

    - `agent?: Agent | null`

      The agent that produced this item.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

    - `caller?: Direct | Program | null`

      The execution context that produced this tool call.

      - `Direct`

        - `type: "direct"`

          - `"direct"`

      - `Program`

        - `caller_id: string`

          The call ID of the program item that produced this tool call.

        - `type: "program"`

          - `"program"`

    - `namespace?: string`

      The namespace of the custom tool being called.

  - `CompactionTrigger`

    Compacts the current context. Must be the final input item.

    - `type: "compaction_trigger"`

      The type of the item. Always `compaction_trigger`.

      - `"compaction_trigger"`

    - `agent?: Agent | null`

      The agent that produced this item.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

  - `ItemReference`

    An internal identifier for an item to reference.

    - `id: string`

      The ID of the item to reference.

    - `agent?: Agent | null`

      The agent that produced this item.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

    - `type?: "item_reference" | null`

      The type of item to reference. Always `item_reference`.

      - `"item_reference"`

  - `Program`

    - `id: string`

      The unique ID of this program item.

    - `call_id: string`

      The stable call ID of the program item.

    - `code: string`

      The JavaScript source executed by programmatic tool calling.

    - `fingerprint: string`

      Opaque program replay fingerprint that must be round-tripped.

    - `type: "program"`

      The item type. Always `program`.

      - `"program"`

    - `agent?: Agent | null`

      The agent that produced this item.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

  - `ProgramOutput`

    - `id: string`

      The unique ID of this program output item.

    - `call_id: string`

      The call ID of the program item.

    - `result: string`

      The result produced by the program item.

    - `status: "completed" | "incomplete"`

      The terminal status of the program output.

      - `"completed"`

      - `"incomplete"`

    - `type: "program_output"`

      The item type. Always `program_output`.

      - `"program_output"`

    - `agent?: Agent | null`

      The agent that produced this item.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

### Beta Response Input Audio

- `BetaResponseInputAudio`

  An audio input to the model.

  - `input_audio: InputAudio`

    - `data: string`

      Base64-encoded audio data.

    - `format: "mp3" | "wav"`

      The format of the audio data. Currently supported formats are `mp3` and
      `wav`.

      - `"mp3"`

      - `"wav"`

  - `type: "input_audio"`

    The type of the input item. Always `input_audio`.

    - `"input_audio"`

### Beta Response Input Content

- `BetaResponseInputContent = BetaResponseInputText | BetaResponseInputImage | BetaResponseInputFile`

  A text input to the model.

  - `BetaResponseInputText`

    A text input to the model.

    - `text: string`

      The text input to the model.

    - `type: "input_text"`

      The type of the input item. Always `input_text`.

      - `"input_text"`

    - `prompt_cache_breakpoint?: PromptCacheBreakpoint`

      Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.

      - `mode: "explicit"`

        The breakpoint mode. Always `explicit`.

        - `"explicit"`

  - `BetaResponseInputImage`

    An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision).

    - `detail: BetaImageDetail`

      The detail level of the image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`.

      - `"low"`

      - `"high"`

      - `"auto"`

      - `"original"`

    - `type: "input_image"`

      The type of the input item. Always `input_image`.

      - `"input_image"`

    - `file_id?: string | null`

      The ID of the file to be sent to the model.

    - `image_url?: string | null`

      The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.

    - `prompt_cache_breakpoint?: PromptCacheBreakpoint`

      Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.

      - `mode: "explicit"`

        The breakpoint mode. Always `explicit`.

        - `"explicit"`

  - `BetaResponseInputFile`

    A file input to the model.

    - `type: "input_file"`

      The type of the input item. Always `input_file`.

      - `"input_file"`

    - `detail?: "auto" | "low" | "high"`

      The detail level of the file to be sent to the model. Use `auto` to let the system select the detail level; for GPT-5.6 and later models, `auto` uses high-quality rendering, which may increase input token usage. Use `low` for lower-cost rendering, or `high` to render the file at higher quality. Defaults to `auto`.

      - `"auto"`

      - `"low"`

      - `"high"`

    - `file_data?: string`

      The content of the file to be sent to the model.

    - `file_id?: string | null`

      The ID of the file to be sent to the model.

    - `file_url?: string`

      The URL of the file to be sent to the model.

    - `filename?: string`

      The name of the file to be sent to the model.

    - `prompt_cache_breakpoint?: PromptCacheBreakpoint`

      Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.

      - `mode: "explicit"`

        The breakpoint mode. Always `explicit`.

        - `"explicit"`

### Beta Response Input File

- `BetaResponseInputFile`

  A file input to the model.

  - `type: "input_file"`

    The type of the input item. Always `input_file`.

    - `"input_file"`

  - `detail?: "auto" | "low" | "high"`

    The detail level of the file to be sent to the model. Use `auto` to let the system select the detail level; for GPT-5.6 and later models, `auto` uses high-quality rendering, which may increase input token usage. Use `low` for lower-cost rendering, or `high` to render the file at higher quality. Defaults to `auto`.

    - `"auto"`

    - `"low"`

    - `"high"`

  - `file_data?: string`

    The content of the file to be sent to the model.

  - `file_id?: string | null`

    The ID of the file to be sent to the model.

  - `file_url?: string`

    The URL of the file to be sent to the model.

  - `filename?: string`

    The name of the file to be sent to the model.

  - `prompt_cache_breakpoint?: PromptCacheBreakpoint`

    Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.

    - `mode: "explicit"`

      The breakpoint mode. Always `explicit`.

      - `"explicit"`

### Beta Response Input File Content

- `BetaResponseInputFileContent`

  A file input to the model.

  - `type: "input_file"`

    The type of the input item. Always `input_file`.

    - `"input_file"`

  - `detail?: "auto" | "low" | "high"`

    The detail level of the file to be sent to the model. Use `auto` to let the system select the detail level; for GPT-5.6 and later models, `auto` uses high-quality rendering, which may increase input token usage. Use `low` for lower-cost rendering, or `high` to render the file at higher quality. Defaults to `auto`.

    - `"auto"`

    - `"low"`

    - `"high"`

  - `file_data?: string | null`

    The base64-encoded data of the file to be sent to the model.

  - `file_id?: string | null`

    The ID of the file to be sent to the model.

  - `file_url?: string | null`

    The URL of the file to be sent to the model.

  - `filename?: string | null`

    The name of the file to be sent to the model.

  - `prompt_cache_breakpoint?: PromptCacheBreakpoint | null`

    Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.

    - `mode: "explicit"`

      The breakpoint mode. Always `explicit`.

      - `"explicit"`

### Beta Response Input Image

- `BetaResponseInputImage`

  An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision).

  - `detail: BetaImageDetail`

    The detail level of the image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`.

    - `"low"`

    - `"high"`

    - `"auto"`

    - `"original"`

  - `type: "input_image"`

    The type of the input item. Always `input_image`.

    - `"input_image"`

  - `file_id?: string | null`

    The ID of the file to be sent to the model.

  - `image_url?: string | null`

    The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.

  - `prompt_cache_breakpoint?: PromptCacheBreakpoint`

    Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.

    - `mode: "explicit"`

      The breakpoint mode. Always `explicit`.

      - `"explicit"`

### Beta Response Input Image Content

- `BetaResponseInputImageContent`

  An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision)

  - `type: "input_image"`

    The type of the input item. Always `input_image`.

    - `"input_image"`

  - `detail?: BetaImageDetail | null`

    The detail level of the image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`.

    - `"low"`

    - `"high"`

    - `"auto"`

    - `"original"`

  - `file_id?: string | null`

    The ID of the file to be sent to the model.

  - `image_url?: string | null`

    The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.

  - `prompt_cache_breakpoint?: PromptCacheBreakpoint | null`

    Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.

    - `mode: "explicit"`

      The breakpoint mode. Always `explicit`.

      - `"explicit"`

### Beta Response Input Item

- `BetaResponseInputItem = BetaEasyInputMessage | Message | BetaResponseOutputMessage | 32 more`

  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.

  - `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.

    - `content: string | BetaResponseInputMessageContentList`

      Text, image, or audio input to the model, used to generate a response.
      Can also contain previous assistant responses.

      - `string`

      - `BetaResponseInputMessageContentList = Array<BetaResponseInputContent>`

        A list of one or many input items to the model, containing different content
        types.

        - `BetaResponseInputText`

          A text input to the model.

          - `text: string`

            The text input to the model.

          - `type: "input_text"`

            The type of the input item. Always `input_text`.

            - `"input_text"`

          - `prompt_cache_breakpoint?: PromptCacheBreakpoint`

            Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.

            - `mode: "explicit"`

              The breakpoint mode. Always `explicit`.

              - `"explicit"`

        - `BetaResponseInputImage`

          An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision).

          - `detail: BetaImageDetail`

            The detail level of the image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`.

            - `"low"`

            - `"high"`

            - `"auto"`

            - `"original"`

          - `type: "input_image"`

            The type of the input item. Always `input_image`.

            - `"input_image"`

          - `file_id?: string | null`

            The ID of the file to be sent to the model.

          - `image_url?: string | null`

            The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.

          - `prompt_cache_breakpoint?: PromptCacheBreakpoint`

            Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.

            - `mode: "explicit"`

              The breakpoint mode. Always `explicit`.

              - `"explicit"`

        - `BetaResponseInputFile`

          A file input to the model.

          - `type: "input_file"`

            The type of the input item. Always `input_file`.

            - `"input_file"`

          - `detail?: "auto" | "low" | "high"`

            The detail level of the file to be sent to the model. Use `auto` to let the system select the detail level; for GPT-5.6 and later models, `auto` uses high-quality rendering, which may increase input token usage. Use `low` for lower-cost rendering, or `high` to render the file at higher quality. Defaults to `auto`.

            - `"auto"`

            - `"low"`

            - `"high"`

          - `file_data?: string`

            The content of the file to be sent to the model.

          - `file_id?: string | null`

            The ID of the file to be sent to the model.

          - `file_url?: string`

            The URL of the file to be sent to the model.

          - `filename?: string`

            The name of the file to be sent to the model.

          - `prompt_cache_breakpoint?: PromptCacheBreakpoint`

            Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.

            - `mode: "explicit"`

              The breakpoint mode. Always `explicit`.

              - `"explicit"`

    - `role: "user" | "assistant" | "system" | "developer"`

      The role of the message input. One of `user`, `assistant`, `system`, or
      `developer`.

      - `"user"`

      - `"assistant"`

      - `"system"`

      - `"developer"`

    - `phase?: "commentary" | "final_answer" | null`

      Labels an `assistant` message as intermediate commentary (`commentary`) or the final answer (`final_answer`).
      For models like `gpt-5.3-codex` and beyond, when sending follow-up requests, preserve and resend
      phase on all assistant messages — dropping it can degrade performance. Not used for user messages.

      - `"commentary"`

      - `"final_answer"`

    - `type?: "message"`

      The type of the message input. Always `message`.

      - `"message"`

  - `Message`

    A message input to the model with a role indicating instruction following
    hierarchy. Instructions given with the `developer` or `system` role take
    precedence over instructions given with the `user` role.

    - `content: BetaResponseInputMessageContentList`

      A list of one or many input items to the model, containing different content
      types.

    - `role: "user" | "system" | "developer"`

      The role of the message input. One of `user`, `system`, or `developer`.

      - `"user"`

      - `"system"`

      - `"developer"`

    - `agent?: Agent | null`

      The agent that produced this item.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

    - `status?: "in_progress" | "completed" | "incomplete"`

      The status of item. One of `in_progress`, `completed`, or
      `incomplete`. Populated when items are returned via API.

      - `"in_progress"`

      - `"completed"`

      - `"incomplete"`

    - `type?: "message"`

      The type of the message input. Always set to `message`.

      - `"message"`

  - `BetaResponseOutputMessage`

    An output message from the model.

    - `id: string`

      The unique ID of the output message.

    - `content: Array<BetaResponseOutputText | BetaResponseOutputRefusal>`

      The content of the output message.

      - `BetaResponseOutputText`

        A text output from the model.

        - `annotations: Array<FileCitation | URLCitation | ContainerFileCitation | FilePath>`

          The annotations of the text output.

          - `FileCitation`

            A citation to a file.

            - `file_id: string`

              The ID of the file.

            - `filename: string`

              The filename of the file cited.

            - `index: number`

              The index of the file in the list of files.

            - `type: "file_citation"`

              The type of the file citation. Always `file_citation`.

              - `"file_citation"`

          - `URLCitation`

            A citation for a web resource used to generate a model response.

            - `end_index: number`

              The index of the last character of the URL citation in the message.

            - `start_index: number`

              The index of the first character of the URL citation in the message.

            - `title: string`

              The title of the web resource.

            - `type: "url_citation"`

              The type of the URL citation. Always `url_citation`.

              - `"url_citation"`

            - `url: string`

              The URL of the web resource.

          - `ContainerFileCitation`

            A citation for a container file used to generate a model response.

            - `container_id: string`

              The ID of the container file.

            - `end_index: number`

              The index of the last character of the container file citation in the message.

            - `file_id: string`

              The ID of the file.

            - `filename: string`

              The filename of the container file cited.

            - `start_index: number`

              The index of the first character of the container file citation in the message.

            - `type: "container_file_citation"`

              The type of the container file citation. Always `container_file_citation`.

              - `"container_file_citation"`

          - `FilePath`

            A path to a file.

            - `file_id: string`

              The ID of the file.

            - `index: number`

              The index of the file in the list of files.

            - `type: "file_path"`

              The type of the file path. Always `file_path`.

              - `"file_path"`

        - `text: string`

          The text output from the model.

        - `type: "output_text"`

          The type of the output text. Always `output_text`.

          - `"output_text"`

        - `logprobs?: Array<Logprob>`

          - `token: string`

          - `bytes: Array<number>`

          - `logprob: number`

          - `top_logprobs: Array<TopLogprob>`

            - `token: string`

            - `bytes: Array<number>`

            - `logprob: number`

      - `BetaResponseOutputRefusal`

        A refusal from the model.

        - `refusal: string`

          The refusal explanation from the model.

        - `type: "refusal"`

          The type of the refusal. Always `refusal`.

          - `"refusal"`

    - `role: "assistant"`

      The role of the output message. Always `assistant`.

      - `"assistant"`

    - `status: "in_progress" | "completed" | "incomplete"`

      The status of the message input. One of `in_progress`, `completed`, or
      `incomplete`. Populated when input items are returned via API.

      - `"in_progress"`

      - `"completed"`

      - `"incomplete"`

    - `type: "message"`

      The type of the output message. Always `message`.

      - `"message"`

    - `agent?: Agent | null`

      The agent that produced this item.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

    - `phase?: "commentary" | "final_answer" | null`

      Labels an `assistant` message as intermediate commentary (`commentary`) or the final answer (`final_answer`).
      For models like `gpt-5.3-codex` and beyond, when sending follow-up requests, preserve and resend
      phase on all assistant messages — dropping it can degrade performance. Not used for user messages.

      - `"commentary"`

      - `"final_answer"`

  - `BetaResponseFileSearchToolCall`

    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.

    - `id: string`

      The unique ID of the file search tool call.

    - `queries: Array<string>`

      The queries used to search for files.

    - `status: "in_progress" | "searching" | "completed" | 2 more`

      The status of the file search tool call. One of `in_progress`,
      `searching`, `incomplete` or `failed`,

      - `"in_progress"`

      - `"searching"`

      - `"completed"`

      - `"incomplete"`

      - `"failed"`

    - `type: "file_search_call"`

      The type of the file search tool call. Always `file_search_call`.

      - `"file_search_call"`

    - `agent?: Agent | null`

      The agent that produced this item.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

    - `results?: Array<Result> | null`

      The results of the file search tool call.

      - `attributes?: Record<string, string | number | boolean> | null`

        Set of 16 key-value pairs that can be attached to an object. This can be
        useful for storing additional information about the object in a structured
        format, and querying for objects via API or the dashboard. Keys are strings
        with a maximum length of 64 characters. Values are strings with a maximum
        length of 512 characters, booleans, or numbers.

        - `string`

        - `number`

        - `boolean`

      - `file_id?: string`

        The unique ID of the file.

      - `filename?: string`

        The name of the file.

      - `score?: number`

        The relevance score of the file - a value between 0 and 1.

      - `text?: string`

        The text that was retrieved from the file.

  - `BetaResponseComputerToolCall`

    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.

    - `id: string`

      The unique ID of the computer call.

    - `call_id: string`

      An identifier used when responding to the tool call with output.

    - `pending_safety_checks: Array<PendingSafetyCheck>`

      The pending safety checks for the computer call.

      - `id: string`

        The ID of the pending safety check.

      - `code?: string | null`

        The type of the pending safety check.

      - `message?: string | null`

        Details about the pending safety check.

    - `status: "in_progress" | "completed" | "incomplete"`

      The status of the item. One of `in_progress`, `completed`, or
      `incomplete`. Populated when items are returned via API.

      - `"in_progress"`

      - `"completed"`

      - `"incomplete"`

    - `type: "computer_call"`

      The type of the computer call. Always `computer_call`.

      - `"computer_call"`

    - `action?: BetaComputerAction`

      A click action.

      - `Click`

        A click action.

        - `button: "left" | "right" | "wheel" | 2 more`

          Indicates which mouse button was pressed during the click. One of `left`, `right`, `wheel`, `back`, or `forward`.

          - `"left"`

          - `"right"`

          - `"wheel"`

          - `"back"`

          - `"forward"`

        - `type: "click"`

          Specifies the event type. For a click action, this property is always `click`.

          - `"click"`

        - `x: number`

          The x-coordinate where the click occurred.

        - `y: number`

          The y-coordinate where the click occurred.

        - `keys?: Array<string> | null`

          The keys being held while clicking.

      - `DoubleClick`

        A double click action.

        - `keys: Array<string> | null`

          The keys being held while double-clicking.

        - `type: "double_click"`

          Specifies the event type. For a double click action, this property is always set to `double_click`.

          - `"double_click"`

        - `x: number`

          The x-coordinate where the double click occurred.

        - `y: number`

          The y-coordinate where the double click occurred.

      - `Drag`

        A drag action.

        - `path: Array<Path>`

          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 }
          ]
          ```

          - `x: number`

            The x-coordinate.

          - `y: number`

            The y-coordinate.

        - `type: "drag"`

          Specifies the event type. For a drag action, this property is always set to `drag`.

          - `"drag"`

        - `keys?: Array<string> | null`

          The keys being held while dragging the mouse.

      - `Keypress`

        A collection of keypresses the model would like to perform.

        - `keys: Array<string>`

          The combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key.

        - `type: "keypress"`

          Specifies the event type. For a keypress action, this property is always set to `keypress`.

          - `"keypress"`

      - `Move`

        A mouse move action.

        - `type: "move"`

          Specifies the event type. For a move action, this property is always set to `move`.

          - `"move"`

        - `x: number`

          The x-coordinate to move to.

        - `y: number`

          The y-coordinate to move to.

        - `keys?: Array<string> | null`

          The keys being held while moving the mouse.

      - `Screenshot`

        A screenshot action.

        - `type: "screenshot"`

          Specifies the event type. For a screenshot action, this property is always set to `screenshot`.

          - `"screenshot"`

      - `Scroll`

        A scroll action.

        - `scroll_x: number`

          The horizontal scroll distance.

        - `scroll_y: number`

          The vertical scroll distance.

        - `type: "scroll"`

          Specifies the event type. For a scroll action, this property is always set to `scroll`.

          - `"scroll"`

        - `x: number`

          The x-coordinate where the scroll occurred.

        - `y: number`

          The y-coordinate where the scroll occurred.

        - `keys?: Array<string> | null`

          The keys being held while scrolling.

      - `Type`

        An action to type in text.

        - `text: string`

          The text to type.

        - `type: "type"`

          Specifies the event type. For a type action, this property is always set to `type`.

          - `"type"`

      - `Wait`

        A wait action.

        - `type: "wait"`

          Specifies the event type. For a wait action, this property is always set to `wait`.

          - `"wait"`

    - `actions?: BetaComputerActionList`

      Flattened batched actions for `computer_use`. Each action includes an
      `type` discriminator and action-specific fields.

      - `Click`

        A click action.

      - `DoubleClick`

        A double click action.

      - `Drag`

        A drag action.

      - `Keypress`

        A collection of keypresses the model would like to perform.

      - `Move`

        A mouse move action.

      - `Screenshot`

        A screenshot action.

      - `Scroll`

        A scroll action.

      - `Type`

        An action to type in text.

      - `Wait`

        A wait action.

    - `agent?: Agent | null`

      The agent that produced this item.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

  - `ComputerCallOutput`

    The output of a computer tool call.

    - `call_id: string`

      The ID of the computer tool call that produced the output.

    - `output: BetaResponseComputerToolCallOutputScreenshot`

      A computer screenshot image used with the computer use tool.

      - `type: "computer_screenshot"`

        Specifies the event type. For a computer screenshot, this property is
        always set to `computer_screenshot`.

        - `"computer_screenshot"`

      - `file_id?: string`

        The identifier of an uploaded file that contains the screenshot.

      - `image_url?: string`

        The URL of the screenshot image.

    - `type: "computer_call_output"`

      The type of the computer tool call output. Always `computer_call_output`.

      - `"computer_call_output"`

    - `id?: string | null`

      The ID of the computer tool call output.

    - `acknowledged_safety_checks?: Array<AcknowledgedSafetyCheck> | null`

      The safety checks reported by the API that have been acknowledged by the developer.

      - `id: string`

        The ID of the pending safety check.

      - `code?: string | null`

        The type of the pending safety check.

      - `message?: string | null`

        Details about the pending safety check.

    - `agent?: Agent | null`

      The agent that produced this item.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

    - `status?: "in_progress" | "completed" | "incomplete" | null`

      The status of the message input. One of `in_progress`, `completed`, or `incomplete`. Populated when input items are returned via API.

      - `"in_progress"`

      - `"completed"`

      - `"incomplete"`

  - `BetaResponseFunctionWebSearch`

    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.

    - `id: string`

      The unique ID of the web search tool call.

    - `action: Search | OpenPage | FindInPage`

      An object describing the specific action taken in this web search call.
      Includes details on how the model used the web (search, open_page, find_in_page).

      - `Search`

        Action type "search" - Performs a web search query.

        - `type: "search"`

          The action type.

          - `"search"`

        - `queries?: Array<string>`

          The search queries.

        - `query?: string`

          The search query.

        - `sources?: Array<Source>`

          The sources used in the search.

          - `type: "url"`

            The type of source. Always `url`.

            - `"url"`

          - `url: string`

            The URL of the source.

      - `OpenPage`

        Action type "open_page" - Opens a specific URL from search results.

        - `type: "open_page"`

          The action type.

          - `"open_page"`

        - `url?: string | null`

          The URL opened by the model.

      - `FindInPage`

        Action type "find_in_page": Searches for a pattern within a loaded page.

        - `pattern: string`

          The pattern or text to search for within the page.

        - `type: "find_in_page"`

          The action type.

          - `"find_in_page"`

        - `url: string`

          The URL of the page searched for the pattern.

    - `status: "in_progress" | "searching" | "completed" | "failed"`

      The status of the web search tool call.

      - `"in_progress"`

      - `"searching"`

      - `"completed"`

      - `"failed"`

    - `type: "web_search_call"`

      The type of the web search tool call. Always `web_search_call`.

      - `"web_search_call"`

    - `agent?: Agent | null`

      The agent that produced this item.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

  - `BetaResponseFunctionToolCall`

    A tool call to run a function. See the
    [function calling guide](https://platform.openai.com/docs/guides/function-calling) for more information.

    - `arguments: string`

      A JSON string of the arguments to pass to the function.

    - `call_id: string`

      The unique ID of the function tool call generated by the model.

    - `name: string`

      The name of the function to run.

    - `type: "function_call"`

      The type of the function tool call. Always `function_call`.

      - `"function_call"`

    - `id?: string`

      The unique ID of the function tool call.

    - `agent?: Agent | null`

      The agent that produced this item.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

    - `caller?: Direct | Program | null`

      The execution context that produced this tool call.

      - `Direct`

        - `type: "direct"`

          - `"direct"`

      - `Program`

        - `caller_id: string`

          The call ID of the program item that produced this tool call.

        - `type: "program"`

          - `"program"`

    - `namespace?: string`

      The namespace of the function to run.

    - `status?: "in_progress" | "completed" | "incomplete"`

      The status of the item. One of `in_progress`, `completed`, or
      `incomplete`. Populated when items are returned via API.

      - `"in_progress"`

      - `"completed"`

      - `"incomplete"`

  - `FunctionCallOutput`

    The output of a function tool call.

    - `call_id: string`

      The unique ID of the function tool call generated by the model.

    - `output: string | BetaResponseFunctionCallOutputItemList`

      Text, image, or file output of the function tool call.

      - `string`

      - `BetaResponseFunctionCallOutputItemList = Array<BetaResponseFunctionCallOutputItem>`

        An array of content outputs (text, image, file) for the function tool call.

        - `BetaResponseInputTextContent`

          A text input to the model.

          - `text: string`

            The text input to the model.

          - `type: "input_text"`

            The type of the input item. Always `input_text`.

            - `"input_text"`

          - `prompt_cache_breakpoint?: PromptCacheBreakpoint | null`

            Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.

            - `mode: "explicit"`

              The breakpoint mode. Always `explicit`.

              - `"explicit"`

        - `BetaResponseInputImageContent`

          An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision)

          - `type: "input_image"`

            The type of the input item. Always `input_image`.

            - `"input_image"`

          - `detail?: BetaImageDetail | null`

            The detail level of the image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`.

          - `file_id?: string | null`

            The ID of the file to be sent to the model.

          - `image_url?: string | null`

            The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.

          - `prompt_cache_breakpoint?: PromptCacheBreakpoint | null`

            Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.

            - `mode: "explicit"`

              The breakpoint mode. Always `explicit`.

              - `"explicit"`

        - `BetaResponseInputFileContent`

          A file input to the model.

          - `type: "input_file"`

            The type of the input item. Always `input_file`.

            - `"input_file"`

          - `detail?: "auto" | "low" | "high"`

            The detail level of the file to be sent to the model. Use `auto` to let the system select the detail level; for GPT-5.6 and later models, `auto` uses high-quality rendering, which may increase input token usage. Use `low` for lower-cost rendering, or `high` to render the file at higher quality. Defaults to `auto`.

            - `"auto"`

            - `"low"`

            - `"high"`

          - `file_data?: string | null`

            The base64-encoded data of the file to be sent to the model.

          - `file_id?: string | null`

            The ID of the file to be sent to the model.

          - `file_url?: string | null`

            The URL of the file to be sent to the model.

          - `filename?: string | null`

            The name of the file to be sent to the model.

          - `prompt_cache_breakpoint?: PromptCacheBreakpoint | null`

            Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.

            - `mode: "explicit"`

              The breakpoint mode. Always `explicit`.

              - `"explicit"`

    - `type: "function_call_output"`

      The type of the function tool call output. Always `function_call_output`.

      - `"function_call_output"`

    - `id?: string | null`

      The unique ID of the function tool call output. Populated when this item is returned via API.

    - `agent?: Agent | null`

      The agent that produced this item.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

    - `caller?: Direct | Program | null`

      The execution context that produced this tool call.

      - `Direct`

        - `type: "direct"`

          The caller type. Always `direct`.

          - `"direct"`

      - `Program`

        - `caller_id: string`

          The call ID of the program item that produced this tool call.

        - `type: "program"`

          The caller type. Always `program`.

          - `"program"`

    - `name?: string | null`

      The name of the tool that produced the output.

    - `namespace?: string | null`

      The namespace of the tool that produced the output.

    - `status?: "in_progress" | "completed" | "incomplete" | null`

      The status of the item. One of `in_progress`, `completed`, or `incomplete`. Populated when items are returned via API.

      - `"in_progress"`

      - `"completed"`

      - `"incomplete"`

  - `AgentMessage`

    A message routed between agents.

    - `author: string`

      The sending agent identity.

    - `content: Array<BetaResponseInputTextContent | BetaResponseInputImageContent | EncryptedContent>`

      Plaintext, image, or encrypted content sent between agents.

      - `BetaResponseInputTextContent`

        A text input to the model.

      - `BetaResponseInputImageContent`

        An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision)

      - `EncryptedContent`

        Opaque encrypted content that Responses API decrypts inside trusted model execution.

        - `encrypted_content: string`

          Opaque encrypted content.

        - `type: "encrypted_content"`

          The type of the input item. Always `encrypted_content`.

          - `"encrypted_content"`

    - `recipient: string`

      The destination agent identity.

    - `type: "agent_message"`

      The item type. Always `agent_message`.

      - `"agent_message"`

    - `id?: string | null`

      The unique ID of this agent message item.

    - `agent?: Agent | null`

      The agent that produced this item.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

  - `MultiAgentCall`

    - `action: "spawn_agent" | "interrupt_agent" | "list_agents" | 3 more`

      The multi-agent action that was executed.

      - `"spawn_agent"`

      - `"interrupt_agent"`

      - `"list_agents"`

      - `"send_message"`

      - `"followup_task"`

      - `"wait_agent"`

    - `arguments: string`

      The action arguments as a JSON string.

    - `call_id: string`

      The unique ID linking this call to its output.

    - `type: "multi_agent_call"`

      The item type. Always `multi_agent_call`.

      - `"multi_agent_call"`

    - `id?: string | null`

      The unique ID of this multi-agent call.

    - `agent?: Agent | null`

      The agent that produced this item.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

  - `MultiAgentCallOutput`

    - `action: "spawn_agent" | "interrupt_agent" | "list_agents" | 3 more`

      The multi-agent action that produced this result.

      - `"spawn_agent"`

      - `"interrupt_agent"`

      - `"list_agents"`

      - `"send_message"`

      - `"followup_task"`

      - `"wait_agent"`

    - `call_id: string`

      The unique ID of the multi-agent call.

    - `output: Array<Output>`

      Text output returned by the multi-agent action.

      - `text: string`

        The text content.

      - `type: "output_text"`

        The content type. Always `output_text`.

        - `"output_text"`

      - `annotations?: Array<FileCitation | URLCitation | ContainerFileCitation>`

        Citations associated with the text content.

        - `FileCitation`

          - `file_id: string`

            The ID of the file.

          - `filename: string`

            The filename of the file cited.

          - `index: number`

            The index of the file in the list of files.

          - `type: "file_citation"`

            The citation type. Always `file_citation`.

            - `"file_citation"`

        - `URLCitation`

          - `end_index: number`

            The index of the last character of the citation in the message.

          - `start_index: number`

            The index of the first character of the citation in the message.

          - `title: string`

            The title of the cited resource.

          - `type: "url_citation"`

            The citation type. Always `url_citation`.

            - `"url_citation"`

          - `url: string`

            The URL of the cited resource.

        - `ContainerFileCitation`

          - `container_id: string`

            The ID of the container.

          - `end_index: number`

            The index of the last character of the citation in the message.

          - `file_id: string`

            The ID of the container file.

          - `filename: string`

            The filename of the container file cited.

          - `start_index: number`

            The index of the first character of the citation in the message.

          - `type: "container_file_citation"`

            The citation type. Always `container_file_citation`.

            - `"container_file_citation"`

    - `type: "multi_agent_call_output"`

      The item type. Always `multi_agent_call_output`.

      - `"multi_agent_call_output"`

    - `id?: string | null`

      The unique ID of this multi-agent call output.

    - `agent?: Agent | null`

      The agent that produced this item.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

  - `ToolSearchCall`

    - `arguments: unknown`

      The arguments supplied to the tool search call.

    - `type: "tool_search_call"`

      The item type. Always `tool_search_call`.

      - `"tool_search_call"`

    - `id?: string | null`

      The unique ID of this tool search call.

    - `agent?: Agent | null`

      The agent that produced this item.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

    - `call_id?: string | null`

      The unique ID of the tool search call generated by the model.

    - `execution?: "server" | "client"`

      Whether tool search was executed by the server or by the client.

      - `"server"`

      - `"client"`

    - `status?: "in_progress" | "completed" | "incomplete" | null`

      The status of the tool search call.

      - `"in_progress"`

      - `"completed"`

      - `"incomplete"`

  - `BetaResponseToolSearchOutputItemParam`

    - `tools: Array<BetaTool>`

      The loaded tool definitions returned by the tool search output.

      - `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).

        - `name: string`

          The name of the function to call.

        - `parameters: Record<string, unknown> | null`

          A JSON schema object describing the parameters of the function.

        - `strict: boolean | null`

          Whether strict parameter validation is enforced for this function tool.

        - `type: "function"`

          The type of the function tool. Always `function`.

          - `"function"`

        - `allowed_callers?: Array<"direct" | "programmatic"> | null`

          The tool invocation context(s).

          - `"direct"`

          - `"programmatic"`

        - `defer_loading?: boolean`

          Whether this function is deferred and loaded via tool search.

        - `description?: string | null`

          A description of the function. Used by the model to determine whether or not to call the function.

        - `output_schema?: Record<string, unknown> | null`

          A JSON schema object describing the JSON value encoded in string outputs for this function.

      - `BetaFileSearchTool`

        A tool that searches for relevant content from uploaded files. Learn more about the [file search tool](https://platform.openai.com/docs/guides/tools-file-search).

        - `type: "file_search"`

          The type of the file search tool. Always `file_search`.

          - `"file_search"`

        - `vector_store_ids: Array<string>`

          The IDs of the vector stores to search.

        - `filters?: ComparisonFilter | CompoundFilter | null`

          A filter to apply.

          - `ComparisonFilter`

            A filter used to compare a specified attribute key to a given value using a defined comparison operation.

            - `key: string`

              The key to compare against the value.

            - `type: "eq" | "ne" | "gt" | 5 more`

              Specifies the comparison operator: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`, `in`, `nin`.

              - `eq`: equals
              - `ne`: not equal
              - `gt`: greater than
              - `gte`: greater than or equal
              - `lt`: less than
              - `lte`: less than or equal
              - `in`: in
              - `nin`: not in

              - `"eq"`

              - `"ne"`

              - `"gt"`

              - `"gte"`

              - `"lt"`

              - `"lte"`

              - `"in"`

              - `"nin"`

            - `value: string | number | boolean | Array<string | number>`

              The value to compare against the attribute key; supports string, number, or boolean types.

              - `string`

              - `number`

              - `boolean`

              - `Array<string | number>`

                - `string`

                - `number`

          - `CompoundFilter`

            Combine multiple filters using `and` or `or`.

            - `filters: Array<ComparisonFilter | unknown>`

              Array of filters to combine. Items can be `ComparisonFilter` or `CompoundFilter`.

              - `ComparisonFilter`

                A filter used to compare a specified attribute key to a given value using a defined comparison operation.

                - `key: string`

                  The key to compare against the value.

                - `type: "eq" | "ne" | "gt" | 5 more`

                  Specifies the comparison operator: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`, `in`, `nin`.

                  - `eq`: equals
                  - `ne`: not equal
                  - `gt`: greater than
                  - `gte`: greater than or equal
                  - `lt`: less than
                  - `lte`: less than or equal
                  - `in`: in
                  - `nin`: not in

                  - `"eq"`

                  - `"ne"`

                  - `"gt"`

                  - `"gte"`

                  - `"lt"`

                  - `"lte"`

                  - `"in"`

                  - `"nin"`

                - `value: string | number | boolean | Array<string | number>`

                  The value to compare against the attribute key; supports string, number, or boolean types.

                  - `string`

                  - `number`

                  - `boolean`

                  - `Array<string | number>`

                    - `string`

                    - `number`

              - `unknown`

            - `type: "and" | "or"`

              Type of operation: `and` or `or`.

              - `"and"`

              - `"or"`

        - `max_num_results?: number`

          The maximum number of results to return. This number should be between 1 and 50 inclusive.

        - `ranking_options?: RankingOptions`

          Ranking options for search.

          - `hybrid_search?: HybridSearch`

            Weights that control how reciprocal rank fusion balances semantic embedding matches versus sparse keyword matches when hybrid search is enabled.

            - `embedding_weight: number`

              The weight of the embedding in the reciprocal ranking fusion.

            - `text_weight: number`

              The weight of the text in the reciprocal ranking fusion.

          - `ranker?: "auto" | "default-2024-11-15"`

            The ranker to use for the file search.

            - `"auto"`

            - `"default-2024-11-15"`

          - `score_threshold?: number`

            The score threshold for the file search, a number between 0 and 1. Numbers closer to 1 will attempt to return only the most relevant results, but may return fewer results.

      - `BetaComputerTool`

        A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use).

        - `type: "computer"`

          The type of the computer tool. Always `computer`.

          - `"computer"`

      - `BetaComputerUsePreviewTool`

        A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use).

        - `display_height: number`

          The height of the computer display.

        - `display_width: number`

          The width of the computer display.

        - `environment: "windows" | "mac" | "linux" | 2 more`

          The type of computer environment to control.

          - `"windows"`

          - `"mac"`

          - `"linux"`

          - `"ubuntu"`

          - `"browser"`

        - `type: "computer_use_preview"`

          The type of the computer use tool. Always `computer_use_preview`.

          - `"computer_use_preview"`

      - `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"`

          The type of the web search tool. One of `web_search` or `web_search_2025_08_26`.

          - `"web_search"`

          - `"web_search_2025_08_26"`

        - `external_web_access?: boolean`

          Allow live internet access for web search. Defaults to true when omitted. When false, the web search tool runs in offline/cache-only mode and will not fetch new external content.

        - `filters?: Filters | null`

          Filters for the search.

          - `allowed_domains?: Array<string> | null`

            Allowed domains for the search. If not provided, all domains are allowed.
            Subdomains of the provided domains are allowed as well.

            Example: `["pubmed.ncbi.nlm.nih.gov"]`

        - `search_context_size?: "low" | "medium" | "high"`

          High level guidance for the amount of context window space to use for the search. One of `low`, `medium`, or `high`. `medium` is the default.

          - `"low"`

          - `"medium"`

          - `"high"`

        - `user_location?: UserLocation | null`

          The approximate location of the user.

          - `city?: string | null`

            Free text input for the city of the user, e.g. `San Francisco`.

          - `country?: string | null`

            The two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of the user, e.g. `US`.

          - `region?: string | null`

            Free text input for the region of the user, e.g. `California`.

          - `timezone?: string | null`

            The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of the user, e.g. `America/Los_Angeles`.

          - `type?: "approximate"`

            The type of location approximation. Always `approximate`.

            - `"approximate"`

      - `Mcp`

        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).

        - `server_label: string`

          A label for this MCP server, used to identify it in tool calls.

        - `type: "mcp"`

          The type of the MCP tool. Always `mcp`.

          - `"mcp"`

        - `allowed_callers?: Array<"direct" | "programmatic"> | null`

          The tool invocation context(s).

          - `"direct"`

          - `"programmatic"`

        - `allowed_tools?: Array<string> | McpToolFilter | null`

          List of allowed tool names or a filter object.

          - `Array<string>`

          - `McpToolFilter`

            A filter object to specify which tools are allowed.

            - `read_only?: boolean`

              Indicates whether or not a tool modifies data or is read-only. If an
              MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint),
              it will match this filter.

            - `tool_names?: Array<string>`

              List of allowed tool names.

        - `authorization?: string`

          An OAuth access token that can be used with a remote MCP server, either
          with a custom MCP server URL or a service connector. Your application
          must handle the OAuth authorization flow and provide the token here.

        - `connector_id?: "connector_dropbox" | "connector_gmail" | "connector_googlecalendar" | 5 more`

          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`

          - `"connector_dropbox"`

          - `"connector_gmail"`

          - `"connector_googlecalendar"`

          - `"connector_googledrive"`

          - `"connector_microsoftteams"`

          - `"connector_outlookcalendar"`

          - `"connector_outlookemail"`

          - `"connector_sharepoint"`

        - `defer_loading?: boolean`

          Whether this MCP tool is deferred and discovered via tool search.

        - `headers?: Record<string, string> | null`

          Optional HTTP headers to send to the MCP server. Use for authentication
          or other purposes.

        - `require_approval?: McpToolApprovalFilter | "always" | "never" | null`

          Specify which of the MCP server's tools require approval.

          - `McpToolApprovalFilter`

            Specify which of the MCP server's tools require approval. Can be
            `always`, `never`, or a filter object associated with tools
            that require approval.

            - `always?: Always`

              A filter object to specify which tools are allowed.

              - `read_only?: boolean`

                Indicates whether or not a tool modifies data or is read-only. If an
                MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint),
                it will match this filter.

              - `tool_names?: Array<string>`

                List of allowed tool names.

            - `never?: Never`

              A filter object to specify which tools are allowed.

              - `read_only?: boolean`

                Indicates whether or not a tool modifies data or is read-only. If an
                MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint),
                it will match this filter.

              - `tool_names?: Array<string>`

                List of allowed tool names.

          - `"always" | "never"`

            - `"always"`

            - `"never"`

        - `server_description?: string`

          Optional description of the MCP server, used to provide more context.

        - `server_url?: string`

          The URL for the MCP server. One of `server_url`, `connector_id`, or
          `tunnel_id` must be provided.

        - `tunnel_id?: string`

          The Secure MCP Tunnel ID to use instead of a direct server URL. One of
          `server_url`, `connector_id`, or `tunnel_id` must be provided.

      - `CodeInterpreter`

        A tool that runs Python code to help generate a response to a prompt.

        - `container: string | CodeInterpreterToolAuto`

          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`

          - `CodeInterpreterToolAuto`

            Configuration for a code interpreter container. Optionally specify the IDs of the files to run the code on.

            - `type: "auto"`

              Always `auto`.

              - `"auto"`

            - `file_ids?: Array<string>`

              An optional list of uploaded files to make available to your code.

            - `memory_limit?: "1g" | "4g" | "16g" | "64g" | null`

              The memory limit for the code interpreter container.

              - `"1g"`

              - `"4g"`

              - `"16g"`

              - `"64g"`

            - `network_policy?: BetaContainerNetworkPolicyDisabled | BetaContainerNetworkPolicyAllowlist`

              Network access policy for the container.

              - `BetaContainerNetworkPolicyDisabled`

                - `type: "disabled"`

                  Disable outbound network access. Always `disabled`.

                  - `"disabled"`

              - `BetaContainerNetworkPolicyAllowlist`

                - `allowed_domains: Array<string>`

                  A list of allowed domains when type is `allowlist`.

                - `type: "allowlist"`

                  Allow outbound network access only to specified domains. Always `allowlist`.

                  - `"allowlist"`

                - `domain_secrets?: Array<BetaContainerNetworkPolicyDomainSecret>`

                  Optional domain-scoped secrets for allowlisted domains.

                  - `domain: string`

                    The domain associated with the secret.

                  - `name: string`

                    The name of the secret to inject for the domain.

                  - `value: string`

                    The secret value to inject for the domain.

        - `type: "code_interpreter"`

          The type of the code interpreter tool. Always `code_interpreter`.

          - `"code_interpreter"`

        - `allowed_callers?: Array<"direct" | "programmatic"> | null`

          The tool invocation context(s).

          - `"direct"`

          - `"programmatic"`

      - `ProgrammaticToolCalling`

        - `type: "programmatic_tool_calling"`

          The type of the tool. Always `programmatic_tool_calling`.

          - `"programmatic_tool_calling"`

      - `ImageGeneration`

        A tool that generates images using the GPT image models.

        - `type: "image_generation"`

          The type of the image generation tool. Always `image_generation`.

          - `"image_generation"`

        - `action?: "generate" | "edit" | "auto"`

          Whether to generate a new image or edit an existing image. Default: `auto`.

          - `"generate"`

          - `"edit"`

          - `"auto"`

        - `background?: "transparent" | "opaque" | "auto"`

          Allows to set transparency for the background of the generated image(s).
          Must be one of `transparent`, `opaque`, or `auto` (default value). When
          `auto` is used, the model will automatically determine the best
          background for the image.

          Transparent backgrounds are available for supported GPT Image models.
          For `gpt-image-2` and `gpt-image-2-2026-04-21`, this support is in
          preview. When using `transparent`, set the output format to `png` or
          `webp`.

          - `"transparent"`

          - `"opaque"`

          - `"auto"`

        - `input_fidelity?: "high" | "low" | null`

          Control how much effort the model will exert to match the style and features, especially facial features, of input images. This parameter is only supported for `gpt-image-1` and `gpt-image-1.5` and later models, unsupported for `gpt-image-1-mini`. Supports `high` and `low`. Defaults to `low`.

          - `"high"`

          - `"low"`

        - `input_image_mask?: InputImageMask`

          Optional mask for inpainting. Contains `image_url`
          (string, optional) and `file_id` (string, optional).

          - `file_id?: string`

            File ID for the mask image.

          - `image_url?: string`

            Base64-encoded mask image.

        - `model?: (string & {}) | "gpt-image-1" | "gpt-image-1-mini" | "gpt-image-2" | 3 more`

          The image generation model to use. One of `gpt-image-1`,
          `gpt-image-1-mini`, `gpt-image-1.5`, `gpt-image-2`,
          `gpt-image-2-2026-04-21`, or `chatgpt-image-latest`. Default:
          `gpt-image-1`.

          - `(string & {})`

          - `"gpt-image-1" | "gpt-image-1-mini" | "gpt-image-2" | 3 more`

            - `"gpt-image-1"`

            - `"gpt-image-1-mini"`

            - `"gpt-image-2"`

            - `"gpt-image-2-2026-04-21"`

            - `"gpt-image-1.5"`

            - `"chatgpt-image-latest"`

        - `moderation?: "auto" | "low"`

          Moderation level for the generated image. Default: `auto`.

          - `"auto"`

          - `"low"`

        - `output_compression?: number`

          Compression level for the output image. Default: 100.

        - `output_format?: "png" | "webp" | "jpeg"`

          The output format of the generated image. One of `png`, `webp`, or
          `jpeg`. Default: `png`.

          - `"png"`

          - `"webp"`

          - `"jpeg"`

        - `partial_images?: number`

          Number of partial images to generate in streaming mode, from 0 (default value) to 3.

        - `quality?: "low" | "medium" | "high" | "auto"`

          The quality of the generated image. One of `low`, `medium`, `high`,
          or `auto`. Default: `auto`.

          - `"low"`

          - `"medium"`

          - `"high"`

          - `"auto"`

        - `size?: (string & {}) | "1024x1024" | "1024x1536" | "1536x1024" | "auto"`

          The size of the generated images. For `gpt-image-2` and `gpt-image-2-2026-04-21`, arbitrary resolutions are supported as `WIDTHxHEIGHT` strings, for example `1536x864`. Width and height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above `2560x1440` are experimental, and the maximum supported resolution is `3840x2160`. The requested size must also satisfy the model's current pixel and edge limits. The standard sizes `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models; `auto` is supported for models that allow automatic sizing. For `dall-e-2`, use one of `256x256`, `512x512`, or `1024x1024`. For `dall-e-3`, use one of `1024x1024`, `1792x1024`, or `1024x1792`.

          - `(string & {})`

          - `"1024x1024" | "1024x1536" | "1536x1024" | "auto"`

            - `"1024x1024"`

            - `"1024x1536"`

            - `"1536x1024"`

            - `"auto"`

      - `LocalShell`

        A tool that allows the model to execute shell commands in a local environment.

        - `type: "local_shell"`

          The type of the local shell tool. Always `local_shell`.

          - `"local_shell"`

      - `BetaFunctionShellTool`

        A tool that allows the model to execute shell commands.

        - `type: "shell"`

          The type of the shell tool. Always `shell`.

          - `"shell"`

        - `allowed_callers?: Array<"direct" | "programmatic"> | null`

          The tool invocation context(s).

          - `"direct"`

          - `"programmatic"`

        - `environment?: BetaContainerAuto | BetaLocalEnvironment | BetaContainerReference | null`

          - `BetaContainerAuto`

            - `type: "container_auto"`

              Automatically creates a container for this request

              - `"container_auto"`

            - `file_ids?: Array<string>`

              An optional list of uploaded files to make available to your code.

            - `memory_limit?: "1g" | "4g" | "16g" | "64g" | null`

              The memory limit for the container.

              - `"1g"`

              - `"4g"`

              - `"16g"`

              - `"64g"`

            - `network_policy?: BetaContainerNetworkPolicyDisabled | BetaContainerNetworkPolicyAllowlist`

              Network access policy for the container.

              - `BetaContainerNetworkPolicyDisabled`

              - `BetaContainerNetworkPolicyAllowlist`

            - `skills?: Array<BetaSkillReference | BetaInlineSkill>`

              An optional list of skills referenced by id or inline data.

              - `BetaSkillReference`

                - `skill_id: string`

                  The ID of the referenced skill.

                - `type: "skill_reference"`

                  References a skill created with the /v1/skills endpoint.

                  - `"skill_reference"`

                - `version?: string`

                  Optional skill version. Use a positive integer or 'latest'. Omit for default.

              - `BetaInlineSkill`

                - `description: string`

                  The description of the skill.

                - `name: string`

                  The name of the skill.

                - `source: BetaInlineSkillSource`

                  Inline skill payload

                  - `data: string`

                    Base64-encoded skill zip bundle.

                  - `media_type: "application/zip"`

                    The media type of the inline skill payload. Must be `application/zip`.

                    - `"application/zip"`

                  - `type: "base64"`

                    The type of the inline skill source. Must be `base64`.

                    - `"base64"`

                - `type: "inline"`

                  Defines an inline skill for this request.

                  - `"inline"`

          - `BetaLocalEnvironment`

            - `type: "local"`

              Use a local computer environment.

              - `"local"`

            - `skills?: Array<BetaLocalSkill>`

              An optional list of skills.

              - `description: string`

                The description of the skill.

              - `name: string`

                The name of the skill.

              - `path: string`

                The path to the directory containing the skill.

          - `BetaContainerReference`

            - `container_id: string`

              The ID of the referenced container.

            - `type: "container_reference"`

              References a container created with the /v1/containers endpoint

              - `"container_reference"`

      - `BetaCustomTool`

        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)

        - `name: string`

          The name of the custom tool, used to identify it in tool calls.

        - `type: "custom"`

          The type of the custom tool. Always `custom`.

          - `"custom"`

        - `allowed_callers?: Array<"direct" | "programmatic"> | null`

          The tool invocation context(s).

          - `"direct"`

          - `"programmatic"`

        - `defer_loading?: boolean`

          Whether this tool should be deferred and discovered via tool search.

        - `description?: string`

          Optional description of the custom tool, used to provide more context.

        - `format?: Text | Grammar`

          The input format for the custom tool. Default is unconstrained text.

          - `Text`

            Unconstrained free-form text.

            - `type: "text"`

              Unconstrained text format. Always `text`.

              - `"text"`

          - `Grammar`

            A grammar defined by the user.

            - `definition: string`

              The grammar definition.

            - `syntax: "lark" | "regex"`

              The syntax of the grammar definition. One of `lark` or `regex`.

              - `"lark"`

              - `"regex"`

            - `type: "grammar"`

              Grammar format. Always `grammar`.

              - `"grammar"`

      - `BetaNamespaceTool`

        Groups function/custom tools under a shared namespace.

        - `description: string`

          A description of the namespace shown to the model.

        - `name: string`

          The namespace name used in tool calls (for example, `crm`).

        - `tools: Array<Function | BetaCustomTool>`

          The function/custom tools available inside this namespace.

          - `Function`

            - `name: string`

            - `type: "function"`

              - `"function"`

            - `allowed_callers?: Array<"direct" | "programmatic"> | null`

              The tool invocation context(s).

              - `"direct"`

              - `"programmatic"`

            - `defer_loading?: boolean`

              Whether this function should be deferred and discovered via tool search.

            - `description?: string | null`

            - `output_schema?: Record<string, unknown> | null`

              A JSON Schema describing the JSON value encoded in string outputs for this function tool. This does not describe content-array outputs.

            - `parameters?: unknown`

            - `strict?: boolean | null`

              Whether to enforce strict parameter validation. If omitted, Responses attempts to use strict validation when the schema is compatible, and falls back to non-strict validation otherwise.

          - `BetaCustomTool`

            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: "namespace"`

          The type of the tool. Always `namespace`.

          - `"namespace"`

      - `BetaToolSearchTool`

        Hosted or BYOT tool search configuration for deferred tools.

        - `type: "tool_search"`

          The type of the tool. Always `tool_search`.

          - `"tool_search"`

        - `description?: string | null`

          Description shown to the model for a client-executed tool search tool.

        - `execution?: "server" | "client"`

          Whether tool search is executed by the server or by the client.

          - `"server"`

          - `"client"`

        - `parameters?: unknown`

          Parameter schema for a client-executed tool search tool.

      - `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"`

          The type of the web search tool. One of `web_search_preview` or `web_search_preview_2025_03_11`.

          - `"web_search_preview"`

          - `"web_search_preview_2025_03_11"`

        - `search_content_types?: Array<"text" | "image">`

          - `"text"`

          - `"image"`

        - `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.

          - `"low"`

          - `"medium"`

          - `"high"`

        - `user_location?: UserLocation | null`

          The user's location.

          - `type: "approximate"`

            The type of location approximation. Always `approximate`.

            - `"approximate"`

          - `city?: string | null`

            Free text input for the city of the user, e.g. `San Francisco`.

          - `country?: string | null`

            The two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of the user, e.g. `US`.

          - `region?: string | null`

            Free text input for the region of the user, e.g. `California`.

          - `timezone?: string | null`

            The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of the user, e.g. `America/Los_Angeles`.

      - `BetaApplyPatchTool`

        Allows the assistant to create, delete, or update files using unified diffs.

        - `type: "apply_patch"`

          The type of the tool. Always `apply_patch`.

          - `"apply_patch"`

        - `allowed_callers?: Array<"direct" | "programmatic"> | null`

          The tool invocation context(s).

          - `"direct"`

          - `"programmatic"`

    - `type: "tool_search_output"`

      The item type. Always `tool_search_output`.

      - `"tool_search_output"`

    - `id?: string | null`

      The unique ID of this tool search output.

    - `agent?: Agent | null`

      The agent that produced this item.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

    - `call_id?: string | null`

      The unique ID of the tool search call generated by the model.

    - `execution?: "server" | "client"`

      Whether tool search was executed by the server or by the client.

      - `"server"`

      - `"client"`

    - `status?: "in_progress" | "completed" | "incomplete" | null`

      The status of the tool search output.

      - `"in_progress"`

      - `"completed"`

      - `"incomplete"`

  - `AdditionalTools`

    - `role: "developer"`

      The role that provided the additional tools. Only `developer` is supported.

      - `"developer"`

    - `tools: Array<BetaTool>`

      A list of additional tools made available at this item.

      - `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).

      - `Mcp`

        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).

      - `CodeInterpreter`

        A tool that runs Python code to help generate a response to a prompt.

      - `ProgrammaticToolCalling`

      - `ImageGeneration`

        A tool that generates images using the GPT image models.

      - `LocalShell`

        A tool that allows the model to execute shell commands in a local environment.

      - `BetaFunctionShellTool`

        A tool that allows the model to execute shell commands.

      - `BetaCustomTool`

        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)

      - `BetaNamespaceTool`

        Groups function/custom tools under a shared namespace.

      - `BetaToolSearchTool`

        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).

      - `BetaApplyPatchTool`

        Allows the assistant to create, delete, or update files using unified diffs.

    - `type: "additional_tools"`

      The item type. Always `additional_tools`.

      - `"additional_tools"`

    - `id?: string | null`

      The unique ID of this additional tools item.

    - `agent?: Agent | null`

      The agent that produced this item.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

  - `BetaResponseReasoningItem`

    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).

    - `id: string`

      The unique identifier of the reasoning content.

    - `summary: Array<Summary>`

      Reasoning summary content.

      - `text: string`

        A summary of the reasoning output from the model so far.

      - `type: "summary_text"`

        The type of the object. Always `summary_text`.

        - `"summary_text"`

    - `type: "reasoning"`

      The type of the object. Always `reasoning`.

      - `"reasoning"`

    - `agent?: Agent | null`

      The agent that produced this item.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

    - `content?: Array<Content>`

      Reasoning text content.

      - `text: string`

        The reasoning text from the model.

      - `type: "reasoning_text"`

        The type of the reasoning text. Always `reasoning_text`.

        - `"reasoning_text"`

    - `encrypted_content?: string | null`

      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.

      When streaming, use the completed reasoning item and its
      `encrypted_content` from the `response.output_item.done` event in
      subsequent requests. The `encrypted_content` in
      `response.output_item.added` may be incomplete. This is especially
      important when `store` is `false` or when using Zero Data Retention.

    - `status?: "in_progress" | "completed" | "incomplete"`

      The status of the item. One of `in_progress`, `completed`, or
      `incomplete`. Populated when items are returned via API.

      - `"in_progress"`

      - `"completed"`

      - `"incomplete"`

  - `BetaResponseCompactionItemParam`

    A compaction item generated by the [`v1/responses/compact` API](https://platform.openai.com/docs/api-reference/responses/compact).

    - `encrypted_content: string`

      The encrypted content of the compaction summary.

    - `type: "compaction"`

      The type of the item. Always `compaction`.

      - `"compaction"`

    - `id?: string | null`

      The ID of the compaction item.

    - `agent?: Agent | null`

      The agent that produced this item.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

  - `ImageGenerationCall`

    An image generation request made by the model.

    - `id: string`

      The unique ID of the image generation call.

    - `result: string | null`

      The generated image encoded in base64.

    - `status: "in_progress" | "completed" | "generating" | "failed"`

      The status of the image generation call.

      - `"in_progress"`

      - `"completed"`

      - `"generating"`

      - `"failed"`

    - `type: "image_generation_call"`

      The type of the image generation call. Always `image_generation_call`.

      - `"image_generation_call"`

    - `agent?: Agent | null`

      The agent that produced this item.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

  - `BetaResponseCodeInterpreterToolCall`

    A tool call to run code.

    - `id: string`

      The unique ID of the code interpreter tool call.

    - `code: string | null`

      The code to run, or null if not available.

    - `container_id: string`

      The ID of the container used to run the code.

    - `outputs: Array<Logs | Image> | null`

      The outputs generated by the code interpreter, such as logs or images.
      Can be null if no outputs are available.

      - `Logs`

        The logs output from the code interpreter.

        - `logs: string`

          The logs output from the code interpreter.

        - `type: "logs"`

          The type of the output. Always `logs`.

          - `"logs"`

      - `Image`

        The image output from the code interpreter.

        - `type: "image"`

          The type of the output. Always `image`.

          - `"image"`

        - `url: string`

          The URL of the image output from the code interpreter.

    - `status: "in_progress" | "completed" | "incomplete" | 2 more`

      The status of the code interpreter tool call. Valid values are `in_progress`, `completed`, `incomplete`, `interpreting`, and `failed`.

      - `"in_progress"`

      - `"completed"`

      - `"incomplete"`

      - `"interpreting"`

      - `"failed"`

    - `type: "code_interpreter_call"`

      The type of the code interpreter tool call. Always `code_interpreter_call`.

      - `"code_interpreter_call"`

    - `agent?: Agent | null`

      The agent that produced this item.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

  - `LocalShellCall`

    A tool call to run a command on the local shell.

    - `id: string`

      The unique ID of the local shell call.

    - `action: Action`

      Execute a shell command on the server.

      - `command: Array<string>`

        The command to run.

      - `env: Record<string, string>`

        Environment variables to set for the command.

      - `type: "exec"`

        The type of the local shell action. Always `exec`.

        - `"exec"`

      - `timeout_ms?: number | null`

        Optional timeout in milliseconds for the command.

      - `user?: string | null`

        Optional user to run the command as.

      - `working_directory?: string | null`

        Optional working directory to run the command in.

    - `call_id: string`

      The unique ID of the local shell tool call generated by the model.

    - `status: "in_progress" | "completed" | "incomplete"`

      The status of the local shell call.

      - `"in_progress"`

      - `"completed"`

      - `"incomplete"`

    - `type: "local_shell_call"`

      The type of the local shell call. Always `local_shell_call`.

      - `"local_shell_call"`

    - `agent?: Agent | null`

      The agent that produced this item.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

  - `LocalShellCallOutput`

    The output of a local shell tool call.

    - `id: string`

      The unique ID of the local shell tool call generated by the model.

    - `output: string`

      A JSON string of the output of the local shell tool call.

    - `type: "local_shell_call_output"`

      The type of the local shell tool call output. Always `local_shell_call_output`.

      - `"local_shell_call_output"`

    - `agent?: Agent | null`

      The agent that produced this item.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

    - `status?: "in_progress" | "completed" | "incomplete" | null`

      The status of the item. One of `in_progress`, `completed`, or `incomplete`.

      - `"in_progress"`

      - `"completed"`

      - `"incomplete"`

  - `ShellCall`

    A tool representing a request to execute one or more shell commands.

    - `action: Action`

      The shell commands and limits that describe how to run the tool call.

      - `commands: Array<string>`

        Ordered shell commands for the execution environment to run.

      - `max_output_length?: number | null`

        Maximum number of UTF-8 characters to capture from combined stdout and stderr output.

      - `timeout_ms?: number | null`

        Maximum wall-clock time in milliseconds to allow the shell commands to run.

    - `call_id: string`

      The unique ID of the shell tool call generated by the model.

    - `type: "shell_call"`

      The type of the item. Always `shell_call`.

      - `"shell_call"`

    - `id?: string | null`

      The unique ID of the shell tool call. Populated when this item is returned via API.

    - `agent?: Agent | null`

      The agent that produced this item.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

    - `caller?: Direct | Program | null`

      The execution context that produced this tool call.

      - `Direct`

        - `type: "direct"`

          The caller type. Always `direct`.

          - `"direct"`

      - `Program`

        - `caller_id: string`

          The call ID of the program item that produced this tool call.

        - `type: "program"`

          The caller type. Always `program`.

          - `"program"`

    - `environment?: BetaLocalEnvironment | BetaContainerReference | null`

      The environment to execute the shell commands in.

      - `BetaLocalEnvironment`

      - `BetaContainerReference`

    - `status?: "in_progress" | "completed" | "incomplete" | null`

      The status of the shell call. One of `in_progress`, `completed`, or `incomplete`.

      - `"in_progress"`

      - `"completed"`

      - `"incomplete"`

  - `ShellCallOutput`

    The streamed output items emitted by a shell tool call.

    - `call_id: string`

      The unique ID of the shell tool call generated by the model.

    - `output: Array<BetaResponseFunctionShellCallOutputContent>`

      Captured chunks of stdout and stderr output, along with their associated outcomes.

      - `outcome: Timeout | Exit`

        The exit or timeout outcome associated with this shell call.

        - `Timeout`

          Indicates that the shell call exceeded its configured time limit.

          - `type: "timeout"`

            The outcome type. Always `timeout`.

            - `"timeout"`

        - `Exit`

          Indicates that the shell commands finished and returned an exit code.

          - `exit_code: number`

            The exit code returned by the shell process.

          - `type: "exit"`

            The outcome type. Always `exit`.

            - `"exit"`

      - `stderr: string`

        Captured stderr output for the shell call.

      - `stdout: string`

        Captured stdout output for the shell call.

    - `type: "shell_call_output"`

      The type of the item. Always `shell_call_output`.

      - `"shell_call_output"`

    - `id?: string | null`

      The unique ID of the shell tool call output. Populated when this item is returned via API.

    - `agent?: Agent | null`

      The agent that produced this item.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

    - `caller?: Direct | Program | null`

      The execution context that produced this tool call.

      - `Direct`

        - `type: "direct"`

          The caller type. Always `direct`.

          - `"direct"`

      - `Program`

        - `caller_id: string`

          The call ID of the program item that produced this tool call.

        - `type: "program"`

          The caller type. Always `program`.

          - `"program"`

    - `max_output_length?: number | null`

      The maximum number of UTF-8 characters captured for this shell call's combined output.

    - `status?: "in_progress" | "completed" | "incomplete" | null`

      The status of the shell call output.

      - `"in_progress"`

      - `"completed"`

      - `"incomplete"`

  - `ApplyPatchCall`

    A tool call representing a request to create, delete, or update files using diff patches.

    - `call_id: string`

      The unique ID of the apply patch tool call generated by the model.

    - `operation: CreateFile | DeleteFile | UpdateFile`

      The specific create, delete, or update instruction for the apply_patch tool call.

      - `CreateFile`

        Instruction for creating a new file via the apply_patch tool.

        - `diff: string`

          Unified diff content to apply when creating the file.

        - `path: string`

          Path of the file to create relative to the workspace root.

        - `type: "create_file"`

          The operation type. Always `create_file`.

          - `"create_file"`

      - `DeleteFile`

        Instruction for deleting an existing file via the apply_patch tool.

        - `path: string`

          Path of the file to delete relative to the workspace root.

        - `type: "delete_file"`

          The operation type. Always `delete_file`.

          - `"delete_file"`

      - `UpdateFile`

        Instruction for updating an existing file via the apply_patch tool.

        - `diff: string`

          Unified diff content to apply to the existing file.

        - `path: string`

          Path of the file to update relative to the workspace root.

        - `type: "update_file"`

          The operation type. Always `update_file`.

          - `"update_file"`

    - `status: "in_progress" | "completed"`

      The status of the apply patch tool call. One of `in_progress` or `completed`.

      - `"in_progress"`

      - `"completed"`

    - `type: "apply_patch_call"`

      The type of the item. Always `apply_patch_call`.

      - `"apply_patch_call"`

    - `id?: string | null`

      The unique ID of the apply patch tool call. Populated when this item is returned via API.

    - `agent?: Agent | null`

      The agent that produced this item.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

    - `caller?: Direct | Program | null`

      The execution context that produced this tool call.

      - `Direct`

        - `type: "direct"`

          The caller type. Always `direct`.

          - `"direct"`

      - `Program`

        - `caller_id: string`

          The call ID of the program item that produced this tool call.

        - `type: "program"`

          The caller type. Always `program`.

          - `"program"`

  - `ApplyPatchCallOutput`

    The streamed output emitted by an apply patch tool call.

    - `call_id: string`

      The unique ID of the apply patch tool call generated by the model.

    - `status: "completed" | "failed"`

      The status of the apply patch tool call output. One of `completed` or `failed`.

      - `"completed"`

      - `"failed"`

    - `type: "apply_patch_call_output"`

      The type of the item. Always `apply_patch_call_output`.

      - `"apply_patch_call_output"`

    - `id?: string | null`

      The unique ID of the apply patch tool call output. Populated when this item is returned via API.

    - `agent?: Agent | null`

      The agent that produced this item.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

    - `caller?: Direct | Program | null`

      The execution context that produced this tool call.

      - `Direct`

        - `type: "direct"`

          The caller type. Always `direct`.

          - `"direct"`

      - `Program`

        - `caller_id: string`

          The call ID of the program item that produced this tool call.

        - `type: "program"`

          The caller type. Always `program`.

          - `"program"`

    - `output?: string | null`

      Optional human-readable log text from the apply patch tool (e.g., patch results or errors).

  - `McpListTools`

    A list of tools available on an MCP server.

    - `id: string`

      The unique ID of the list.

    - `server_label: string`

      The label of the MCP server.

    - `tools: Array<Tool>`

      The tools available on the server.

      - `input_schema: unknown`

        The JSON schema describing the tool's input.

      - `name: string`

        The name of the tool.

      - `annotations?: unknown`

        Additional annotations about the tool.

      - `description?: string | null`

        The description of the tool.

    - `type: "mcp_list_tools"`

      The type of the item. Always `mcp_list_tools`.

      - `"mcp_list_tools"`

    - `agent?: Agent | null`

      The agent that produced this item.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

    - `error?: string | null`

      Error message if the server could not list tools.

  - `McpApprovalRequest`

    A request for human approval of a tool invocation.

    - `id: string`

      The unique ID of the approval request.

    - `arguments: string`

      A JSON string of arguments for the tool.

    - `name: string`

      The name of the tool to run.

    - `server_label: string`

      The label of the MCP server making the request.

    - `type: "mcp_approval_request"`

      The type of the item. Always `mcp_approval_request`.

      - `"mcp_approval_request"`

    - `agent?: Agent | null`

      The agent that produced this item.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

  - `McpApprovalResponse`

    A response to an MCP approval request.

    - `approval_request_id: string`

      The ID of the approval request being answered.

    - `approve: boolean`

      Whether the request was approved.

    - `type: "mcp_approval_response"`

      The type of the item. Always `mcp_approval_response`.

      - `"mcp_approval_response"`

    - `id?: string | null`

      The unique ID of the approval response

    - `agent?: Agent | null`

      The agent that produced this item.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

    - `reason?: string | null`

      Optional reason for the decision.

  - `McpCall`

    An invocation of a tool on an MCP server.

    - `id: string`

      The unique ID of the tool call.

    - `arguments: string`

      A JSON string of the arguments passed to the tool.

    - `name: string`

      The name of the tool that was run.

    - `server_label: string`

      The label of the MCP server running the tool.

    - `type: "mcp_call"`

      The type of the item. Always `mcp_call`.

      - `"mcp_call"`

    - `agent?: Agent | null`

      The agent that produced this item.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

    - `approval_request_id?: string | null`

      Unique identifier for the MCP tool call approval request.
      Include this value in a subsequent `mcp_approval_response` input to approve or reject the corresponding tool call.

    - `error?: BetaMcpToolCallError | null`

      The error from the tool call, if any.

      - `McpProtocolError`

        - `code: number`

        - `message: string`

        - `type: "mcp_protocol_error"`

          - `"mcp_protocol_error"`

      - `McpToolExecutionError`

        - `content: unknown`

        - `type: "mcp_tool_execution_error"`

          - `"mcp_tool_execution_error"`

      - `HTTPError`

        - `code: number`

        - `message: string`

        - `type: "http_error"`

          - `"http_error"`

    - `output?: string | null`

      The output from the tool call.

    - `status?: "in_progress" | "completed" | "incomplete" | 2 more`

      The status of the tool call. One of `in_progress`, `completed`, `incomplete`, `calling`, or `failed`.

      - `"in_progress"`

      - `"completed"`

      - `"incomplete"`

      - `"calling"`

      - `"failed"`

  - `BetaResponseCustomToolCallOutput`

    The output of a custom tool call from your code, being sent back to the model.

    - `call_id: string`

      The call ID, used to map this custom tool call output to a custom tool call.

    - `output: string | Array<BetaResponseInputText | BetaResponseInputImage | BetaResponseInputFile>`

      The output from the custom tool call generated by your code.
      Can be a string or an list of output content.

      - `string`

      - `Array<BetaResponseInputText | BetaResponseInputImage | BetaResponseInputFile>`

        - `BetaResponseInputText`

          A text input to the model.

        - `BetaResponseInputImage`

          An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision).

        - `BetaResponseInputFile`

          A file input to the model.

    - `type: "custom_tool_call_output"`

      The type of the custom tool call output. Always `custom_tool_call_output`.

      - `"custom_tool_call_output"`

    - `id?: string`

      The unique ID of the custom tool call output in the OpenAI platform.

    - `agent?: Agent | null`

      The agent that produced this item.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

    - `caller?: Direct | Program | null`

      The execution context that produced this tool call.

      - `Direct`

        - `type: "direct"`

          The caller type. Always `direct`.

          - `"direct"`

      - `Program`

        - `caller_id: string`

          The call ID of the program item that produced this tool call.

        - `type: "program"`

          The caller type. Always `program`.

          - `"program"`

  - `BetaResponseCustomToolCall`

    A call to a custom tool created by the model.

    - `call_id: string`

      An identifier used to map this custom tool call to a tool call output.

    - `input: string`

      The input for the custom tool call generated by the model.

    - `name: string`

      The name of the custom tool being called.

    - `type: "custom_tool_call"`

      The type of the custom tool call. Always `custom_tool_call`.

      - `"custom_tool_call"`

    - `id?: string`

      The unique ID of the custom tool call in the OpenAI platform.

    - `agent?: Agent | null`

      The agent that produced this item.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

    - `caller?: Direct | Program | null`

      The execution context that produced this tool call.

      - `Direct`

        - `type: "direct"`

          - `"direct"`

      - `Program`

        - `caller_id: string`

          The call ID of the program item that produced this tool call.

        - `type: "program"`

          - `"program"`

    - `namespace?: string`

      The namespace of the custom tool being called.

  - `CompactionTrigger`

    Compacts the current context. Must be the final input item.

    - `type: "compaction_trigger"`

      The type of the item. Always `compaction_trigger`.

      - `"compaction_trigger"`

    - `agent?: Agent | null`

      The agent that produced this item.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

  - `ItemReference`

    An internal identifier for an item to reference.

    - `id: string`

      The ID of the item to reference.

    - `agent?: Agent | null`

      The agent that produced this item.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

    - `type?: "item_reference" | null`

      The type of item to reference. Always `item_reference`.

      - `"item_reference"`

  - `Program`

    - `id: string`

      The unique ID of this program item.

    - `call_id: string`

      The stable call ID of the program item.

    - `code: string`

      The JavaScript source executed by programmatic tool calling.

    - `fingerprint: string`

      Opaque program replay fingerprint that must be round-tripped.

    - `type: "program"`

      The item type. Always `program`.

      - `"program"`

    - `agent?: Agent | null`

      The agent that produced this item.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

  - `ProgramOutput`

    - `id: string`

      The unique ID of this program output item.

    - `call_id: string`

      The call ID of the program item.

    - `result: string`

      The result produced by the program item.

    - `status: "completed" | "incomplete"`

      The terminal status of the program output.

      - `"completed"`

      - `"incomplete"`

    - `type: "program_output"`

      The item type. Always `program_output`.

      - `"program_output"`

    - `agent?: Agent | null`

      The agent that produced this item.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

### Beta Response Input Message Content List

- `BetaResponseInputMessageContentList = Array<BetaResponseInputContent>`

  A list of one or many input items to the model, containing different content
  types.

  - `BetaResponseInputText`

    A text input to the model.

    - `text: string`

      The text input to the model.

    - `type: "input_text"`

      The type of the input item. Always `input_text`.

      - `"input_text"`

    - `prompt_cache_breakpoint?: PromptCacheBreakpoint`

      Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.

      - `mode: "explicit"`

        The breakpoint mode. Always `explicit`.

        - `"explicit"`

  - `BetaResponseInputImage`

    An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision).

    - `detail: BetaImageDetail`

      The detail level of the image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`.

      - `"low"`

      - `"high"`

      - `"auto"`

      - `"original"`

    - `type: "input_image"`

      The type of the input item. Always `input_image`.

      - `"input_image"`

    - `file_id?: string | null`

      The ID of the file to be sent to the model.

    - `image_url?: string | null`

      The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.

    - `prompt_cache_breakpoint?: PromptCacheBreakpoint`

      Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.

      - `mode: "explicit"`

        The breakpoint mode. Always `explicit`.

        - `"explicit"`

  - `BetaResponseInputFile`

    A file input to the model.

    - `type: "input_file"`

      The type of the input item. Always `input_file`.

      - `"input_file"`

    - `detail?: "auto" | "low" | "high"`

      The detail level of the file to be sent to the model. Use `auto` to let the system select the detail level; for GPT-5.6 and later models, `auto` uses high-quality rendering, which may increase input token usage. Use `low` for lower-cost rendering, or `high` to render the file at higher quality. Defaults to `auto`.

      - `"auto"`

      - `"low"`

      - `"high"`

    - `file_data?: string`

      The content of the file to be sent to the model.

    - `file_id?: string | null`

      The ID of the file to be sent to the model.

    - `file_url?: string`

      The URL of the file to be sent to the model.

    - `filename?: string`

      The name of the file to be sent to the model.

    - `prompt_cache_breakpoint?: PromptCacheBreakpoint`

      Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.

      - `mode: "explicit"`

        The breakpoint mode. Always `explicit`.

        - `"explicit"`

### Beta Response Input Message Item

- `BetaResponseInputMessageItem`

  - `id: string`

    The unique ID of the message input.

  - `content: BetaResponseInputMessageContentList`

    A list of one or many input items to the model, containing different content
    types.

    - `BetaResponseInputText`

      A text input to the model.

      - `text: string`

        The text input to the model.

      - `type: "input_text"`

        The type of the input item. Always `input_text`.

        - `"input_text"`

      - `prompt_cache_breakpoint?: PromptCacheBreakpoint`

        Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.

        - `mode: "explicit"`

          The breakpoint mode. Always `explicit`.

          - `"explicit"`

    - `BetaResponseInputImage`

      An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision).

      - `detail: BetaImageDetail`

        The detail level of the image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`.

        - `"low"`

        - `"high"`

        - `"auto"`

        - `"original"`

      - `type: "input_image"`

        The type of the input item. Always `input_image`.

        - `"input_image"`

      - `file_id?: string | null`

        The ID of the file to be sent to the model.

      - `image_url?: string | null`

        The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.

      - `prompt_cache_breakpoint?: PromptCacheBreakpoint`

        Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.

        - `mode: "explicit"`

          The breakpoint mode. Always `explicit`.

          - `"explicit"`

    - `BetaResponseInputFile`

      A file input to the model.

      - `type: "input_file"`

        The type of the input item. Always `input_file`.

        - `"input_file"`

      - `detail?: "auto" | "low" | "high"`

        The detail level of the file to be sent to the model. Use `auto` to let the system select the detail level; for GPT-5.6 and later models, `auto` uses high-quality rendering, which may increase input token usage. Use `low` for lower-cost rendering, or `high` to render the file at higher quality. Defaults to `auto`.

        - `"auto"`

        - `"low"`

        - `"high"`

      - `file_data?: string`

        The content of the file to be sent to the model.

      - `file_id?: string | null`

        The ID of the file to be sent to the model.

      - `file_url?: string`

        The URL of the file to be sent to the model.

      - `filename?: string`

        The name of the file to be sent to the model.

      - `prompt_cache_breakpoint?: PromptCacheBreakpoint`

        Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.

        - `mode: "explicit"`

          The breakpoint mode. Always `explicit`.

          - `"explicit"`

  - `role: "user" | "system" | "developer"`

    The role of the message input. One of `user`, `system`, or `developer`.

    - `"user"`

    - `"system"`

    - `"developer"`

  - `type: "message"`

    The type of the message input. Always set to `message`.

    - `"message"`

  - `agent?: Agent | null`

    The agent that produced this item.

    - `agent_name: string`

      The canonical name of the agent that produced this item.

  - `status?: "in_progress" | "completed" | "incomplete"`

    The status of item. One of `in_progress`, `completed`, or
    `incomplete`. Populated when items are returned via API.

    - `"in_progress"`

    - `"completed"`

    - `"incomplete"`

### Beta Response Input Text

- `BetaResponseInputText`

  A text input to the model.

  - `text: string`

    The text input to the model.

  - `type: "input_text"`

    The type of the input item. Always `input_text`.

    - `"input_text"`

  - `prompt_cache_breakpoint?: PromptCacheBreakpoint`

    Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.

    - `mode: "explicit"`

      The breakpoint mode. Always `explicit`.

      - `"explicit"`

### Beta Response Input Text Content

- `BetaResponseInputTextContent`

  A text input to the model.

  - `text: string`

    The text input to the model.

  - `type: "input_text"`

    The type of the input item. Always `input_text`.

    - `"input_text"`

  - `prompt_cache_breakpoint?: PromptCacheBreakpoint | null`

    Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.

    - `mode: "explicit"`

      The breakpoint mode. Always `explicit`.

      - `"explicit"`

### Beta Response Item

- `BetaResponseItem = BetaResponseInputMessageItem | BetaResponseOutputMessage | BetaResponseFileSearchToolCall | 29 more`

  Content item used to generate a response.

  - `BetaResponseInputMessageItem`

    - `id: string`

      The unique ID of the message input.

    - `content: BetaResponseInputMessageContentList`

      A list of one or many input items to the model, containing different content
      types.

      - `BetaResponseInputText`

        A text input to the model.

        - `text: string`

          The text input to the model.

        - `type: "input_text"`

          The type of the input item. Always `input_text`.

          - `"input_text"`

        - `prompt_cache_breakpoint?: PromptCacheBreakpoint`

          Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.

          - `mode: "explicit"`

            The breakpoint mode. Always `explicit`.

            - `"explicit"`

      - `BetaResponseInputImage`

        An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision).

        - `detail: BetaImageDetail`

          The detail level of the image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`.

          - `"low"`

          - `"high"`

          - `"auto"`

          - `"original"`

        - `type: "input_image"`

          The type of the input item. Always `input_image`.

          - `"input_image"`

        - `file_id?: string | null`

          The ID of the file to be sent to the model.

        - `image_url?: string | null`

          The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.

        - `prompt_cache_breakpoint?: PromptCacheBreakpoint`

          Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.

          - `mode: "explicit"`

            The breakpoint mode. Always `explicit`.

            - `"explicit"`

      - `BetaResponseInputFile`

        A file input to the model.

        - `type: "input_file"`

          The type of the input item. Always `input_file`.

          - `"input_file"`

        - `detail?: "auto" | "low" | "high"`

          The detail level of the file to be sent to the model. Use `auto` to let the system select the detail level; for GPT-5.6 and later models, `auto` uses high-quality rendering, which may increase input token usage. Use `low` for lower-cost rendering, or `high` to render the file at higher quality. Defaults to `auto`.

          - `"auto"`

          - `"low"`

          - `"high"`

        - `file_data?: string`

          The content of the file to be sent to the model.

        - `file_id?: string | null`

          The ID of the file to be sent to the model.

        - `file_url?: string`

          The URL of the file to be sent to the model.

        - `filename?: string`

          The name of the file to be sent to the model.

        - `prompt_cache_breakpoint?: PromptCacheBreakpoint`

          Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.

          - `mode: "explicit"`

            The breakpoint mode. Always `explicit`.

            - `"explicit"`

    - `role: "user" | "system" | "developer"`

      The role of the message input. One of `user`, `system`, or `developer`.

      - `"user"`

      - `"system"`

      - `"developer"`

    - `type: "message"`

      The type of the message input. Always set to `message`.

      - `"message"`

    - `agent?: Agent | null`

      The agent that produced this item.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

    - `status?: "in_progress" | "completed" | "incomplete"`

      The status of item. One of `in_progress`, `completed`, or
      `incomplete`. Populated when items are returned via API.

      - `"in_progress"`

      - `"completed"`

      - `"incomplete"`

  - `BetaResponseOutputMessage`

    An output message from the model.

    - `id: string`

      The unique ID of the output message.

    - `content: Array<BetaResponseOutputText | BetaResponseOutputRefusal>`

      The content of the output message.

      - `BetaResponseOutputText`

        A text output from the model.

        - `annotations: Array<FileCitation | URLCitation | ContainerFileCitation | FilePath>`

          The annotations of the text output.

          - `FileCitation`

            A citation to a file.

            - `file_id: string`

              The ID of the file.

            - `filename: string`

              The filename of the file cited.

            - `index: number`

              The index of the file in the list of files.

            - `type: "file_citation"`

              The type of the file citation. Always `file_citation`.

              - `"file_citation"`

          - `URLCitation`

            A citation for a web resource used to generate a model response.

            - `end_index: number`

              The index of the last character of the URL citation in the message.

            - `start_index: number`

              The index of the first character of the URL citation in the message.

            - `title: string`

              The title of the web resource.

            - `type: "url_citation"`

              The type of the URL citation. Always `url_citation`.

              - `"url_citation"`

            - `url: string`

              The URL of the web resource.

          - `ContainerFileCitation`

            A citation for a container file used to generate a model response.

            - `container_id: string`

              The ID of the container file.

            - `end_index: number`

              The index of the last character of the container file citation in the message.

            - `file_id: string`

              The ID of the file.

            - `filename: string`

              The filename of the container file cited.

            - `start_index: number`

              The index of the first character of the container file citation in the message.

            - `type: "container_file_citation"`

              The type of the container file citation. Always `container_file_citation`.

              - `"container_file_citation"`

          - `FilePath`

            A path to a file.

            - `file_id: string`

              The ID of the file.

            - `index: number`

              The index of the file in the list of files.

            - `type: "file_path"`

              The type of the file path. Always `file_path`.

              - `"file_path"`

        - `text: string`

          The text output from the model.

        - `type: "output_text"`

          The type of the output text. Always `output_text`.

          - `"output_text"`

        - `logprobs?: Array<Logprob>`

          - `token: string`

          - `bytes: Array<number>`

          - `logprob: number`

          - `top_logprobs: Array<TopLogprob>`

            - `token: string`

            - `bytes: Array<number>`

            - `logprob: number`

      - `BetaResponseOutputRefusal`

        A refusal from the model.

        - `refusal: string`

          The refusal explanation from the model.

        - `type: "refusal"`

          The type of the refusal. Always `refusal`.

          - `"refusal"`

    - `role: "assistant"`

      The role of the output message. Always `assistant`.

      - `"assistant"`

    - `status: "in_progress" | "completed" | "incomplete"`

      The status of the message input. One of `in_progress`, `completed`, or
      `incomplete`. Populated when input items are returned via API.

      - `"in_progress"`

      - `"completed"`

      - `"incomplete"`

    - `type: "message"`

      The type of the output message. Always `message`.

      - `"message"`

    - `agent?: Agent | null`

      The agent that produced this item.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

    - `phase?: "commentary" | "final_answer" | null`

      Labels an `assistant` message as intermediate commentary (`commentary`) or the final answer (`final_answer`).
      For models like `gpt-5.3-codex` and beyond, when sending follow-up requests, preserve and resend
      phase on all assistant messages — dropping it can degrade performance. Not used for user messages.

      - `"commentary"`

      - `"final_answer"`

  - `BetaResponseFileSearchToolCall`

    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.

    - `id: string`

      The unique ID of the file search tool call.

    - `queries: Array<string>`

      The queries used to search for files.

    - `status: "in_progress" | "searching" | "completed" | 2 more`

      The status of the file search tool call. One of `in_progress`,
      `searching`, `incomplete` or `failed`,

      - `"in_progress"`

      - `"searching"`

      - `"completed"`

      - `"incomplete"`

      - `"failed"`

    - `type: "file_search_call"`

      The type of the file search tool call. Always `file_search_call`.

      - `"file_search_call"`

    - `agent?: Agent | null`

      The agent that produced this item.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

    - `results?: Array<Result> | null`

      The results of the file search tool call.

      - `attributes?: Record<string, string | number | boolean> | null`

        Set of 16 key-value pairs that can be attached to an object. This can be
        useful for storing additional information about the object in a structured
        format, and querying for objects via API or the dashboard. Keys are strings
        with a maximum length of 64 characters. Values are strings with a maximum
        length of 512 characters, booleans, or numbers.

        - `string`

        - `number`

        - `boolean`

      - `file_id?: string`

        The unique ID of the file.

      - `filename?: string`

        The name of the file.

      - `score?: number`

        The relevance score of the file - a value between 0 and 1.

      - `text?: string`

        The text that was retrieved from the file.

  - `BetaResponseComputerToolCall`

    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.

    - `id: string`

      The unique ID of the computer call.

    - `call_id: string`

      An identifier used when responding to the tool call with output.

    - `pending_safety_checks: Array<PendingSafetyCheck>`

      The pending safety checks for the computer call.

      - `id: string`

        The ID of the pending safety check.

      - `code?: string | null`

        The type of the pending safety check.

      - `message?: string | null`

        Details about the pending safety check.

    - `status: "in_progress" | "completed" | "incomplete"`

      The status of the item. One of `in_progress`, `completed`, or
      `incomplete`. Populated when items are returned via API.

      - `"in_progress"`

      - `"completed"`

      - `"incomplete"`

    - `type: "computer_call"`

      The type of the computer call. Always `computer_call`.

      - `"computer_call"`

    - `action?: BetaComputerAction`

      A click action.

      - `Click`

        A click action.

        - `button: "left" | "right" | "wheel" | 2 more`

          Indicates which mouse button was pressed during the click. One of `left`, `right`, `wheel`, `back`, or `forward`.

          - `"left"`

          - `"right"`

          - `"wheel"`

          - `"back"`

          - `"forward"`

        - `type: "click"`

          Specifies the event type. For a click action, this property is always `click`.

          - `"click"`

        - `x: number`

          The x-coordinate where the click occurred.

        - `y: number`

          The y-coordinate where the click occurred.

        - `keys?: Array<string> | null`

          The keys being held while clicking.

      - `DoubleClick`

        A double click action.

        - `keys: Array<string> | null`

          The keys being held while double-clicking.

        - `type: "double_click"`

          Specifies the event type. For a double click action, this property is always set to `double_click`.

          - `"double_click"`

        - `x: number`

          The x-coordinate where the double click occurred.

        - `y: number`

          The y-coordinate where the double click occurred.

      - `Drag`

        A drag action.

        - `path: Array<Path>`

          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 }
          ]
          ```

          - `x: number`

            The x-coordinate.

          - `y: number`

            The y-coordinate.

        - `type: "drag"`

          Specifies the event type. For a drag action, this property is always set to `drag`.

          - `"drag"`

        - `keys?: Array<string> | null`

          The keys being held while dragging the mouse.

      - `Keypress`

        A collection of keypresses the model would like to perform.

        - `keys: Array<string>`

          The combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key.

        - `type: "keypress"`

          Specifies the event type. For a keypress action, this property is always set to `keypress`.

          - `"keypress"`

      - `Move`

        A mouse move action.

        - `type: "move"`

          Specifies the event type. For a move action, this property is always set to `move`.

          - `"move"`

        - `x: number`

          The x-coordinate to move to.

        - `y: number`

          The y-coordinate to move to.

        - `keys?: Array<string> | null`

          The keys being held while moving the mouse.

      - `Screenshot`

        A screenshot action.

        - `type: "screenshot"`

          Specifies the event type. For a screenshot action, this property is always set to `screenshot`.

          - `"screenshot"`

      - `Scroll`

        A scroll action.

        - `scroll_x: number`

          The horizontal scroll distance.

        - `scroll_y: number`

          The vertical scroll distance.

        - `type: "scroll"`

          Specifies the event type. For a scroll action, this property is always set to `scroll`.

          - `"scroll"`

        - `x: number`

          The x-coordinate where the scroll occurred.

        - `y: number`

          The y-coordinate where the scroll occurred.

        - `keys?: Array<string> | null`

          The keys being held while scrolling.

      - `Type`

        An action to type in text.

        - `text: string`

          The text to type.

        - `type: "type"`

          Specifies the event type. For a type action, this property is always set to `type`.

          - `"type"`

      - `Wait`

        A wait action.

        - `type: "wait"`

          Specifies the event type. For a wait action, this property is always set to `wait`.

          - `"wait"`

    - `actions?: BetaComputerActionList`

      Flattened batched actions for `computer_use`. Each action includes an
      `type` discriminator and action-specific fields.

      - `Click`

        A click action.

      - `DoubleClick`

        A double click action.

      - `Drag`

        A drag action.

      - `Keypress`

        A collection of keypresses the model would like to perform.

      - `Move`

        A mouse move action.

      - `Screenshot`

        A screenshot action.

      - `Scroll`

        A scroll action.

      - `Type`

        An action to type in text.

      - `Wait`

        A wait action.

    - `agent?: Agent | null`

      The agent that produced this item.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

  - `BetaResponseComputerToolCallOutputItem`

    - `id: string`

      The unique ID of the computer call tool output.

    - `call_id: string`

      The ID of the computer tool call that produced the output.

    - `output: BetaResponseComputerToolCallOutputScreenshot`

      A computer screenshot image used with the computer use tool.

      - `type: "computer_screenshot"`

        Specifies the event type. For a computer screenshot, this property is
        always set to `computer_screenshot`.

        - `"computer_screenshot"`

      - `file_id?: string`

        The identifier of an uploaded file that contains the screenshot.

      - `image_url?: string`

        The URL of the screenshot image.

    - `status: "completed" | "incomplete" | "failed" | "in_progress"`

      The status of the message input. One of `in_progress`, `completed`, or
      `incomplete`. Populated when input items are returned via API.

      - `"completed"`

      - `"incomplete"`

      - `"failed"`

      - `"in_progress"`

    - `type: "computer_call_output"`

      The type of the computer tool call output. Always `computer_call_output`.

      - `"computer_call_output"`

    - `acknowledged_safety_checks?: Array<AcknowledgedSafetyCheck>`

      The safety checks reported by the API that have been acknowledged by the
      developer.

      - `id: string`

        The ID of the pending safety check.

      - `code?: string | null`

        The type of the pending safety check.

      - `message?: string | null`

        Details about the pending safety check.

    - `agent?: Agent | null`

      The agent that produced this item.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

    - `created_by?: string`

      The identifier of the actor that created the item.

  - `BetaResponseFunctionWebSearch`

    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.

    - `id: string`

      The unique ID of the web search tool call.

    - `action: Search | OpenPage | FindInPage`

      An object describing the specific action taken in this web search call.
      Includes details on how the model used the web (search, open_page, find_in_page).

      - `Search`

        Action type "search" - Performs a web search query.

        - `type: "search"`

          The action type.

          - `"search"`

        - `queries?: Array<string>`

          The search queries.

        - `query?: string`

          The search query.

        - `sources?: Array<Source>`

          The sources used in the search.

          - `type: "url"`

            The type of source. Always `url`.

            - `"url"`

          - `url: string`

            The URL of the source.

      - `OpenPage`

        Action type "open_page" - Opens a specific URL from search results.

        - `type: "open_page"`

          The action type.

          - `"open_page"`

        - `url?: string | null`

          The URL opened by the model.

      - `FindInPage`

        Action type "find_in_page": Searches for a pattern within a loaded page.

        - `pattern: string`

          The pattern or text to search for within the page.

        - `type: "find_in_page"`

          The action type.

          - `"find_in_page"`

        - `url: string`

          The URL of the page searched for the pattern.

    - `status: "in_progress" | "searching" | "completed" | "failed"`

      The status of the web search tool call.

      - `"in_progress"`

      - `"searching"`

      - `"completed"`

      - `"failed"`

    - `type: "web_search_call"`

      The type of the web search tool call. Always `web_search_call`.

      - `"web_search_call"`

    - `agent?: Agent | null`

      The agent that produced this item.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

  - `BetaResponseFunctionToolCallItem extends BetaResponseFunctionToolCall`

    A tool call to run a function. See the
    [function calling guide](https://platform.openai.com/docs/guides/function-calling) for more information.

    - `id: string`

      The unique ID of the function tool call.

    - `status: "in_progress" | "completed" | "incomplete"`

      The status of the item. One of `in_progress`, `completed`, or
      `incomplete`. Populated when items are returned via API.

      - `"in_progress"`

      - `"completed"`

      - `"incomplete"`

    - `created_by?: string`

      The identifier of the actor that created the item.

  - `BetaResponseFunctionToolCallOutputItem`

    - `id: string`

      The unique ID of the function call tool output.

    - `call_id: string`

      The unique ID of the function tool call generated by the model.

    - `output: string | Array<BetaResponseInputText | BetaResponseInputImage | BetaResponseInputFile>`

      The output from the function call generated by your code.
      Can be a string or an list of output content.

      - `string`

      - `Array<BetaResponseInputText | BetaResponseInputImage | BetaResponseInputFile>`

        - `BetaResponseInputText`

          A text input to the model.

        - `BetaResponseInputImage`

          An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision).

        - `BetaResponseInputFile`

          A file input to 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.

      - `"in_progress"`

      - `"completed"`

      - `"incomplete"`

    - `type: "function_call_output"`

      The type of the function tool call output. Always `function_call_output`.

      - `"function_call_output"`

    - `agent?: Agent | null`

      The agent that produced this item.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

    - `caller?: Direct | Program | null`

      The execution context that produced this tool call.

      - `Direct`

        - `type: "direct"`

          The caller type. Always `direct`.

          - `"direct"`

      - `Program`

        - `caller_id: string`

          The call ID of the program item that produced this tool call.

        - `type: "program"`

          The caller type. Always `program`.

          - `"program"`

    - `created_by?: string`

      The identifier of the actor that created the item.

    - `name?: string`

      The name of the tool that produced the output.

    - `namespace?: string`

      The namespace of the tool that produced the output.

  - `AgentMessage`

    - `id: string`

      The unique ID of the agent message.

    - `author: string`

      The sending agent identity.

    - `content: Array<BetaResponseInputText | BetaResponseOutputText | Text | 7 more>`

      Encrypted content sent between agents.

      - `BetaResponseInputText`

        A text input to the model.

      - `BetaResponseOutputText`

        A text output from the model.

      - `Text`

        A text content.

        - `text: string`

        - `type: "text"`

          - `"text"`

      - `SummaryText`

        A summary text from the model.

        - `text: string`

          A summary of the reasoning output from the model so far.

        - `type: "summary_text"`

          The type of the object. Always `summary_text`.

          - `"summary_text"`

      - `ReasoningText`

        Reasoning text from the model.

        - `text: string`

          The reasoning text from the model.

        - `type: "reasoning_text"`

          The type of the reasoning text. Always `reasoning_text`.

          - `"reasoning_text"`

      - `BetaResponseOutputRefusal`

        A refusal from the model.

      - `BetaResponseInputImage`

        An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision).

      - `ComputerScreenshot`

        A screenshot of a computer.

        - `detail: BetaImageDetail`

          The detail level of the screenshot image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`.

        - `file_id: string | null`

          The identifier of an uploaded file that contains the screenshot.

        - `image_url: string | null`

          The URL of the screenshot image.

        - `type: "computer_screenshot"`

          Specifies the event type. For a computer screenshot, this property is always set to `computer_screenshot`.

          - `"computer_screenshot"`

        - `prompt_cache_breakpoint?: PromptCacheBreakpoint`

          Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.

          - `mode: "explicit"`

            The breakpoint mode. Always `explicit`.

            - `"explicit"`

      - `BetaResponseInputFile`

        A file input to the model.

      - `EncryptedContent`

        Opaque encrypted content that Responses API decrypts inside trusted model execution.

        - `encrypted_content: string`

          Opaque encrypted content.

        - `type: "encrypted_content"`

          The type of the input item. Always `encrypted_content`.

          - `"encrypted_content"`

    - `recipient: string`

      The destination agent identity.

    - `type: "agent_message"`

      The type of the item. Always `agent_message`.

      - `"agent_message"`

    - `agent?: Agent`

      The agent that produced this item.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

  - `MultiAgentCall`

    - `id: string`

      The unique ID of the multi-agent call item.

    - `action: "spawn_agent" | "interrupt_agent" | "list_agents" | 3 more`

      The multi-agent action to execute.

      - `"spawn_agent"`

      - `"interrupt_agent"`

      - `"list_agents"`

      - `"send_message"`

      - `"followup_task"`

      - `"wait_agent"`

    - `arguments: string`

      The JSON string of arguments generated for the action.

    - `call_id: string`

      The unique ID linking this call to its output.

    - `type: "multi_agent_call"`

      The type of the multi-agent call. Always `multi_agent_call`.

      - `"multi_agent_call"`

    - `agent?: Agent`

      The agent that produced this item.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

  - `MultiAgentCallOutput`

    - `id: string`

      The unique ID of the multi-agent call output item.

    - `action: "spawn_agent" | "interrupt_agent" | "list_agents" | 3 more`

      The multi-agent action that produced this result.

      - `"spawn_agent"`

      - `"interrupt_agent"`

      - `"list_agents"`

      - `"send_message"`

      - `"followup_task"`

      - `"wait_agent"`

    - `call_id: string`

      The unique ID of the multi-agent call.

    - `output: Array<BetaResponseOutputText>`

      Text output returned by the multi-agent action.

      - `annotations: Array<FileCitation | URLCitation | ContainerFileCitation | FilePath>`

        The annotations of the text output.

      - `text: string`

        The text output from the model.

      - `type: "output_text"`

        The type of the output text. Always `output_text`.

      - `logprobs?: Array<Logprob>`

    - `type: "multi_agent_call_output"`

      The type of the multi-agent result. Always `multi_agent_call_output`.

      - `"multi_agent_call_output"`

    - `agent?: Agent`

      The agent that produced this item.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

  - `BetaResponseToolSearchCall`

    - `id: string`

      The unique ID of the tool search call item.

    - `arguments: unknown`

      Arguments used for the tool search call.

    - `call_id: string | null`

      The unique ID of the tool search call generated by the model.

    - `execution: "server" | "client"`

      Whether tool search was executed by the server or by the client.

      - `"server"`

      - `"client"`

    - `status: "in_progress" | "completed" | "incomplete"`

      The status of the tool search call item that was recorded.

      - `"in_progress"`

      - `"completed"`

      - `"incomplete"`

    - `type: "tool_search_call"`

      The type of the item. Always `tool_search_call`.

      - `"tool_search_call"`

    - `agent?: Agent`

      The agent that produced this item.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

    - `created_by?: string`

      The identifier of the actor that created the item.

  - `BetaResponseToolSearchOutputItem`

    - `id: string`

      The unique ID of the tool search output item.

    - `call_id: string | null`

      The unique ID of the tool search call generated by the model.

    - `execution: "server" | "client"`

      Whether tool search was executed by the server or by the client.

      - `"server"`

      - `"client"`

    - `status: "in_progress" | "completed" | "incomplete"`

      The status of the tool search output item that was recorded.

      - `"in_progress"`

      - `"completed"`

      - `"incomplete"`

    - `tools: Array<BetaTool>`

      The loaded tool definitions returned by tool search.

      - `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).

        - `name: string`

          The name of the function to call.

        - `parameters: Record<string, unknown> | null`

          A JSON schema object describing the parameters of the function.

        - `strict: boolean | null`

          Whether strict parameter validation is enforced for this function tool.

        - `type: "function"`

          The type of the function tool. Always `function`.

          - `"function"`

        - `allowed_callers?: Array<"direct" | "programmatic"> | null`

          The tool invocation context(s).

          - `"direct"`

          - `"programmatic"`

        - `defer_loading?: boolean`

          Whether this function is deferred and loaded via tool search.

        - `description?: string | null`

          A description of the function. Used by the model to determine whether or not to call the function.

        - `output_schema?: Record<string, unknown> | null`

          A JSON schema object describing the JSON value encoded in string outputs for this function.

      - `BetaFileSearchTool`

        A tool that searches for relevant content from uploaded files. Learn more about the [file search tool](https://platform.openai.com/docs/guides/tools-file-search).

        - `type: "file_search"`

          The type of the file search tool. Always `file_search`.

          - `"file_search"`

        - `vector_store_ids: Array<string>`

          The IDs of the vector stores to search.

        - `filters?: ComparisonFilter | CompoundFilter | null`

          A filter to apply.

          - `ComparisonFilter`

            A filter used to compare a specified attribute key to a given value using a defined comparison operation.

            - `key: string`

              The key to compare against the value.

            - `type: "eq" | "ne" | "gt" | 5 more`

              Specifies the comparison operator: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`, `in`, `nin`.

              - `eq`: equals
              - `ne`: not equal
              - `gt`: greater than
              - `gte`: greater than or equal
              - `lt`: less than
              - `lte`: less than or equal
              - `in`: in
              - `nin`: not in

              - `"eq"`

              - `"ne"`

              - `"gt"`

              - `"gte"`

              - `"lt"`

              - `"lte"`

              - `"in"`

              - `"nin"`

            - `value: string | number | boolean | Array<string | number>`

              The value to compare against the attribute key; supports string, number, or boolean types.

              - `string`

              - `number`

              - `boolean`

              - `Array<string | number>`

                - `string`

                - `number`

          - `CompoundFilter`

            Combine multiple filters using `and` or `or`.

            - `filters: Array<ComparisonFilter | unknown>`

              Array of filters to combine. Items can be `ComparisonFilter` or `CompoundFilter`.

              - `ComparisonFilter`

                A filter used to compare a specified attribute key to a given value using a defined comparison operation.

                - `key: string`

                  The key to compare against the value.

                - `type: "eq" | "ne" | "gt" | 5 more`

                  Specifies the comparison operator: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`, `in`, `nin`.

                  - `eq`: equals
                  - `ne`: not equal
                  - `gt`: greater than
                  - `gte`: greater than or equal
                  - `lt`: less than
                  - `lte`: less than or equal
                  - `in`: in
                  - `nin`: not in

                  - `"eq"`

                  - `"ne"`

                  - `"gt"`

                  - `"gte"`

                  - `"lt"`

                  - `"lte"`

                  - `"in"`

                  - `"nin"`

                - `value: string | number | boolean | Array<string | number>`

                  The value to compare against the attribute key; supports string, number, or boolean types.

                  - `string`

                  - `number`

                  - `boolean`

                  - `Array<string | number>`

                    - `string`

                    - `number`

              - `unknown`

            - `type: "and" | "or"`

              Type of operation: `and` or `or`.

              - `"and"`

              - `"or"`

        - `max_num_results?: number`

          The maximum number of results to return. This number should be between 1 and 50 inclusive.

        - `ranking_options?: RankingOptions`

          Ranking options for search.

          - `hybrid_search?: HybridSearch`

            Weights that control how reciprocal rank fusion balances semantic embedding matches versus sparse keyword matches when hybrid search is enabled.

            - `embedding_weight: number`

              The weight of the embedding in the reciprocal ranking fusion.

            - `text_weight: number`

              The weight of the text in the reciprocal ranking fusion.

          - `ranker?: "auto" | "default-2024-11-15"`

            The ranker to use for the file search.

            - `"auto"`

            - `"default-2024-11-15"`

          - `score_threshold?: number`

            The score threshold for the file search, a number between 0 and 1. Numbers closer to 1 will attempt to return only the most relevant results, but may return fewer results.

      - `BetaComputerTool`

        A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use).

        - `type: "computer"`

          The type of the computer tool. Always `computer`.

          - `"computer"`

      - `BetaComputerUsePreviewTool`

        A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use).

        - `display_height: number`

          The height of the computer display.

        - `display_width: number`

          The width of the computer display.

        - `environment: "windows" | "mac" | "linux" | 2 more`

          The type of computer environment to control.

          - `"windows"`

          - `"mac"`

          - `"linux"`

          - `"ubuntu"`

          - `"browser"`

        - `type: "computer_use_preview"`

          The type of the computer use tool. Always `computer_use_preview`.

          - `"computer_use_preview"`

      - `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"`

          The type of the web search tool. One of `web_search` or `web_search_2025_08_26`.

          - `"web_search"`

          - `"web_search_2025_08_26"`

        - `external_web_access?: boolean`

          Allow live internet access for web search. Defaults to true when omitted. When false, the web search tool runs in offline/cache-only mode and will not fetch new external content.

        - `filters?: Filters | null`

          Filters for the search.

          - `allowed_domains?: Array<string> | null`

            Allowed domains for the search. If not provided, all domains are allowed.
            Subdomains of the provided domains are allowed as well.

            Example: `["pubmed.ncbi.nlm.nih.gov"]`

        - `search_context_size?: "low" | "medium" | "high"`

          High level guidance for the amount of context window space to use for the search. One of `low`, `medium`, or `high`. `medium` is the default.

          - `"low"`

          - `"medium"`

          - `"high"`

        - `user_location?: UserLocation | null`

          The approximate location of the user.

          - `city?: string | null`

            Free text input for the city of the user, e.g. `San Francisco`.

          - `country?: string | null`

            The two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of the user, e.g. `US`.

          - `region?: string | null`

            Free text input for the region of the user, e.g. `California`.

          - `timezone?: string | null`

            The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of the user, e.g. `America/Los_Angeles`.

          - `type?: "approximate"`

            The type of location approximation. Always `approximate`.

            - `"approximate"`

      - `Mcp`

        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).

        - `server_label: string`

          A label for this MCP server, used to identify it in tool calls.

        - `type: "mcp"`

          The type of the MCP tool. Always `mcp`.

          - `"mcp"`

        - `allowed_callers?: Array<"direct" | "programmatic"> | null`

          The tool invocation context(s).

          - `"direct"`

          - `"programmatic"`

        - `allowed_tools?: Array<string> | McpToolFilter | null`

          List of allowed tool names or a filter object.

          - `Array<string>`

          - `McpToolFilter`

            A filter object to specify which tools are allowed.

            - `read_only?: boolean`

              Indicates whether or not a tool modifies data or is read-only. If an
              MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint),
              it will match this filter.

            - `tool_names?: Array<string>`

              List of allowed tool names.

        - `authorization?: string`

          An OAuth access token that can be used with a remote MCP server, either
          with a custom MCP server URL or a service connector. Your application
          must handle the OAuth authorization flow and provide the token here.

        - `connector_id?: "connector_dropbox" | "connector_gmail" | "connector_googlecalendar" | 5 more`

          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`

          - `"connector_dropbox"`

          - `"connector_gmail"`

          - `"connector_googlecalendar"`

          - `"connector_googledrive"`

          - `"connector_microsoftteams"`

          - `"connector_outlookcalendar"`

          - `"connector_outlookemail"`

          - `"connector_sharepoint"`

        - `defer_loading?: boolean`

          Whether this MCP tool is deferred and discovered via tool search.

        - `headers?: Record<string, string> | null`

          Optional HTTP headers to send to the MCP server. Use for authentication
          or other purposes.

        - `require_approval?: McpToolApprovalFilter | "always" | "never" | null`

          Specify which of the MCP server's tools require approval.

          - `McpToolApprovalFilter`

            Specify which of the MCP server's tools require approval. Can be
            `always`, `never`, or a filter object associated with tools
            that require approval.

            - `always?: Always`

              A filter object to specify which tools are allowed.

              - `read_only?: boolean`

                Indicates whether or not a tool modifies data or is read-only. If an
                MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint),
                it will match this filter.

              - `tool_names?: Array<string>`

                List of allowed tool names.

            - `never?: Never`

              A filter object to specify which tools are allowed.

              - `read_only?: boolean`

                Indicates whether or not a tool modifies data or is read-only. If an
                MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint),
                it will match this filter.

              - `tool_names?: Array<string>`

                List of allowed tool names.

          - `"always" | "never"`

            - `"always"`

            - `"never"`

        - `server_description?: string`

          Optional description of the MCP server, used to provide more context.

        - `server_url?: string`

          The URL for the MCP server. One of `server_url`, `connector_id`, or
          `tunnel_id` must be provided.

        - `tunnel_id?: string`

          The Secure MCP Tunnel ID to use instead of a direct server URL. One of
          `server_url`, `connector_id`, or `tunnel_id` must be provided.

      - `CodeInterpreter`

        A tool that runs Python code to help generate a response to a prompt.

        - `container: string | CodeInterpreterToolAuto`

          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`

          - `CodeInterpreterToolAuto`

            Configuration for a code interpreter container. Optionally specify the IDs of the files to run the code on.

            - `type: "auto"`

              Always `auto`.

              - `"auto"`

            - `file_ids?: Array<string>`

              An optional list of uploaded files to make available to your code.

            - `memory_limit?: "1g" | "4g" | "16g" | "64g" | null`

              The memory limit for the code interpreter container.

              - `"1g"`

              - `"4g"`

              - `"16g"`

              - `"64g"`

            - `network_policy?: BetaContainerNetworkPolicyDisabled | BetaContainerNetworkPolicyAllowlist`

              Network access policy for the container.

              - `BetaContainerNetworkPolicyDisabled`

                - `type: "disabled"`

                  Disable outbound network access. Always `disabled`.

                  - `"disabled"`

              - `BetaContainerNetworkPolicyAllowlist`

                - `allowed_domains: Array<string>`

                  A list of allowed domains when type is `allowlist`.

                - `type: "allowlist"`

                  Allow outbound network access only to specified domains. Always `allowlist`.

                  - `"allowlist"`

                - `domain_secrets?: Array<BetaContainerNetworkPolicyDomainSecret>`

                  Optional domain-scoped secrets for allowlisted domains.

                  - `domain: string`

                    The domain associated with the secret.

                  - `name: string`

                    The name of the secret to inject for the domain.

                  - `value: string`

                    The secret value to inject for the domain.

        - `type: "code_interpreter"`

          The type of the code interpreter tool. Always `code_interpreter`.

          - `"code_interpreter"`

        - `allowed_callers?: Array<"direct" | "programmatic"> | null`

          The tool invocation context(s).

          - `"direct"`

          - `"programmatic"`

      - `ProgrammaticToolCalling`

        - `type: "programmatic_tool_calling"`

          The type of the tool. Always `programmatic_tool_calling`.

          - `"programmatic_tool_calling"`

      - `ImageGeneration`

        A tool that generates images using the GPT image models.

        - `type: "image_generation"`

          The type of the image generation tool. Always `image_generation`.

          - `"image_generation"`

        - `action?: "generate" | "edit" | "auto"`

          Whether to generate a new image or edit an existing image. Default: `auto`.

          - `"generate"`

          - `"edit"`

          - `"auto"`

        - `background?: "transparent" | "opaque" | "auto"`

          Allows to set transparency for the background of the generated image(s).
          Must be one of `transparent`, `opaque`, or `auto` (default value). When
          `auto` is used, the model will automatically determine the best
          background for the image.

          Transparent backgrounds are available for supported GPT Image models.
          For `gpt-image-2` and `gpt-image-2-2026-04-21`, this support is in
          preview. When using `transparent`, set the output format to `png` or
          `webp`.

          - `"transparent"`

          - `"opaque"`

          - `"auto"`

        - `input_fidelity?: "high" | "low" | null`

          Control how much effort the model will exert to match the style and features, especially facial features, of input images. This parameter is only supported for `gpt-image-1` and `gpt-image-1.5` and later models, unsupported for `gpt-image-1-mini`. Supports `high` and `low`. Defaults to `low`.

          - `"high"`

          - `"low"`

        - `input_image_mask?: InputImageMask`

          Optional mask for inpainting. Contains `image_url`
          (string, optional) and `file_id` (string, optional).

          - `file_id?: string`

            File ID for the mask image.

          - `image_url?: string`

            Base64-encoded mask image.

        - `model?: (string & {}) | "gpt-image-1" | "gpt-image-1-mini" | "gpt-image-2" | 3 more`

          The image generation model to use. One of `gpt-image-1`,
          `gpt-image-1-mini`, `gpt-image-1.5`, `gpt-image-2`,
          `gpt-image-2-2026-04-21`, or `chatgpt-image-latest`. Default:
          `gpt-image-1`.

          - `(string & {})`

          - `"gpt-image-1" | "gpt-image-1-mini" | "gpt-image-2" | 3 more`

            - `"gpt-image-1"`

            - `"gpt-image-1-mini"`

            - `"gpt-image-2"`

            - `"gpt-image-2-2026-04-21"`

            - `"gpt-image-1.5"`

            - `"chatgpt-image-latest"`

        - `moderation?: "auto" | "low"`

          Moderation level for the generated image. Default: `auto`.

          - `"auto"`

          - `"low"`

        - `output_compression?: number`

          Compression level for the output image. Default: 100.

        - `output_format?: "png" | "webp" | "jpeg"`

          The output format of the generated image. One of `png`, `webp`, or
          `jpeg`. Default: `png`.

          - `"png"`

          - `"webp"`

          - `"jpeg"`

        - `partial_images?: number`

          Number of partial images to generate in streaming mode, from 0 (default value) to 3.

        - `quality?: "low" | "medium" | "high" | "auto"`

          The quality of the generated image. One of `low`, `medium`, `high`,
          or `auto`. Default: `auto`.

          - `"low"`

          - `"medium"`

          - `"high"`

          - `"auto"`

        - `size?: (string & {}) | "1024x1024" | "1024x1536" | "1536x1024" | "auto"`

          The size of the generated images. For `gpt-image-2` and `gpt-image-2-2026-04-21`, arbitrary resolutions are supported as `WIDTHxHEIGHT` strings, for example `1536x864`. Width and height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above `2560x1440` are experimental, and the maximum supported resolution is `3840x2160`. The requested size must also satisfy the model's current pixel and edge limits. The standard sizes `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models; `auto` is supported for models that allow automatic sizing. For `dall-e-2`, use one of `256x256`, `512x512`, or `1024x1024`. For `dall-e-3`, use one of `1024x1024`, `1792x1024`, or `1024x1792`.

          - `(string & {})`

          - `"1024x1024" | "1024x1536" | "1536x1024" | "auto"`

            - `"1024x1024"`

            - `"1024x1536"`

            - `"1536x1024"`

            - `"auto"`

      - `LocalShell`

        A tool that allows the model to execute shell commands in a local environment.

        - `type: "local_shell"`

          The type of the local shell tool. Always `local_shell`.

          - `"local_shell"`

      - `BetaFunctionShellTool`

        A tool that allows the model to execute shell commands.

        - `type: "shell"`

          The type of the shell tool. Always `shell`.

          - `"shell"`

        - `allowed_callers?: Array<"direct" | "programmatic"> | null`

          The tool invocation context(s).

          - `"direct"`

          - `"programmatic"`

        - `environment?: BetaContainerAuto | BetaLocalEnvironment | BetaContainerReference | null`

          - `BetaContainerAuto`

            - `type: "container_auto"`

              Automatically creates a container for this request

              - `"container_auto"`

            - `file_ids?: Array<string>`

              An optional list of uploaded files to make available to your code.

            - `memory_limit?: "1g" | "4g" | "16g" | "64g" | null`

              The memory limit for the container.

              - `"1g"`

              - `"4g"`

              - `"16g"`

              - `"64g"`

            - `network_policy?: BetaContainerNetworkPolicyDisabled | BetaContainerNetworkPolicyAllowlist`

              Network access policy for the container.

              - `BetaContainerNetworkPolicyDisabled`

              - `BetaContainerNetworkPolicyAllowlist`

            - `skills?: Array<BetaSkillReference | BetaInlineSkill>`

              An optional list of skills referenced by id or inline data.

              - `BetaSkillReference`

                - `skill_id: string`

                  The ID of the referenced skill.

                - `type: "skill_reference"`

                  References a skill created with the /v1/skills endpoint.

                  - `"skill_reference"`

                - `version?: string`

                  Optional skill version. Use a positive integer or 'latest'. Omit for default.

              - `BetaInlineSkill`

                - `description: string`

                  The description of the skill.

                - `name: string`

                  The name of the skill.

                - `source: BetaInlineSkillSource`

                  Inline skill payload

                  - `data: string`

                    Base64-encoded skill zip bundle.

                  - `media_type: "application/zip"`

                    The media type of the inline skill payload. Must be `application/zip`.

                    - `"application/zip"`

                  - `type: "base64"`

                    The type of the inline skill source. Must be `base64`.

                    - `"base64"`

                - `type: "inline"`

                  Defines an inline skill for this request.

                  - `"inline"`

          - `BetaLocalEnvironment`

            - `type: "local"`

              Use a local computer environment.

              - `"local"`

            - `skills?: Array<BetaLocalSkill>`

              An optional list of skills.

              - `description: string`

                The description of the skill.

              - `name: string`

                The name of the skill.

              - `path: string`

                The path to the directory containing the skill.

          - `BetaContainerReference`

            - `container_id: string`

              The ID of the referenced container.

            - `type: "container_reference"`

              References a container created with the /v1/containers endpoint

              - `"container_reference"`

      - `BetaCustomTool`

        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)

        - `name: string`

          The name of the custom tool, used to identify it in tool calls.

        - `type: "custom"`

          The type of the custom tool. Always `custom`.

          - `"custom"`

        - `allowed_callers?: Array<"direct" | "programmatic"> | null`

          The tool invocation context(s).

          - `"direct"`

          - `"programmatic"`

        - `defer_loading?: boolean`

          Whether this tool should be deferred and discovered via tool search.

        - `description?: string`

          Optional description of the custom tool, used to provide more context.

        - `format?: Text | Grammar`

          The input format for the custom tool. Default is unconstrained text.

          - `Text`

            Unconstrained free-form text.

            - `type: "text"`

              Unconstrained text format. Always `text`.

              - `"text"`

          - `Grammar`

            A grammar defined by the user.

            - `definition: string`

              The grammar definition.

            - `syntax: "lark" | "regex"`

              The syntax of the grammar definition. One of `lark` or `regex`.

              - `"lark"`

              - `"regex"`

            - `type: "grammar"`

              Grammar format. Always `grammar`.

              - `"grammar"`

      - `BetaNamespaceTool`

        Groups function/custom tools under a shared namespace.

        - `description: string`

          A description of the namespace shown to the model.

        - `name: string`

          The namespace name used in tool calls (for example, `crm`).

        - `tools: Array<Function | BetaCustomTool>`

          The function/custom tools available inside this namespace.

          - `Function`

            - `name: string`

            - `type: "function"`

              - `"function"`

            - `allowed_callers?: Array<"direct" | "programmatic"> | null`

              The tool invocation context(s).

              - `"direct"`

              - `"programmatic"`

            - `defer_loading?: boolean`

              Whether this function should be deferred and discovered via tool search.

            - `description?: string | null`

            - `output_schema?: Record<string, unknown> | null`

              A JSON Schema describing the JSON value encoded in string outputs for this function tool. This does not describe content-array outputs.

            - `parameters?: unknown`

            - `strict?: boolean | null`

              Whether to enforce strict parameter validation. If omitted, Responses attempts to use strict validation when the schema is compatible, and falls back to non-strict validation otherwise.

          - `BetaCustomTool`

            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: "namespace"`

          The type of the tool. Always `namespace`.

          - `"namespace"`

      - `BetaToolSearchTool`

        Hosted or BYOT tool search configuration for deferred tools.

        - `type: "tool_search"`

          The type of the tool. Always `tool_search`.

          - `"tool_search"`

        - `description?: string | null`

          Description shown to the model for a client-executed tool search tool.

        - `execution?: "server" | "client"`

          Whether tool search is executed by the server or by the client.

          - `"server"`

          - `"client"`

        - `parameters?: unknown`

          Parameter schema for a client-executed tool search tool.

      - `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"`

          The type of the web search tool. One of `web_search_preview` or `web_search_preview_2025_03_11`.

          - `"web_search_preview"`

          - `"web_search_preview_2025_03_11"`

        - `search_content_types?: Array<"text" | "image">`

          - `"text"`

          - `"image"`

        - `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.

          - `"low"`

          - `"medium"`

          - `"high"`

        - `user_location?: UserLocation | null`

          The user's location.

          - `type: "approximate"`

            The type of location approximation. Always `approximate`.

            - `"approximate"`

          - `city?: string | null`

            Free text input for the city of the user, e.g. `San Francisco`.

          - `country?: string | null`

            The two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of the user, e.g. `US`.

          - `region?: string | null`

            Free text input for the region of the user, e.g. `California`.

          - `timezone?: string | null`

            The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of the user, e.g. `America/Los_Angeles`.

      - `BetaApplyPatchTool`

        Allows the assistant to create, delete, or update files using unified diffs.

        - `type: "apply_patch"`

          The type of the tool. Always `apply_patch`.

          - `"apply_patch"`

        - `allowed_callers?: Array<"direct" | "programmatic"> | null`

          The tool invocation context(s).

          - `"direct"`

          - `"programmatic"`

    - `type: "tool_search_output"`

      The type of the item. Always `tool_search_output`.

      - `"tool_search_output"`

    - `agent?: Agent`

      The agent that produced this item.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

    - `created_by?: string`

      The identifier of the actor that created the item.

  - `AdditionalTools`

    - `id: string`

      The unique ID of the additional tools item.

    - `role: "unknown" | "user" | "assistant" | 5 more`

      The role that provided the additional tools.

      - `"unknown"`

      - `"user"`

      - `"assistant"`

      - `"system"`

      - `"critic"`

      - `"discriminator"`

      - `"developer"`

      - `"tool"`

    - `tools: Array<BetaTool>`

      The additional tool definitions made available at this item.

      - `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).

      - `Mcp`

        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).

      - `CodeInterpreter`

        A tool that runs Python code to help generate a response to a prompt.

      - `ProgrammaticToolCalling`

      - `ImageGeneration`

        A tool that generates images using the GPT image models.

      - `LocalShell`

        A tool that allows the model to execute shell commands in a local environment.

      - `BetaFunctionShellTool`

        A tool that allows the model to execute shell commands.

      - `BetaCustomTool`

        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)

      - `BetaNamespaceTool`

        Groups function/custom tools under a shared namespace.

      - `BetaToolSearchTool`

        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).

      - `BetaApplyPatchTool`

        Allows the assistant to create, delete, or update files using unified diffs.

    - `type: "additional_tools"`

      The type of the item. Always `additional_tools`.

      - `"additional_tools"`

    - `agent?: Agent`

      The agent that produced this item.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

  - `BetaResponseReasoningItem`

    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).

    - `id: string`

      The unique identifier of the reasoning content.

    - `summary: Array<Summary>`

      Reasoning summary content.

      - `text: string`

        A summary of the reasoning output from the model so far.

      - `type: "summary_text"`

        The type of the object. Always `summary_text`.

        - `"summary_text"`

    - `type: "reasoning"`

      The type of the object. Always `reasoning`.

      - `"reasoning"`

    - `agent?: Agent | null`

      The agent that produced this item.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

    - `content?: Array<Content>`

      Reasoning text content.

      - `text: string`

        The reasoning text from the model.

      - `type: "reasoning_text"`

        The type of the reasoning text. Always `reasoning_text`.

        - `"reasoning_text"`

    - `encrypted_content?: string | null`

      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.

      When streaming, use the completed reasoning item and its
      `encrypted_content` from the `response.output_item.done` event in
      subsequent requests. The `encrypted_content` in
      `response.output_item.added` may be incomplete. This is especially
      important when `store` is `false` or when using Zero Data Retention.

    - `status?: "in_progress" | "completed" | "incomplete"`

      The status of the item. One of `in_progress`, `completed`, or
      `incomplete`. Populated when items are returned via API.

      - `"in_progress"`

      - `"completed"`

      - `"incomplete"`

  - `Program`

    - `id: string`

      The unique ID of the program item.

    - `call_id: string`

      The stable call ID of the program item.

    - `code: string`

      The JavaScript source executed by programmatic tool calling.

    - `fingerprint: string`

      Opaque program replay fingerprint that must be round-tripped.

    - `type: "program"`

      The type of the item. Always `program`.

      - `"program"`

    - `agent?: Agent`

      The agent that produced this item.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

  - `ProgramOutput`

    - `id: string`

      The unique ID of the program output item.

    - `call_id: string`

      The call ID of the program item.

    - `result: string`

      The result produced by the program item.

    - `status: "completed" | "incomplete"`

      The terminal status of the program output item.

      - `"completed"`

      - `"incomplete"`

    - `type: "program_output"`

      The type of the item. Always `program_output`.

      - `"program_output"`

    - `agent?: Agent`

      The agent that produced this item.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

  - `BetaResponseCompactionItem`

    A compaction item generated by the [`v1/responses/compact` API](https://platform.openai.com/docs/api-reference/responses/compact).

    - `id: string`

      The unique ID of the compaction item.

    - `encrypted_content: string`

      The encrypted content that was produced by compaction.

    - `type: "compaction"`

      The type of the item. Always `compaction`.

      - `"compaction"`

    - `agent?: Agent`

      The agent that produced this item.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

    - `created_by?: string`

      The identifier of the actor that created the item.

  - `ImageGenerationCall`

    An image generation request made by the model.

    - `id: string`

      The unique ID of the image generation call.

    - `result: string | null`

      The generated image encoded in base64.

    - `status: "in_progress" | "completed" | "generating" | "failed"`

      The status of the image generation call.

      - `"in_progress"`

      - `"completed"`

      - `"generating"`

      - `"failed"`

    - `type: "image_generation_call"`

      The type of the image generation call. Always `image_generation_call`.

      - `"image_generation_call"`

    - `agent?: Agent | null`

      The agent that produced this item.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

  - `BetaResponseCodeInterpreterToolCall`

    A tool call to run code.

    - `id: string`

      The unique ID of the code interpreter tool call.

    - `code: string | null`

      The code to run, or null if not available.

    - `container_id: string`

      The ID of the container used to run the code.

    - `outputs: Array<Logs | Image> | null`

      The outputs generated by the code interpreter, such as logs or images.
      Can be null if no outputs are available.

      - `Logs`

        The logs output from the code interpreter.

        - `logs: string`

          The logs output from the code interpreter.

        - `type: "logs"`

          The type of the output. Always `logs`.

          - `"logs"`

      - `Image`

        The image output from the code interpreter.

        - `type: "image"`

          The type of the output. Always `image`.

          - `"image"`

        - `url: string`

          The URL of the image output from the code interpreter.

    - `status: "in_progress" | "completed" | "incomplete" | 2 more`

      The status of the code interpreter tool call. Valid values are `in_progress`, `completed`, `incomplete`, `interpreting`, and `failed`.

      - `"in_progress"`

      - `"completed"`

      - `"incomplete"`

      - `"interpreting"`

      - `"failed"`

    - `type: "code_interpreter_call"`

      The type of the code interpreter tool call. Always `code_interpreter_call`.

      - `"code_interpreter_call"`

    - `agent?: Agent | null`

      The agent that produced this item.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

  - `LocalShellCall`

    A tool call to run a command on the local shell.

    - `id: string`

      The unique ID of the local shell call.

    - `action: Action`

      Execute a shell command on the server.

      - `command: Array<string>`

        The command to run.

      - `env: Record<string, string>`

        Environment variables to set for the command.

      - `type: "exec"`

        The type of the local shell action. Always `exec`.

        - `"exec"`

      - `timeout_ms?: number | null`

        Optional timeout in milliseconds for the command.

      - `user?: string | null`

        Optional user to run the command as.

      - `working_directory?: string | null`

        Optional working directory to run the command in.

    - `call_id: string`

      The unique ID of the local shell tool call generated by the model.

    - `status: "in_progress" | "completed" | "incomplete"`

      The status of the local shell call.

      - `"in_progress"`

      - `"completed"`

      - `"incomplete"`

    - `type: "local_shell_call"`

      The type of the local shell call. Always `local_shell_call`.

      - `"local_shell_call"`

    - `agent?: Agent | null`

      The agent that produced this item.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

  - `LocalShellCallOutput`

    The output of a local shell tool call.

    - `id: string`

      The unique ID of the local shell tool call generated by the model.

    - `output: string`

      A JSON string of the output of the local shell tool call.

    - `type: "local_shell_call_output"`

      The type of the local shell tool call output. Always `local_shell_call_output`.

      - `"local_shell_call_output"`

    - `agent?: Agent | null`

      The agent that produced this item.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

    - `status?: "in_progress" | "completed" | "incomplete" | null`

      The status of the item. One of `in_progress`, `completed`, or `incomplete`.

      - `"in_progress"`

      - `"completed"`

      - `"incomplete"`

  - `BetaResponseFunctionShellToolCall`

    A tool call that executes one or more shell commands in a managed environment.

    - `id: string`

      The unique ID of the shell tool call. Populated when this item is returned via API.

    - `action: Action`

      The shell commands and limits that describe how to run the tool call.

      - `commands: Array<string>`

      - `max_output_length: number | null`

        Optional maximum number of characters to return from each command.

      - `timeout_ms: number | null`

        Optional timeout in milliseconds for the commands.

    - `call_id: string`

      The unique ID of the shell tool call generated by the model.

    - `environment: BetaResponseLocalEnvironment | BetaResponseContainerReference | null`

      Represents the use of a local environment to perform shell actions.

      - `BetaResponseLocalEnvironment`

        Represents the use of a local environment to perform shell actions.

        - `type: "local"`

          The environment type. Always `local`.

          - `"local"`

      - `BetaResponseContainerReference`

        Represents a container created with /v1/containers.

        - `container_id: string`

        - `type: "container_reference"`

          The environment type. Always `container_reference`.

          - `"container_reference"`

    - `status: "in_progress" | "completed" | "incomplete"`

      The status of the shell call. One of `in_progress`, `completed`, or `incomplete`.

      - `"in_progress"`

      - `"completed"`

      - `"incomplete"`

    - `type: "shell_call"`

      The type of the item. Always `shell_call`.

      - `"shell_call"`

    - `agent?: Agent`

      The agent that produced this item.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

    - `caller?: Direct | Program | null`

      The execution context that produced this tool call.

      - `Direct`

        - `type: "direct"`

          - `"direct"`

      - `Program`

        - `caller_id: string`

          The call ID of the program item that produced this tool call.

        - `type: "program"`

          - `"program"`

    - `created_by?: string`

      The ID of the entity that created this tool call.

  - `BetaResponseFunctionShellToolCallOutput`

    The output of a shell tool call that was emitted.

    - `id: string`

      The unique ID of the shell call output. Populated when this item is returned via API.

    - `call_id: string`

      The unique ID of the shell tool call generated by the model.

    - `max_output_length: number | null`

      The maximum length of the shell command output. This is generated by the model and should be passed back with the raw output.

    - `output: Array<Output>`

      An array of shell call output contents

      - `outcome: Timeout | Exit`

        Represents either an exit outcome (with an exit code) or a timeout outcome for a shell call output chunk.

        - `Timeout`

          Indicates that the shell call exceeded its configured time limit.

          - `type: "timeout"`

            The outcome type. Always `timeout`.

            - `"timeout"`

        - `Exit`

          Indicates that the shell commands finished and returned an exit code.

          - `exit_code: number`

            Exit code from the shell process.

          - `type: "exit"`

            The outcome type. Always `exit`.

            - `"exit"`

      - `stderr: string`

        The standard error output that was captured.

      - `stdout: string`

        The standard output that was captured.

      - `created_by?: string`

        The identifier of the actor that created the item.

    - `status: "in_progress" | "completed" | "incomplete"`

      The status of the shell call output. One of `in_progress`, `completed`, or `incomplete`.

      - `"in_progress"`

      - `"completed"`

      - `"incomplete"`

    - `type: "shell_call_output"`

      The type of the shell call output. Always `shell_call_output`.

      - `"shell_call_output"`

    - `agent?: Agent`

      The agent that produced this item.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

    - `caller?: Direct | Program | null`

      The execution context that produced this tool call.

      - `Direct`

        - `type: "direct"`

          - `"direct"`

      - `Program`

        - `caller_id: string`

          The call ID of the program item that produced this tool call.

        - `type: "program"`

          - `"program"`

    - `created_by?: string`

      The identifier of the actor that created the item.

  - `BetaResponseApplyPatchToolCall`

    A tool call that applies file diffs by creating, deleting, or updating files.

    - `id: string`

      The unique ID of the apply patch tool call. Populated when this item is returned via API.

    - `call_id: string`

      The unique ID of the apply patch tool call generated by the model.

    - `operation: CreateFile | DeleteFile | UpdateFile`

      One of the create_file, delete_file, or update_file operations applied via apply_patch.

      - `CreateFile`

        Instruction describing how to create a file via the apply_patch tool.

        - `diff: string`

          Diff to apply.

        - `path: string`

          Path of the file to create.

        - `type: "create_file"`

          Create a new file with the provided diff.

          - `"create_file"`

      - `DeleteFile`

        Instruction describing how to delete a file via the apply_patch tool.

        - `path: string`

          Path of the file to delete.

        - `type: "delete_file"`

          Delete the specified file.

          - `"delete_file"`

      - `UpdateFile`

        Instruction describing how to update a file via the apply_patch tool.

        - `diff: string`

          Diff to apply.

        - `path: string`

          Path of the file to update.

        - `type: "update_file"`

          Update an existing file with the provided diff.

          - `"update_file"`

    - `status: "in_progress" | "completed"`

      The status of the apply patch tool call. One of `in_progress` or `completed`.

      - `"in_progress"`

      - `"completed"`

    - `type: "apply_patch_call"`

      The type of the item. Always `apply_patch_call`.

      - `"apply_patch_call"`

    - `agent?: Agent`

      The agent that produced this item.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

    - `caller?: Direct | Program | null`

      The execution context that produced this tool call.

      - `Direct`

        - `type: "direct"`

          - `"direct"`

      - `Program`

        - `caller_id: string`

          The call ID of the program item that produced this tool call.

        - `type: "program"`

          - `"program"`

    - `created_by?: string`

      The ID of the entity that created this tool call.

  - `BetaResponseApplyPatchToolCallOutput`

    The output emitted by an apply patch tool call.

    - `id: string`

      The unique ID of the apply patch tool call output. Populated when this item is returned via API.

    - `call_id: string`

      The unique ID of the apply patch tool call generated by the model.

    - `status: "completed" | "failed"`

      The status of the apply patch tool call output. One of `completed` or `failed`.

      - `"completed"`

      - `"failed"`

    - `type: "apply_patch_call_output"`

      The type of the item. Always `apply_patch_call_output`.

      - `"apply_patch_call_output"`

    - `agent?: Agent`

      The agent that produced this item.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

    - `caller?: Direct | Program | null`

      The execution context that produced this tool call.

      - `Direct`

        - `type: "direct"`

          - `"direct"`

      - `Program`

        - `caller_id: string`

          The call ID of the program item that produced this tool call.

        - `type: "program"`

          - `"program"`

    - `created_by?: string`

      The ID of the entity that created this tool call output.

    - `output?: string | null`

      Optional textual output returned by the apply patch tool.

  - `McpListTools`

    A list of tools available on an MCP server.

    - `id: string`

      The unique ID of the list.

    - `server_label: string`

      The label of the MCP server.

    - `tools: Array<Tool>`

      The tools available on the server.

      - `input_schema: unknown`

        The JSON schema describing the tool's input.

      - `name: string`

        The name of the tool.

      - `annotations?: unknown`

        Additional annotations about the tool.

      - `description?: string | null`

        The description of the tool.

    - `type: "mcp_list_tools"`

      The type of the item. Always `mcp_list_tools`.

      - `"mcp_list_tools"`

    - `agent?: Agent | null`

      The agent that produced this item.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

    - `error?: string | null`

      Error message if the server could not list tools.

  - `McpApprovalRequest`

    A request for human approval of a tool invocation.

    - `id: string`

      The unique ID of the approval request.

    - `arguments: string`

      A JSON string of arguments for the tool.

    - `name: string`

      The name of the tool to run.

    - `server_label: string`

      The label of the MCP server making the request.

    - `type: "mcp_approval_request"`

      The type of the item. Always `mcp_approval_request`.

      - `"mcp_approval_request"`

    - `agent?: Agent | null`

      The agent that produced this item.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

  - `McpApprovalResponse`

    A response to an MCP approval request.

    - `id: string`

      The unique ID of the approval response

    - `approval_request_id: string`

      The ID of the approval request being answered.

    - `approve: boolean`

      Whether the request was approved.

    - `type: "mcp_approval_response"`

      The type of the item. Always `mcp_approval_response`.

      - `"mcp_approval_response"`

    - `agent?: Agent | null`

      The agent that produced this item.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

    - `reason?: string | null`

      Optional reason for the decision.

  - `McpCall`

    An invocation of a tool on an MCP server.

    - `id: string`

      The unique ID of the tool call.

    - `arguments: string`

      A JSON string of the arguments passed to the tool.

    - `name: string`

      The name of the tool that was run.

    - `server_label: string`

      The label of the MCP server running the tool.

    - `type: "mcp_call"`

      The type of the item. Always `mcp_call`.

      - `"mcp_call"`

    - `agent?: Agent | null`

      The agent that produced this item.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

    - `approval_request_id?: string | null`

      Unique identifier for the MCP tool call approval request.
      Include this value in a subsequent `mcp_approval_response` input to approve or reject the corresponding tool call.

    - `error?: BetaMcpToolCallError | null`

      The error from the tool call, if any.

      - `McpProtocolError`

        - `code: number`

        - `message: string`

        - `type: "mcp_protocol_error"`

          - `"mcp_protocol_error"`

      - `McpToolExecutionError`

        - `content: unknown`

        - `type: "mcp_tool_execution_error"`

          - `"mcp_tool_execution_error"`

      - `HTTPError`

        - `code: number`

        - `message: string`

        - `type: "http_error"`

          - `"http_error"`

    - `output?: string | null`

      The output from the tool call.

    - `status?: "in_progress" | "completed" | "incomplete" | 2 more`

      The status of the tool call. One of `in_progress`, `completed`, `incomplete`, `calling`, or `failed`.

      - `"in_progress"`

      - `"completed"`

      - `"incomplete"`

      - `"calling"`

      - `"failed"`

  - `BetaResponseCustomToolCallItem extends BetaResponseCustomToolCall`

    A call to a custom tool created by the model.

    - `id: string`

      The unique ID of the custom tool call item.

    - `status: "in_progress" | "completed" | "incomplete"`

      The status of the item. One of `in_progress`, `completed`, or
      `incomplete`. Populated when items are returned via API.

      - `"in_progress"`

      - `"completed"`

      - `"incomplete"`

    - `created_by?: string`

      The identifier of the actor that created the item.

  - `BetaResponseCustomToolCallOutputItem extends BetaResponseCustomToolCallOutput`

    The output of a custom tool call from your code, being sent back to the model.

    - `id: string`

      The unique ID of the custom tool call output item.

    - `status: "in_progress" | "completed" | "incomplete"`

      The status of the item. One of `in_progress`, `completed`, or
      `incomplete`. Populated when items are returned via API.

      - `"in_progress"`

      - `"completed"`

      - `"incomplete"`

    - `created_by?: string`

      The identifier of the actor that created the item.

### Beta Response Local Environment

- `BetaResponseLocalEnvironment`

  Represents the use of a local environment to perform shell actions.

  - `type: "local"`

    The environment type. Always `local`.

    - `"local"`

### Beta Response Mcp Call Arguments Delta Event

- `BetaResponseMcpCallArgumentsDeltaEvent`

  Emitted when there is a delta (partial update) to the arguments of an MCP tool call.

  - `delta: string`

    A JSON string containing the partial update to the arguments for the MCP tool call.

  - `item_id: string`

    The unique identifier of the MCP tool call item being processed.

  - `output_index: number`

    The index of the output item in the response's output array.

  - `sequence_number: number`

    The sequence number of this event.

  - `type: "response.mcp_call_arguments.delta"`

    The type of the event. Always 'response.mcp_call_arguments.delta'.

    - `"response.mcp_call_arguments.delta"`

  - `agent?: Agent | null`

    The agent that owns this multi-agent streaming event.

    - `agent_name: string`

      The canonical name of the agent that produced this item.

### Beta Response Mcp Call Arguments Done Event

- `BetaResponseMcpCallArgumentsDoneEvent`

  Emitted when the arguments for an MCP tool call are finalized.

  - `arguments: string`

    A JSON string containing the finalized arguments for the MCP tool call.

  - `item_id: string`

    The unique identifier of the MCP tool call item being processed.

  - `output_index: number`

    The index of the output item in the response's output array.

  - `sequence_number: number`

    The sequence number of this event.

  - `type: "response.mcp_call_arguments.done"`

    The type of the event. Always 'response.mcp_call_arguments.done'.

    - `"response.mcp_call_arguments.done"`

  - `agent?: Agent | null`

    The agent that owns this multi-agent streaming event.

    - `agent_name: string`

      The canonical name of the agent that produced this item.

### Beta Response Mcp Call Completed Event

- `BetaResponseMcpCallCompletedEvent`

  Emitted when an MCP  tool call has completed successfully.

  - `item_id: string`

    The ID of the MCP tool call item that completed.

  - `output_index: number`

    The index of the output item that completed.

  - `sequence_number: number`

    The sequence number of this event.

  - `type: "response.mcp_call.completed"`

    The type of the event. Always 'response.mcp_call.completed'.

    - `"response.mcp_call.completed"`

  - `agent?: Agent | null`

    The agent that owns this multi-agent streaming event.

    - `agent_name: string`

      The canonical name of the agent that produced this item.

### Beta Response Mcp Call Failed Event

- `BetaResponseMcpCallFailedEvent`

  Emitted when an MCP  tool call has failed.

  - `item_id: string`

    The ID of the MCP tool call item that failed.

  - `output_index: number`

    The index of the output item that failed.

  - `sequence_number: number`

    The sequence number of this event.

  - `type: "response.mcp_call.failed"`

    The type of the event. Always 'response.mcp_call.failed'.

    - `"response.mcp_call.failed"`

  - `agent?: Agent | null`

    The agent that owns this multi-agent streaming event.

    - `agent_name: string`

      The canonical name of the agent that produced this item.

### Beta Response Mcp Call In Progress Event

- `BetaResponseMcpCallInProgressEvent`

  Emitted when an MCP  tool call is in progress.

  - `item_id: string`

    The unique identifier of the MCP tool call item being processed.

  - `output_index: number`

    The index of the output item in the response's output array.

  - `sequence_number: number`

    The sequence number of this event.

  - `type: "response.mcp_call.in_progress"`

    The type of the event. Always 'response.mcp_call.in_progress'.

    - `"response.mcp_call.in_progress"`

  - `agent?: Agent | null`

    The agent that owns this multi-agent streaming event.

    - `agent_name: string`

      The canonical name of the agent that produced this item.

### Beta Response Mcp List Tools Completed Event

- `BetaResponseMcpListToolsCompletedEvent`

  Emitted when the list of available MCP tools has been successfully retrieved.

  - `item_id: string`

    The ID of the MCP tool call item that produced this output.

  - `output_index: number`

    The index of the output item that was processed.

  - `sequence_number: number`

    The sequence number of this event.

  - `type: "response.mcp_list_tools.completed"`

    The type of the event. Always 'response.mcp_list_tools.completed'.

    - `"response.mcp_list_tools.completed"`

  - `agent?: Agent | null`

    The agent that owns this multi-agent streaming event.

    - `agent_name: string`

      The canonical name of the agent that produced this item.

### Beta Response Mcp List Tools Failed Event

- `BetaResponseMcpListToolsFailedEvent`

  Emitted when the attempt to list available MCP tools has failed.

  - `item_id: string`

    The ID of the MCP tool call item that failed.

  - `output_index: number`

    The index of the output item that failed.

  - `sequence_number: number`

    The sequence number of this event.

  - `type: "response.mcp_list_tools.failed"`

    The type of the event. Always 'response.mcp_list_tools.failed'.

    - `"response.mcp_list_tools.failed"`

  - `agent?: Agent | null`

    The agent that owns this multi-agent streaming event.

    - `agent_name: string`

      The canonical name of the agent that produced this item.

### Beta Response Mcp List Tools In Progress Event

- `BetaResponseMcpListToolsInProgressEvent`

  Emitted when the system is in the process of retrieving the list of available MCP tools.

  - `item_id: string`

    The ID of the MCP tool call item that is being processed.

  - `output_index: number`

    The index of the output item that is being processed.

  - `sequence_number: number`

    The sequence number of this event.

  - `type: "response.mcp_list_tools.in_progress"`

    The type of the event. Always 'response.mcp_list_tools.in_progress'.

    - `"response.mcp_list_tools.in_progress"`

  - `agent?: Agent | null`

    The agent that owns this multi-agent streaming event.

    - `agent_name: string`

      The canonical name of the agent that produced this item.

### Beta Response Output Audio

- `BetaResponseOutputAudio`

  An audio output from the model.

  - `data: string`

    Base64-encoded audio data from the model.

  - `transcript: string`

    The transcript of the audio data from the model.

  - `type: "output_audio"`

    The type of the output audio. Always `output_audio`.

    - `"output_audio"`

### Beta Response Output Item

- `BetaResponseOutputItem = BetaResponseOutputMessage | BetaResponseFileSearchToolCall | BetaResponseFunctionToolCall | 28 more`

  An output message from the model.

  - `BetaResponseOutputMessage`

    An output message from the model.

    - `id: string`

      The unique ID of the output message.

    - `content: Array<BetaResponseOutputText | BetaResponseOutputRefusal>`

      The content of the output message.

      - `BetaResponseOutputText`

        A text output from the model.

        - `annotations: Array<FileCitation | URLCitation | ContainerFileCitation | FilePath>`

          The annotations of the text output.

          - `FileCitation`

            A citation to a file.

            - `file_id: string`

              The ID of the file.

            - `filename: string`

              The filename of the file cited.

            - `index: number`

              The index of the file in the list of files.

            - `type: "file_citation"`

              The type of the file citation. Always `file_citation`.

              - `"file_citation"`

          - `URLCitation`

            A citation for a web resource used to generate a model response.

            - `end_index: number`

              The index of the last character of the URL citation in the message.

            - `start_index: number`

              The index of the first character of the URL citation in the message.

            - `title: string`

              The title of the web resource.

            - `type: "url_citation"`

              The type of the URL citation. Always `url_citation`.

              - `"url_citation"`

            - `url: string`

              The URL of the web resource.

          - `ContainerFileCitation`

            A citation for a container file used to generate a model response.

            - `container_id: string`

              The ID of the container file.

            - `end_index: number`

              The index of the last character of the container file citation in the message.

            - `file_id: string`

              The ID of the file.

            - `filename: string`

              The filename of the container file cited.

            - `start_index: number`

              The index of the first character of the container file citation in the message.

            - `type: "container_file_citation"`

              The type of the container file citation. Always `container_file_citation`.

              - `"container_file_citation"`

          - `FilePath`

            A path to a file.

            - `file_id: string`

              The ID of the file.

            - `index: number`

              The index of the file in the list of files.

            - `type: "file_path"`

              The type of the file path. Always `file_path`.

              - `"file_path"`

        - `text: string`

          The text output from the model.

        - `type: "output_text"`

          The type of the output text. Always `output_text`.

          - `"output_text"`

        - `logprobs?: Array<Logprob>`

          - `token: string`

          - `bytes: Array<number>`

          - `logprob: number`

          - `top_logprobs: Array<TopLogprob>`

            - `token: string`

            - `bytes: Array<number>`

            - `logprob: number`

      - `BetaResponseOutputRefusal`

        A refusal from the model.

        - `refusal: string`

          The refusal explanation from the model.

        - `type: "refusal"`

          The type of the refusal. Always `refusal`.

          - `"refusal"`

    - `role: "assistant"`

      The role of the output message. Always `assistant`.

      - `"assistant"`

    - `status: "in_progress" | "completed" | "incomplete"`

      The status of the message input. One of `in_progress`, `completed`, or
      `incomplete`. Populated when input items are returned via API.

      - `"in_progress"`

      - `"completed"`

      - `"incomplete"`

    - `type: "message"`

      The type of the output message. Always `message`.

      - `"message"`

    - `agent?: Agent | null`

      The agent that produced this item.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

    - `phase?: "commentary" | "final_answer" | null`

      Labels an `assistant` message as intermediate commentary (`commentary`) or the final answer (`final_answer`).
      For models like `gpt-5.3-codex` and beyond, when sending follow-up requests, preserve and resend
      phase on all assistant messages — dropping it can degrade performance. Not used for user messages.

      - `"commentary"`

      - `"final_answer"`

  - `BetaResponseFileSearchToolCall`

    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.

    - `id: string`

      The unique ID of the file search tool call.

    - `queries: Array<string>`

      The queries used to search for files.

    - `status: "in_progress" | "searching" | "completed" | 2 more`

      The status of the file search tool call. One of `in_progress`,
      `searching`, `incomplete` or `failed`,

      - `"in_progress"`

      - `"searching"`

      - `"completed"`

      - `"incomplete"`

      - `"failed"`

    - `type: "file_search_call"`

      The type of the file search tool call. Always `file_search_call`.

      - `"file_search_call"`

    - `agent?: Agent | null`

      The agent that produced this item.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

    - `results?: Array<Result> | null`

      The results of the file search tool call.

      - `attributes?: Record<string, string | number | boolean> | null`

        Set of 16 key-value pairs that can be attached to an object. This can be
        useful for storing additional information about the object in a structured
        format, and querying for objects via API or the dashboard. Keys are strings
        with a maximum length of 64 characters. Values are strings with a maximum
        length of 512 characters, booleans, or numbers.

        - `string`

        - `number`

        - `boolean`

      - `file_id?: string`

        The unique ID of the file.

      - `filename?: string`

        The name of the file.

      - `score?: number`

        The relevance score of the file - a value between 0 and 1.

      - `text?: string`

        The text that was retrieved from the file.

  - `BetaResponseFunctionToolCall`

    A tool call to run a function. See the
    [function calling guide](https://platform.openai.com/docs/guides/function-calling) for more information.

    - `arguments: string`

      A JSON string of the arguments to pass to the function.

    - `call_id: string`

      The unique ID of the function tool call generated by the model.

    - `name: string`

      The name of the function to run.

    - `type: "function_call"`

      The type of the function tool call. Always `function_call`.

      - `"function_call"`

    - `id?: string`

      The unique ID of the function tool call.

    - `agent?: Agent | null`

      The agent that produced this item.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

    - `caller?: Direct | Program | null`

      The execution context that produced this tool call.

      - `Direct`

        - `type: "direct"`

          - `"direct"`

      - `Program`

        - `caller_id: string`

          The call ID of the program item that produced this tool call.

        - `type: "program"`

          - `"program"`

    - `namespace?: string`

      The namespace of the function to run.

    - `status?: "in_progress" | "completed" | "incomplete"`

      The status of the item. One of `in_progress`, `completed`, or
      `incomplete`. Populated when items are returned via API.

      - `"in_progress"`

      - `"completed"`

      - `"incomplete"`

  - `BetaResponseFunctionToolCallOutputItem`

    - `id: string`

      The unique ID of the function call tool output.

    - `call_id: string`

      The unique ID of the function tool call generated by the model.

    - `output: string | Array<BetaResponseInputText | BetaResponseInputImage | BetaResponseInputFile>`

      The output from the function call generated by your code.
      Can be a string or an list of output content.

      - `string`

      - `Array<BetaResponseInputText | BetaResponseInputImage | BetaResponseInputFile>`

        - `BetaResponseInputText`

          A text input to the model.

          - `text: string`

            The text input to the model.

          - `type: "input_text"`

            The type of the input item. Always `input_text`.

            - `"input_text"`

          - `prompt_cache_breakpoint?: PromptCacheBreakpoint`

            Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.

            - `mode: "explicit"`

              The breakpoint mode. Always `explicit`.

              - `"explicit"`

        - `BetaResponseInputImage`

          An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision).

          - `detail: BetaImageDetail`

            The detail level of the image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`.

            - `"low"`

            - `"high"`

            - `"auto"`

            - `"original"`

          - `type: "input_image"`

            The type of the input item. Always `input_image`.

            - `"input_image"`

          - `file_id?: string | null`

            The ID of the file to be sent to the model.

          - `image_url?: string | null`

            The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.

          - `prompt_cache_breakpoint?: PromptCacheBreakpoint`

            Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.

            - `mode: "explicit"`

              The breakpoint mode. Always `explicit`.

              - `"explicit"`

        - `BetaResponseInputFile`

          A file input to the model.

          - `type: "input_file"`

            The type of the input item. Always `input_file`.

            - `"input_file"`

          - `detail?: "auto" | "low" | "high"`

            The detail level of the file to be sent to the model. Use `auto` to let the system select the detail level; for GPT-5.6 and later models, `auto` uses high-quality rendering, which may increase input token usage. Use `low` for lower-cost rendering, or `high` to render the file at higher quality. Defaults to `auto`.

            - `"auto"`

            - `"low"`

            - `"high"`

          - `file_data?: string`

            The content of the file to be sent to the model.

          - `file_id?: string | null`

            The ID of the file to be sent to the model.

          - `file_url?: string`

            The URL of the file to be sent to the model.

          - `filename?: string`

            The name of the file to be sent to the model.

          - `prompt_cache_breakpoint?: PromptCacheBreakpoint`

            Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.

            - `mode: "explicit"`

              The breakpoint mode. Always `explicit`.

              - `"explicit"`

    - `status: "in_progress" | "completed" | "incomplete"`

      The status of the item. One of `in_progress`, `completed`, or
      `incomplete`. Populated when items are returned via API.

      - `"in_progress"`

      - `"completed"`

      - `"incomplete"`

    - `type: "function_call_output"`

      The type of the function tool call output. Always `function_call_output`.

      - `"function_call_output"`

    - `agent?: Agent | null`

      The agent that produced this item.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

    - `caller?: Direct | Program | null`

      The execution context that produced this tool call.

      - `Direct`

        - `type: "direct"`

          The caller type. Always `direct`.

          - `"direct"`

      - `Program`

        - `caller_id: string`

          The call ID of the program item that produced this tool call.

        - `type: "program"`

          The caller type. Always `program`.

          - `"program"`

    - `created_by?: string`

      The identifier of the actor that created the item.

    - `name?: string`

      The name of the tool that produced the output.

    - `namespace?: string`

      The namespace of the tool that produced the output.

  - `AgentMessage`

    - `id: string`

      The unique ID of the agent message.

    - `author: string`

      The sending agent identity.

    - `content: Array<BetaResponseInputText | BetaResponseOutputText | Text | 7 more>`

      Encrypted content sent between agents.

      - `BetaResponseInputText`

        A text input to the model.

      - `BetaResponseOutputText`

        A text output from the model.

      - `Text`

        A text content.

        - `text: string`

        - `type: "text"`

          - `"text"`

      - `SummaryText`

        A summary text from the model.

        - `text: string`

          A summary of the reasoning output from the model so far.

        - `type: "summary_text"`

          The type of the object. Always `summary_text`.

          - `"summary_text"`

      - `ReasoningText`

        Reasoning text from the model.

        - `text: string`

          The reasoning text from the model.

        - `type: "reasoning_text"`

          The type of the reasoning text. Always `reasoning_text`.

          - `"reasoning_text"`

      - `BetaResponseOutputRefusal`

        A refusal from the model.

      - `BetaResponseInputImage`

        An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision).

      - `ComputerScreenshot`

        A screenshot of a computer.

        - `detail: BetaImageDetail`

          The detail level of the screenshot image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`.

        - `file_id: string | null`

          The identifier of an uploaded file that contains the screenshot.

        - `image_url: string | null`

          The URL of the screenshot image.

        - `type: "computer_screenshot"`

          Specifies the event type. For a computer screenshot, this property is always set to `computer_screenshot`.

          - `"computer_screenshot"`

        - `prompt_cache_breakpoint?: PromptCacheBreakpoint`

          Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.

          - `mode: "explicit"`

            The breakpoint mode. Always `explicit`.

            - `"explicit"`

      - `BetaResponseInputFile`

        A file input to the model.

      - `EncryptedContent`

        Opaque encrypted content that Responses API decrypts inside trusted model execution.

        - `encrypted_content: string`

          Opaque encrypted content.

        - `type: "encrypted_content"`

          The type of the input item. Always `encrypted_content`.

          - `"encrypted_content"`

    - `recipient: string`

      The destination agent identity.

    - `type: "agent_message"`

      The type of the item. Always `agent_message`.

      - `"agent_message"`

    - `agent?: Agent`

      The agent that produced this item.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

  - `MultiAgentCall`

    - `id: string`

      The unique ID of the multi-agent call item.

    - `action: "spawn_agent" | "interrupt_agent" | "list_agents" | 3 more`

      The multi-agent action to execute.

      - `"spawn_agent"`

      - `"interrupt_agent"`

      - `"list_agents"`

      - `"send_message"`

      - `"followup_task"`

      - `"wait_agent"`

    - `arguments: string`

      The JSON string of arguments generated for the action.

    - `call_id: string`

      The unique ID linking this call to its output.

    - `type: "multi_agent_call"`

      The type of the multi-agent call. Always `multi_agent_call`.

      - `"multi_agent_call"`

    - `agent?: Agent`

      The agent that produced this item.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

  - `MultiAgentCallOutput`

    - `id: string`

      The unique ID of the multi-agent call output item.

    - `action: "spawn_agent" | "interrupt_agent" | "list_agents" | 3 more`

      The multi-agent action that produced this result.

      - `"spawn_agent"`

      - `"interrupt_agent"`

      - `"list_agents"`

      - `"send_message"`

      - `"followup_task"`

      - `"wait_agent"`

    - `call_id: string`

      The unique ID of the multi-agent call.

    - `output: Array<BetaResponseOutputText>`

      Text output returned by the multi-agent action.

      - `annotations: Array<FileCitation | URLCitation | ContainerFileCitation | FilePath>`

        The annotations of the text output.

      - `text: string`

        The text output from the model.

      - `type: "output_text"`

        The type of the output text. Always `output_text`.

      - `logprobs?: Array<Logprob>`

    - `type: "multi_agent_call_output"`

      The type of the multi-agent result. Always `multi_agent_call_output`.

      - `"multi_agent_call_output"`

    - `agent?: Agent`

      The agent that produced this item.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

  - `BetaResponseFunctionWebSearch`

    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.

    - `id: string`

      The unique ID of the web search tool call.

    - `action: Search | OpenPage | FindInPage`

      An object describing the specific action taken in this web search call.
      Includes details on how the model used the web (search, open_page, find_in_page).

      - `Search`

        Action type "search" - Performs a web search query.

        - `type: "search"`

          The action type.

          - `"search"`

        - `queries?: Array<string>`

          The search queries.

        - `query?: string`

          The search query.

        - `sources?: Array<Source>`

          The sources used in the search.

          - `type: "url"`

            The type of source. Always `url`.

            - `"url"`

          - `url: string`

            The URL of the source.

      - `OpenPage`

        Action type "open_page" - Opens a specific URL from search results.

        - `type: "open_page"`

          The action type.

          - `"open_page"`

        - `url?: string | null`

          The URL opened by the model.

      - `FindInPage`

        Action type "find_in_page": Searches for a pattern within a loaded page.

        - `pattern: string`

          The pattern or text to search for within the page.

        - `type: "find_in_page"`

          The action type.

          - `"find_in_page"`

        - `url: string`

          The URL of the page searched for the pattern.

    - `status: "in_progress" | "searching" | "completed" | "failed"`

      The status of the web search tool call.

      - `"in_progress"`

      - `"searching"`

      - `"completed"`

      - `"failed"`

    - `type: "web_search_call"`

      The type of the web search tool call. Always `web_search_call`.

      - `"web_search_call"`

    - `agent?: Agent | null`

      The agent that produced this item.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

  - `BetaResponseComputerToolCall`

    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.

    - `id: string`

      The unique ID of the computer call.

    - `call_id: string`

      An identifier used when responding to the tool call with output.

    - `pending_safety_checks: Array<PendingSafetyCheck>`

      The pending safety checks for the computer call.

      - `id: string`

        The ID of the pending safety check.

      - `code?: string | null`

        The type of the pending safety check.

      - `message?: string | null`

        Details about the pending safety check.

    - `status: "in_progress" | "completed" | "incomplete"`

      The status of the item. One of `in_progress`, `completed`, or
      `incomplete`. Populated when items are returned via API.

      - `"in_progress"`

      - `"completed"`

      - `"incomplete"`

    - `type: "computer_call"`

      The type of the computer call. Always `computer_call`.

      - `"computer_call"`

    - `action?: BetaComputerAction`

      A click action.

      - `Click`

        A click action.

        - `button: "left" | "right" | "wheel" | 2 more`

          Indicates which mouse button was pressed during the click. One of `left`, `right`, `wheel`, `back`, or `forward`.

          - `"left"`

          - `"right"`

          - `"wheel"`

          - `"back"`

          - `"forward"`

        - `type: "click"`

          Specifies the event type. For a click action, this property is always `click`.

          - `"click"`

        - `x: number`

          The x-coordinate where the click occurred.

        - `y: number`

          The y-coordinate where the click occurred.

        - `keys?: Array<string> | null`

          The keys being held while clicking.

      - `DoubleClick`

        A double click action.

        - `keys: Array<string> | null`

          The keys being held while double-clicking.

        - `type: "double_click"`

          Specifies the event type. For a double click action, this property is always set to `double_click`.

          - `"double_click"`

        - `x: number`

          The x-coordinate where the double click occurred.

        - `y: number`

          The y-coordinate where the double click occurred.

      - `Drag`

        A drag action.

        - `path: Array<Path>`

          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 }
          ]
          ```

          - `x: number`

            The x-coordinate.

          - `y: number`

            The y-coordinate.

        - `type: "drag"`

          Specifies the event type. For a drag action, this property is always set to `drag`.

          - `"drag"`

        - `keys?: Array<string> | null`

          The keys being held while dragging the mouse.

      - `Keypress`

        A collection of keypresses the model would like to perform.

        - `keys: Array<string>`

          The combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key.

        - `type: "keypress"`

          Specifies the event type. For a keypress action, this property is always set to `keypress`.

          - `"keypress"`

      - `Move`

        A mouse move action.

        - `type: "move"`

          Specifies the event type. For a move action, this property is always set to `move`.

          - `"move"`

        - `x: number`

          The x-coordinate to move to.

        - `y: number`

          The y-coordinate to move to.

        - `keys?: Array<string> | null`

          The keys being held while moving the mouse.

      - `Screenshot`

        A screenshot action.

        - `type: "screenshot"`

          Specifies the event type. For a screenshot action, this property is always set to `screenshot`.

          - `"screenshot"`

      - `Scroll`

        A scroll action.

        - `scroll_x: number`

          The horizontal scroll distance.

        - `scroll_y: number`

          The vertical scroll distance.

        - `type: "scroll"`

          Specifies the event type. For a scroll action, this property is always set to `scroll`.

          - `"scroll"`

        - `x: number`

          The x-coordinate where the scroll occurred.

        - `y: number`

          The y-coordinate where the scroll occurred.

        - `keys?: Array<string> | null`

          The keys being held while scrolling.

      - `Type`

        An action to type in text.

        - `text: string`

          The text to type.

        - `type: "type"`

          Specifies the event type. For a type action, this property is always set to `type`.

          - `"type"`

      - `Wait`

        A wait action.

        - `type: "wait"`

          Specifies the event type. For a wait action, this property is always set to `wait`.

          - `"wait"`

    - `actions?: BetaComputerActionList`

      Flattened batched actions for `computer_use`. Each action includes an
      `type` discriminator and action-specific fields.

      - `Click`

        A click action.

      - `DoubleClick`

        A double click action.

      - `Drag`

        A drag action.

      - `Keypress`

        A collection of keypresses the model would like to perform.

      - `Move`

        A mouse move action.

      - `Screenshot`

        A screenshot action.

      - `Scroll`

        A scroll action.

      - `Type`

        An action to type in text.

      - `Wait`

        A wait action.

    - `agent?: Agent | null`

      The agent that produced this item.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

  - `BetaResponseComputerToolCallOutputItem`

    - `id: string`

      The unique ID of the computer call tool output.

    - `call_id: string`

      The ID of the computer tool call that produced the output.

    - `output: BetaResponseComputerToolCallOutputScreenshot`

      A computer screenshot image used with the computer use tool.

      - `type: "computer_screenshot"`

        Specifies the event type. For a computer screenshot, this property is
        always set to `computer_screenshot`.

        - `"computer_screenshot"`

      - `file_id?: string`

        The identifier of an uploaded file that contains the screenshot.

      - `image_url?: string`

        The URL of the screenshot image.

    - `status: "completed" | "incomplete" | "failed" | "in_progress"`

      The status of the message input. One of `in_progress`, `completed`, or
      `incomplete`. Populated when input items are returned via API.

      - `"completed"`

      - `"incomplete"`

      - `"failed"`

      - `"in_progress"`

    - `type: "computer_call_output"`

      The type of the computer tool call output. Always `computer_call_output`.

      - `"computer_call_output"`

    - `acknowledged_safety_checks?: Array<AcknowledgedSafetyCheck>`

      The safety checks reported by the API that have been acknowledged by the
      developer.

      - `id: string`

        The ID of the pending safety check.

      - `code?: string | null`

        The type of the pending safety check.

      - `message?: string | null`

        Details about the pending safety check.

    - `agent?: Agent | null`

      The agent that produced this item.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

    - `created_by?: string`

      The identifier of the actor that created the item.

  - `BetaResponseReasoningItem`

    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).

    - `id: string`

      The unique identifier of the reasoning content.

    - `summary: Array<Summary>`

      Reasoning summary content.

      - `text: string`

        A summary of the reasoning output from the model so far.

      - `type: "summary_text"`

        The type of the object. Always `summary_text`.

        - `"summary_text"`

    - `type: "reasoning"`

      The type of the object. Always `reasoning`.

      - `"reasoning"`

    - `agent?: Agent | null`

      The agent that produced this item.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

    - `content?: Array<Content>`

      Reasoning text content.

      - `text: string`

        The reasoning text from the model.

      - `type: "reasoning_text"`

        The type of the reasoning text. Always `reasoning_text`.

        - `"reasoning_text"`

    - `encrypted_content?: string | null`

      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.

      When streaming, use the completed reasoning item and its
      `encrypted_content` from the `response.output_item.done` event in
      subsequent requests. The `encrypted_content` in
      `response.output_item.added` may be incomplete. This is especially
      important when `store` is `false` or when using Zero Data Retention.

    - `status?: "in_progress" | "completed" | "incomplete"`

      The status of the item. One of `in_progress`, `completed`, or
      `incomplete`. Populated when items are returned via API.

      - `"in_progress"`

      - `"completed"`

      - `"incomplete"`

  - `Program`

    - `id: string`

      The unique ID of the program item.

    - `call_id: string`

      The stable call ID of the program item.

    - `code: string`

      The JavaScript source executed by programmatic tool calling.

    - `fingerprint: string`

      Opaque program replay fingerprint that must be round-tripped.

    - `type: "program"`

      The type of the item. Always `program`.

      - `"program"`

    - `agent?: Agent`

      The agent that produced this item.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

  - `ProgramOutput`

    - `id: string`

      The unique ID of the program output item.

    - `call_id: string`

      The call ID of the program item.

    - `result: string`

      The result produced by the program item.

    - `status: "completed" | "incomplete"`

      The terminal status of the program output item.

      - `"completed"`

      - `"incomplete"`

    - `type: "program_output"`

      The type of the item. Always `program_output`.

      - `"program_output"`

    - `agent?: Agent`

      The agent that produced this item.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

  - `BetaResponseToolSearchCall`

    - `id: string`

      The unique ID of the tool search call item.

    - `arguments: unknown`

      Arguments used for the tool search call.

    - `call_id: string | null`

      The unique ID of the tool search call generated by the model.

    - `execution: "server" | "client"`

      Whether tool search was executed by the server or by the client.

      - `"server"`

      - `"client"`

    - `status: "in_progress" | "completed" | "incomplete"`

      The status of the tool search call item that was recorded.

      - `"in_progress"`

      - `"completed"`

      - `"incomplete"`

    - `type: "tool_search_call"`

      The type of the item. Always `tool_search_call`.

      - `"tool_search_call"`

    - `agent?: Agent`

      The agent that produced this item.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

    - `created_by?: string`

      The identifier of the actor that created the item.

  - `BetaResponseToolSearchOutputItem`

    - `id: string`

      The unique ID of the tool search output item.

    - `call_id: string | null`

      The unique ID of the tool search call generated by the model.

    - `execution: "server" | "client"`

      Whether tool search was executed by the server or by the client.

      - `"server"`

      - `"client"`

    - `status: "in_progress" | "completed" | "incomplete"`

      The status of the tool search output item that was recorded.

      - `"in_progress"`

      - `"completed"`

      - `"incomplete"`

    - `tools: Array<BetaTool>`

      The loaded tool definitions returned by tool search.

      - `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).

        - `name: string`

          The name of the function to call.

        - `parameters: Record<string, unknown> | null`

          A JSON schema object describing the parameters of the function.

        - `strict: boolean | null`

          Whether strict parameter validation is enforced for this function tool.

        - `type: "function"`

          The type of the function tool. Always `function`.

          - `"function"`

        - `allowed_callers?: Array<"direct" | "programmatic"> | null`

          The tool invocation context(s).

          - `"direct"`

          - `"programmatic"`

        - `defer_loading?: boolean`

          Whether this function is deferred and loaded via tool search.

        - `description?: string | null`

          A description of the function. Used by the model to determine whether or not to call the function.

        - `output_schema?: Record<string, unknown> | null`

          A JSON schema object describing the JSON value encoded in string outputs for this function.

      - `BetaFileSearchTool`

        A tool that searches for relevant content from uploaded files. Learn more about the [file search tool](https://platform.openai.com/docs/guides/tools-file-search).

        - `type: "file_search"`

          The type of the file search tool. Always `file_search`.

          - `"file_search"`

        - `vector_store_ids: Array<string>`

          The IDs of the vector stores to search.

        - `filters?: ComparisonFilter | CompoundFilter | null`

          A filter to apply.

          - `ComparisonFilter`

            A filter used to compare a specified attribute key to a given value using a defined comparison operation.

            - `key: string`

              The key to compare against the value.

            - `type: "eq" | "ne" | "gt" | 5 more`

              Specifies the comparison operator: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`, `in`, `nin`.

              - `eq`: equals
              - `ne`: not equal
              - `gt`: greater than
              - `gte`: greater than or equal
              - `lt`: less than
              - `lte`: less than or equal
              - `in`: in
              - `nin`: not in

              - `"eq"`

              - `"ne"`

              - `"gt"`

              - `"gte"`

              - `"lt"`

              - `"lte"`

              - `"in"`

              - `"nin"`

            - `value: string | number | boolean | Array<string | number>`

              The value to compare against the attribute key; supports string, number, or boolean types.

              - `string`

              - `number`

              - `boolean`

              - `Array<string | number>`

                - `string`

                - `number`

          - `CompoundFilter`

            Combine multiple filters using `and` or `or`.

            - `filters: Array<ComparisonFilter | unknown>`

              Array of filters to combine. Items can be `ComparisonFilter` or `CompoundFilter`.

              - `ComparisonFilter`

                A filter used to compare a specified attribute key to a given value using a defined comparison operation.

                - `key: string`

                  The key to compare against the value.

                - `type: "eq" | "ne" | "gt" | 5 more`

                  Specifies the comparison operator: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`, `in`, `nin`.

                  - `eq`: equals
                  - `ne`: not equal
                  - `gt`: greater than
                  - `gte`: greater than or equal
                  - `lt`: less than
                  - `lte`: less than or equal
                  - `in`: in
                  - `nin`: not in

                  - `"eq"`

                  - `"ne"`

                  - `"gt"`

                  - `"gte"`

                  - `"lt"`

                  - `"lte"`

                  - `"in"`

                  - `"nin"`

                - `value: string | number | boolean | Array<string | number>`

                  The value to compare against the attribute key; supports string, number, or boolean types.

                  - `string`

                  - `number`

                  - `boolean`

                  - `Array<string | number>`

                    - `string`

                    - `number`

              - `unknown`

            - `type: "and" | "or"`

              Type of operation: `and` or `or`.

              - `"and"`

              - `"or"`

        - `max_num_results?: number`

          The maximum number of results to return. This number should be between 1 and 50 inclusive.

        - `ranking_options?: RankingOptions`

          Ranking options for search.

          - `hybrid_search?: HybridSearch`

            Weights that control how reciprocal rank fusion balances semantic embedding matches versus sparse keyword matches when hybrid search is enabled.

            - `embedding_weight: number`

              The weight of the embedding in the reciprocal ranking fusion.

            - `text_weight: number`

              The weight of the text in the reciprocal ranking fusion.

          - `ranker?: "auto" | "default-2024-11-15"`

            The ranker to use for the file search.

            - `"auto"`

            - `"default-2024-11-15"`

          - `score_threshold?: number`

            The score threshold for the file search, a number between 0 and 1. Numbers closer to 1 will attempt to return only the most relevant results, but may return fewer results.

      - `BetaComputerTool`

        A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use).

        - `type: "computer"`

          The type of the computer tool. Always `computer`.

          - `"computer"`

      - `BetaComputerUsePreviewTool`

        A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use).

        - `display_height: number`

          The height of the computer display.

        - `display_width: number`

          The width of the computer display.

        - `environment: "windows" | "mac" | "linux" | 2 more`

          The type of computer environment to control.

          - `"windows"`

          - `"mac"`

          - `"linux"`

          - `"ubuntu"`

          - `"browser"`

        - `type: "computer_use_preview"`

          The type of the computer use tool. Always `computer_use_preview`.

          - `"computer_use_preview"`

      - `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"`

          The type of the web search tool. One of `web_search` or `web_search_2025_08_26`.

          - `"web_search"`

          - `"web_search_2025_08_26"`

        - `external_web_access?: boolean`

          Allow live internet access for web search. Defaults to true when omitted. When false, the web search tool runs in offline/cache-only mode and will not fetch new external content.

        - `filters?: Filters | null`

          Filters for the search.

          - `allowed_domains?: Array<string> | null`

            Allowed domains for the search. If not provided, all domains are allowed.
            Subdomains of the provided domains are allowed as well.

            Example: `["pubmed.ncbi.nlm.nih.gov"]`

        - `search_context_size?: "low" | "medium" | "high"`

          High level guidance for the amount of context window space to use for the search. One of `low`, `medium`, or `high`. `medium` is the default.

          - `"low"`

          - `"medium"`

          - `"high"`

        - `user_location?: UserLocation | null`

          The approximate location of the user.

          - `city?: string | null`

            Free text input for the city of the user, e.g. `San Francisco`.

          - `country?: string | null`

            The two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of the user, e.g. `US`.

          - `region?: string | null`

            Free text input for the region of the user, e.g. `California`.

          - `timezone?: string | null`

            The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of the user, e.g. `America/Los_Angeles`.

          - `type?: "approximate"`

            The type of location approximation. Always `approximate`.

            - `"approximate"`

      - `Mcp`

        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).

        - `server_label: string`

          A label for this MCP server, used to identify it in tool calls.

        - `type: "mcp"`

          The type of the MCP tool. Always `mcp`.

          - `"mcp"`

        - `allowed_callers?: Array<"direct" | "programmatic"> | null`

          The tool invocation context(s).

          - `"direct"`

          - `"programmatic"`

        - `allowed_tools?: Array<string> | McpToolFilter | null`

          List of allowed tool names or a filter object.

          - `Array<string>`

          - `McpToolFilter`

            A filter object to specify which tools are allowed.

            - `read_only?: boolean`

              Indicates whether or not a tool modifies data or is read-only. If an
              MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint),
              it will match this filter.

            - `tool_names?: Array<string>`

              List of allowed tool names.

        - `authorization?: string`

          An OAuth access token that can be used with a remote MCP server, either
          with a custom MCP server URL or a service connector. Your application
          must handle the OAuth authorization flow and provide the token here.

        - `connector_id?: "connector_dropbox" | "connector_gmail" | "connector_googlecalendar" | 5 more`

          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`

          - `"connector_dropbox"`

          - `"connector_gmail"`

          - `"connector_googlecalendar"`

          - `"connector_googledrive"`

          - `"connector_microsoftteams"`

          - `"connector_outlookcalendar"`

          - `"connector_outlookemail"`

          - `"connector_sharepoint"`

        - `defer_loading?: boolean`

          Whether this MCP tool is deferred and discovered via tool search.

        - `headers?: Record<string, string> | null`

          Optional HTTP headers to send to the MCP server. Use for authentication
          or other purposes.

        - `require_approval?: McpToolApprovalFilter | "always" | "never" | null`

          Specify which of the MCP server's tools require approval.

          - `McpToolApprovalFilter`

            Specify which of the MCP server's tools require approval. Can be
            `always`, `never`, or a filter object associated with tools
            that require approval.

            - `always?: Always`

              A filter object to specify which tools are allowed.

              - `read_only?: boolean`

                Indicates whether or not a tool modifies data or is read-only. If an
                MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint),
                it will match this filter.

              - `tool_names?: Array<string>`

                List of allowed tool names.

            - `never?: Never`

              A filter object to specify which tools are allowed.

              - `read_only?: boolean`

                Indicates whether or not a tool modifies data or is read-only. If an
                MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint),
                it will match this filter.

              - `tool_names?: Array<string>`

                List of allowed tool names.

          - `"always" | "never"`

            - `"always"`

            - `"never"`

        - `server_description?: string`

          Optional description of the MCP server, used to provide more context.

        - `server_url?: string`

          The URL for the MCP server. One of `server_url`, `connector_id`, or
          `tunnel_id` must be provided.

        - `tunnel_id?: string`

          The Secure MCP Tunnel ID to use instead of a direct server URL. One of
          `server_url`, `connector_id`, or `tunnel_id` must be provided.

      - `CodeInterpreter`

        A tool that runs Python code to help generate a response to a prompt.

        - `container: string | CodeInterpreterToolAuto`

          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`

          - `CodeInterpreterToolAuto`

            Configuration for a code interpreter container. Optionally specify the IDs of the files to run the code on.

            - `type: "auto"`

              Always `auto`.

              - `"auto"`

            - `file_ids?: Array<string>`

              An optional list of uploaded files to make available to your code.

            - `memory_limit?: "1g" | "4g" | "16g" | "64g" | null`

              The memory limit for the code interpreter container.

              - `"1g"`

              - `"4g"`

              - `"16g"`

              - `"64g"`

            - `network_policy?: BetaContainerNetworkPolicyDisabled | BetaContainerNetworkPolicyAllowlist`

              Network access policy for the container.

              - `BetaContainerNetworkPolicyDisabled`

                - `type: "disabled"`

                  Disable outbound network access. Always `disabled`.

                  - `"disabled"`

              - `BetaContainerNetworkPolicyAllowlist`

                - `allowed_domains: Array<string>`

                  A list of allowed domains when type is `allowlist`.

                - `type: "allowlist"`

                  Allow outbound network access only to specified domains. Always `allowlist`.

                  - `"allowlist"`

                - `domain_secrets?: Array<BetaContainerNetworkPolicyDomainSecret>`

                  Optional domain-scoped secrets for allowlisted domains.

                  - `domain: string`

                    The domain associated with the secret.

                  - `name: string`

                    The name of the secret to inject for the domain.

                  - `value: string`

                    The secret value to inject for the domain.

        - `type: "code_interpreter"`

          The type of the code interpreter tool. Always `code_interpreter`.

          - `"code_interpreter"`

        - `allowed_callers?: Array<"direct" | "programmatic"> | null`

          The tool invocation context(s).

          - `"direct"`

          - `"programmatic"`

      - `ProgrammaticToolCalling`

        - `type: "programmatic_tool_calling"`

          The type of the tool. Always `programmatic_tool_calling`.

          - `"programmatic_tool_calling"`

      - `ImageGeneration`

        A tool that generates images using the GPT image models.

        - `type: "image_generation"`

          The type of the image generation tool. Always `image_generation`.

          - `"image_generation"`

        - `action?: "generate" | "edit" | "auto"`

          Whether to generate a new image or edit an existing image. Default: `auto`.

          - `"generate"`

          - `"edit"`

          - `"auto"`

        - `background?: "transparent" | "opaque" | "auto"`

          Allows to set transparency for the background of the generated image(s).
          Must be one of `transparent`, `opaque`, or `auto` (default value). When
          `auto` is used, the model will automatically determine the best
          background for the image.

          Transparent backgrounds are available for supported GPT Image models.
          For `gpt-image-2` and `gpt-image-2-2026-04-21`, this support is in
          preview. When using `transparent`, set the output format to `png` or
          `webp`.

          - `"transparent"`

          - `"opaque"`

          - `"auto"`

        - `input_fidelity?: "high" | "low" | null`

          Control how much effort the model will exert to match the style and features, especially facial features, of input images. This parameter is only supported for `gpt-image-1` and `gpt-image-1.5` and later models, unsupported for `gpt-image-1-mini`. Supports `high` and `low`. Defaults to `low`.

          - `"high"`

          - `"low"`

        - `input_image_mask?: InputImageMask`

          Optional mask for inpainting. Contains `image_url`
          (string, optional) and `file_id` (string, optional).

          - `file_id?: string`

            File ID for the mask image.

          - `image_url?: string`

            Base64-encoded mask image.

        - `model?: (string & {}) | "gpt-image-1" | "gpt-image-1-mini" | "gpt-image-2" | 3 more`

          The image generation model to use. One of `gpt-image-1`,
          `gpt-image-1-mini`, `gpt-image-1.5`, `gpt-image-2`,
          `gpt-image-2-2026-04-21`, or `chatgpt-image-latest`. Default:
          `gpt-image-1`.

          - `(string & {})`

          - `"gpt-image-1" | "gpt-image-1-mini" | "gpt-image-2" | 3 more`

            - `"gpt-image-1"`

            - `"gpt-image-1-mini"`

            - `"gpt-image-2"`

            - `"gpt-image-2-2026-04-21"`

            - `"gpt-image-1.5"`

            - `"chatgpt-image-latest"`

        - `moderation?: "auto" | "low"`

          Moderation level for the generated image. Default: `auto`.

          - `"auto"`

          - `"low"`

        - `output_compression?: number`

          Compression level for the output image. Default: 100.

        - `output_format?: "png" | "webp" | "jpeg"`

          The output format of the generated image. One of `png`, `webp`, or
          `jpeg`. Default: `png`.

          - `"png"`

          - `"webp"`

          - `"jpeg"`

        - `partial_images?: number`

          Number of partial images to generate in streaming mode, from 0 (default value) to 3.

        - `quality?: "low" | "medium" | "high" | "auto"`

          The quality of the generated image. One of `low`, `medium`, `high`,
          or `auto`. Default: `auto`.

          - `"low"`

          - `"medium"`

          - `"high"`

          - `"auto"`

        - `size?: (string & {}) | "1024x1024" | "1024x1536" | "1536x1024" | "auto"`

          The size of the generated images. For `gpt-image-2` and `gpt-image-2-2026-04-21`, arbitrary resolutions are supported as `WIDTHxHEIGHT` strings, for example `1536x864`. Width and height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above `2560x1440` are experimental, and the maximum supported resolution is `3840x2160`. The requested size must also satisfy the model's current pixel and edge limits. The standard sizes `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models; `auto` is supported for models that allow automatic sizing. For `dall-e-2`, use one of `256x256`, `512x512`, or `1024x1024`. For `dall-e-3`, use one of `1024x1024`, `1792x1024`, or `1024x1792`.

          - `(string & {})`

          - `"1024x1024" | "1024x1536" | "1536x1024" | "auto"`

            - `"1024x1024"`

            - `"1024x1536"`

            - `"1536x1024"`

            - `"auto"`

      - `LocalShell`

        A tool that allows the model to execute shell commands in a local environment.

        - `type: "local_shell"`

          The type of the local shell tool. Always `local_shell`.

          - `"local_shell"`

      - `BetaFunctionShellTool`

        A tool that allows the model to execute shell commands.

        - `type: "shell"`

          The type of the shell tool. Always `shell`.

          - `"shell"`

        - `allowed_callers?: Array<"direct" | "programmatic"> | null`

          The tool invocation context(s).

          - `"direct"`

          - `"programmatic"`

        - `environment?: BetaContainerAuto | BetaLocalEnvironment | BetaContainerReference | null`

          - `BetaContainerAuto`

            - `type: "container_auto"`

              Automatically creates a container for this request

              - `"container_auto"`

            - `file_ids?: Array<string>`

              An optional list of uploaded files to make available to your code.

            - `memory_limit?: "1g" | "4g" | "16g" | "64g" | null`

              The memory limit for the container.

              - `"1g"`

              - `"4g"`

              - `"16g"`

              - `"64g"`

            - `network_policy?: BetaContainerNetworkPolicyDisabled | BetaContainerNetworkPolicyAllowlist`

              Network access policy for the container.

              - `BetaContainerNetworkPolicyDisabled`

              - `BetaContainerNetworkPolicyAllowlist`

            - `skills?: Array<BetaSkillReference | BetaInlineSkill>`

              An optional list of skills referenced by id or inline data.

              - `BetaSkillReference`

                - `skill_id: string`

                  The ID of the referenced skill.

                - `type: "skill_reference"`

                  References a skill created with the /v1/skills endpoint.

                  - `"skill_reference"`

                - `version?: string`

                  Optional skill version. Use a positive integer or 'latest'. Omit for default.

              - `BetaInlineSkill`

                - `description: string`

                  The description of the skill.

                - `name: string`

                  The name of the skill.

                - `source: BetaInlineSkillSource`

                  Inline skill payload

                  - `data: string`

                    Base64-encoded skill zip bundle.

                  - `media_type: "application/zip"`

                    The media type of the inline skill payload. Must be `application/zip`.

                    - `"application/zip"`

                  - `type: "base64"`

                    The type of the inline skill source. Must be `base64`.

                    - `"base64"`

                - `type: "inline"`

                  Defines an inline skill for this request.

                  - `"inline"`

          - `BetaLocalEnvironment`

            - `type: "local"`

              Use a local computer environment.

              - `"local"`

            - `skills?: Array<BetaLocalSkill>`

              An optional list of skills.

              - `description: string`

                The description of the skill.

              - `name: string`

                The name of the skill.

              - `path: string`

                The path to the directory containing the skill.

          - `BetaContainerReference`

            - `container_id: string`

              The ID of the referenced container.

            - `type: "container_reference"`

              References a container created with the /v1/containers endpoint

              - `"container_reference"`

      - `BetaCustomTool`

        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)

        - `name: string`

          The name of the custom tool, used to identify it in tool calls.

        - `type: "custom"`

          The type of the custom tool. Always `custom`.

          - `"custom"`

        - `allowed_callers?: Array<"direct" | "programmatic"> | null`

          The tool invocation context(s).

          - `"direct"`

          - `"programmatic"`

        - `defer_loading?: boolean`

          Whether this tool should be deferred and discovered via tool search.

        - `description?: string`

          Optional description of the custom tool, used to provide more context.

        - `format?: Text | Grammar`

          The input format for the custom tool. Default is unconstrained text.

          - `Text`

            Unconstrained free-form text.

            - `type: "text"`

              Unconstrained text format. Always `text`.

              - `"text"`

          - `Grammar`

            A grammar defined by the user.

            - `definition: string`

              The grammar definition.

            - `syntax: "lark" | "regex"`

              The syntax of the grammar definition. One of `lark` or `regex`.

              - `"lark"`

              - `"regex"`

            - `type: "grammar"`

              Grammar format. Always `grammar`.

              - `"grammar"`

      - `BetaNamespaceTool`

        Groups function/custom tools under a shared namespace.

        - `description: string`

          A description of the namespace shown to the model.

        - `name: string`

          The namespace name used in tool calls (for example, `crm`).

        - `tools: Array<Function | BetaCustomTool>`

          The function/custom tools available inside this namespace.

          - `Function`

            - `name: string`

            - `type: "function"`

              - `"function"`

            - `allowed_callers?: Array<"direct" | "programmatic"> | null`

              The tool invocation context(s).

              - `"direct"`

              - `"programmatic"`

            - `defer_loading?: boolean`

              Whether this function should be deferred and discovered via tool search.

            - `description?: string | null`

            - `output_schema?: Record<string, unknown> | null`

              A JSON Schema describing the JSON value encoded in string outputs for this function tool. This does not describe content-array outputs.

            - `parameters?: unknown`

            - `strict?: boolean | null`

              Whether to enforce strict parameter validation. If omitted, Responses attempts to use strict validation when the schema is compatible, and falls back to non-strict validation otherwise.

          - `BetaCustomTool`

            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: "namespace"`

          The type of the tool. Always `namespace`.

          - `"namespace"`

      - `BetaToolSearchTool`

        Hosted or BYOT tool search configuration for deferred tools.

        - `type: "tool_search"`

          The type of the tool. Always `tool_search`.

          - `"tool_search"`

        - `description?: string | null`

          Description shown to the model for a client-executed tool search tool.

        - `execution?: "server" | "client"`

          Whether tool search is executed by the server or by the client.

          - `"server"`

          - `"client"`

        - `parameters?: unknown`

          Parameter schema for a client-executed tool search tool.

      - `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"`

          The type of the web search tool. One of `web_search_preview` or `web_search_preview_2025_03_11`.

          - `"web_search_preview"`

          - `"web_search_preview_2025_03_11"`

        - `search_content_types?: Array<"text" | "image">`

          - `"text"`

          - `"image"`

        - `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.

          - `"low"`

          - `"medium"`

          - `"high"`

        - `user_location?: UserLocation | null`

          The user's location.

          - `type: "approximate"`

            The type of location approximation. Always `approximate`.

            - `"approximate"`

          - `city?: string | null`

            Free text input for the city of the user, e.g. `San Francisco`.

          - `country?: string | null`

            The two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of the user, e.g. `US`.

          - `region?: string | null`

            Free text input for the region of the user, e.g. `California`.

          - `timezone?: string | null`

            The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of the user, e.g. `America/Los_Angeles`.

      - `BetaApplyPatchTool`

        Allows the assistant to create, delete, or update files using unified diffs.

        - `type: "apply_patch"`

          The type of the tool. Always `apply_patch`.

          - `"apply_patch"`

        - `allowed_callers?: Array<"direct" | "programmatic"> | null`

          The tool invocation context(s).

          - `"direct"`

          - `"programmatic"`

    - `type: "tool_search_output"`

      The type of the item. Always `tool_search_output`.

      - `"tool_search_output"`

    - `agent?: Agent`

      The agent that produced this item.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

    - `created_by?: string`

      The identifier of the actor that created the item.

  - `AdditionalTools`

    - `id: string`

      The unique ID of the additional tools item.

    - `role: "unknown" | "user" | "assistant" | 5 more`

      The role that provided the additional tools.

      - `"unknown"`

      - `"user"`

      - `"assistant"`

      - `"system"`

      - `"critic"`

      - `"discriminator"`

      - `"developer"`

      - `"tool"`

    - `tools: Array<BetaTool>`

      The additional tool definitions made available at this item.

      - `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).

      - `Mcp`

        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).

      - `CodeInterpreter`

        A tool that runs Python code to help generate a response to a prompt.

      - `ProgrammaticToolCalling`

      - `ImageGeneration`

        A tool that generates images using the GPT image models.

      - `LocalShell`

        A tool that allows the model to execute shell commands in a local environment.

      - `BetaFunctionShellTool`

        A tool that allows the model to execute shell commands.

      - `BetaCustomTool`

        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)

      - `BetaNamespaceTool`

        Groups function/custom tools under a shared namespace.

      - `BetaToolSearchTool`

        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).

      - `BetaApplyPatchTool`

        Allows the assistant to create, delete, or update files using unified diffs.

    - `type: "additional_tools"`

      The type of the item. Always `additional_tools`.

      - `"additional_tools"`

    - `agent?: Agent`

      The agent that produced this item.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

  - `BetaResponseCompactionItem`

    A compaction item generated by the [`v1/responses/compact` API](https://platform.openai.com/docs/api-reference/responses/compact).

    - `id: string`

      The unique ID of the compaction item.

    - `encrypted_content: string`

      The encrypted content that was produced by compaction.

    - `type: "compaction"`

      The type of the item. Always `compaction`.

      - `"compaction"`

    - `agent?: Agent`

      The agent that produced this item.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

    - `created_by?: string`

      The identifier of the actor that created the item.

  - `ImageGenerationCall`

    An image generation request made by the model.

    - `id: string`

      The unique ID of the image generation call.

    - `result: string | null`

      The generated image encoded in base64.

    - `status: "in_progress" | "completed" | "generating" | "failed"`

      The status of the image generation call.

      - `"in_progress"`

      - `"completed"`

      - `"generating"`

      - `"failed"`

    - `type: "image_generation_call"`

      The type of the image generation call. Always `image_generation_call`.

      - `"image_generation_call"`

    - `agent?: Agent | null`

      The agent that produced this item.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

  - `BetaResponseCodeInterpreterToolCall`

    A tool call to run code.

    - `id: string`

      The unique ID of the code interpreter tool call.

    - `code: string | null`

      The code to run, or null if not available.

    - `container_id: string`

      The ID of the container used to run the code.

    - `outputs: Array<Logs | Image> | null`

      The outputs generated by the code interpreter, such as logs or images.
      Can be null if no outputs are available.

      - `Logs`

        The logs output from the code interpreter.

        - `logs: string`

          The logs output from the code interpreter.

        - `type: "logs"`

          The type of the output. Always `logs`.

          - `"logs"`

      - `Image`

        The image output from the code interpreter.

        - `type: "image"`

          The type of the output. Always `image`.

          - `"image"`

        - `url: string`

          The URL of the image output from the code interpreter.

    - `status: "in_progress" | "completed" | "incomplete" | 2 more`

      The status of the code interpreter tool call. Valid values are `in_progress`, `completed`, `incomplete`, `interpreting`, and `failed`.

      - `"in_progress"`

      - `"completed"`

      - `"incomplete"`

      - `"interpreting"`

      - `"failed"`

    - `type: "code_interpreter_call"`

      The type of the code interpreter tool call. Always `code_interpreter_call`.

      - `"code_interpreter_call"`

    - `agent?: Agent | null`

      The agent that produced this item.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

  - `LocalShellCall`

    A tool call to run a command on the local shell.

    - `id: string`

      The unique ID of the local shell call.

    - `action: Action`

      Execute a shell command on the server.

      - `command: Array<string>`

        The command to run.

      - `env: Record<string, string>`

        Environment variables to set for the command.

      - `type: "exec"`

        The type of the local shell action. Always `exec`.

        - `"exec"`

      - `timeout_ms?: number | null`

        Optional timeout in milliseconds for the command.

      - `user?: string | null`

        Optional user to run the command as.

      - `working_directory?: string | null`

        Optional working directory to run the command in.

    - `call_id: string`

      The unique ID of the local shell tool call generated by the model.

    - `status: "in_progress" | "completed" | "incomplete"`

      The status of the local shell call.

      - `"in_progress"`

      - `"completed"`

      - `"incomplete"`

    - `type: "local_shell_call"`

      The type of the local shell call. Always `local_shell_call`.

      - `"local_shell_call"`

    - `agent?: Agent | null`

      The agent that produced this item.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

  - `LocalShellCallOutput`

    The output of a local shell tool call.

    - `id: string`

      The unique ID of the local shell tool call generated by the model.

    - `output: string`

      A JSON string of the output of the local shell tool call.

    - `type: "local_shell_call_output"`

      The type of the local shell tool call output. Always `local_shell_call_output`.

      - `"local_shell_call_output"`

    - `agent?: Agent | null`

      The agent that produced this item.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

    - `status?: "in_progress" | "completed" | "incomplete" | null`

      The status of the item. One of `in_progress`, `completed`, or `incomplete`.

      - `"in_progress"`

      - `"completed"`

      - `"incomplete"`

  - `BetaResponseFunctionShellToolCall`

    A tool call that executes one or more shell commands in a managed environment.

    - `id: string`

      The unique ID of the shell tool call. Populated when this item is returned via API.

    - `action: Action`

      The shell commands and limits that describe how to run the tool call.

      - `commands: Array<string>`

      - `max_output_length: number | null`

        Optional maximum number of characters to return from each command.

      - `timeout_ms: number | null`

        Optional timeout in milliseconds for the commands.

    - `call_id: string`

      The unique ID of the shell tool call generated by the model.

    - `environment: BetaResponseLocalEnvironment | BetaResponseContainerReference | null`

      Represents the use of a local environment to perform shell actions.

      - `BetaResponseLocalEnvironment`

        Represents the use of a local environment to perform shell actions.

        - `type: "local"`

          The environment type. Always `local`.

          - `"local"`

      - `BetaResponseContainerReference`

        Represents a container created with /v1/containers.

        - `container_id: string`

        - `type: "container_reference"`

          The environment type. Always `container_reference`.

          - `"container_reference"`

    - `status: "in_progress" | "completed" | "incomplete"`

      The status of the shell call. One of `in_progress`, `completed`, or `incomplete`.

      - `"in_progress"`

      - `"completed"`

      - `"incomplete"`

    - `type: "shell_call"`

      The type of the item. Always `shell_call`.

      - `"shell_call"`

    - `agent?: Agent`

      The agent that produced this item.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

    - `caller?: Direct | Program | null`

      The execution context that produced this tool call.

      - `Direct`

        - `type: "direct"`

          - `"direct"`

      - `Program`

        - `caller_id: string`

          The call ID of the program item that produced this tool call.

        - `type: "program"`

          - `"program"`

    - `created_by?: string`

      The ID of the entity that created this tool call.

  - `BetaResponseFunctionShellToolCallOutput`

    The output of a shell tool call that was emitted.

    - `id: string`

      The unique ID of the shell call output. Populated when this item is returned via API.

    - `call_id: string`

      The unique ID of the shell tool call generated by the model.

    - `max_output_length: number | null`

      The maximum length of the shell command output. This is generated by the model and should be passed back with the raw output.

    - `output: Array<Output>`

      An array of shell call output contents

      - `outcome: Timeout | Exit`

        Represents either an exit outcome (with an exit code) or a timeout outcome for a shell call output chunk.

        - `Timeout`

          Indicates that the shell call exceeded its configured time limit.

          - `type: "timeout"`

            The outcome type. Always `timeout`.

            - `"timeout"`

        - `Exit`

          Indicates that the shell commands finished and returned an exit code.

          - `exit_code: number`

            Exit code from the shell process.

          - `type: "exit"`

            The outcome type. Always `exit`.

            - `"exit"`

      - `stderr: string`

        The standard error output that was captured.

      - `stdout: string`

        The standard output that was captured.

      - `created_by?: string`

        The identifier of the actor that created the item.

    - `status: "in_progress" | "completed" | "incomplete"`

      The status of the shell call output. One of `in_progress`, `completed`, or `incomplete`.

      - `"in_progress"`

      - `"completed"`

      - `"incomplete"`

    - `type: "shell_call_output"`

      The type of the shell call output. Always `shell_call_output`.

      - `"shell_call_output"`

    - `agent?: Agent`

      The agent that produced this item.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

    - `caller?: Direct | Program | null`

      The execution context that produced this tool call.

      - `Direct`

        - `type: "direct"`

          - `"direct"`

      - `Program`

        - `caller_id: string`

          The call ID of the program item that produced this tool call.

        - `type: "program"`

          - `"program"`

    - `created_by?: string`

      The identifier of the actor that created the item.

  - `BetaResponseApplyPatchToolCall`

    A tool call that applies file diffs by creating, deleting, or updating files.

    - `id: string`

      The unique ID of the apply patch tool call. Populated when this item is returned via API.

    - `call_id: string`

      The unique ID of the apply patch tool call generated by the model.

    - `operation: CreateFile | DeleteFile | UpdateFile`

      One of the create_file, delete_file, or update_file operations applied via apply_patch.

      - `CreateFile`

        Instruction describing how to create a file via the apply_patch tool.

        - `diff: string`

          Diff to apply.

        - `path: string`

          Path of the file to create.

        - `type: "create_file"`

          Create a new file with the provided diff.

          - `"create_file"`

      - `DeleteFile`

        Instruction describing how to delete a file via the apply_patch tool.

        - `path: string`

          Path of the file to delete.

        - `type: "delete_file"`

          Delete the specified file.

          - `"delete_file"`

      - `UpdateFile`

        Instruction describing how to update a file via the apply_patch tool.

        - `diff: string`

          Diff to apply.

        - `path: string`

          Path of the file to update.

        - `type: "update_file"`

          Update an existing file with the provided diff.

          - `"update_file"`

    - `status: "in_progress" | "completed"`

      The status of the apply patch tool call. One of `in_progress` or `completed`.

      - `"in_progress"`

      - `"completed"`

    - `type: "apply_patch_call"`

      The type of the item. Always `apply_patch_call`.

      - `"apply_patch_call"`

    - `agent?: Agent`

      The agent that produced this item.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

    - `caller?: Direct | Program | null`

      The execution context that produced this tool call.

      - `Direct`

        - `type: "direct"`

          - `"direct"`

      - `Program`

        - `caller_id: string`

          The call ID of the program item that produced this tool call.

        - `type: "program"`

          - `"program"`

    - `created_by?: string`

      The ID of the entity that created this tool call.

  - `BetaResponseApplyPatchToolCallOutput`

    The output emitted by an apply patch tool call.

    - `id: string`

      The unique ID of the apply patch tool call output. Populated when this item is returned via API.

    - `call_id: string`

      The unique ID of the apply patch tool call generated by the model.

    - `status: "completed" | "failed"`

      The status of the apply patch tool call output. One of `completed` or `failed`.

      - `"completed"`

      - `"failed"`

    - `type: "apply_patch_call_output"`

      The type of the item. Always `apply_patch_call_output`.

      - `"apply_patch_call_output"`

    - `agent?: Agent`

      The agent that produced this item.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

    - `caller?: Direct | Program | null`

      The execution context that produced this tool call.

      - `Direct`

        - `type: "direct"`

          - `"direct"`

      - `Program`

        - `caller_id: string`

          The call ID of the program item that produced this tool call.

        - `type: "program"`

          - `"program"`

    - `created_by?: string`

      The ID of the entity that created this tool call output.

    - `output?: string | null`

      Optional textual output returned by the apply patch tool.

  - `McpCall`

    An invocation of a tool on an MCP server.

    - `id: string`

      The unique ID of the tool call.

    - `arguments: string`

      A JSON string of the arguments passed to the tool.

    - `name: string`

      The name of the tool that was run.

    - `server_label: string`

      The label of the MCP server running the tool.

    - `type: "mcp_call"`

      The type of the item. Always `mcp_call`.

      - `"mcp_call"`

    - `agent?: Agent | null`

      The agent that produced this item.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

    - `approval_request_id?: string | null`

      Unique identifier for the MCP tool call approval request.
      Include this value in a subsequent `mcp_approval_response` input to approve or reject the corresponding tool call.

    - `error?: BetaMcpToolCallError | null`

      The error from the tool call, if any.

      - `McpProtocolError`

        - `code: number`

        - `message: string`

        - `type: "mcp_protocol_error"`

          - `"mcp_protocol_error"`

      - `McpToolExecutionError`

        - `content: unknown`

        - `type: "mcp_tool_execution_error"`

          - `"mcp_tool_execution_error"`

      - `HTTPError`

        - `code: number`

        - `message: string`

        - `type: "http_error"`

          - `"http_error"`

    - `output?: string | null`

      The output from the tool call.

    - `status?: "in_progress" | "completed" | "incomplete" | 2 more`

      The status of the tool call. One of `in_progress`, `completed`, `incomplete`, `calling`, or `failed`.

      - `"in_progress"`

      - `"completed"`

      - `"incomplete"`

      - `"calling"`

      - `"failed"`

  - `McpListTools`

    A list of tools available on an MCP server.

    - `id: string`

      The unique ID of the list.

    - `server_label: string`

      The label of the MCP server.

    - `tools: Array<Tool>`

      The tools available on the server.

      - `input_schema: unknown`

        The JSON schema describing the tool's input.

      - `name: string`

        The name of the tool.

      - `annotations?: unknown`

        Additional annotations about the tool.

      - `description?: string | null`

        The description of the tool.

    - `type: "mcp_list_tools"`

      The type of the item. Always `mcp_list_tools`.

      - `"mcp_list_tools"`

    - `agent?: Agent | null`

      The agent that produced this item.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

    - `error?: string | null`

      Error message if the server could not list tools.

  - `McpApprovalRequest`

    A request for human approval of a tool invocation.

    - `id: string`

      The unique ID of the approval request.

    - `arguments: string`

      A JSON string of arguments for the tool.

    - `name: string`

      The name of the tool to run.

    - `server_label: string`

      The label of the MCP server making the request.

    - `type: "mcp_approval_request"`

      The type of the item. Always `mcp_approval_request`.

      - `"mcp_approval_request"`

    - `agent?: Agent | null`

      The agent that produced this item.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

  - `McpApprovalResponse`

    A response to an MCP approval request.

    - `id: string`

      The unique ID of the approval response

    - `approval_request_id: string`

      The ID of the approval request being answered.

    - `approve: boolean`

      Whether the request was approved.

    - `type: "mcp_approval_response"`

      The type of the item. Always `mcp_approval_response`.

      - `"mcp_approval_response"`

    - `agent?: Agent | null`

      The agent that produced this item.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

    - `reason?: string | null`

      Optional reason for the decision.

  - `BetaResponseCustomToolCall`

    A call to a custom tool created by the model.

    - `call_id: string`

      An identifier used to map this custom tool call to a tool call output.

    - `input: string`

      The input for the custom tool call generated by the model.

    - `name: string`

      The name of the custom tool being called.

    - `type: "custom_tool_call"`

      The type of the custom tool call. Always `custom_tool_call`.

      - `"custom_tool_call"`

    - `id?: string`

      The unique ID of the custom tool call in the OpenAI platform.

    - `agent?: Agent | null`

      The agent that produced this item.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

    - `caller?: Direct | Program | null`

      The execution context that produced this tool call.

      - `Direct`

        - `type: "direct"`

          - `"direct"`

      - `Program`

        - `caller_id: string`

          The call ID of the program item that produced this tool call.

        - `type: "program"`

          - `"program"`

    - `namespace?: string`

      The namespace of the custom tool being called.

  - `BetaResponseCustomToolCallOutputItem extends BetaResponseCustomToolCallOutput`

    The output of a custom tool call from your code, being sent back to the model.

    - `id: string`

      The unique ID of the custom tool call output item.

    - `status: "in_progress" | "completed" | "incomplete"`

      The status of the item. One of `in_progress`, `completed`, or
      `incomplete`. Populated when items are returned via API.

      - `"in_progress"`

      - `"completed"`

      - `"incomplete"`

    - `created_by?: string`

      The identifier of the actor that created the item.

### Beta Response Output Item Added Event

- `BetaResponseOutputItemAddedEvent`

  Emitted when a new output item is added.

  - `item: BetaResponseOutputItem`

    The output item that was added. For reasoning items, `encrypted_content`
    may be incomplete while the item is in progress. Use the reasoning item
    from the corresponding `response.output_item.done` event when passing it
    as input to a subsequent request.

    - `BetaResponseOutputMessage`

      An output message from the model.

      - `id: string`

        The unique ID of the output message.

      - `content: Array<BetaResponseOutputText | BetaResponseOutputRefusal>`

        The content of the output message.

        - `BetaResponseOutputText`

          A text output from the model.

          - `annotations: Array<FileCitation | URLCitation | ContainerFileCitation | FilePath>`

            The annotations of the text output.

            - `FileCitation`

              A citation to a file.

              - `file_id: string`

                The ID of the file.

              - `filename: string`

                The filename of the file cited.

              - `index: number`

                The index of the file in the list of files.

              - `type: "file_citation"`

                The type of the file citation. Always `file_citation`.

                - `"file_citation"`

            - `URLCitation`

              A citation for a web resource used to generate a model response.

              - `end_index: number`

                The index of the last character of the URL citation in the message.

              - `start_index: number`

                The index of the first character of the URL citation in the message.

              - `title: string`

                The title of the web resource.

              - `type: "url_citation"`

                The type of the URL citation. Always `url_citation`.

                - `"url_citation"`

              - `url: string`

                The URL of the web resource.

            - `ContainerFileCitation`

              A citation for a container file used to generate a model response.

              - `container_id: string`

                The ID of the container file.

              - `end_index: number`

                The index of the last character of the container file citation in the message.

              - `file_id: string`

                The ID of the file.

              - `filename: string`

                The filename of the container file cited.

              - `start_index: number`

                The index of the first character of the container file citation in the message.

              - `type: "container_file_citation"`

                The type of the container file citation. Always `container_file_citation`.

                - `"container_file_citation"`

            - `FilePath`

              A path to a file.

              - `file_id: string`

                The ID of the file.

              - `index: number`

                The index of the file in the list of files.

              - `type: "file_path"`

                The type of the file path. Always `file_path`.

                - `"file_path"`

          - `text: string`

            The text output from the model.

          - `type: "output_text"`

            The type of the output text. Always `output_text`.

            - `"output_text"`

          - `logprobs?: Array<Logprob>`

            - `token: string`

            - `bytes: Array<number>`

            - `logprob: number`

            - `top_logprobs: Array<TopLogprob>`

              - `token: string`

              - `bytes: Array<number>`

              - `logprob: number`

        - `BetaResponseOutputRefusal`

          A refusal from the model.

          - `refusal: string`

            The refusal explanation from the model.

          - `type: "refusal"`

            The type of the refusal. Always `refusal`.

            - `"refusal"`

      - `role: "assistant"`

        The role of the output message. Always `assistant`.

        - `"assistant"`

      - `status: "in_progress" | "completed" | "incomplete"`

        The status of the message input. One of `in_progress`, `completed`, or
        `incomplete`. Populated when input items are returned via API.

        - `"in_progress"`

        - `"completed"`

        - `"incomplete"`

      - `type: "message"`

        The type of the output message. Always `message`.

        - `"message"`

      - `agent?: Agent | null`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

      - `phase?: "commentary" | "final_answer" | null`

        Labels an `assistant` message as intermediate commentary (`commentary`) or the final answer (`final_answer`).
        For models like `gpt-5.3-codex` and beyond, when sending follow-up requests, preserve and resend
        phase on all assistant messages — dropping it can degrade performance. Not used for user messages.

        - `"commentary"`

        - `"final_answer"`

    - `BetaResponseFileSearchToolCall`

      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.

      - `id: string`

        The unique ID of the file search tool call.

      - `queries: Array<string>`

        The queries used to search for files.

      - `status: "in_progress" | "searching" | "completed" | 2 more`

        The status of the file search tool call. One of `in_progress`,
        `searching`, `incomplete` or `failed`,

        - `"in_progress"`

        - `"searching"`

        - `"completed"`

        - `"incomplete"`

        - `"failed"`

      - `type: "file_search_call"`

        The type of the file search tool call. Always `file_search_call`.

        - `"file_search_call"`

      - `agent?: Agent | null`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

      - `results?: Array<Result> | null`

        The results of the file search tool call.

        - `attributes?: Record<string, string | number | boolean> | null`

          Set of 16 key-value pairs that can be attached to an object. This can be
          useful for storing additional information about the object in a structured
          format, and querying for objects via API or the dashboard. Keys are strings
          with a maximum length of 64 characters. Values are strings with a maximum
          length of 512 characters, booleans, or numbers.

          - `string`

          - `number`

          - `boolean`

        - `file_id?: string`

          The unique ID of the file.

        - `filename?: string`

          The name of the file.

        - `score?: number`

          The relevance score of the file - a value between 0 and 1.

        - `text?: string`

          The text that was retrieved from the file.

    - `BetaResponseFunctionToolCall`

      A tool call to run a function. See the
      [function calling guide](https://platform.openai.com/docs/guides/function-calling) for more information.

      - `arguments: string`

        A JSON string of the arguments to pass to the function.

      - `call_id: string`

        The unique ID of the function tool call generated by the model.

      - `name: string`

        The name of the function to run.

      - `type: "function_call"`

        The type of the function tool call. Always `function_call`.

        - `"function_call"`

      - `id?: string`

        The unique ID of the function tool call.

      - `agent?: Agent | null`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

      - `caller?: Direct | Program | null`

        The execution context that produced this tool call.

        - `Direct`

          - `type: "direct"`

            - `"direct"`

        - `Program`

          - `caller_id: string`

            The call ID of the program item that produced this tool call.

          - `type: "program"`

            - `"program"`

      - `namespace?: string`

        The namespace of the function to run.

      - `status?: "in_progress" | "completed" | "incomplete"`

        The status of the item. One of `in_progress`, `completed`, or
        `incomplete`. Populated when items are returned via API.

        - `"in_progress"`

        - `"completed"`

        - `"incomplete"`

    - `BetaResponseFunctionToolCallOutputItem`

      - `id: string`

        The unique ID of the function call tool output.

      - `call_id: string`

        The unique ID of the function tool call generated by the model.

      - `output: string | Array<BetaResponseInputText | BetaResponseInputImage | BetaResponseInputFile>`

        The output from the function call generated by your code.
        Can be a string or an list of output content.

        - `string`

        - `Array<BetaResponseInputText | BetaResponseInputImage | BetaResponseInputFile>`

          - `BetaResponseInputText`

            A text input to the model.

            - `text: string`

              The text input to the model.

            - `type: "input_text"`

              The type of the input item. Always `input_text`.

              - `"input_text"`

            - `prompt_cache_breakpoint?: PromptCacheBreakpoint`

              Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.

              - `mode: "explicit"`

                The breakpoint mode. Always `explicit`.

                - `"explicit"`

          - `BetaResponseInputImage`

            An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision).

            - `detail: BetaImageDetail`

              The detail level of the image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`.

              - `"low"`

              - `"high"`

              - `"auto"`

              - `"original"`

            - `type: "input_image"`

              The type of the input item. Always `input_image`.

              - `"input_image"`

            - `file_id?: string | null`

              The ID of the file to be sent to the model.

            - `image_url?: string | null`

              The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.

            - `prompt_cache_breakpoint?: PromptCacheBreakpoint`

              Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.

              - `mode: "explicit"`

                The breakpoint mode. Always `explicit`.

                - `"explicit"`

          - `BetaResponseInputFile`

            A file input to the model.

            - `type: "input_file"`

              The type of the input item. Always `input_file`.

              - `"input_file"`

            - `detail?: "auto" | "low" | "high"`

              The detail level of the file to be sent to the model. Use `auto` to let the system select the detail level; for GPT-5.6 and later models, `auto` uses high-quality rendering, which may increase input token usage. Use `low` for lower-cost rendering, or `high` to render the file at higher quality. Defaults to `auto`.

              - `"auto"`

              - `"low"`

              - `"high"`

            - `file_data?: string`

              The content of the file to be sent to the model.

            - `file_id?: string | null`

              The ID of the file to be sent to the model.

            - `file_url?: string`

              The URL of the file to be sent to the model.

            - `filename?: string`

              The name of the file to be sent to the model.

            - `prompt_cache_breakpoint?: PromptCacheBreakpoint`

              Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.

              - `mode: "explicit"`

                The breakpoint mode. Always `explicit`.

                - `"explicit"`

      - `status: "in_progress" | "completed" | "incomplete"`

        The status of the item. One of `in_progress`, `completed`, or
        `incomplete`. Populated when items are returned via API.

        - `"in_progress"`

        - `"completed"`

        - `"incomplete"`

      - `type: "function_call_output"`

        The type of the function tool call output. Always `function_call_output`.

        - `"function_call_output"`

      - `agent?: Agent | null`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

      - `caller?: Direct | Program | null`

        The execution context that produced this tool call.

        - `Direct`

          - `type: "direct"`

            The caller type. Always `direct`.

            - `"direct"`

        - `Program`

          - `caller_id: string`

            The call ID of the program item that produced this tool call.

          - `type: "program"`

            The caller type. Always `program`.

            - `"program"`

      - `created_by?: string`

        The identifier of the actor that created the item.

      - `name?: string`

        The name of the tool that produced the output.

      - `namespace?: string`

        The namespace of the tool that produced the output.

    - `AgentMessage`

      - `id: string`

        The unique ID of the agent message.

      - `author: string`

        The sending agent identity.

      - `content: Array<BetaResponseInputText | BetaResponseOutputText | Text | 7 more>`

        Encrypted content sent between agents.

        - `BetaResponseInputText`

          A text input to the model.

        - `BetaResponseOutputText`

          A text output from the model.

        - `Text`

          A text content.

          - `text: string`

          - `type: "text"`

            - `"text"`

        - `SummaryText`

          A summary text from the model.

          - `text: string`

            A summary of the reasoning output from the model so far.

          - `type: "summary_text"`

            The type of the object. Always `summary_text`.

            - `"summary_text"`

        - `ReasoningText`

          Reasoning text from the model.

          - `text: string`

            The reasoning text from the model.

          - `type: "reasoning_text"`

            The type of the reasoning text. Always `reasoning_text`.

            - `"reasoning_text"`

        - `BetaResponseOutputRefusal`

          A refusal from the model.

        - `BetaResponseInputImage`

          An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision).

        - `ComputerScreenshot`

          A screenshot of a computer.

          - `detail: BetaImageDetail`

            The detail level of the screenshot image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`.

          - `file_id: string | null`

            The identifier of an uploaded file that contains the screenshot.

          - `image_url: string | null`

            The URL of the screenshot image.

          - `type: "computer_screenshot"`

            Specifies the event type. For a computer screenshot, this property is always set to `computer_screenshot`.

            - `"computer_screenshot"`

          - `prompt_cache_breakpoint?: PromptCacheBreakpoint`

            Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.

            - `mode: "explicit"`

              The breakpoint mode. Always `explicit`.

              - `"explicit"`

        - `BetaResponseInputFile`

          A file input to the model.

        - `EncryptedContent`

          Opaque encrypted content that Responses API decrypts inside trusted model execution.

          - `encrypted_content: string`

            Opaque encrypted content.

          - `type: "encrypted_content"`

            The type of the input item. Always `encrypted_content`.

            - `"encrypted_content"`

      - `recipient: string`

        The destination agent identity.

      - `type: "agent_message"`

        The type of the item. Always `agent_message`.

        - `"agent_message"`

      - `agent?: Agent`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

    - `MultiAgentCall`

      - `id: string`

        The unique ID of the multi-agent call item.

      - `action: "spawn_agent" | "interrupt_agent" | "list_agents" | 3 more`

        The multi-agent action to execute.

        - `"spawn_agent"`

        - `"interrupt_agent"`

        - `"list_agents"`

        - `"send_message"`

        - `"followup_task"`

        - `"wait_agent"`

      - `arguments: string`

        The JSON string of arguments generated for the action.

      - `call_id: string`

        The unique ID linking this call to its output.

      - `type: "multi_agent_call"`

        The type of the multi-agent call. Always `multi_agent_call`.

        - `"multi_agent_call"`

      - `agent?: Agent`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

    - `MultiAgentCallOutput`

      - `id: string`

        The unique ID of the multi-agent call output item.

      - `action: "spawn_agent" | "interrupt_agent" | "list_agents" | 3 more`

        The multi-agent action that produced this result.

        - `"spawn_agent"`

        - `"interrupt_agent"`

        - `"list_agents"`

        - `"send_message"`

        - `"followup_task"`

        - `"wait_agent"`

      - `call_id: string`

        The unique ID of the multi-agent call.

      - `output: Array<BetaResponseOutputText>`

        Text output returned by the multi-agent action.

        - `annotations: Array<FileCitation | URLCitation | ContainerFileCitation | FilePath>`

          The annotations of the text output.

        - `text: string`

          The text output from the model.

        - `type: "output_text"`

          The type of the output text. Always `output_text`.

        - `logprobs?: Array<Logprob>`

      - `type: "multi_agent_call_output"`

        The type of the multi-agent result. Always `multi_agent_call_output`.

        - `"multi_agent_call_output"`

      - `agent?: Agent`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

    - `BetaResponseFunctionWebSearch`

      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.

      - `id: string`

        The unique ID of the web search tool call.

      - `action: Search | OpenPage | FindInPage`

        An object describing the specific action taken in this web search call.
        Includes details on how the model used the web (search, open_page, find_in_page).

        - `Search`

          Action type "search" - Performs a web search query.

          - `type: "search"`

            The action type.

            - `"search"`

          - `queries?: Array<string>`

            The search queries.

          - `query?: string`

            The search query.

          - `sources?: Array<Source>`

            The sources used in the search.

            - `type: "url"`

              The type of source. Always `url`.

              - `"url"`

            - `url: string`

              The URL of the source.

        - `OpenPage`

          Action type "open_page" - Opens a specific URL from search results.

          - `type: "open_page"`

            The action type.

            - `"open_page"`

          - `url?: string | null`

            The URL opened by the model.

        - `FindInPage`

          Action type "find_in_page": Searches for a pattern within a loaded page.

          - `pattern: string`

            The pattern or text to search for within the page.

          - `type: "find_in_page"`

            The action type.

            - `"find_in_page"`

          - `url: string`

            The URL of the page searched for the pattern.

      - `status: "in_progress" | "searching" | "completed" | "failed"`

        The status of the web search tool call.

        - `"in_progress"`

        - `"searching"`

        - `"completed"`

        - `"failed"`

      - `type: "web_search_call"`

        The type of the web search tool call. Always `web_search_call`.

        - `"web_search_call"`

      - `agent?: Agent | null`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

    - `BetaResponseComputerToolCall`

      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.

      - `id: string`

        The unique ID of the computer call.

      - `call_id: string`

        An identifier used when responding to the tool call with output.

      - `pending_safety_checks: Array<PendingSafetyCheck>`

        The pending safety checks for the computer call.

        - `id: string`

          The ID of the pending safety check.

        - `code?: string | null`

          The type of the pending safety check.

        - `message?: string | null`

          Details about the pending safety check.

      - `status: "in_progress" | "completed" | "incomplete"`

        The status of the item. One of `in_progress`, `completed`, or
        `incomplete`. Populated when items are returned via API.

        - `"in_progress"`

        - `"completed"`

        - `"incomplete"`

      - `type: "computer_call"`

        The type of the computer call. Always `computer_call`.

        - `"computer_call"`

      - `action?: BetaComputerAction`

        A click action.

        - `Click`

          A click action.

          - `button: "left" | "right" | "wheel" | 2 more`

            Indicates which mouse button was pressed during the click. One of `left`, `right`, `wheel`, `back`, or `forward`.

            - `"left"`

            - `"right"`

            - `"wheel"`

            - `"back"`

            - `"forward"`

          - `type: "click"`

            Specifies the event type. For a click action, this property is always `click`.

            - `"click"`

          - `x: number`

            The x-coordinate where the click occurred.

          - `y: number`

            The y-coordinate where the click occurred.

          - `keys?: Array<string> | null`

            The keys being held while clicking.

        - `DoubleClick`

          A double click action.

          - `keys: Array<string> | null`

            The keys being held while double-clicking.

          - `type: "double_click"`

            Specifies the event type. For a double click action, this property is always set to `double_click`.

            - `"double_click"`

          - `x: number`

            The x-coordinate where the double click occurred.

          - `y: number`

            The y-coordinate where the double click occurred.

        - `Drag`

          A drag action.

          - `path: Array<Path>`

            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 }
            ]
            ```

            - `x: number`

              The x-coordinate.

            - `y: number`

              The y-coordinate.

          - `type: "drag"`

            Specifies the event type. For a drag action, this property is always set to `drag`.

            - `"drag"`

          - `keys?: Array<string> | null`

            The keys being held while dragging the mouse.

        - `Keypress`

          A collection of keypresses the model would like to perform.

          - `keys: Array<string>`

            The combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key.

          - `type: "keypress"`

            Specifies the event type. For a keypress action, this property is always set to `keypress`.

            - `"keypress"`

        - `Move`

          A mouse move action.

          - `type: "move"`

            Specifies the event type. For a move action, this property is always set to `move`.

            - `"move"`

          - `x: number`

            The x-coordinate to move to.

          - `y: number`

            The y-coordinate to move to.

          - `keys?: Array<string> | null`

            The keys being held while moving the mouse.

        - `Screenshot`

          A screenshot action.

          - `type: "screenshot"`

            Specifies the event type. For a screenshot action, this property is always set to `screenshot`.

            - `"screenshot"`

        - `Scroll`

          A scroll action.

          - `scroll_x: number`

            The horizontal scroll distance.

          - `scroll_y: number`

            The vertical scroll distance.

          - `type: "scroll"`

            Specifies the event type. For a scroll action, this property is always set to `scroll`.

            - `"scroll"`

          - `x: number`

            The x-coordinate where the scroll occurred.

          - `y: number`

            The y-coordinate where the scroll occurred.

          - `keys?: Array<string> | null`

            The keys being held while scrolling.

        - `Type`

          An action to type in text.

          - `text: string`

            The text to type.

          - `type: "type"`

            Specifies the event type. For a type action, this property is always set to `type`.

            - `"type"`

        - `Wait`

          A wait action.

          - `type: "wait"`

            Specifies the event type. For a wait action, this property is always set to `wait`.

            - `"wait"`

      - `actions?: BetaComputerActionList`

        Flattened batched actions for `computer_use`. Each action includes an
        `type` discriminator and action-specific fields.

        - `Click`

          A click action.

        - `DoubleClick`

          A double click action.

        - `Drag`

          A drag action.

        - `Keypress`

          A collection of keypresses the model would like to perform.

        - `Move`

          A mouse move action.

        - `Screenshot`

          A screenshot action.

        - `Scroll`

          A scroll action.

        - `Type`

          An action to type in text.

        - `Wait`

          A wait action.

      - `agent?: Agent | null`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

    - `BetaResponseComputerToolCallOutputItem`

      - `id: string`

        The unique ID of the computer call tool output.

      - `call_id: string`

        The ID of the computer tool call that produced the output.

      - `output: BetaResponseComputerToolCallOutputScreenshot`

        A computer screenshot image used with the computer use tool.

        - `type: "computer_screenshot"`

          Specifies the event type. For a computer screenshot, this property is
          always set to `computer_screenshot`.

          - `"computer_screenshot"`

        - `file_id?: string`

          The identifier of an uploaded file that contains the screenshot.

        - `image_url?: string`

          The URL of the screenshot image.

      - `status: "completed" | "incomplete" | "failed" | "in_progress"`

        The status of the message input. One of `in_progress`, `completed`, or
        `incomplete`. Populated when input items are returned via API.

        - `"completed"`

        - `"incomplete"`

        - `"failed"`

        - `"in_progress"`

      - `type: "computer_call_output"`

        The type of the computer tool call output. Always `computer_call_output`.

        - `"computer_call_output"`

      - `acknowledged_safety_checks?: Array<AcknowledgedSafetyCheck>`

        The safety checks reported by the API that have been acknowledged by the
        developer.

        - `id: string`

          The ID of the pending safety check.

        - `code?: string | null`

          The type of the pending safety check.

        - `message?: string | null`

          Details about the pending safety check.

      - `agent?: Agent | null`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

      - `created_by?: string`

        The identifier of the actor that created the item.

    - `BetaResponseReasoningItem`

      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).

      - `id: string`

        The unique identifier of the reasoning content.

      - `summary: Array<Summary>`

        Reasoning summary content.

        - `text: string`

          A summary of the reasoning output from the model so far.

        - `type: "summary_text"`

          The type of the object. Always `summary_text`.

          - `"summary_text"`

      - `type: "reasoning"`

        The type of the object. Always `reasoning`.

        - `"reasoning"`

      - `agent?: Agent | null`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

      - `content?: Array<Content>`

        Reasoning text content.

        - `text: string`

          The reasoning text from the model.

        - `type: "reasoning_text"`

          The type of the reasoning text. Always `reasoning_text`.

          - `"reasoning_text"`

      - `encrypted_content?: string | null`

        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.

        When streaming, use the completed reasoning item and its
        `encrypted_content` from the `response.output_item.done` event in
        subsequent requests. The `encrypted_content` in
        `response.output_item.added` may be incomplete. This is especially
        important when `store` is `false` or when using Zero Data Retention.

      - `status?: "in_progress" | "completed" | "incomplete"`

        The status of the item. One of `in_progress`, `completed`, or
        `incomplete`. Populated when items are returned via API.

        - `"in_progress"`

        - `"completed"`

        - `"incomplete"`

    - `Program`

      - `id: string`

        The unique ID of the program item.

      - `call_id: string`

        The stable call ID of the program item.

      - `code: string`

        The JavaScript source executed by programmatic tool calling.

      - `fingerprint: string`

        Opaque program replay fingerprint that must be round-tripped.

      - `type: "program"`

        The type of the item. Always `program`.

        - `"program"`

      - `agent?: Agent`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

    - `ProgramOutput`

      - `id: string`

        The unique ID of the program output item.

      - `call_id: string`

        The call ID of the program item.

      - `result: string`

        The result produced by the program item.

      - `status: "completed" | "incomplete"`

        The terminal status of the program output item.

        - `"completed"`

        - `"incomplete"`

      - `type: "program_output"`

        The type of the item. Always `program_output`.

        - `"program_output"`

      - `agent?: Agent`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

    - `BetaResponseToolSearchCall`

      - `id: string`

        The unique ID of the tool search call item.

      - `arguments: unknown`

        Arguments used for the tool search call.

      - `call_id: string | null`

        The unique ID of the tool search call generated by the model.

      - `execution: "server" | "client"`

        Whether tool search was executed by the server or by the client.

        - `"server"`

        - `"client"`

      - `status: "in_progress" | "completed" | "incomplete"`

        The status of the tool search call item that was recorded.

        - `"in_progress"`

        - `"completed"`

        - `"incomplete"`

      - `type: "tool_search_call"`

        The type of the item. Always `tool_search_call`.

        - `"tool_search_call"`

      - `agent?: Agent`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

      - `created_by?: string`

        The identifier of the actor that created the item.

    - `BetaResponseToolSearchOutputItem`

      - `id: string`

        The unique ID of the tool search output item.

      - `call_id: string | null`

        The unique ID of the tool search call generated by the model.

      - `execution: "server" | "client"`

        Whether tool search was executed by the server or by the client.

        - `"server"`

        - `"client"`

      - `status: "in_progress" | "completed" | "incomplete"`

        The status of the tool search output item that was recorded.

        - `"in_progress"`

        - `"completed"`

        - `"incomplete"`

      - `tools: Array<BetaTool>`

        The loaded tool definitions returned by tool search.

        - `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).

          - `name: string`

            The name of the function to call.

          - `parameters: Record<string, unknown> | null`

            A JSON schema object describing the parameters of the function.

          - `strict: boolean | null`

            Whether strict parameter validation is enforced for this function tool.

          - `type: "function"`

            The type of the function tool. Always `function`.

            - `"function"`

          - `allowed_callers?: Array<"direct" | "programmatic"> | null`

            The tool invocation context(s).

            - `"direct"`

            - `"programmatic"`

          - `defer_loading?: boolean`

            Whether this function is deferred and loaded via tool search.

          - `description?: string | null`

            A description of the function. Used by the model to determine whether or not to call the function.

          - `output_schema?: Record<string, unknown> | null`

            A JSON schema object describing the JSON value encoded in string outputs for this function.

        - `BetaFileSearchTool`

          A tool that searches for relevant content from uploaded files. Learn more about the [file search tool](https://platform.openai.com/docs/guides/tools-file-search).

          - `type: "file_search"`

            The type of the file search tool. Always `file_search`.

            - `"file_search"`

          - `vector_store_ids: Array<string>`

            The IDs of the vector stores to search.

          - `filters?: ComparisonFilter | CompoundFilter | null`

            A filter to apply.

            - `ComparisonFilter`

              A filter used to compare a specified attribute key to a given value using a defined comparison operation.

              - `key: string`

                The key to compare against the value.

              - `type: "eq" | "ne" | "gt" | 5 more`

                Specifies the comparison operator: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`, `in`, `nin`.

                - `eq`: equals
                - `ne`: not equal
                - `gt`: greater than
                - `gte`: greater than or equal
                - `lt`: less than
                - `lte`: less than or equal
                - `in`: in
                - `nin`: not in

                - `"eq"`

                - `"ne"`

                - `"gt"`

                - `"gte"`

                - `"lt"`

                - `"lte"`

                - `"in"`

                - `"nin"`

              - `value: string | number | boolean | Array<string | number>`

                The value to compare against the attribute key; supports string, number, or boolean types.

                - `string`

                - `number`

                - `boolean`

                - `Array<string | number>`

                  - `string`

                  - `number`

            - `CompoundFilter`

              Combine multiple filters using `and` or `or`.

              - `filters: Array<ComparisonFilter | unknown>`

                Array of filters to combine. Items can be `ComparisonFilter` or `CompoundFilter`.

                - `ComparisonFilter`

                  A filter used to compare a specified attribute key to a given value using a defined comparison operation.

                  - `key: string`

                    The key to compare against the value.

                  - `type: "eq" | "ne" | "gt" | 5 more`

                    Specifies the comparison operator: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`, `in`, `nin`.

                    - `eq`: equals
                    - `ne`: not equal
                    - `gt`: greater than
                    - `gte`: greater than or equal
                    - `lt`: less than
                    - `lte`: less than or equal
                    - `in`: in
                    - `nin`: not in

                    - `"eq"`

                    - `"ne"`

                    - `"gt"`

                    - `"gte"`

                    - `"lt"`

                    - `"lte"`

                    - `"in"`

                    - `"nin"`

                  - `value: string | number | boolean | Array<string | number>`

                    The value to compare against the attribute key; supports string, number, or boolean types.

                    - `string`

                    - `number`

                    - `boolean`

                    - `Array<string | number>`

                      - `string`

                      - `number`

                - `unknown`

              - `type: "and" | "or"`

                Type of operation: `and` or `or`.

                - `"and"`

                - `"or"`

          - `max_num_results?: number`

            The maximum number of results to return. This number should be between 1 and 50 inclusive.

          - `ranking_options?: RankingOptions`

            Ranking options for search.

            - `hybrid_search?: HybridSearch`

              Weights that control how reciprocal rank fusion balances semantic embedding matches versus sparse keyword matches when hybrid search is enabled.

              - `embedding_weight: number`

                The weight of the embedding in the reciprocal ranking fusion.

              - `text_weight: number`

                The weight of the text in the reciprocal ranking fusion.

            - `ranker?: "auto" | "default-2024-11-15"`

              The ranker to use for the file search.

              - `"auto"`

              - `"default-2024-11-15"`

            - `score_threshold?: number`

              The score threshold for the file search, a number between 0 and 1. Numbers closer to 1 will attempt to return only the most relevant results, but may return fewer results.

        - `BetaComputerTool`

          A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use).

          - `type: "computer"`

            The type of the computer tool. Always `computer`.

            - `"computer"`

        - `BetaComputerUsePreviewTool`

          A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use).

          - `display_height: number`

            The height of the computer display.

          - `display_width: number`

            The width of the computer display.

          - `environment: "windows" | "mac" | "linux" | 2 more`

            The type of computer environment to control.

            - `"windows"`

            - `"mac"`

            - `"linux"`

            - `"ubuntu"`

            - `"browser"`

          - `type: "computer_use_preview"`

            The type of the computer use tool. Always `computer_use_preview`.

            - `"computer_use_preview"`

        - `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"`

            The type of the web search tool. One of `web_search` or `web_search_2025_08_26`.

            - `"web_search"`

            - `"web_search_2025_08_26"`

          - `external_web_access?: boolean`

            Allow live internet access for web search. Defaults to true when omitted. When false, the web search tool runs in offline/cache-only mode and will not fetch new external content.

          - `filters?: Filters | null`

            Filters for the search.

            - `allowed_domains?: Array<string> | null`

              Allowed domains for the search. If not provided, all domains are allowed.
              Subdomains of the provided domains are allowed as well.

              Example: `["pubmed.ncbi.nlm.nih.gov"]`

          - `search_context_size?: "low" | "medium" | "high"`

            High level guidance for the amount of context window space to use for the search. One of `low`, `medium`, or `high`. `medium` is the default.

            - `"low"`

            - `"medium"`

            - `"high"`

          - `user_location?: UserLocation | null`

            The approximate location of the user.

            - `city?: string | null`

              Free text input for the city of the user, e.g. `San Francisco`.

            - `country?: string | null`

              The two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of the user, e.g. `US`.

            - `region?: string | null`

              Free text input for the region of the user, e.g. `California`.

            - `timezone?: string | null`

              The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of the user, e.g. `America/Los_Angeles`.

            - `type?: "approximate"`

              The type of location approximation. Always `approximate`.

              - `"approximate"`

        - `Mcp`

          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).

          - `server_label: string`

            A label for this MCP server, used to identify it in tool calls.

          - `type: "mcp"`

            The type of the MCP tool. Always `mcp`.

            - `"mcp"`

          - `allowed_callers?: Array<"direct" | "programmatic"> | null`

            The tool invocation context(s).

            - `"direct"`

            - `"programmatic"`

          - `allowed_tools?: Array<string> | McpToolFilter | null`

            List of allowed tool names or a filter object.

            - `Array<string>`

            - `McpToolFilter`

              A filter object to specify which tools are allowed.

              - `read_only?: boolean`

                Indicates whether or not a tool modifies data or is read-only. If an
                MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint),
                it will match this filter.

              - `tool_names?: Array<string>`

                List of allowed tool names.

          - `authorization?: string`

            An OAuth access token that can be used with a remote MCP server, either
            with a custom MCP server URL or a service connector. Your application
            must handle the OAuth authorization flow and provide the token here.

          - `connector_id?: "connector_dropbox" | "connector_gmail" | "connector_googlecalendar" | 5 more`

            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`

            - `"connector_dropbox"`

            - `"connector_gmail"`

            - `"connector_googlecalendar"`

            - `"connector_googledrive"`

            - `"connector_microsoftteams"`

            - `"connector_outlookcalendar"`

            - `"connector_outlookemail"`

            - `"connector_sharepoint"`

          - `defer_loading?: boolean`

            Whether this MCP tool is deferred and discovered via tool search.

          - `headers?: Record<string, string> | null`

            Optional HTTP headers to send to the MCP server. Use for authentication
            or other purposes.

          - `require_approval?: McpToolApprovalFilter | "always" | "never" | null`

            Specify which of the MCP server's tools require approval.

            - `McpToolApprovalFilter`

              Specify which of the MCP server's tools require approval. Can be
              `always`, `never`, or a filter object associated with tools
              that require approval.

              - `always?: Always`

                A filter object to specify which tools are allowed.

                - `read_only?: boolean`

                  Indicates whether or not a tool modifies data or is read-only. If an
                  MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint),
                  it will match this filter.

                - `tool_names?: Array<string>`

                  List of allowed tool names.

              - `never?: Never`

                A filter object to specify which tools are allowed.

                - `read_only?: boolean`

                  Indicates whether or not a tool modifies data or is read-only. If an
                  MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint),
                  it will match this filter.

                - `tool_names?: Array<string>`

                  List of allowed tool names.

            - `"always" | "never"`

              - `"always"`

              - `"never"`

          - `server_description?: string`

            Optional description of the MCP server, used to provide more context.

          - `server_url?: string`

            The URL for the MCP server. One of `server_url`, `connector_id`, or
            `tunnel_id` must be provided.

          - `tunnel_id?: string`

            The Secure MCP Tunnel ID to use instead of a direct server URL. One of
            `server_url`, `connector_id`, or `tunnel_id` must be provided.

        - `CodeInterpreter`

          A tool that runs Python code to help generate a response to a prompt.

          - `container: string | CodeInterpreterToolAuto`

            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`

            - `CodeInterpreterToolAuto`

              Configuration for a code interpreter container. Optionally specify the IDs of the files to run the code on.

              - `type: "auto"`

                Always `auto`.

                - `"auto"`

              - `file_ids?: Array<string>`

                An optional list of uploaded files to make available to your code.

              - `memory_limit?: "1g" | "4g" | "16g" | "64g" | null`

                The memory limit for the code interpreter container.

                - `"1g"`

                - `"4g"`

                - `"16g"`

                - `"64g"`

              - `network_policy?: BetaContainerNetworkPolicyDisabled | BetaContainerNetworkPolicyAllowlist`

                Network access policy for the container.

                - `BetaContainerNetworkPolicyDisabled`

                  - `type: "disabled"`

                    Disable outbound network access. Always `disabled`.

                    - `"disabled"`

                - `BetaContainerNetworkPolicyAllowlist`

                  - `allowed_domains: Array<string>`

                    A list of allowed domains when type is `allowlist`.

                  - `type: "allowlist"`

                    Allow outbound network access only to specified domains. Always `allowlist`.

                    - `"allowlist"`

                  - `domain_secrets?: Array<BetaContainerNetworkPolicyDomainSecret>`

                    Optional domain-scoped secrets for allowlisted domains.

                    - `domain: string`

                      The domain associated with the secret.

                    - `name: string`

                      The name of the secret to inject for the domain.

                    - `value: string`

                      The secret value to inject for the domain.

          - `type: "code_interpreter"`

            The type of the code interpreter tool. Always `code_interpreter`.

            - `"code_interpreter"`

          - `allowed_callers?: Array<"direct" | "programmatic"> | null`

            The tool invocation context(s).

            - `"direct"`

            - `"programmatic"`

        - `ProgrammaticToolCalling`

          - `type: "programmatic_tool_calling"`

            The type of the tool. Always `programmatic_tool_calling`.

            - `"programmatic_tool_calling"`

        - `ImageGeneration`

          A tool that generates images using the GPT image models.

          - `type: "image_generation"`

            The type of the image generation tool. Always `image_generation`.

            - `"image_generation"`

          - `action?: "generate" | "edit" | "auto"`

            Whether to generate a new image or edit an existing image. Default: `auto`.

            - `"generate"`

            - `"edit"`

            - `"auto"`

          - `background?: "transparent" | "opaque" | "auto"`

            Allows to set transparency for the background of the generated image(s).
            Must be one of `transparent`, `opaque`, or `auto` (default value). When
            `auto` is used, the model will automatically determine the best
            background for the image.

            Transparent backgrounds are available for supported GPT Image models.
            For `gpt-image-2` and `gpt-image-2-2026-04-21`, this support is in
            preview. When using `transparent`, set the output format to `png` or
            `webp`.

            - `"transparent"`

            - `"opaque"`

            - `"auto"`

          - `input_fidelity?: "high" | "low" | null`

            Control how much effort the model will exert to match the style and features, especially facial features, of input images. This parameter is only supported for `gpt-image-1` and `gpt-image-1.5` and later models, unsupported for `gpt-image-1-mini`. Supports `high` and `low`. Defaults to `low`.

            - `"high"`

            - `"low"`

          - `input_image_mask?: InputImageMask`

            Optional mask for inpainting. Contains `image_url`
            (string, optional) and `file_id` (string, optional).

            - `file_id?: string`

              File ID for the mask image.

            - `image_url?: string`

              Base64-encoded mask image.

          - `model?: (string & {}) | "gpt-image-1" | "gpt-image-1-mini" | "gpt-image-2" | 3 more`

            The image generation model to use. One of `gpt-image-1`,
            `gpt-image-1-mini`, `gpt-image-1.5`, `gpt-image-2`,
            `gpt-image-2-2026-04-21`, or `chatgpt-image-latest`. Default:
            `gpt-image-1`.

            - `(string & {})`

            - `"gpt-image-1" | "gpt-image-1-mini" | "gpt-image-2" | 3 more`

              - `"gpt-image-1"`

              - `"gpt-image-1-mini"`

              - `"gpt-image-2"`

              - `"gpt-image-2-2026-04-21"`

              - `"gpt-image-1.5"`

              - `"chatgpt-image-latest"`

          - `moderation?: "auto" | "low"`

            Moderation level for the generated image. Default: `auto`.

            - `"auto"`

            - `"low"`

          - `output_compression?: number`

            Compression level for the output image. Default: 100.

          - `output_format?: "png" | "webp" | "jpeg"`

            The output format of the generated image. One of `png`, `webp`, or
            `jpeg`. Default: `png`.

            - `"png"`

            - `"webp"`

            - `"jpeg"`

          - `partial_images?: number`

            Number of partial images to generate in streaming mode, from 0 (default value) to 3.

          - `quality?: "low" | "medium" | "high" | "auto"`

            The quality of the generated image. One of `low`, `medium`, `high`,
            or `auto`. Default: `auto`.

            - `"low"`

            - `"medium"`

            - `"high"`

            - `"auto"`

          - `size?: (string & {}) | "1024x1024" | "1024x1536" | "1536x1024" | "auto"`

            The size of the generated images. For `gpt-image-2` and `gpt-image-2-2026-04-21`, arbitrary resolutions are supported as `WIDTHxHEIGHT` strings, for example `1536x864`. Width and height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above `2560x1440` are experimental, and the maximum supported resolution is `3840x2160`. The requested size must also satisfy the model's current pixel and edge limits. The standard sizes `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models; `auto` is supported for models that allow automatic sizing. For `dall-e-2`, use one of `256x256`, `512x512`, or `1024x1024`. For `dall-e-3`, use one of `1024x1024`, `1792x1024`, or `1024x1792`.

            - `(string & {})`

            - `"1024x1024" | "1024x1536" | "1536x1024" | "auto"`

              - `"1024x1024"`

              - `"1024x1536"`

              - `"1536x1024"`

              - `"auto"`

        - `LocalShell`

          A tool that allows the model to execute shell commands in a local environment.

          - `type: "local_shell"`

            The type of the local shell tool. Always `local_shell`.

            - `"local_shell"`

        - `BetaFunctionShellTool`

          A tool that allows the model to execute shell commands.

          - `type: "shell"`

            The type of the shell tool. Always `shell`.

            - `"shell"`

          - `allowed_callers?: Array<"direct" | "programmatic"> | null`

            The tool invocation context(s).

            - `"direct"`

            - `"programmatic"`

          - `environment?: BetaContainerAuto | BetaLocalEnvironment | BetaContainerReference | null`

            - `BetaContainerAuto`

              - `type: "container_auto"`

                Automatically creates a container for this request

                - `"container_auto"`

              - `file_ids?: Array<string>`

                An optional list of uploaded files to make available to your code.

              - `memory_limit?: "1g" | "4g" | "16g" | "64g" | null`

                The memory limit for the container.

                - `"1g"`

                - `"4g"`

                - `"16g"`

                - `"64g"`

              - `network_policy?: BetaContainerNetworkPolicyDisabled | BetaContainerNetworkPolicyAllowlist`

                Network access policy for the container.

                - `BetaContainerNetworkPolicyDisabled`

                - `BetaContainerNetworkPolicyAllowlist`

              - `skills?: Array<BetaSkillReference | BetaInlineSkill>`

                An optional list of skills referenced by id or inline data.

                - `BetaSkillReference`

                  - `skill_id: string`

                    The ID of the referenced skill.

                  - `type: "skill_reference"`

                    References a skill created with the /v1/skills endpoint.

                    - `"skill_reference"`

                  - `version?: string`

                    Optional skill version. Use a positive integer or 'latest'. Omit for default.

                - `BetaInlineSkill`

                  - `description: string`

                    The description of the skill.

                  - `name: string`

                    The name of the skill.

                  - `source: BetaInlineSkillSource`

                    Inline skill payload

                    - `data: string`

                      Base64-encoded skill zip bundle.

                    - `media_type: "application/zip"`

                      The media type of the inline skill payload. Must be `application/zip`.

                      - `"application/zip"`

                    - `type: "base64"`

                      The type of the inline skill source. Must be `base64`.

                      - `"base64"`

                  - `type: "inline"`

                    Defines an inline skill for this request.

                    - `"inline"`

            - `BetaLocalEnvironment`

              - `type: "local"`

                Use a local computer environment.

                - `"local"`

              - `skills?: Array<BetaLocalSkill>`

                An optional list of skills.

                - `description: string`

                  The description of the skill.

                - `name: string`

                  The name of the skill.

                - `path: string`

                  The path to the directory containing the skill.

            - `BetaContainerReference`

              - `container_id: string`

                The ID of the referenced container.

              - `type: "container_reference"`

                References a container created with the /v1/containers endpoint

                - `"container_reference"`

        - `BetaCustomTool`

          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)

          - `name: string`

            The name of the custom tool, used to identify it in tool calls.

          - `type: "custom"`

            The type of the custom tool. Always `custom`.

            - `"custom"`

          - `allowed_callers?: Array<"direct" | "programmatic"> | null`

            The tool invocation context(s).

            - `"direct"`

            - `"programmatic"`

          - `defer_loading?: boolean`

            Whether this tool should be deferred and discovered via tool search.

          - `description?: string`

            Optional description of the custom tool, used to provide more context.

          - `format?: Text | Grammar`

            The input format for the custom tool. Default is unconstrained text.

            - `Text`

              Unconstrained free-form text.

              - `type: "text"`

                Unconstrained text format. Always `text`.

                - `"text"`

            - `Grammar`

              A grammar defined by the user.

              - `definition: string`

                The grammar definition.

              - `syntax: "lark" | "regex"`

                The syntax of the grammar definition. One of `lark` or `regex`.

                - `"lark"`

                - `"regex"`

              - `type: "grammar"`

                Grammar format. Always `grammar`.

                - `"grammar"`

        - `BetaNamespaceTool`

          Groups function/custom tools under a shared namespace.

          - `description: string`

            A description of the namespace shown to the model.

          - `name: string`

            The namespace name used in tool calls (for example, `crm`).

          - `tools: Array<Function | BetaCustomTool>`

            The function/custom tools available inside this namespace.

            - `Function`

              - `name: string`

              - `type: "function"`

                - `"function"`

              - `allowed_callers?: Array<"direct" | "programmatic"> | null`

                The tool invocation context(s).

                - `"direct"`

                - `"programmatic"`

              - `defer_loading?: boolean`

                Whether this function should be deferred and discovered via tool search.

              - `description?: string | null`

              - `output_schema?: Record<string, unknown> | null`

                A JSON Schema describing the JSON value encoded in string outputs for this function tool. This does not describe content-array outputs.

              - `parameters?: unknown`

              - `strict?: boolean | null`

                Whether to enforce strict parameter validation. If omitted, Responses attempts to use strict validation when the schema is compatible, and falls back to non-strict validation otherwise.

            - `BetaCustomTool`

              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: "namespace"`

            The type of the tool. Always `namespace`.

            - `"namespace"`

        - `BetaToolSearchTool`

          Hosted or BYOT tool search configuration for deferred tools.

          - `type: "tool_search"`

            The type of the tool. Always `tool_search`.

            - `"tool_search"`

          - `description?: string | null`

            Description shown to the model for a client-executed tool search tool.

          - `execution?: "server" | "client"`

            Whether tool search is executed by the server or by the client.

            - `"server"`

            - `"client"`

          - `parameters?: unknown`

            Parameter schema for a client-executed tool search tool.

        - `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"`

            The type of the web search tool. One of `web_search_preview` or `web_search_preview_2025_03_11`.

            - `"web_search_preview"`

            - `"web_search_preview_2025_03_11"`

          - `search_content_types?: Array<"text" | "image">`

            - `"text"`

            - `"image"`

          - `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.

            - `"low"`

            - `"medium"`

            - `"high"`

          - `user_location?: UserLocation | null`

            The user's location.

            - `type: "approximate"`

              The type of location approximation. Always `approximate`.

              - `"approximate"`

            - `city?: string | null`

              Free text input for the city of the user, e.g. `San Francisco`.

            - `country?: string | null`

              The two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of the user, e.g. `US`.

            - `region?: string | null`

              Free text input for the region of the user, e.g. `California`.

            - `timezone?: string | null`

              The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of the user, e.g. `America/Los_Angeles`.

        - `BetaApplyPatchTool`

          Allows the assistant to create, delete, or update files using unified diffs.

          - `type: "apply_patch"`

            The type of the tool. Always `apply_patch`.

            - `"apply_patch"`

          - `allowed_callers?: Array<"direct" | "programmatic"> | null`

            The tool invocation context(s).

            - `"direct"`

            - `"programmatic"`

      - `type: "tool_search_output"`

        The type of the item. Always `tool_search_output`.

        - `"tool_search_output"`

      - `agent?: Agent`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

      - `created_by?: string`

        The identifier of the actor that created the item.

    - `AdditionalTools`

      - `id: string`

        The unique ID of the additional tools item.

      - `role: "unknown" | "user" | "assistant" | 5 more`

        The role that provided the additional tools.

        - `"unknown"`

        - `"user"`

        - `"assistant"`

        - `"system"`

        - `"critic"`

        - `"discriminator"`

        - `"developer"`

        - `"tool"`

      - `tools: Array<BetaTool>`

        The additional tool definitions made available at this item.

        - `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).

        - `Mcp`

          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).

        - `CodeInterpreter`

          A tool that runs Python code to help generate a response to a prompt.

        - `ProgrammaticToolCalling`

        - `ImageGeneration`

          A tool that generates images using the GPT image models.

        - `LocalShell`

          A tool that allows the model to execute shell commands in a local environment.

        - `BetaFunctionShellTool`

          A tool that allows the model to execute shell commands.

        - `BetaCustomTool`

          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)

        - `BetaNamespaceTool`

          Groups function/custom tools under a shared namespace.

        - `BetaToolSearchTool`

          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).

        - `BetaApplyPatchTool`

          Allows the assistant to create, delete, or update files using unified diffs.

      - `type: "additional_tools"`

        The type of the item. Always `additional_tools`.

        - `"additional_tools"`

      - `agent?: Agent`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

    - `BetaResponseCompactionItem`

      A compaction item generated by the [`v1/responses/compact` API](https://platform.openai.com/docs/api-reference/responses/compact).

      - `id: string`

        The unique ID of the compaction item.

      - `encrypted_content: string`

        The encrypted content that was produced by compaction.

      - `type: "compaction"`

        The type of the item. Always `compaction`.

        - `"compaction"`

      - `agent?: Agent`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

      - `created_by?: string`

        The identifier of the actor that created the item.

    - `ImageGenerationCall`

      An image generation request made by the model.

      - `id: string`

        The unique ID of the image generation call.

      - `result: string | null`

        The generated image encoded in base64.

      - `status: "in_progress" | "completed" | "generating" | "failed"`

        The status of the image generation call.

        - `"in_progress"`

        - `"completed"`

        - `"generating"`

        - `"failed"`

      - `type: "image_generation_call"`

        The type of the image generation call. Always `image_generation_call`.

        - `"image_generation_call"`

      - `agent?: Agent | null`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

    - `BetaResponseCodeInterpreterToolCall`

      A tool call to run code.

      - `id: string`

        The unique ID of the code interpreter tool call.

      - `code: string | null`

        The code to run, or null if not available.

      - `container_id: string`

        The ID of the container used to run the code.

      - `outputs: Array<Logs | Image> | null`

        The outputs generated by the code interpreter, such as logs or images.
        Can be null if no outputs are available.

        - `Logs`

          The logs output from the code interpreter.

          - `logs: string`

            The logs output from the code interpreter.

          - `type: "logs"`

            The type of the output. Always `logs`.

            - `"logs"`

        - `Image`

          The image output from the code interpreter.

          - `type: "image"`

            The type of the output. Always `image`.

            - `"image"`

          - `url: string`

            The URL of the image output from the code interpreter.

      - `status: "in_progress" | "completed" | "incomplete" | 2 more`

        The status of the code interpreter tool call. Valid values are `in_progress`, `completed`, `incomplete`, `interpreting`, and `failed`.

        - `"in_progress"`

        - `"completed"`

        - `"incomplete"`

        - `"interpreting"`

        - `"failed"`

      - `type: "code_interpreter_call"`

        The type of the code interpreter tool call. Always `code_interpreter_call`.

        - `"code_interpreter_call"`

      - `agent?: Agent | null`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

    - `LocalShellCall`

      A tool call to run a command on the local shell.

      - `id: string`

        The unique ID of the local shell call.

      - `action: Action`

        Execute a shell command on the server.

        - `command: Array<string>`

          The command to run.

        - `env: Record<string, string>`

          Environment variables to set for the command.

        - `type: "exec"`

          The type of the local shell action. Always `exec`.

          - `"exec"`

        - `timeout_ms?: number | null`

          Optional timeout in milliseconds for the command.

        - `user?: string | null`

          Optional user to run the command as.

        - `working_directory?: string | null`

          Optional working directory to run the command in.

      - `call_id: string`

        The unique ID of the local shell tool call generated by the model.

      - `status: "in_progress" | "completed" | "incomplete"`

        The status of the local shell call.

        - `"in_progress"`

        - `"completed"`

        - `"incomplete"`

      - `type: "local_shell_call"`

        The type of the local shell call. Always `local_shell_call`.

        - `"local_shell_call"`

      - `agent?: Agent | null`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

    - `LocalShellCallOutput`

      The output of a local shell tool call.

      - `id: string`

        The unique ID of the local shell tool call generated by the model.

      - `output: string`

        A JSON string of the output of the local shell tool call.

      - `type: "local_shell_call_output"`

        The type of the local shell tool call output. Always `local_shell_call_output`.

        - `"local_shell_call_output"`

      - `agent?: Agent | null`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

      - `status?: "in_progress" | "completed" | "incomplete" | null`

        The status of the item. One of `in_progress`, `completed`, or `incomplete`.

        - `"in_progress"`

        - `"completed"`

        - `"incomplete"`

    - `BetaResponseFunctionShellToolCall`

      A tool call that executes one or more shell commands in a managed environment.

      - `id: string`

        The unique ID of the shell tool call. Populated when this item is returned via API.

      - `action: Action`

        The shell commands and limits that describe how to run the tool call.

        - `commands: Array<string>`

        - `max_output_length: number | null`

          Optional maximum number of characters to return from each command.

        - `timeout_ms: number | null`

          Optional timeout in milliseconds for the commands.

      - `call_id: string`

        The unique ID of the shell tool call generated by the model.

      - `environment: BetaResponseLocalEnvironment | BetaResponseContainerReference | null`

        Represents the use of a local environment to perform shell actions.

        - `BetaResponseLocalEnvironment`

          Represents the use of a local environment to perform shell actions.

          - `type: "local"`

            The environment type. Always `local`.

            - `"local"`

        - `BetaResponseContainerReference`

          Represents a container created with /v1/containers.

          - `container_id: string`

          - `type: "container_reference"`

            The environment type. Always `container_reference`.

            - `"container_reference"`

      - `status: "in_progress" | "completed" | "incomplete"`

        The status of the shell call. One of `in_progress`, `completed`, or `incomplete`.

        - `"in_progress"`

        - `"completed"`

        - `"incomplete"`

      - `type: "shell_call"`

        The type of the item. Always `shell_call`.

        - `"shell_call"`

      - `agent?: Agent`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

      - `caller?: Direct | Program | null`

        The execution context that produced this tool call.

        - `Direct`

          - `type: "direct"`

            - `"direct"`

        - `Program`

          - `caller_id: string`

            The call ID of the program item that produced this tool call.

          - `type: "program"`

            - `"program"`

      - `created_by?: string`

        The ID of the entity that created this tool call.

    - `BetaResponseFunctionShellToolCallOutput`

      The output of a shell tool call that was emitted.

      - `id: string`

        The unique ID of the shell call output. Populated when this item is returned via API.

      - `call_id: string`

        The unique ID of the shell tool call generated by the model.

      - `max_output_length: number | null`

        The maximum length of the shell command output. This is generated by the model and should be passed back with the raw output.

      - `output: Array<Output>`

        An array of shell call output contents

        - `outcome: Timeout | Exit`

          Represents either an exit outcome (with an exit code) or a timeout outcome for a shell call output chunk.

          - `Timeout`

            Indicates that the shell call exceeded its configured time limit.

            - `type: "timeout"`

              The outcome type. Always `timeout`.

              - `"timeout"`

          - `Exit`

            Indicates that the shell commands finished and returned an exit code.

            - `exit_code: number`

              Exit code from the shell process.

            - `type: "exit"`

              The outcome type. Always `exit`.

              - `"exit"`

        - `stderr: string`

          The standard error output that was captured.

        - `stdout: string`

          The standard output that was captured.

        - `created_by?: string`

          The identifier of the actor that created the item.

      - `status: "in_progress" | "completed" | "incomplete"`

        The status of the shell call output. One of `in_progress`, `completed`, or `incomplete`.

        - `"in_progress"`

        - `"completed"`

        - `"incomplete"`

      - `type: "shell_call_output"`

        The type of the shell call output. Always `shell_call_output`.

        - `"shell_call_output"`

      - `agent?: Agent`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

      - `caller?: Direct | Program | null`

        The execution context that produced this tool call.

        - `Direct`

          - `type: "direct"`

            - `"direct"`

        - `Program`

          - `caller_id: string`

            The call ID of the program item that produced this tool call.

          - `type: "program"`

            - `"program"`

      - `created_by?: string`

        The identifier of the actor that created the item.

    - `BetaResponseApplyPatchToolCall`

      A tool call that applies file diffs by creating, deleting, or updating files.

      - `id: string`

        The unique ID of the apply patch tool call. Populated when this item is returned via API.

      - `call_id: string`

        The unique ID of the apply patch tool call generated by the model.

      - `operation: CreateFile | DeleteFile | UpdateFile`

        One of the create_file, delete_file, or update_file operations applied via apply_patch.

        - `CreateFile`

          Instruction describing how to create a file via the apply_patch tool.

          - `diff: string`

            Diff to apply.

          - `path: string`

            Path of the file to create.

          - `type: "create_file"`

            Create a new file with the provided diff.

            - `"create_file"`

        - `DeleteFile`

          Instruction describing how to delete a file via the apply_patch tool.

          - `path: string`

            Path of the file to delete.

          - `type: "delete_file"`

            Delete the specified file.

            - `"delete_file"`

        - `UpdateFile`

          Instruction describing how to update a file via the apply_patch tool.

          - `diff: string`

            Diff to apply.

          - `path: string`

            Path of the file to update.

          - `type: "update_file"`

            Update an existing file with the provided diff.

            - `"update_file"`

      - `status: "in_progress" | "completed"`

        The status of the apply patch tool call. One of `in_progress` or `completed`.

        - `"in_progress"`

        - `"completed"`

      - `type: "apply_patch_call"`

        The type of the item. Always `apply_patch_call`.

        - `"apply_patch_call"`

      - `agent?: Agent`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

      - `caller?: Direct | Program | null`

        The execution context that produced this tool call.

        - `Direct`

          - `type: "direct"`

            - `"direct"`

        - `Program`

          - `caller_id: string`

            The call ID of the program item that produced this tool call.

          - `type: "program"`

            - `"program"`

      - `created_by?: string`

        The ID of the entity that created this tool call.

    - `BetaResponseApplyPatchToolCallOutput`

      The output emitted by an apply patch tool call.

      - `id: string`

        The unique ID of the apply patch tool call output. Populated when this item is returned via API.

      - `call_id: string`

        The unique ID of the apply patch tool call generated by the model.

      - `status: "completed" | "failed"`

        The status of the apply patch tool call output. One of `completed` or `failed`.

        - `"completed"`

        - `"failed"`

      - `type: "apply_patch_call_output"`

        The type of the item. Always `apply_patch_call_output`.

        - `"apply_patch_call_output"`

      - `agent?: Agent`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

      - `caller?: Direct | Program | null`

        The execution context that produced this tool call.

        - `Direct`

          - `type: "direct"`

            - `"direct"`

        - `Program`

          - `caller_id: string`

            The call ID of the program item that produced this tool call.

          - `type: "program"`

            - `"program"`

      - `created_by?: string`

        The ID of the entity that created this tool call output.

      - `output?: string | null`

        Optional textual output returned by the apply patch tool.

    - `McpCall`

      An invocation of a tool on an MCP server.

      - `id: string`

        The unique ID of the tool call.

      - `arguments: string`

        A JSON string of the arguments passed to the tool.

      - `name: string`

        The name of the tool that was run.

      - `server_label: string`

        The label of the MCP server running the tool.

      - `type: "mcp_call"`

        The type of the item. Always `mcp_call`.

        - `"mcp_call"`

      - `agent?: Agent | null`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

      - `approval_request_id?: string | null`

        Unique identifier for the MCP tool call approval request.
        Include this value in a subsequent `mcp_approval_response` input to approve or reject the corresponding tool call.

      - `error?: BetaMcpToolCallError | null`

        The error from the tool call, if any.

        - `McpProtocolError`

          - `code: number`

          - `message: string`

          - `type: "mcp_protocol_error"`

            - `"mcp_protocol_error"`

        - `McpToolExecutionError`

          - `content: unknown`

          - `type: "mcp_tool_execution_error"`

            - `"mcp_tool_execution_error"`

        - `HTTPError`

          - `code: number`

          - `message: string`

          - `type: "http_error"`

            - `"http_error"`

      - `output?: string | null`

        The output from the tool call.

      - `status?: "in_progress" | "completed" | "incomplete" | 2 more`

        The status of the tool call. One of `in_progress`, `completed`, `incomplete`, `calling`, or `failed`.

        - `"in_progress"`

        - `"completed"`

        - `"incomplete"`

        - `"calling"`

        - `"failed"`

    - `McpListTools`

      A list of tools available on an MCP server.

      - `id: string`

        The unique ID of the list.

      - `server_label: string`

        The label of the MCP server.

      - `tools: Array<Tool>`

        The tools available on the server.

        - `input_schema: unknown`

          The JSON schema describing the tool's input.

        - `name: string`

          The name of the tool.

        - `annotations?: unknown`

          Additional annotations about the tool.

        - `description?: string | null`

          The description of the tool.

      - `type: "mcp_list_tools"`

        The type of the item. Always `mcp_list_tools`.

        - `"mcp_list_tools"`

      - `agent?: Agent | null`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

      - `error?: string | null`

        Error message if the server could not list tools.

    - `McpApprovalRequest`

      A request for human approval of a tool invocation.

      - `id: string`

        The unique ID of the approval request.

      - `arguments: string`

        A JSON string of arguments for the tool.

      - `name: string`

        The name of the tool to run.

      - `server_label: string`

        The label of the MCP server making the request.

      - `type: "mcp_approval_request"`

        The type of the item. Always `mcp_approval_request`.

        - `"mcp_approval_request"`

      - `agent?: Agent | null`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

    - `McpApprovalResponse`

      A response to an MCP approval request.

      - `id: string`

        The unique ID of the approval response

      - `approval_request_id: string`

        The ID of the approval request being answered.

      - `approve: boolean`

        Whether the request was approved.

      - `type: "mcp_approval_response"`

        The type of the item. Always `mcp_approval_response`.

        - `"mcp_approval_response"`

      - `agent?: Agent | null`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

      - `reason?: string | null`

        Optional reason for the decision.

    - `BetaResponseCustomToolCall`

      A call to a custom tool created by the model.

      - `call_id: string`

        An identifier used to map this custom tool call to a tool call output.

      - `input: string`

        The input for the custom tool call generated by the model.

      - `name: string`

        The name of the custom tool being called.

      - `type: "custom_tool_call"`

        The type of the custom tool call. Always `custom_tool_call`.

        - `"custom_tool_call"`

      - `id?: string`

        The unique ID of the custom tool call in the OpenAI platform.

      - `agent?: Agent | null`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

      - `caller?: Direct | Program | null`

        The execution context that produced this tool call.

        - `Direct`

          - `type: "direct"`

            - `"direct"`

        - `Program`

          - `caller_id: string`

            The call ID of the program item that produced this tool call.

          - `type: "program"`

            - `"program"`

      - `namespace?: string`

        The namespace of the custom tool being called.

    - `BetaResponseCustomToolCallOutputItem extends BetaResponseCustomToolCallOutput`

      The output of a custom tool call from your code, being sent back to the model.

      - `id: string`

        The unique ID of the custom tool call output item.

      - `status: "in_progress" | "completed" | "incomplete"`

        The status of the item. One of `in_progress`, `completed`, or
        `incomplete`. Populated when items are returned via API.

        - `"in_progress"`

        - `"completed"`

        - `"incomplete"`

      - `created_by?: string`

        The identifier of the actor that created the item.

  - `output_index: number`

    The index of the output item that was added.

  - `sequence_number: number`

    The sequence number of this event.

  - `type: "response.output_item.added"`

    The type of the event. Always `response.output_item.added`.

    - `"response.output_item.added"`

  - `agent?: Agent | null`

    The agent that owns this multi-agent streaming event.

    - `agent_name: string`

      The canonical name of the agent that produced this item.

### Beta Response Output Item Done Event

- `BetaResponseOutputItemDoneEvent`

  Emitted when an output item is marked done.

  - `item: BetaResponseOutputItem`

    The output item that was marked done.

    - `BetaResponseOutputMessage`

      An output message from the model.

      - `id: string`

        The unique ID of the output message.

      - `content: Array<BetaResponseOutputText | BetaResponseOutputRefusal>`

        The content of the output message.

        - `BetaResponseOutputText`

          A text output from the model.

          - `annotations: Array<FileCitation | URLCitation | ContainerFileCitation | FilePath>`

            The annotations of the text output.

            - `FileCitation`

              A citation to a file.

              - `file_id: string`

                The ID of the file.

              - `filename: string`

                The filename of the file cited.

              - `index: number`

                The index of the file in the list of files.

              - `type: "file_citation"`

                The type of the file citation. Always `file_citation`.

                - `"file_citation"`

            - `URLCitation`

              A citation for a web resource used to generate a model response.

              - `end_index: number`

                The index of the last character of the URL citation in the message.

              - `start_index: number`

                The index of the first character of the URL citation in the message.

              - `title: string`

                The title of the web resource.

              - `type: "url_citation"`

                The type of the URL citation. Always `url_citation`.

                - `"url_citation"`

              - `url: string`

                The URL of the web resource.

            - `ContainerFileCitation`

              A citation for a container file used to generate a model response.

              - `container_id: string`

                The ID of the container file.

              - `end_index: number`

                The index of the last character of the container file citation in the message.

              - `file_id: string`

                The ID of the file.

              - `filename: string`

                The filename of the container file cited.

              - `start_index: number`

                The index of the first character of the container file citation in the message.

              - `type: "container_file_citation"`

                The type of the container file citation. Always `container_file_citation`.

                - `"container_file_citation"`

            - `FilePath`

              A path to a file.

              - `file_id: string`

                The ID of the file.

              - `index: number`

                The index of the file in the list of files.

              - `type: "file_path"`

                The type of the file path. Always `file_path`.

                - `"file_path"`

          - `text: string`

            The text output from the model.

          - `type: "output_text"`

            The type of the output text. Always `output_text`.

            - `"output_text"`

          - `logprobs?: Array<Logprob>`

            - `token: string`

            - `bytes: Array<number>`

            - `logprob: number`

            - `top_logprobs: Array<TopLogprob>`

              - `token: string`

              - `bytes: Array<number>`

              - `logprob: number`

        - `BetaResponseOutputRefusal`

          A refusal from the model.

          - `refusal: string`

            The refusal explanation from the model.

          - `type: "refusal"`

            The type of the refusal. Always `refusal`.

            - `"refusal"`

      - `role: "assistant"`

        The role of the output message. Always `assistant`.

        - `"assistant"`

      - `status: "in_progress" | "completed" | "incomplete"`

        The status of the message input. One of `in_progress`, `completed`, or
        `incomplete`. Populated when input items are returned via API.

        - `"in_progress"`

        - `"completed"`

        - `"incomplete"`

      - `type: "message"`

        The type of the output message. Always `message`.

        - `"message"`

      - `agent?: Agent | null`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

      - `phase?: "commentary" | "final_answer" | null`

        Labels an `assistant` message as intermediate commentary (`commentary`) or the final answer (`final_answer`).
        For models like `gpt-5.3-codex` and beyond, when sending follow-up requests, preserve and resend
        phase on all assistant messages — dropping it can degrade performance. Not used for user messages.

        - `"commentary"`

        - `"final_answer"`

    - `BetaResponseFileSearchToolCall`

      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.

      - `id: string`

        The unique ID of the file search tool call.

      - `queries: Array<string>`

        The queries used to search for files.

      - `status: "in_progress" | "searching" | "completed" | 2 more`

        The status of the file search tool call. One of `in_progress`,
        `searching`, `incomplete` or `failed`,

        - `"in_progress"`

        - `"searching"`

        - `"completed"`

        - `"incomplete"`

        - `"failed"`

      - `type: "file_search_call"`

        The type of the file search tool call. Always `file_search_call`.

        - `"file_search_call"`

      - `agent?: Agent | null`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

      - `results?: Array<Result> | null`

        The results of the file search tool call.

        - `attributes?: Record<string, string | number | boolean> | null`

          Set of 16 key-value pairs that can be attached to an object. This can be
          useful for storing additional information about the object in a structured
          format, and querying for objects via API or the dashboard. Keys are strings
          with a maximum length of 64 characters. Values are strings with a maximum
          length of 512 characters, booleans, or numbers.

          - `string`

          - `number`

          - `boolean`

        - `file_id?: string`

          The unique ID of the file.

        - `filename?: string`

          The name of the file.

        - `score?: number`

          The relevance score of the file - a value between 0 and 1.

        - `text?: string`

          The text that was retrieved from the file.

    - `BetaResponseFunctionToolCall`

      A tool call to run a function. See the
      [function calling guide](https://platform.openai.com/docs/guides/function-calling) for more information.

      - `arguments: string`

        A JSON string of the arguments to pass to the function.

      - `call_id: string`

        The unique ID of the function tool call generated by the model.

      - `name: string`

        The name of the function to run.

      - `type: "function_call"`

        The type of the function tool call. Always `function_call`.

        - `"function_call"`

      - `id?: string`

        The unique ID of the function tool call.

      - `agent?: Agent | null`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

      - `caller?: Direct | Program | null`

        The execution context that produced this tool call.

        - `Direct`

          - `type: "direct"`

            - `"direct"`

        - `Program`

          - `caller_id: string`

            The call ID of the program item that produced this tool call.

          - `type: "program"`

            - `"program"`

      - `namespace?: string`

        The namespace of the function to run.

      - `status?: "in_progress" | "completed" | "incomplete"`

        The status of the item. One of `in_progress`, `completed`, or
        `incomplete`. Populated when items are returned via API.

        - `"in_progress"`

        - `"completed"`

        - `"incomplete"`

    - `BetaResponseFunctionToolCallOutputItem`

      - `id: string`

        The unique ID of the function call tool output.

      - `call_id: string`

        The unique ID of the function tool call generated by the model.

      - `output: string | Array<BetaResponseInputText | BetaResponseInputImage | BetaResponseInputFile>`

        The output from the function call generated by your code.
        Can be a string or an list of output content.

        - `string`

        - `Array<BetaResponseInputText | BetaResponseInputImage | BetaResponseInputFile>`

          - `BetaResponseInputText`

            A text input to the model.

            - `text: string`

              The text input to the model.

            - `type: "input_text"`

              The type of the input item. Always `input_text`.

              - `"input_text"`

            - `prompt_cache_breakpoint?: PromptCacheBreakpoint`

              Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.

              - `mode: "explicit"`

                The breakpoint mode. Always `explicit`.

                - `"explicit"`

          - `BetaResponseInputImage`

            An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision).

            - `detail: BetaImageDetail`

              The detail level of the image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`.

              - `"low"`

              - `"high"`

              - `"auto"`

              - `"original"`

            - `type: "input_image"`

              The type of the input item. Always `input_image`.

              - `"input_image"`

            - `file_id?: string | null`

              The ID of the file to be sent to the model.

            - `image_url?: string | null`

              The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.

            - `prompt_cache_breakpoint?: PromptCacheBreakpoint`

              Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.

              - `mode: "explicit"`

                The breakpoint mode. Always `explicit`.

                - `"explicit"`

          - `BetaResponseInputFile`

            A file input to the model.

            - `type: "input_file"`

              The type of the input item. Always `input_file`.

              - `"input_file"`

            - `detail?: "auto" | "low" | "high"`

              The detail level of the file to be sent to the model. Use `auto` to let the system select the detail level; for GPT-5.6 and later models, `auto` uses high-quality rendering, which may increase input token usage. Use `low` for lower-cost rendering, or `high` to render the file at higher quality. Defaults to `auto`.

              - `"auto"`

              - `"low"`

              - `"high"`

            - `file_data?: string`

              The content of the file to be sent to the model.

            - `file_id?: string | null`

              The ID of the file to be sent to the model.

            - `file_url?: string`

              The URL of the file to be sent to the model.

            - `filename?: string`

              The name of the file to be sent to the model.

            - `prompt_cache_breakpoint?: PromptCacheBreakpoint`

              Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.

              - `mode: "explicit"`

                The breakpoint mode. Always `explicit`.

                - `"explicit"`

      - `status: "in_progress" | "completed" | "incomplete"`

        The status of the item. One of `in_progress`, `completed`, or
        `incomplete`. Populated when items are returned via API.

        - `"in_progress"`

        - `"completed"`

        - `"incomplete"`

      - `type: "function_call_output"`

        The type of the function tool call output. Always `function_call_output`.

        - `"function_call_output"`

      - `agent?: Agent | null`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

      - `caller?: Direct | Program | null`

        The execution context that produced this tool call.

        - `Direct`

          - `type: "direct"`

            The caller type. Always `direct`.

            - `"direct"`

        - `Program`

          - `caller_id: string`

            The call ID of the program item that produced this tool call.

          - `type: "program"`

            The caller type. Always `program`.

            - `"program"`

      - `created_by?: string`

        The identifier of the actor that created the item.

      - `name?: string`

        The name of the tool that produced the output.

      - `namespace?: string`

        The namespace of the tool that produced the output.

    - `AgentMessage`

      - `id: string`

        The unique ID of the agent message.

      - `author: string`

        The sending agent identity.

      - `content: Array<BetaResponseInputText | BetaResponseOutputText | Text | 7 more>`

        Encrypted content sent between agents.

        - `BetaResponseInputText`

          A text input to the model.

        - `BetaResponseOutputText`

          A text output from the model.

        - `Text`

          A text content.

          - `text: string`

          - `type: "text"`

            - `"text"`

        - `SummaryText`

          A summary text from the model.

          - `text: string`

            A summary of the reasoning output from the model so far.

          - `type: "summary_text"`

            The type of the object. Always `summary_text`.

            - `"summary_text"`

        - `ReasoningText`

          Reasoning text from the model.

          - `text: string`

            The reasoning text from the model.

          - `type: "reasoning_text"`

            The type of the reasoning text. Always `reasoning_text`.

            - `"reasoning_text"`

        - `BetaResponseOutputRefusal`

          A refusal from the model.

        - `BetaResponseInputImage`

          An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision).

        - `ComputerScreenshot`

          A screenshot of a computer.

          - `detail: BetaImageDetail`

            The detail level of the screenshot image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`.

          - `file_id: string | null`

            The identifier of an uploaded file that contains the screenshot.

          - `image_url: string | null`

            The URL of the screenshot image.

          - `type: "computer_screenshot"`

            Specifies the event type. For a computer screenshot, this property is always set to `computer_screenshot`.

            - `"computer_screenshot"`

          - `prompt_cache_breakpoint?: PromptCacheBreakpoint`

            Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.

            - `mode: "explicit"`

              The breakpoint mode. Always `explicit`.

              - `"explicit"`

        - `BetaResponseInputFile`

          A file input to the model.

        - `EncryptedContent`

          Opaque encrypted content that Responses API decrypts inside trusted model execution.

          - `encrypted_content: string`

            Opaque encrypted content.

          - `type: "encrypted_content"`

            The type of the input item. Always `encrypted_content`.

            - `"encrypted_content"`

      - `recipient: string`

        The destination agent identity.

      - `type: "agent_message"`

        The type of the item. Always `agent_message`.

        - `"agent_message"`

      - `agent?: Agent`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

    - `MultiAgentCall`

      - `id: string`

        The unique ID of the multi-agent call item.

      - `action: "spawn_agent" | "interrupt_agent" | "list_agents" | 3 more`

        The multi-agent action to execute.

        - `"spawn_agent"`

        - `"interrupt_agent"`

        - `"list_agents"`

        - `"send_message"`

        - `"followup_task"`

        - `"wait_agent"`

      - `arguments: string`

        The JSON string of arguments generated for the action.

      - `call_id: string`

        The unique ID linking this call to its output.

      - `type: "multi_agent_call"`

        The type of the multi-agent call. Always `multi_agent_call`.

        - `"multi_agent_call"`

      - `agent?: Agent`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

    - `MultiAgentCallOutput`

      - `id: string`

        The unique ID of the multi-agent call output item.

      - `action: "spawn_agent" | "interrupt_agent" | "list_agents" | 3 more`

        The multi-agent action that produced this result.

        - `"spawn_agent"`

        - `"interrupt_agent"`

        - `"list_agents"`

        - `"send_message"`

        - `"followup_task"`

        - `"wait_agent"`

      - `call_id: string`

        The unique ID of the multi-agent call.

      - `output: Array<BetaResponseOutputText>`

        Text output returned by the multi-agent action.

        - `annotations: Array<FileCitation | URLCitation | ContainerFileCitation | FilePath>`

          The annotations of the text output.

        - `text: string`

          The text output from the model.

        - `type: "output_text"`

          The type of the output text. Always `output_text`.

        - `logprobs?: Array<Logprob>`

      - `type: "multi_agent_call_output"`

        The type of the multi-agent result. Always `multi_agent_call_output`.

        - `"multi_agent_call_output"`

      - `agent?: Agent`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

    - `BetaResponseFunctionWebSearch`

      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.

      - `id: string`

        The unique ID of the web search tool call.

      - `action: Search | OpenPage | FindInPage`

        An object describing the specific action taken in this web search call.
        Includes details on how the model used the web (search, open_page, find_in_page).

        - `Search`

          Action type "search" - Performs a web search query.

          - `type: "search"`

            The action type.

            - `"search"`

          - `queries?: Array<string>`

            The search queries.

          - `query?: string`

            The search query.

          - `sources?: Array<Source>`

            The sources used in the search.

            - `type: "url"`

              The type of source. Always `url`.

              - `"url"`

            - `url: string`

              The URL of the source.

        - `OpenPage`

          Action type "open_page" - Opens a specific URL from search results.

          - `type: "open_page"`

            The action type.

            - `"open_page"`

          - `url?: string | null`

            The URL opened by the model.

        - `FindInPage`

          Action type "find_in_page": Searches for a pattern within a loaded page.

          - `pattern: string`

            The pattern or text to search for within the page.

          - `type: "find_in_page"`

            The action type.

            - `"find_in_page"`

          - `url: string`

            The URL of the page searched for the pattern.

      - `status: "in_progress" | "searching" | "completed" | "failed"`

        The status of the web search tool call.

        - `"in_progress"`

        - `"searching"`

        - `"completed"`

        - `"failed"`

      - `type: "web_search_call"`

        The type of the web search tool call. Always `web_search_call`.

        - `"web_search_call"`

      - `agent?: Agent | null`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

    - `BetaResponseComputerToolCall`

      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.

      - `id: string`

        The unique ID of the computer call.

      - `call_id: string`

        An identifier used when responding to the tool call with output.

      - `pending_safety_checks: Array<PendingSafetyCheck>`

        The pending safety checks for the computer call.

        - `id: string`

          The ID of the pending safety check.

        - `code?: string | null`

          The type of the pending safety check.

        - `message?: string | null`

          Details about the pending safety check.

      - `status: "in_progress" | "completed" | "incomplete"`

        The status of the item. One of `in_progress`, `completed`, or
        `incomplete`. Populated when items are returned via API.

        - `"in_progress"`

        - `"completed"`

        - `"incomplete"`

      - `type: "computer_call"`

        The type of the computer call. Always `computer_call`.

        - `"computer_call"`

      - `action?: BetaComputerAction`

        A click action.

        - `Click`

          A click action.

          - `button: "left" | "right" | "wheel" | 2 more`

            Indicates which mouse button was pressed during the click. One of `left`, `right`, `wheel`, `back`, or `forward`.

            - `"left"`

            - `"right"`

            - `"wheel"`

            - `"back"`

            - `"forward"`

          - `type: "click"`

            Specifies the event type. For a click action, this property is always `click`.

            - `"click"`

          - `x: number`

            The x-coordinate where the click occurred.

          - `y: number`

            The y-coordinate where the click occurred.

          - `keys?: Array<string> | null`

            The keys being held while clicking.

        - `DoubleClick`

          A double click action.

          - `keys: Array<string> | null`

            The keys being held while double-clicking.

          - `type: "double_click"`

            Specifies the event type. For a double click action, this property is always set to `double_click`.

            - `"double_click"`

          - `x: number`

            The x-coordinate where the double click occurred.

          - `y: number`

            The y-coordinate where the double click occurred.

        - `Drag`

          A drag action.

          - `path: Array<Path>`

            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 }
            ]
            ```

            - `x: number`

              The x-coordinate.

            - `y: number`

              The y-coordinate.

          - `type: "drag"`

            Specifies the event type. For a drag action, this property is always set to `drag`.

            - `"drag"`

          - `keys?: Array<string> | null`

            The keys being held while dragging the mouse.

        - `Keypress`

          A collection of keypresses the model would like to perform.

          - `keys: Array<string>`

            The combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key.

          - `type: "keypress"`

            Specifies the event type. For a keypress action, this property is always set to `keypress`.

            - `"keypress"`

        - `Move`

          A mouse move action.

          - `type: "move"`

            Specifies the event type. For a move action, this property is always set to `move`.

            - `"move"`

          - `x: number`

            The x-coordinate to move to.

          - `y: number`

            The y-coordinate to move to.

          - `keys?: Array<string> | null`

            The keys being held while moving the mouse.

        - `Screenshot`

          A screenshot action.

          - `type: "screenshot"`

            Specifies the event type. For a screenshot action, this property is always set to `screenshot`.

            - `"screenshot"`

        - `Scroll`

          A scroll action.

          - `scroll_x: number`

            The horizontal scroll distance.

          - `scroll_y: number`

            The vertical scroll distance.

          - `type: "scroll"`

            Specifies the event type. For a scroll action, this property is always set to `scroll`.

            - `"scroll"`

          - `x: number`

            The x-coordinate where the scroll occurred.

          - `y: number`

            The y-coordinate where the scroll occurred.

          - `keys?: Array<string> | null`

            The keys being held while scrolling.

        - `Type`

          An action to type in text.

          - `text: string`

            The text to type.

          - `type: "type"`

            Specifies the event type. For a type action, this property is always set to `type`.

            - `"type"`

        - `Wait`

          A wait action.

          - `type: "wait"`

            Specifies the event type. For a wait action, this property is always set to `wait`.

            - `"wait"`

      - `actions?: BetaComputerActionList`

        Flattened batched actions for `computer_use`. Each action includes an
        `type` discriminator and action-specific fields.

        - `Click`

          A click action.

        - `DoubleClick`

          A double click action.

        - `Drag`

          A drag action.

        - `Keypress`

          A collection of keypresses the model would like to perform.

        - `Move`

          A mouse move action.

        - `Screenshot`

          A screenshot action.

        - `Scroll`

          A scroll action.

        - `Type`

          An action to type in text.

        - `Wait`

          A wait action.

      - `agent?: Agent | null`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

    - `BetaResponseComputerToolCallOutputItem`

      - `id: string`

        The unique ID of the computer call tool output.

      - `call_id: string`

        The ID of the computer tool call that produced the output.

      - `output: BetaResponseComputerToolCallOutputScreenshot`

        A computer screenshot image used with the computer use tool.

        - `type: "computer_screenshot"`

          Specifies the event type. For a computer screenshot, this property is
          always set to `computer_screenshot`.

          - `"computer_screenshot"`

        - `file_id?: string`

          The identifier of an uploaded file that contains the screenshot.

        - `image_url?: string`

          The URL of the screenshot image.

      - `status: "completed" | "incomplete" | "failed" | "in_progress"`

        The status of the message input. One of `in_progress`, `completed`, or
        `incomplete`. Populated when input items are returned via API.

        - `"completed"`

        - `"incomplete"`

        - `"failed"`

        - `"in_progress"`

      - `type: "computer_call_output"`

        The type of the computer tool call output. Always `computer_call_output`.

        - `"computer_call_output"`

      - `acknowledged_safety_checks?: Array<AcknowledgedSafetyCheck>`

        The safety checks reported by the API that have been acknowledged by the
        developer.

        - `id: string`

          The ID of the pending safety check.

        - `code?: string | null`

          The type of the pending safety check.

        - `message?: string | null`

          Details about the pending safety check.

      - `agent?: Agent | null`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

      - `created_by?: string`

        The identifier of the actor that created the item.

    - `BetaResponseReasoningItem`

      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).

      - `id: string`

        The unique identifier of the reasoning content.

      - `summary: Array<Summary>`

        Reasoning summary content.

        - `text: string`

          A summary of the reasoning output from the model so far.

        - `type: "summary_text"`

          The type of the object. Always `summary_text`.

          - `"summary_text"`

      - `type: "reasoning"`

        The type of the object. Always `reasoning`.

        - `"reasoning"`

      - `agent?: Agent | null`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

      - `content?: Array<Content>`

        Reasoning text content.

        - `text: string`

          The reasoning text from the model.

        - `type: "reasoning_text"`

          The type of the reasoning text. Always `reasoning_text`.

          - `"reasoning_text"`

      - `encrypted_content?: string | null`

        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.

        When streaming, use the completed reasoning item and its
        `encrypted_content` from the `response.output_item.done` event in
        subsequent requests. The `encrypted_content` in
        `response.output_item.added` may be incomplete. This is especially
        important when `store` is `false` or when using Zero Data Retention.

      - `status?: "in_progress" | "completed" | "incomplete"`

        The status of the item. One of `in_progress`, `completed`, or
        `incomplete`. Populated when items are returned via API.

        - `"in_progress"`

        - `"completed"`

        - `"incomplete"`

    - `Program`

      - `id: string`

        The unique ID of the program item.

      - `call_id: string`

        The stable call ID of the program item.

      - `code: string`

        The JavaScript source executed by programmatic tool calling.

      - `fingerprint: string`

        Opaque program replay fingerprint that must be round-tripped.

      - `type: "program"`

        The type of the item. Always `program`.

        - `"program"`

      - `agent?: Agent`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

    - `ProgramOutput`

      - `id: string`

        The unique ID of the program output item.

      - `call_id: string`

        The call ID of the program item.

      - `result: string`

        The result produced by the program item.

      - `status: "completed" | "incomplete"`

        The terminal status of the program output item.

        - `"completed"`

        - `"incomplete"`

      - `type: "program_output"`

        The type of the item. Always `program_output`.

        - `"program_output"`

      - `agent?: Agent`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

    - `BetaResponseToolSearchCall`

      - `id: string`

        The unique ID of the tool search call item.

      - `arguments: unknown`

        Arguments used for the tool search call.

      - `call_id: string | null`

        The unique ID of the tool search call generated by the model.

      - `execution: "server" | "client"`

        Whether tool search was executed by the server or by the client.

        - `"server"`

        - `"client"`

      - `status: "in_progress" | "completed" | "incomplete"`

        The status of the tool search call item that was recorded.

        - `"in_progress"`

        - `"completed"`

        - `"incomplete"`

      - `type: "tool_search_call"`

        The type of the item. Always `tool_search_call`.

        - `"tool_search_call"`

      - `agent?: Agent`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

      - `created_by?: string`

        The identifier of the actor that created the item.

    - `BetaResponseToolSearchOutputItem`

      - `id: string`

        The unique ID of the tool search output item.

      - `call_id: string | null`

        The unique ID of the tool search call generated by the model.

      - `execution: "server" | "client"`

        Whether tool search was executed by the server or by the client.

        - `"server"`

        - `"client"`

      - `status: "in_progress" | "completed" | "incomplete"`

        The status of the tool search output item that was recorded.

        - `"in_progress"`

        - `"completed"`

        - `"incomplete"`

      - `tools: Array<BetaTool>`

        The loaded tool definitions returned by tool search.

        - `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).

          - `name: string`

            The name of the function to call.

          - `parameters: Record<string, unknown> | null`

            A JSON schema object describing the parameters of the function.

          - `strict: boolean | null`

            Whether strict parameter validation is enforced for this function tool.

          - `type: "function"`

            The type of the function tool. Always `function`.

            - `"function"`

          - `allowed_callers?: Array<"direct" | "programmatic"> | null`

            The tool invocation context(s).

            - `"direct"`

            - `"programmatic"`

          - `defer_loading?: boolean`

            Whether this function is deferred and loaded via tool search.

          - `description?: string | null`

            A description of the function. Used by the model to determine whether or not to call the function.

          - `output_schema?: Record<string, unknown> | null`

            A JSON schema object describing the JSON value encoded in string outputs for this function.

        - `BetaFileSearchTool`

          A tool that searches for relevant content from uploaded files. Learn more about the [file search tool](https://platform.openai.com/docs/guides/tools-file-search).

          - `type: "file_search"`

            The type of the file search tool. Always `file_search`.

            - `"file_search"`

          - `vector_store_ids: Array<string>`

            The IDs of the vector stores to search.

          - `filters?: ComparisonFilter | CompoundFilter | null`

            A filter to apply.

            - `ComparisonFilter`

              A filter used to compare a specified attribute key to a given value using a defined comparison operation.

              - `key: string`

                The key to compare against the value.

              - `type: "eq" | "ne" | "gt" | 5 more`

                Specifies the comparison operator: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`, `in`, `nin`.

                - `eq`: equals
                - `ne`: not equal
                - `gt`: greater than
                - `gte`: greater than or equal
                - `lt`: less than
                - `lte`: less than or equal
                - `in`: in
                - `nin`: not in

                - `"eq"`

                - `"ne"`

                - `"gt"`

                - `"gte"`

                - `"lt"`

                - `"lte"`

                - `"in"`

                - `"nin"`

              - `value: string | number | boolean | Array<string | number>`

                The value to compare against the attribute key; supports string, number, or boolean types.

                - `string`

                - `number`

                - `boolean`

                - `Array<string | number>`

                  - `string`

                  - `number`

            - `CompoundFilter`

              Combine multiple filters using `and` or `or`.

              - `filters: Array<ComparisonFilter | unknown>`

                Array of filters to combine. Items can be `ComparisonFilter` or `CompoundFilter`.

                - `ComparisonFilter`

                  A filter used to compare a specified attribute key to a given value using a defined comparison operation.

                  - `key: string`

                    The key to compare against the value.

                  - `type: "eq" | "ne" | "gt" | 5 more`

                    Specifies the comparison operator: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`, `in`, `nin`.

                    - `eq`: equals
                    - `ne`: not equal
                    - `gt`: greater than
                    - `gte`: greater than or equal
                    - `lt`: less than
                    - `lte`: less than or equal
                    - `in`: in
                    - `nin`: not in

                    - `"eq"`

                    - `"ne"`

                    - `"gt"`

                    - `"gte"`

                    - `"lt"`

                    - `"lte"`

                    - `"in"`

                    - `"nin"`

                  - `value: string | number | boolean | Array<string | number>`

                    The value to compare against the attribute key; supports string, number, or boolean types.

                    - `string`

                    - `number`

                    - `boolean`

                    - `Array<string | number>`

                      - `string`

                      - `number`

                - `unknown`

              - `type: "and" | "or"`

                Type of operation: `and` or `or`.

                - `"and"`

                - `"or"`

          - `max_num_results?: number`

            The maximum number of results to return. This number should be between 1 and 50 inclusive.

          - `ranking_options?: RankingOptions`

            Ranking options for search.

            - `hybrid_search?: HybridSearch`

              Weights that control how reciprocal rank fusion balances semantic embedding matches versus sparse keyword matches when hybrid search is enabled.

              - `embedding_weight: number`

                The weight of the embedding in the reciprocal ranking fusion.

              - `text_weight: number`

                The weight of the text in the reciprocal ranking fusion.

            - `ranker?: "auto" | "default-2024-11-15"`

              The ranker to use for the file search.

              - `"auto"`

              - `"default-2024-11-15"`

            - `score_threshold?: number`

              The score threshold for the file search, a number between 0 and 1. Numbers closer to 1 will attempt to return only the most relevant results, but may return fewer results.

        - `BetaComputerTool`

          A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use).

          - `type: "computer"`

            The type of the computer tool. Always `computer`.

            - `"computer"`

        - `BetaComputerUsePreviewTool`

          A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use).

          - `display_height: number`

            The height of the computer display.

          - `display_width: number`

            The width of the computer display.

          - `environment: "windows" | "mac" | "linux" | 2 more`

            The type of computer environment to control.

            - `"windows"`

            - `"mac"`

            - `"linux"`

            - `"ubuntu"`

            - `"browser"`

          - `type: "computer_use_preview"`

            The type of the computer use tool. Always `computer_use_preview`.

            - `"computer_use_preview"`

        - `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"`

            The type of the web search tool. One of `web_search` or `web_search_2025_08_26`.

            - `"web_search"`

            - `"web_search_2025_08_26"`

          - `external_web_access?: boolean`

            Allow live internet access for web search. Defaults to true when omitted. When false, the web search tool runs in offline/cache-only mode and will not fetch new external content.

          - `filters?: Filters | null`

            Filters for the search.

            - `allowed_domains?: Array<string> | null`

              Allowed domains for the search. If not provided, all domains are allowed.
              Subdomains of the provided domains are allowed as well.

              Example: `["pubmed.ncbi.nlm.nih.gov"]`

          - `search_context_size?: "low" | "medium" | "high"`

            High level guidance for the amount of context window space to use for the search. One of `low`, `medium`, or `high`. `medium` is the default.

            - `"low"`

            - `"medium"`

            - `"high"`

          - `user_location?: UserLocation | null`

            The approximate location of the user.

            - `city?: string | null`

              Free text input for the city of the user, e.g. `San Francisco`.

            - `country?: string | null`

              The two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of the user, e.g. `US`.

            - `region?: string | null`

              Free text input for the region of the user, e.g. `California`.

            - `timezone?: string | null`

              The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of the user, e.g. `America/Los_Angeles`.

            - `type?: "approximate"`

              The type of location approximation. Always `approximate`.

              - `"approximate"`

        - `Mcp`

          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).

          - `server_label: string`

            A label for this MCP server, used to identify it in tool calls.

          - `type: "mcp"`

            The type of the MCP tool. Always `mcp`.

            - `"mcp"`

          - `allowed_callers?: Array<"direct" | "programmatic"> | null`

            The tool invocation context(s).

            - `"direct"`

            - `"programmatic"`

          - `allowed_tools?: Array<string> | McpToolFilter | null`

            List of allowed tool names or a filter object.

            - `Array<string>`

            - `McpToolFilter`

              A filter object to specify which tools are allowed.

              - `read_only?: boolean`

                Indicates whether or not a tool modifies data or is read-only. If an
                MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint),
                it will match this filter.

              - `tool_names?: Array<string>`

                List of allowed tool names.

          - `authorization?: string`

            An OAuth access token that can be used with a remote MCP server, either
            with a custom MCP server URL or a service connector. Your application
            must handle the OAuth authorization flow and provide the token here.

          - `connector_id?: "connector_dropbox" | "connector_gmail" | "connector_googlecalendar" | 5 more`

            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`

            - `"connector_dropbox"`

            - `"connector_gmail"`

            - `"connector_googlecalendar"`

            - `"connector_googledrive"`

            - `"connector_microsoftteams"`

            - `"connector_outlookcalendar"`

            - `"connector_outlookemail"`

            - `"connector_sharepoint"`

          - `defer_loading?: boolean`

            Whether this MCP tool is deferred and discovered via tool search.

          - `headers?: Record<string, string> | null`

            Optional HTTP headers to send to the MCP server. Use for authentication
            or other purposes.

          - `require_approval?: McpToolApprovalFilter | "always" | "never" | null`

            Specify which of the MCP server's tools require approval.

            - `McpToolApprovalFilter`

              Specify which of the MCP server's tools require approval. Can be
              `always`, `never`, or a filter object associated with tools
              that require approval.

              - `always?: Always`

                A filter object to specify which tools are allowed.

                - `read_only?: boolean`

                  Indicates whether or not a tool modifies data or is read-only. If an
                  MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint),
                  it will match this filter.

                - `tool_names?: Array<string>`

                  List of allowed tool names.

              - `never?: Never`

                A filter object to specify which tools are allowed.

                - `read_only?: boolean`

                  Indicates whether or not a tool modifies data or is read-only. If an
                  MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint),
                  it will match this filter.

                - `tool_names?: Array<string>`

                  List of allowed tool names.

            - `"always" | "never"`

              - `"always"`

              - `"never"`

          - `server_description?: string`

            Optional description of the MCP server, used to provide more context.

          - `server_url?: string`

            The URL for the MCP server. One of `server_url`, `connector_id`, or
            `tunnel_id` must be provided.

          - `tunnel_id?: string`

            The Secure MCP Tunnel ID to use instead of a direct server URL. One of
            `server_url`, `connector_id`, or `tunnel_id` must be provided.

        - `CodeInterpreter`

          A tool that runs Python code to help generate a response to a prompt.

          - `container: string | CodeInterpreterToolAuto`

            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`

            - `CodeInterpreterToolAuto`

              Configuration for a code interpreter container. Optionally specify the IDs of the files to run the code on.

              - `type: "auto"`

                Always `auto`.

                - `"auto"`

              - `file_ids?: Array<string>`

                An optional list of uploaded files to make available to your code.

              - `memory_limit?: "1g" | "4g" | "16g" | "64g" | null`

                The memory limit for the code interpreter container.

                - `"1g"`

                - `"4g"`

                - `"16g"`

                - `"64g"`

              - `network_policy?: BetaContainerNetworkPolicyDisabled | BetaContainerNetworkPolicyAllowlist`

                Network access policy for the container.

                - `BetaContainerNetworkPolicyDisabled`

                  - `type: "disabled"`

                    Disable outbound network access. Always `disabled`.

                    - `"disabled"`

                - `BetaContainerNetworkPolicyAllowlist`

                  - `allowed_domains: Array<string>`

                    A list of allowed domains when type is `allowlist`.

                  - `type: "allowlist"`

                    Allow outbound network access only to specified domains. Always `allowlist`.

                    - `"allowlist"`

                  - `domain_secrets?: Array<BetaContainerNetworkPolicyDomainSecret>`

                    Optional domain-scoped secrets for allowlisted domains.

                    - `domain: string`

                      The domain associated with the secret.

                    - `name: string`

                      The name of the secret to inject for the domain.

                    - `value: string`

                      The secret value to inject for the domain.

          - `type: "code_interpreter"`

            The type of the code interpreter tool. Always `code_interpreter`.

            - `"code_interpreter"`

          - `allowed_callers?: Array<"direct" | "programmatic"> | null`

            The tool invocation context(s).

            - `"direct"`

            - `"programmatic"`

        - `ProgrammaticToolCalling`

          - `type: "programmatic_tool_calling"`

            The type of the tool. Always `programmatic_tool_calling`.

            - `"programmatic_tool_calling"`

        - `ImageGeneration`

          A tool that generates images using the GPT image models.

          - `type: "image_generation"`

            The type of the image generation tool. Always `image_generation`.

            - `"image_generation"`

          - `action?: "generate" | "edit" | "auto"`

            Whether to generate a new image or edit an existing image. Default: `auto`.

            - `"generate"`

            - `"edit"`

            - `"auto"`

          - `background?: "transparent" | "opaque" | "auto"`

            Allows to set transparency for the background of the generated image(s).
            Must be one of `transparent`, `opaque`, or `auto` (default value). When
            `auto` is used, the model will automatically determine the best
            background for the image.

            Transparent backgrounds are available for supported GPT Image models.
            For `gpt-image-2` and `gpt-image-2-2026-04-21`, this support is in
            preview. When using `transparent`, set the output format to `png` or
            `webp`.

            - `"transparent"`

            - `"opaque"`

            - `"auto"`

          - `input_fidelity?: "high" | "low" | null`

            Control how much effort the model will exert to match the style and features, especially facial features, of input images. This parameter is only supported for `gpt-image-1` and `gpt-image-1.5` and later models, unsupported for `gpt-image-1-mini`. Supports `high` and `low`. Defaults to `low`.

            - `"high"`

            - `"low"`

          - `input_image_mask?: InputImageMask`

            Optional mask for inpainting. Contains `image_url`
            (string, optional) and `file_id` (string, optional).

            - `file_id?: string`

              File ID for the mask image.

            - `image_url?: string`

              Base64-encoded mask image.

          - `model?: (string & {}) | "gpt-image-1" | "gpt-image-1-mini" | "gpt-image-2" | 3 more`

            The image generation model to use. One of `gpt-image-1`,
            `gpt-image-1-mini`, `gpt-image-1.5`, `gpt-image-2`,
            `gpt-image-2-2026-04-21`, or `chatgpt-image-latest`. Default:
            `gpt-image-1`.

            - `(string & {})`

            - `"gpt-image-1" | "gpt-image-1-mini" | "gpt-image-2" | 3 more`

              - `"gpt-image-1"`

              - `"gpt-image-1-mini"`

              - `"gpt-image-2"`

              - `"gpt-image-2-2026-04-21"`

              - `"gpt-image-1.5"`

              - `"chatgpt-image-latest"`

          - `moderation?: "auto" | "low"`

            Moderation level for the generated image. Default: `auto`.

            - `"auto"`

            - `"low"`

          - `output_compression?: number`

            Compression level for the output image. Default: 100.

          - `output_format?: "png" | "webp" | "jpeg"`

            The output format of the generated image. One of `png`, `webp`, or
            `jpeg`. Default: `png`.

            - `"png"`

            - `"webp"`

            - `"jpeg"`

          - `partial_images?: number`

            Number of partial images to generate in streaming mode, from 0 (default value) to 3.

          - `quality?: "low" | "medium" | "high" | "auto"`

            The quality of the generated image. One of `low`, `medium`, `high`,
            or `auto`. Default: `auto`.

            - `"low"`

            - `"medium"`

            - `"high"`

            - `"auto"`

          - `size?: (string & {}) | "1024x1024" | "1024x1536" | "1536x1024" | "auto"`

            The size of the generated images. For `gpt-image-2` and `gpt-image-2-2026-04-21`, arbitrary resolutions are supported as `WIDTHxHEIGHT` strings, for example `1536x864`. Width and height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above `2560x1440` are experimental, and the maximum supported resolution is `3840x2160`. The requested size must also satisfy the model's current pixel and edge limits. The standard sizes `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models; `auto` is supported for models that allow automatic sizing. For `dall-e-2`, use one of `256x256`, `512x512`, or `1024x1024`. For `dall-e-3`, use one of `1024x1024`, `1792x1024`, or `1024x1792`.

            - `(string & {})`

            - `"1024x1024" | "1024x1536" | "1536x1024" | "auto"`

              - `"1024x1024"`

              - `"1024x1536"`

              - `"1536x1024"`

              - `"auto"`

        - `LocalShell`

          A tool that allows the model to execute shell commands in a local environment.

          - `type: "local_shell"`

            The type of the local shell tool. Always `local_shell`.

            - `"local_shell"`

        - `BetaFunctionShellTool`

          A tool that allows the model to execute shell commands.

          - `type: "shell"`

            The type of the shell tool. Always `shell`.

            - `"shell"`

          - `allowed_callers?: Array<"direct" | "programmatic"> | null`

            The tool invocation context(s).

            - `"direct"`

            - `"programmatic"`

          - `environment?: BetaContainerAuto | BetaLocalEnvironment | BetaContainerReference | null`

            - `BetaContainerAuto`

              - `type: "container_auto"`

                Automatically creates a container for this request

                - `"container_auto"`

              - `file_ids?: Array<string>`

                An optional list of uploaded files to make available to your code.

              - `memory_limit?: "1g" | "4g" | "16g" | "64g" | null`

                The memory limit for the container.

                - `"1g"`

                - `"4g"`

                - `"16g"`

                - `"64g"`

              - `network_policy?: BetaContainerNetworkPolicyDisabled | BetaContainerNetworkPolicyAllowlist`

                Network access policy for the container.

                - `BetaContainerNetworkPolicyDisabled`

                - `BetaContainerNetworkPolicyAllowlist`

              - `skills?: Array<BetaSkillReference | BetaInlineSkill>`

                An optional list of skills referenced by id or inline data.

                - `BetaSkillReference`

                  - `skill_id: string`

                    The ID of the referenced skill.

                  - `type: "skill_reference"`

                    References a skill created with the /v1/skills endpoint.

                    - `"skill_reference"`

                  - `version?: string`

                    Optional skill version. Use a positive integer or 'latest'. Omit for default.

                - `BetaInlineSkill`

                  - `description: string`

                    The description of the skill.

                  - `name: string`

                    The name of the skill.

                  - `source: BetaInlineSkillSource`

                    Inline skill payload

                    - `data: string`

                      Base64-encoded skill zip bundle.

                    - `media_type: "application/zip"`

                      The media type of the inline skill payload. Must be `application/zip`.

                      - `"application/zip"`

                    - `type: "base64"`

                      The type of the inline skill source. Must be `base64`.

                      - `"base64"`

                  - `type: "inline"`

                    Defines an inline skill for this request.

                    - `"inline"`

            - `BetaLocalEnvironment`

              - `type: "local"`

                Use a local computer environment.

                - `"local"`

              - `skills?: Array<BetaLocalSkill>`

                An optional list of skills.

                - `description: string`

                  The description of the skill.

                - `name: string`

                  The name of the skill.

                - `path: string`

                  The path to the directory containing the skill.

            - `BetaContainerReference`

              - `container_id: string`

                The ID of the referenced container.

              - `type: "container_reference"`

                References a container created with the /v1/containers endpoint

                - `"container_reference"`

        - `BetaCustomTool`

          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)

          - `name: string`

            The name of the custom tool, used to identify it in tool calls.

          - `type: "custom"`

            The type of the custom tool. Always `custom`.

            - `"custom"`

          - `allowed_callers?: Array<"direct" | "programmatic"> | null`

            The tool invocation context(s).

            - `"direct"`

            - `"programmatic"`

          - `defer_loading?: boolean`

            Whether this tool should be deferred and discovered via tool search.

          - `description?: string`

            Optional description of the custom tool, used to provide more context.

          - `format?: Text | Grammar`

            The input format for the custom tool. Default is unconstrained text.

            - `Text`

              Unconstrained free-form text.

              - `type: "text"`

                Unconstrained text format. Always `text`.

                - `"text"`

            - `Grammar`

              A grammar defined by the user.

              - `definition: string`

                The grammar definition.

              - `syntax: "lark" | "regex"`

                The syntax of the grammar definition. One of `lark` or `regex`.

                - `"lark"`

                - `"regex"`

              - `type: "grammar"`

                Grammar format. Always `grammar`.

                - `"grammar"`

        - `BetaNamespaceTool`

          Groups function/custom tools under a shared namespace.

          - `description: string`

            A description of the namespace shown to the model.

          - `name: string`

            The namespace name used in tool calls (for example, `crm`).

          - `tools: Array<Function | BetaCustomTool>`

            The function/custom tools available inside this namespace.

            - `Function`

              - `name: string`

              - `type: "function"`

                - `"function"`

              - `allowed_callers?: Array<"direct" | "programmatic"> | null`

                The tool invocation context(s).

                - `"direct"`

                - `"programmatic"`

              - `defer_loading?: boolean`

                Whether this function should be deferred and discovered via tool search.

              - `description?: string | null`

              - `output_schema?: Record<string, unknown> | null`

                A JSON Schema describing the JSON value encoded in string outputs for this function tool. This does not describe content-array outputs.

              - `parameters?: unknown`

              - `strict?: boolean | null`

                Whether to enforce strict parameter validation. If omitted, Responses attempts to use strict validation when the schema is compatible, and falls back to non-strict validation otherwise.

            - `BetaCustomTool`

              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: "namespace"`

            The type of the tool. Always `namespace`.

            - `"namespace"`

        - `BetaToolSearchTool`

          Hosted or BYOT tool search configuration for deferred tools.

          - `type: "tool_search"`

            The type of the tool. Always `tool_search`.

            - `"tool_search"`

          - `description?: string | null`

            Description shown to the model for a client-executed tool search tool.

          - `execution?: "server" | "client"`

            Whether tool search is executed by the server or by the client.

            - `"server"`

            - `"client"`

          - `parameters?: unknown`

            Parameter schema for a client-executed tool search tool.

        - `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"`

            The type of the web search tool. One of `web_search_preview` or `web_search_preview_2025_03_11`.

            - `"web_search_preview"`

            - `"web_search_preview_2025_03_11"`

          - `search_content_types?: Array<"text" | "image">`

            - `"text"`

            - `"image"`

          - `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.

            - `"low"`

            - `"medium"`

            - `"high"`

          - `user_location?: UserLocation | null`

            The user's location.

            - `type: "approximate"`

              The type of location approximation. Always `approximate`.

              - `"approximate"`

            - `city?: string | null`

              Free text input for the city of the user, e.g. `San Francisco`.

            - `country?: string | null`

              The two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of the user, e.g. `US`.

            - `region?: string | null`

              Free text input for the region of the user, e.g. `California`.

            - `timezone?: string | null`

              The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of the user, e.g. `America/Los_Angeles`.

        - `BetaApplyPatchTool`

          Allows the assistant to create, delete, or update files using unified diffs.

          - `type: "apply_patch"`

            The type of the tool. Always `apply_patch`.

            - `"apply_patch"`

          - `allowed_callers?: Array<"direct" | "programmatic"> | null`

            The tool invocation context(s).

            - `"direct"`

            - `"programmatic"`

      - `type: "tool_search_output"`

        The type of the item. Always `tool_search_output`.

        - `"tool_search_output"`

      - `agent?: Agent`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

      - `created_by?: string`

        The identifier of the actor that created the item.

    - `AdditionalTools`

      - `id: string`

        The unique ID of the additional tools item.

      - `role: "unknown" | "user" | "assistant" | 5 more`

        The role that provided the additional tools.

        - `"unknown"`

        - `"user"`

        - `"assistant"`

        - `"system"`

        - `"critic"`

        - `"discriminator"`

        - `"developer"`

        - `"tool"`

      - `tools: Array<BetaTool>`

        The additional tool definitions made available at this item.

        - `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).

        - `Mcp`

          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).

        - `CodeInterpreter`

          A tool that runs Python code to help generate a response to a prompt.

        - `ProgrammaticToolCalling`

        - `ImageGeneration`

          A tool that generates images using the GPT image models.

        - `LocalShell`

          A tool that allows the model to execute shell commands in a local environment.

        - `BetaFunctionShellTool`

          A tool that allows the model to execute shell commands.

        - `BetaCustomTool`

          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)

        - `BetaNamespaceTool`

          Groups function/custom tools under a shared namespace.

        - `BetaToolSearchTool`

          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).

        - `BetaApplyPatchTool`

          Allows the assistant to create, delete, or update files using unified diffs.

      - `type: "additional_tools"`

        The type of the item. Always `additional_tools`.

        - `"additional_tools"`

      - `agent?: Agent`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

    - `BetaResponseCompactionItem`

      A compaction item generated by the [`v1/responses/compact` API](https://platform.openai.com/docs/api-reference/responses/compact).

      - `id: string`

        The unique ID of the compaction item.

      - `encrypted_content: string`

        The encrypted content that was produced by compaction.

      - `type: "compaction"`

        The type of the item. Always `compaction`.

        - `"compaction"`

      - `agent?: Agent`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

      - `created_by?: string`

        The identifier of the actor that created the item.

    - `ImageGenerationCall`

      An image generation request made by the model.

      - `id: string`

        The unique ID of the image generation call.

      - `result: string | null`

        The generated image encoded in base64.

      - `status: "in_progress" | "completed" | "generating" | "failed"`

        The status of the image generation call.

        - `"in_progress"`

        - `"completed"`

        - `"generating"`

        - `"failed"`

      - `type: "image_generation_call"`

        The type of the image generation call. Always `image_generation_call`.

        - `"image_generation_call"`

      - `agent?: Agent | null`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

    - `BetaResponseCodeInterpreterToolCall`

      A tool call to run code.

      - `id: string`

        The unique ID of the code interpreter tool call.

      - `code: string | null`

        The code to run, or null if not available.

      - `container_id: string`

        The ID of the container used to run the code.

      - `outputs: Array<Logs | Image> | null`

        The outputs generated by the code interpreter, such as logs or images.
        Can be null if no outputs are available.

        - `Logs`

          The logs output from the code interpreter.

          - `logs: string`

            The logs output from the code interpreter.

          - `type: "logs"`

            The type of the output. Always `logs`.

            - `"logs"`

        - `Image`

          The image output from the code interpreter.

          - `type: "image"`

            The type of the output. Always `image`.

            - `"image"`

          - `url: string`

            The URL of the image output from the code interpreter.

      - `status: "in_progress" | "completed" | "incomplete" | 2 more`

        The status of the code interpreter tool call. Valid values are `in_progress`, `completed`, `incomplete`, `interpreting`, and `failed`.

        - `"in_progress"`

        - `"completed"`

        - `"incomplete"`

        - `"interpreting"`

        - `"failed"`

      - `type: "code_interpreter_call"`

        The type of the code interpreter tool call. Always `code_interpreter_call`.

        - `"code_interpreter_call"`

      - `agent?: Agent | null`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

    - `LocalShellCall`

      A tool call to run a command on the local shell.

      - `id: string`

        The unique ID of the local shell call.

      - `action: Action`

        Execute a shell command on the server.

        - `command: Array<string>`

          The command to run.

        - `env: Record<string, string>`

          Environment variables to set for the command.

        - `type: "exec"`

          The type of the local shell action. Always `exec`.

          - `"exec"`

        - `timeout_ms?: number | null`

          Optional timeout in milliseconds for the command.

        - `user?: string | null`

          Optional user to run the command as.

        - `working_directory?: string | null`

          Optional working directory to run the command in.

      - `call_id: string`

        The unique ID of the local shell tool call generated by the model.

      - `status: "in_progress" | "completed" | "incomplete"`

        The status of the local shell call.

        - `"in_progress"`

        - `"completed"`

        - `"incomplete"`

      - `type: "local_shell_call"`

        The type of the local shell call. Always `local_shell_call`.

        - `"local_shell_call"`

      - `agent?: Agent | null`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

    - `LocalShellCallOutput`

      The output of a local shell tool call.

      - `id: string`

        The unique ID of the local shell tool call generated by the model.

      - `output: string`

        A JSON string of the output of the local shell tool call.

      - `type: "local_shell_call_output"`

        The type of the local shell tool call output. Always `local_shell_call_output`.

        - `"local_shell_call_output"`

      - `agent?: Agent | null`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

      - `status?: "in_progress" | "completed" | "incomplete" | null`

        The status of the item. One of `in_progress`, `completed`, or `incomplete`.

        - `"in_progress"`

        - `"completed"`

        - `"incomplete"`

    - `BetaResponseFunctionShellToolCall`

      A tool call that executes one or more shell commands in a managed environment.

      - `id: string`

        The unique ID of the shell tool call. Populated when this item is returned via API.

      - `action: Action`

        The shell commands and limits that describe how to run the tool call.

        - `commands: Array<string>`

        - `max_output_length: number | null`

          Optional maximum number of characters to return from each command.

        - `timeout_ms: number | null`

          Optional timeout in milliseconds for the commands.

      - `call_id: string`

        The unique ID of the shell tool call generated by the model.

      - `environment: BetaResponseLocalEnvironment | BetaResponseContainerReference | null`

        Represents the use of a local environment to perform shell actions.

        - `BetaResponseLocalEnvironment`

          Represents the use of a local environment to perform shell actions.

          - `type: "local"`

            The environment type. Always `local`.

            - `"local"`

        - `BetaResponseContainerReference`

          Represents a container created with /v1/containers.

          - `container_id: string`

          - `type: "container_reference"`

            The environment type. Always `container_reference`.

            - `"container_reference"`

      - `status: "in_progress" | "completed" | "incomplete"`

        The status of the shell call. One of `in_progress`, `completed`, or `incomplete`.

        - `"in_progress"`

        - `"completed"`

        - `"incomplete"`

      - `type: "shell_call"`

        The type of the item. Always `shell_call`.

        - `"shell_call"`

      - `agent?: Agent`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

      - `caller?: Direct | Program | null`

        The execution context that produced this tool call.

        - `Direct`

          - `type: "direct"`

            - `"direct"`

        - `Program`

          - `caller_id: string`

            The call ID of the program item that produced this tool call.

          - `type: "program"`

            - `"program"`

      - `created_by?: string`

        The ID of the entity that created this tool call.

    - `BetaResponseFunctionShellToolCallOutput`

      The output of a shell tool call that was emitted.

      - `id: string`

        The unique ID of the shell call output. Populated when this item is returned via API.

      - `call_id: string`

        The unique ID of the shell tool call generated by the model.

      - `max_output_length: number | null`

        The maximum length of the shell command output. This is generated by the model and should be passed back with the raw output.

      - `output: Array<Output>`

        An array of shell call output contents

        - `outcome: Timeout | Exit`

          Represents either an exit outcome (with an exit code) or a timeout outcome for a shell call output chunk.

          - `Timeout`

            Indicates that the shell call exceeded its configured time limit.

            - `type: "timeout"`

              The outcome type. Always `timeout`.

              - `"timeout"`

          - `Exit`

            Indicates that the shell commands finished and returned an exit code.

            - `exit_code: number`

              Exit code from the shell process.

            - `type: "exit"`

              The outcome type. Always `exit`.

              - `"exit"`

        - `stderr: string`

          The standard error output that was captured.

        - `stdout: string`

          The standard output that was captured.

        - `created_by?: string`

          The identifier of the actor that created the item.

      - `status: "in_progress" | "completed" | "incomplete"`

        The status of the shell call output. One of `in_progress`, `completed`, or `incomplete`.

        - `"in_progress"`

        - `"completed"`

        - `"incomplete"`

      - `type: "shell_call_output"`

        The type of the shell call output. Always `shell_call_output`.

        - `"shell_call_output"`

      - `agent?: Agent`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

      - `caller?: Direct | Program | null`

        The execution context that produced this tool call.

        - `Direct`

          - `type: "direct"`

            - `"direct"`

        - `Program`

          - `caller_id: string`

            The call ID of the program item that produced this tool call.

          - `type: "program"`

            - `"program"`

      - `created_by?: string`

        The identifier of the actor that created the item.

    - `BetaResponseApplyPatchToolCall`

      A tool call that applies file diffs by creating, deleting, or updating files.

      - `id: string`

        The unique ID of the apply patch tool call. Populated when this item is returned via API.

      - `call_id: string`

        The unique ID of the apply patch tool call generated by the model.

      - `operation: CreateFile | DeleteFile | UpdateFile`

        One of the create_file, delete_file, or update_file operations applied via apply_patch.

        - `CreateFile`

          Instruction describing how to create a file via the apply_patch tool.

          - `diff: string`

            Diff to apply.

          - `path: string`

            Path of the file to create.

          - `type: "create_file"`

            Create a new file with the provided diff.

            - `"create_file"`

        - `DeleteFile`

          Instruction describing how to delete a file via the apply_patch tool.

          - `path: string`

            Path of the file to delete.

          - `type: "delete_file"`

            Delete the specified file.

            - `"delete_file"`

        - `UpdateFile`

          Instruction describing how to update a file via the apply_patch tool.

          - `diff: string`

            Diff to apply.

          - `path: string`

            Path of the file to update.

          - `type: "update_file"`

            Update an existing file with the provided diff.

            - `"update_file"`

      - `status: "in_progress" | "completed"`

        The status of the apply patch tool call. One of `in_progress` or `completed`.

        - `"in_progress"`

        - `"completed"`

      - `type: "apply_patch_call"`

        The type of the item. Always `apply_patch_call`.

        - `"apply_patch_call"`

      - `agent?: Agent`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

      - `caller?: Direct | Program | null`

        The execution context that produced this tool call.

        - `Direct`

          - `type: "direct"`

            - `"direct"`

        - `Program`

          - `caller_id: string`

            The call ID of the program item that produced this tool call.

          - `type: "program"`

            - `"program"`

      - `created_by?: string`

        The ID of the entity that created this tool call.

    - `BetaResponseApplyPatchToolCallOutput`

      The output emitted by an apply patch tool call.

      - `id: string`

        The unique ID of the apply patch tool call output. Populated when this item is returned via API.

      - `call_id: string`

        The unique ID of the apply patch tool call generated by the model.

      - `status: "completed" | "failed"`

        The status of the apply patch tool call output. One of `completed` or `failed`.

        - `"completed"`

        - `"failed"`

      - `type: "apply_patch_call_output"`

        The type of the item. Always `apply_patch_call_output`.

        - `"apply_patch_call_output"`

      - `agent?: Agent`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

      - `caller?: Direct | Program | null`

        The execution context that produced this tool call.

        - `Direct`

          - `type: "direct"`

            - `"direct"`

        - `Program`

          - `caller_id: string`

            The call ID of the program item that produced this tool call.

          - `type: "program"`

            - `"program"`

      - `created_by?: string`

        The ID of the entity that created this tool call output.

      - `output?: string | null`

        Optional textual output returned by the apply patch tool.

    - `McpCall`

      An invocation of a tool on an MCP server.

      - `id: string`

        The unique ID of the tool call.

      - `arguments: string`

        A JSON string of the arguments passed to the tool.

      - `name: string`

        The name of the tool that was run.

      - `server_label: string`

        The label of the MCP server running the tool.

      - `type: "mcp_call"`

        The type of the item. Always `mcp_call`.

        - `"mcp_call"`

      - `agent?: Agent | null`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

      - `approval_request_id?: string | null`

        Unique identifier for the MCP tool call approval request.
        Include this value in a subsequent `mcp_approval_response` input to approve or reject the corresponding tool call.

      - `error?: BetaMcpToolCallError | null`

        The error from the tool call, if any.

        - `McpProtocolError`

          - `code: number`

          - `message: string`

          - `type: "mcp_protocol_error"`

            - `"mcp_protocol_error"`

        - `McpToolExecutionError`

          - `content: unknown`

          - `type: "mcp_tool_execution_error"`

            - `"mcp_tool_execution_error"`

        - `HTTPError`

          - `code: number`

          - `message: string`

          - `type: "http_error"`

            - `"http_error"`

      - `output?: string | null`

        The output from the tool call.

      - `status?: "in_progress" | "completed" | "incomplete" | 2 more`

        The status of the tool call. One of `in_progress`, `completed`, `incomplete`, `calling`, or `failed`.

        - `"in_progress"`

        - `"completed"`

        - `"incomplete"`

        - `"calling"`

        - `"failed"`

    - `McpListTools`

      A list of tools available on an MCP server.

      - `id: string`

        The unique ID of the list.

      - `server_label: string`

        The label of the MCP server.

      - `tools: Array<Tool>`

        The tools available on the server.

        - `input_schema: unknown`

          The JSON schema describing the tool's input.

        - `name: string`

          The name of the tool.

        - `annotations?: unknown`

          Additional annotations about the tool.

        - `description?: string | null`

          The description of the tool.

      - `type: "mcp_list_tools"`

        The type of the item. Always `mcp_list_tools`.

        - `"mcp_list_tools"`

      - `agent?: Agent | null`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

      - `error?: string | null`

        Error message if the server could not list tools.

    - `McpApprovalRequest`

      A request for human approval of a tool invocation.

      - `id: string`

        The unique ID of the approval request.

      - `arguments: string`

        A JSON string of arguments for the tool.

      - `name: string`

        The name of the tool to run.

      - `server_label: string`

        The label of the MCP server making the request.

      - `type: "mcp_approval_request"`

        The type of the item. Always `mcp_approval_request`.

        - `"mcp_approval_request"`

      - `agent?: Agent | null`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

    - `McpApprovalResponse`

      A response to an MCP approval request.

      - `id: string`

        The unique ID of the approval response

      - `approval_request_id: string`

        The ID of the approval request being answered.

      - `approve: boolean`

        Whether the request was approved.

      - `type: "mcp_approval_response"`

        The type of the item. Always `mcp_approval_response`.

        - `"mcp_approval_response"`

      - `agent?: Agent | null`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

      - `reason?: string | null`

        Optional reason for the decision.

    - `BetaResponseCustomToolCall`

      A call to a custom tool created by the model.

      - `call_id: string`

        An identifier used to map this custom tool call to a tool call output.

      - `input: string`

        The input for the custom tool call generated by the model.

      - `name: string`

        The name of the custom tool being called.

      - `type: "custom_tool_call"`

        The type of the custom tool call. Always `custom_tool_call`.

        - `"custom_tool_call"`

      - `id?: string`

        The unique ID of the custom tool call in the OpenAI platform.

      - `agent?: Agent | null`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

      - `caller?: Direct | Program | null`

        The execution context that produced this tool call.

        - `Direct`

          - `type: "direct"`

            - `"direct"`

        - `Program`

          - `caller_id: string`

            The call ID of the program item that produced this tool call.

          - `type: "program"`

            - `"program"`

      - `namespace?: string`

        The namespace of the custom tool being called.

    - `BetaResponseCustomToolCallOutputItem extends BetaResponseCustomToolCallOutput`

      The output of a custom tool call from your code, being sent back to the model.

      - `id: string`

        The unique ID of the custom tool call output item.

      - `status: "in_progress" | "completed" | "incomplete"`

        The status of the item. One of `in_progress`, `completed`, or
        `incomplete`. Populated when items are returned via API.

        - `"in_progress"`

        - `"completed"`

        - `"incomplete"`

      - `created_by?: string`

        The identifier of the actor that created the item.

  - `output_index: number`

    The index of the output item that was marked done.

  - `sequence_number: number`

    The sequence number of this event.

  - `type: "response.output_item.done"`

    The type of the event. Always `response.output_item.done`.

    - `"response.output_item.done"`

  - `agent?: Agent | null`

    The agent that owns this multi-agent streaming event.

    - `agent_name: string`

      The canonical name of the agent that produced this item.

### Beta Response Output Message

- `BetaResponseOutputMessage`

  An output message from the model.

  - `id: string`

    The unique ID of the output message.

  - `content: Array<BetaResponseOutputText | BetaResponseOutputRefusal>`

    The content of the output message.

    - `BetaResponseOutputText`

      A text output from the model.

      - `annotations: Array<FileCitation | URLCitation | ContainerFileCitation | FilePath>`

        The annotations of the text output.

        - `FileCitation`

          A citation to a file.

          - `file_id: string`

            The ID of the file.

          - `filename: string`

            The filename of the file cited.

          - `index: number`

            The index of the file in the list of files.

          - `type: "file_citation"`

            The type of the file citation. Always `file_citation`.

            - `"file_citation"`

        - `URLCitation`

          A citation for a web resource used to generate a model response.

          - `end_index: number`

            The index of the last character of the URL citation in the message.

          - `start_index: number`

            The index of the first character of the URL citation in the message.

          - `title: string`

            The title of the web resource.

          - `type: "url_citation"`

            The type of the URL citation. Always `url_citation`.

            - `"url_citation"`

          - `url: string`

            The URL of the web resource.

        - `ContainerFileCitation`

          A citation for a container file used to generate a model response.

          - `container_id: string`

            The ID of the container file.

          - `end_index: number`

            The index of the last character of the container file citation in the message.

          - `file_id: string`

            The ID of the file.

          - `filename: string`

            The filename of the container file cited.

          - `start_index: number`

            The index of the first character of the container file citation in the message.

          - `type: "container_file_citation"`

            The type of the container file citation. Always `container_file_citation`.

            - `"container_file_citation"`

        - `FilePath`

          A path to a file.

          - `file_id: string`

            The ID of the file.

          - `index: number`

            The index of the file in the list of files.

          - `type: "file_path"`

            The type of the file path. Always `file_path`.

            - `"file_path"`

      - `text: string`

        The text output from the model.

      - `type: "output_text"`

        The type of the output text. Always `output_text`.

        - `"output_text"`

      - `logprobs?: Array<Logprob>`

        - `token: string`

        - `bytes: Array<number>`

        - `logprob: number`

        - `top_logprobs: Array<TopLogprob>`

          - `token: string`

          - `bytes: Array<number>`

          - `logprob: number`

    - `BetaResponseOutputRefusal`

      A refusal from the model.

      - `refusal: string`

        The refusal explanation from the model.

      - `type: "refusal"`

        The type of the refusal. Always `refusal`.

        - `"refusal"`

  - `role: "assistant"`

    The role of the output message. Always `assistant`.

    - `"assistant"`

  - `status: "in_progress" | "completed" | "incomplete"`

    The status of the message input. One of `in_progress`, `completed`, or
    `incomplete`. Populated when input items are returned via API.

    - `"in_progress"`

    - `"completed"`

    - `"incomplete"`

  - `type: "message"`

    The type of the output message. Always `message`.

    - `"message"`

  - `agent?: Agent | null`

    The agent that produced this item.

    - `agent_name: string`

      The canonical name of the agent that produced this item.

  - `phase?: "commentary" | "final_answer" | null`

    Labels an `assistant` message as intermediate commentary (`commentary`) or the final answer (`final_answer`).
    For models like `gpt-5.3-codex` and beyond, when sending follow-up requests, preserve and resend
    phase on all assistant messages — dropping it can degrade performance. Not used for user messages.

    - `"commentary"`

    - `"final_answer"`

### Beta Response Output Refusal

- `BetaResponseOutputRefusal`

  A refusal from the model.

  - `refusal: string`

    The refusal explanation from the model.

  - `type: "refusal"`

    The type of the refusal. Always `refusal`.

    - `"refusal"`

### Beta Response Output Text

- `BetaResponseOutputText`

  A text output from the model.

  - `annotations: Array<FileCitation | URLCitation | ContainerFileCitation | FilePath>`

    The annotations of the text output.

    - `FileCitation`

      A citation to a file.

      - `file_id: string`

        The ID of the file.

      - `filename: string`

        The filename of the file cited.

      - `index: number`

        The index of the file in the list of files.

      - `type: "file_citation"`

        The type of the file citation. Always `file_citation`.

        - `"file_citation"`

    - `URLCitation`

      A citation for a web resource used to generate a model response.

      - `end_index: number`

        The index of the last character of the URL citation in the message.

      - `start_index: number`

        The index of the first character of the URL citation in the message.

      - `title: string`

        The title of the web resource.

      - `type: "url_citation"`

        The type of the URL citation. Always `url_citation`.

        - `"url_citation"`

      - `url: string`

        The URL of the web resource.

    - `ContainerFileCitation`

      A citation for a container file used to generate a model response.

      - `container_id: string`

        The ID of the container file.

      - `end_index: number`

        The index of the last character of the container file citation in the message.

      - `file_id: string`

        The ID of the file.

      - `filename: string`

        The filename of the container file cited.

      - `start_index: number`

        The index of the first character of the container file citation in the message.

      - `type: "container_file_citation"`

        The type of the container file citation. Always `container_file_citation`.

        - `"container_file_citation"`

    - `FilePath`

      A path to a file.

      - `file_id: string`

        The ID of the file.

      - `index: number`

        The index of the file in the list of files.

      - `type: "file_path"`

        The type of the file path. Always `file_path`.

        - `"file_path"`

  - `text: string`

    The text output from the model.

  - `type: "output_text"`

    The type of the output text. Always `output_text`.

    - `"output_text"`

  - `logprobs?: Array<Logprob>`

    - `token: string`

    - `bytes: Array<number>`

    - `logprob: number`

    - `top_logprobs: Array<TopLogprob>`

      - `token: string`

      - `bytes: Array<number>`

      - `logprob: number`

### Beta Response Output Text Annotation Added Event

- `BetaResponseOutputTextAnnotationAddedEvent`

  Emitted when an annotation is added to output text content.

  - `annotation: FileCitation | URLCitation | ContainerFileCitation | FilePath | null`

    An annotation that applies to a span of output text.

    - `FileCitation`

      A citation to a file.

      - `file_id: string`

        The ID of the file.

      - `filename: string`

        The filename of the file cited.

      - `index: number`

        The index of the file in the list of files.

      - `type: "file_citation"`

        The type of the file citation. Always `file_citation`.

        - `"file_citation"`

    - `URLCitation`

      A citation for a web resource used to generate a model response.

      - `end_index: number`

        The index of the last character of the URL citation in the message.

      - `start_index: number`

        The index of the first character of the URL citation in the message.

      - `title: string`

        The title of the web resource.

      - `type: "url_citation"`

        The type of the URL citation. Always `url_citation`.

        - `"url_citation"`

      - `url: string`

        The URL of the web resource.

    - `ContainerFileCitation`

      A citation for a container file used to generate a model response.

      - `container_id: string`

        The ID of the container file.

      - `end_index: number`

        The index of the last character of the container file citation in the message.

      - `file_id: string`

        The ID of the file.

      - `filename: string`

        The filename of the container file cited.

      - `start_index: number`

        The index of the first character of the container file citation in the message.

      - `type: "container_file_citation"`

        The type of the container file citation. Always `container_file_citation`.

        - `"container_file_citation"`

    - `FilePath`

      A path to a file.

      - `file_id: string`

        The ID of the file.

      - `index: number`

        The index of the file in the list of files.

      - `type: "file_path"`

        The type of the file path. Always `file_path`.

        - `"file_path"`

  - `annotation_index: number`

    The index of the annotation within the content part.

  - `content_index: number`

    The index of the content part within the output item.

  - `item_id: string`

    The unique identifier of the item to which the annotation is being added.

  - `output_index: number`

    The index of the output item in the response's output array.

  - `sequence_number: number`

    The sequence number of this event.

  - `type: "response.output_text.annotation.added"`

    The type of the event. Always 'response.output_text.annotation.added'.

    - `"response.output_text.annotation.added"`

  - `agent?: Agent | null`

    The agent that owns this multi-agent streaming event.

    - `agent_name: string`

      The canonical name of the agent that produced this item.

### Beta Response Prompt

- `BetaResponsePrompt`

  Reference to a prompt template and its variables.
  [Learn more](https://platform.openai.com/docs/guides/text?api-mode=responses#reusable-prompts).

  - `id: string`

    The unique identifier of the prompt template to use.

  - `variables?: Record<string, string | BetaResponseInputText | BetaResponseInputImage | BetaResponseInputFile> | null`

    Optional map of values to substitute in for variables in your
    prompt. The substitution values can either be strings, or other
    Response input types like images or files.

    - `string`

    - `BetaResponseInputText`

      A text input to the model.

      - `text: string`

        The text input to the model.

      - `type: "input_text"`

        The type of the input item. Always `input_text`.

        - `"input_text"`

      - `prompt_cache_breakpoint?: PromptCacheBreakpoint`

        Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.

        - `mode: "explicit"`

          The breakpoint mode. Always `explicit`.

          - `"explicit"`

    - `BetaResponseInputImage`

      An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision).

      - `detail: BetaImageDetail`

        The detail level of the image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`.

        - `"low"`

        - `"high"`

        - `"auto"`

        - `"original"`

      - `type: "input_image"`

        The type of the input item. Always `input_image`.

        - `"input_image"`

      - `file_id?: string | null`

        The ID of the file to be sent to the model.

      - `image_url?: string | null`

        The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.

      - `prompt_cache_breakpoint?: PromptCacheBreakpoint`

        Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.

        - `mode: "explicit"`

          The breakpoint mode. Always `explicit`.

          - `"explicit"`

    - `BetaResponseInputFile`

      A file input to the model.

      - `type: "input_file"`

        The type of the input item. Always `input_file`.

        - `"input_file"`

      - `detail?: "auto" | "low" | "high"`

        The detail level of the file to be sent to the model. Use `auto` to let the system select the detail level; for GPT-5.6 and later models, `auto` uses high-quality rendering, which may increase input token usage. Use `low` for lower-cost rendering, or `high` to render the file at higher quality. Defaults to `auto`.

        - `"auto"`

        - `"low"`

        - `"high"`

      - `file_data?: string`

        The content of the file to be sent to the model.

      - `file_id?: string | null`

        The ID of the file to be sent to the model.

      - `file_url?: string`

        The URL of the file to be sent to the model.

      - `filename?: string`

        The name of the file to be sent to the model.

      - `prompt_cache_breakpoint?: PromptCacheBreakpoint`

        Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.

        - `mode: "explicit"`

          The breakpoint mode. Always `explicit`.

          - `"explicit"`

  - `version?: string | null`

    Optional version of the prompt template.

### Beta Response Queued Event

- `BetaResponseQueuedEvent`

  Emitted when a response is queued and waiting to be processed.

  - `response: BetaResponse`

    The full response object that is queued.

    - `id: string`

      Unique identifier for this Response.

    - `created_at: number`

      Unix timestamp (in seconds) of when this Response was created.

    - `error: BetaResponseError | null`

      An error object returned when the model fails to generate a Response.

      - `code: "server_error" | "rate_limit_exceeded" | "invalid_prompt" | 17 more`

        The error code for the response.

        - `"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"`

      - `message: string`

        A human-readable description of the error.

    - `incomplete_details: IncompleteDetails | null`

      Details about why the response is incomplete.

      - `reason?: "max_output_tokens" | "content_filter"`

        The reason why the response is incomplete.

        - `"max_output_tokens"`

        - `"content_filter"`

    - `instructions: string | Array<BetaResponseInputItem> | null`

      A system (or developer) message inserted into the model's context.

      When using along with `previous_response_id`, the instructions from a previous
      response will not be carried over to the next response. This makes it simple
      to swap out system (or developer) messages in new responses.

      - `string`

      - `Array<BetaResponseInputItem>`

        - `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.

          - `content: string | BetaResponseInputMessageContentList`

            Text, image, or audio input to the model, used to generate a response.
            Can also contain previous assistant responses.

            - `string`

            - `BetaResponseInputMessageContentList = Array<BetaResponseInputContent>`

              A list of one or many input items to the model, containing different content
              types.

              - `BetaResponseInputText`

                A text input to the model.

                - `text: string`

                  The text input to the model.

                - `type: "input_text"`

                  The type of the input item. Always `input_text`.

                  - `"input_text"`

                - `prompt_cache_breakpoint?: PromptCacheBreakpoint`

                  Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.

                  - `mode: "explicit"`

                    The breakpoint mode. Always `explicit`.

                    - `"explicit"`

              - `BetaResponseInputImage`

                An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision).

                - `detail: BetaImageDetail`

                  The detail level of the image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`.

                  - `"low"`

                  - `"high"`

                  - `"auto"`

                  - `"original"`

                - `type: "input_image"`

                  The type of the input item. Always `input_image`.

                  - `"input_image"`

                - `file_id?: string | null`

                  The ID of the file to be sent to the model.

                - `image_url?: string | null`

                  The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.

                - `prompt_cache_breakpoint?: PromptCacheBreakpoint`

                  Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.

                  - `mode: "explicit"`

                    The breakpoint mode. Always `explicit`.

                    - `"explicit"`

              - `BetaResponseInputFile`

                A file input to the model.

                - `type: "input_file"`

                  The type of the input item. Always `input_file`.

                  - `"input_file"`

                - `detail?: "auto" | "low" | "high"`

                  The detail level of the file to be sent to the model. Use `auto` to let the system select the detail level; for GPT-5.6 and later models, `auto` uses high-quality rendering, which may increase input token usage. Use `low` for lower-cost rendering, or `high` to render the file at higher quality. Defaults to `auto`.

                  - `"auto"`

                  - `"low"`

                  - `"high"`

                - `file_data?: string`

                  The content of the file to be sent to the model.

                - `file_id?: string | null`

                  The ID of the file to be sent to the model.

                - `file_url?: string`

                  The URL of the file to be sent to the model.

                - `filename?: string`

                  The name of the file to be sent to the model.

                - `prompt_cache_breakpoint?: PromptCacheBreakpoint`

                  Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.

                  - `mode: "explicit"`

                    The breakpoint mode. Always `explicit`.

                    - `"explicit"`

          - `role: "user" | "assistant" | "system" | "developer"`

            The role of the message input. One of `user`, `assistant`, `system`, or
            `developer`.

            - `"user"`

            - `"assistant"`

            - `"system"`

            - `"developer"`

          - `phase?: "commentary" | "final_answer" | null`

            Labels an `assistant` message as intermediate commentary (`commentary`) or the final answer (`final_answer`).
            For models like `gpt-5.3-codex` and beyond, when sending follow-up requests, preserve and resend
            phase on all assistant messages — dropping it can degrade performance. Not used for user messages.

            - `"commentary"`

            - `"final_answer"`

          - `type?: "message"`

            The type of the message input. Always `message`.

            - `"message"`

        - `Message`

          A message input to the model with a role indicating instruction following
          hierarchy. Instructions given with the `developer` or `system` role take
          precedence over instructions given with the `user` role.

          - `content: BetaResponseInputMessageContentList`

            A list of one or many input items to the model, containing different content
            types.

          - `role: "user" | "system" | "developer"`

            The role of the message input. One of `user`, `system`, or `developer`.

            - `"user"`

            - `"system"`

            - `"developer"`

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

          - `status?: "in_progress" | "completed" | "incomplete"`

            The status of item. One of `in_progress`, `completed`, or
            `incomplete`. Populated when items are returned via API.

            - `"in_progress"`

            - `"completed"`

            - `"incomplete"`

          - `type?: "message"`

            The type of the message input. Always set to `message`.

            - `"message"`

        - `BetaResponseOutputMessage`

          An output message from the model.

          - `id: string`

            The unique ID of the output message.

          - `content: Array<BetaResponseOutputText | BetaResponseOutputRefusal>`

            The content of the output message.

            - `BetaResponseOutputText`

              A text output from the model.

              - `annotations: Array<FileCitation | URLCitation | ContainerFileCitation | FilePath>`

                The annotations of the text output.

                - `FileCitation`

                  A citation to a file.

                  - `file_id: string`

                    The ID of the file.

                  - `filename: string`

                    The filename of the file cited.

                  - `index: number`

                    The index of the file in the list of files.

                  - `type: "file_citation"`

                    The type of the file citation. Always `file_citation`.

                    - `"file_citation"`

                - `URLCitation`

                  A citation for a web resource used to generate a model response.

                  - `end_index: number`

                    The index of the last character of the URL citation in the message.

                  - `start_index: number`

                    The index of the first character of the URL citation in the message.

                  - `title: string`

                    The title of the web resource.

                  - `type: "url_citation"`

                    The type of the URL citation. Always `url_citation`.

                    - `"url_citation"`

                  - `url: string`

                    The URL of the web resource.

                - `ContainerFileCitation`

                  A citation for a container file used to generate a model response.

                  - `container_id: string`

                    The ID of the container file.

                  - `end_index: number`

                    The index of the last character of the container file citation in the message.

                  - `file_id: string`

                    The ID of the file.

                  - `filename: string`

                    The filename of the container file cited.

                  - `start_index: number`

                    The index of the first character of the container file citation in the message.

                  - `type: "container_file_citation"`

                    The type of the container file citation. Always `container_file_citation`.

                    - `"container_file_citation"`

                - `FilePath`

                  A path to a file.

                  - `file_id: string`

                    The ID of the file.

                  - `index: number`

                    The index of the file in the list of files.

                  - `type: "file_path"`

                    The type of the file path. Always `file_path`.

                    - `"file_path"`

              - `text: string`

                The text output from the model.

              - `type: "output_text"`

                The type of the output text. Always `output_text`.

                - `"output_text"`

              - `logprobs?: Array<Logprob>`

                - `token: string`

                - `bytes: Array<number>`

                - `logprob: number`

                - `top_logprobs: Array<TopLogprob>`

                  - `token: string`

                  - `bytes: Array<number>`

                  - `logprob: number`

            - `BetaResponseOutputRefusal`

              A refusal from the model.

              - `refusal: string`

                The refusal explanation from the model.

              - `type: "refusal"`

                The type of the refusal. Always `refusal`.

                - `"refusal"`

          - `role: "assistant"`

            The role of the output message. Always `assistant`.

            - `"assistant"`

          - `status: "in_progress" | "completed" | "incomplete"`

            The status of the message input. One of `in_progress`, `completed`, or
            `incomplete`. Populated when input items are returned via API.

            - `"in_progress"`

            - `"completed"`

            - `"incomplete"`

          - `type: "message"`

            The type of the output message. Always `message`.

            - `"message"`

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

          - `phase?: "commentary" | "final_answer" | null`

            Labels an `assistant` message as intermediate commentary (`commentary`) or the final answer (`final_answer`).
            For models like `gpt-5.3-codex` and beyond, when sending follow-up requests, preserve and resend
            phase on all assistant messages — dropping it can degrade performance. Not used for user messages.

            - `"commentary"`

            - `"final_answer"`

        - `BetaResponseFileSearchToolCall`

          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.

          - `id: string`

            The unique ID of the file search tool call.

          - `queries: Array<string>`

            The queries used to search for files.

          - `status: "in_progress" | "searching" | "completed" | 2 more`

            The status of the file search tool call. One of `in_progress`,
            `searching`, `incomplete` or `failed`,

            - `"in_progress"`

            - `"searching"`

            - `"completed"`

            - `"incomplete"`

            - `"failed"`

          - `type: "file_search_call"`

            The type of the file search tool call. Always `file_search_call`.

            - `"file_search_call"`

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

          - `results?: Array<Result> | null`

            The results of the file search tool call.

            - `attributes?: Record<string, string | number | boolean> | null`

              Set of 16 key-value pairs that can be attached to an object. This can be
              useful for storing additional information about the object in a structured
              format, and querying for objects via API or the dashboard. Keys are strings
              with a maximum length of 64 characters. Values are strings with a maximum
              length of 512 characters, booleans, or numbers.

              - `string`

              - `number`

              - `boolean`

            - `file_id?: string`

              The unique ID of the file.

            - `filename?: string`

              The name of the file.

            - `score?: number`

              The relevance score of the file - a value between 0 and 1.

            - `text?: string`

              The text that was retrieved from the file.

        - `BetaResponseComputerToolCall`

          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.

          - `id: string`

            The unique ID of the computer call.

          - `call_id: string`

            An identifier used when responding to the tool call with output.

          - `pending_safety_checks: Array<PendingSafetyCheck>`

            The pending safety checks for the computer call.

            - `id: string`

              The ID of the pending safety check.

            - `code?: string | null`

              The type of the pending safety check.

            - `message?: string | null`

              Details about the pending safety check.

          - `status: "in_progress" | "completed" | "incomplete"`

            The status of the item. One of `in_progress`, `completed`, or
            `incomplete`. Populated when items are returned via API.

            - `"in_progress"`

            - `"completed"`

            - `"incomplete"`

          - `type: "computer_call"`

            The type of the computer call. Always `computer_call`.

            - `"computer_call"`

          - `action?: BetaComputerAction`

            A click action.

            - `Click`

              A click action.

              - `button: "left" | "right" | "wheel" | 2 more`

                Indicates which mouse button was pressed during the click. One of `left`, `right`, `wheel`, `back`, or `forward`.

                - `"left"`

                - `"right"`

                - `"wheel"`

                - `"back"`

                - `"forward"`

              - `type: "click"`

                Specifies the event type. For a click action, this property is always `click`.

                - `"click"`

              - `x: number`

                The x-coordinate where the click occurred.

              - `y: number`

                The y-coordinate where the click occurred.

              - `keys?: Array<string> | null`

                The keys being held while clicking.

            - `DoubleClick`

              A double click action.

              - `keys: Array<string> | null`

                The keys being held while double-clicking.

              - `type: "double_click"`

                Specifies the event type. For a double click action, this property is always set to `double_click`.

                - `"double_click"`

              - `x: number`

                The x-coordinate where the double click occurred.

              - `y: number`

                The y-coordinate where the double click occurred.

            - `Drag`

              A drag action.

              - `path: Array<Path>`

                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 }
                ]
                ```

                - `x: number`

                  The x-coordinate.

                - `y: number`

                  The y-coordinate.

              - `type: "drag"`

                Specifies the event type. For a drag action, this property is always set to `drag`.

                - `"drag"`

              - `keys?: Array<string> | null`

                The keys being held while dragging the mouse.

            - `Keypress`

              A collection of keypresses the model would like to perform.

              - `keys: Array<string>`

                The combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key.

              - `type: "keypress"`

                Specifies the event type. For a keypress action, this property is always set to `keypress`.

                - `"keypress"`

            - `Move`

              A mouse move action.

              - `type: "move"`

                Specifies the event type. For a move action, this property is always set to `move`.

                - `"move"`

              - `x: number`

                The x-coordinate to move to.

              - `y: number`

                The y-coordinate to move to.

              - `keys?: Array<string> | null`

                The keys being held while moving the mouse.

            - `Screenshot`

              A screenshot action.

              - `type: "screenshot"`

                Specifies the event type. For a screenshot action, this property is always set to `screenshot`.

                - `"screenshot"`

            - `Scroll`

              A scroll action.

              - `scroll_x: number`

                The horizontal scroll distance.

              - `scroll_y: number`

                The vertical scroll distance.

              - `type: "scroll"`

                Specifies the event type. For a scroll action, this property is always set to `scroll`.

                - `"scroll"`

              - `x: number`

                The x-coordinate where the scroll occurred.

              - `y: number`

                The y-coordinate where the scroll occurred.

              - `keys?: Array<string> | null`

                The keys being held while scrolling.

            - `Type`

              An action to type in text.

              - `text: string`

                The text to type.

              - `type: "type"`

                Specifies the event type. For a type action, this property is always set to `type`.

                - `"type"`

            - `Wait`

              A wait action.

              - `type: "wait"`

                Specifies the event type. For a wait action, this property is always set to `wait`.

                - `"wait"`

          - `actions?: BetaComputerActionList`

            Flattened batched actions for `computer_use`. Each action includes an
            `type` discriminator and action-specific fields.

            - `Click`

              A click action.

            - `DoubleClick`

              A double click action.

            - `Drag`

              A drag action.

            - `Keypress`

              A collection of keypresses the model would like to perform.

            - `Move`

              A mouse move action.

            - `Screenshot`

              A screenshot action.

            - `Scroll`

              A scroll action.

            - `Type`

              An action to type in text.

            - `Wait`

              A wait action.

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

        - `ComputerCallOutput`

          The output of a computer tool call.

          - `call_id: string`

            The ID of the computer tool call that produced the output.

          - `output: BetaResponseComputerToolCallOutputScreenshot`

            A computer screenshot image used with the computer use tool.

            - `type: "computer_screenshot"`

              Specifies the event type. For a computer screenshot, this property is
              always set to `computer_screenshot`.

              - `"computer_screenshot"`

            - `file_id?: string`

              The identifier of an uploaded file that contains the screenshot.

            - `image_url?: string`

              The URL of the screenshot image.

          - `type: "computer_call_output"`

            The type of the computer tool call output. Always `computer_call_output`.

            - `"computer_call_output"`

          - `id?: string | null`

            The ID of the computer tool call output.

          - `acknowledged_safety_checks?: Array<AcknowledgedSafetyCheck> | null`

            The safety checks reported by the API that have been acknowledged by the developer.

            - `id: string`

              The ID of the pending safety check.

            - `code?: string | null`

              The type of the pending safety check.

            - `message?: string | null`

              Details about the pending safety check.

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

          - `status?: "in_progress" | "completed" | "incomplete" | null`

            The status of the message input. One of `in_progress`, `completed`, or `incomplete`. Populated when input items are returned via API.

            - `"in_progress"`

            - `"completed"`

            - `"incomplete"`

        - `BetaResponseFunctionWebSearch`

          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.

          - `id: string`

            The unique ID of the web search tool call.

          - `action: Search | OpenPage | FindInPage`

            An object describing the specific action taken in this web search call.
            Includes details on how the model used the web (search, open_page, find_in_page).

            - `Search`

              Action type "search" - Performs a web search query.

              - `type: "search"`

                The action type.

                - `"search"`

              - `queries?: Array<string>`

                The search queries.

              - `query?: string`

                The search query.

              - `sources?: Array<Source>`

                The sources used in the search.

                - `type: "url"`

                  The type of source. Always `url`.

                  - `"url"`

                - `url: string`

                  The URL of the source.

            - `OpenPage`

              Action type "open_page" - Opens a specific URL from search results.

              - `type: "open_page"`

                The action type.

                - `"open_page"`

              - `url?: string | null`

                The URL opened by the model.

            - `FindInPage`

              Action type "find_in_page": Searches for a pattern within a loaded page.

              - `pattern: string`

                The pattern or text to search for within the page.

              - `type: "find_in_page"`

                The action type.

                - `"find_in_page"`

              - `url: string`

                The URL of the page searched for the pattern.

          - `status: "in_progress" | "searching" | "completed" | "failed"`

            The status of the web search tool call.

            - `"in_progress"`

            - `"searching"`

            - `"completed"`

            - `"failed"`

          - `type: "web_search_call"`

            The type of the web search tool call. Always `web_search_call`.

            - `"web_search_call"`

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

        - `BetaResponseFunctionToolCall`

          A tool call to run a function. See the
          [function calling guide](https://platform.openai.com/docs/guides/function-calling) for more information.

          - `arguments: string`

            A JSON string of the arguments to pass to the function.

          - `call_id: string`

            The unique ID of the function tool call generated by the model.

          - `name: string`

            The name of the function to run.

          - `type: "function_call"`

            The type of the function tool call. Always `function_call`.

            - `"function_call"`

          - `id?: string`

            The unique ID of the function tool call.

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

          - `caller?: Direct | Program | null`

            The execution context that produced this tool call.

            - `Direct`

              - `type: "direct"`

                - `"direct"`

            - `Program`

              - `caller_id: string`

                The call ID of the program item that produced this tool call.

              - `type: "program"`

                - `"program"`

          - `namespace?: string`

            The namespace of the function to run.

          - `status?: "in_progress" | "completed" | "incomplete"`

            The status of the item. One of `in_progress`, `completed`, or
            `incomplete`. Populated when items are returned via API.

            - `"in_progress"`

            - `"completed"`

            - `"incomplete"`

        - `FunctionCallOutput`

          The output of a function tool call.

          - `call_id: string`

            The unique ID of the function tool call generated by the model.

          - `output: string | BetaResponseFunctionCallOutputItemList`

            Text, image, or file output of the function tool call.

            - `string`

            - `BetaResponseFunctionCallOutputItemList = Array<BetaResponseFunctionCallOutputItem>`

              An array of content outputs (text, image, file) for the function tool call.

              - `BetaResponseInputTextContent`

                A text input to the model.

                - `text: string`

                  The text input to the model.

                - `type: "input_text"`

                  The type of the input item. Always `input_text`.

                  - `"input_text"`

                - `prompt_cache_breakpoint?: PromptCacheBreakpoint | null`

                  Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.

                  - `mode: "explicit"`

                    The breakpoint mode. Always `explicit`.

                    - `"explicit"`

              - `BetaResponseInputImageContent`

                An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision)

                - `type: "input_image"`

                  The type of the input item. Always `input_image`.

                  - `"input_image"`

                - `detail?: BetaImageDetail | null`

                  The detail level of the image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`.

                - `file_id?: string | null`

                  The ID of the file to be sent to the model.

                - `image_url?: string | null`

                  The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.

                - `prompt_cache_breakpoint?: PromptCacheBreakpoint | null`

                  Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.

                  - `mode: "explicit"`

                    The breakpoint mode. Always `explicit`.

                    - `"explicit"`

              - `BetaResponseInputFileContent`

                A file input to the model.

                - `type: "input_file"`

                  The type of the input item. Always `input_file`.

                  - `"input_file"`

                - `detail?: "auto" | "low" | "high"`

                  The detail level of the file to be sent to the model. Use `auto` to let the system select the detail level; for GPT-5.6 and later models, `auto` uses high-quality rendering, which may increase input token usage. Use `low` for lower-cost rendering, or `high` to render the file at higher quality. Defaults to `auto`.

                  - `"auto"`

                  - `"low"`

                  - `"high"`

                - `file_data?: string | null`

                  The base64-encoded data of the file to be sent to the model.

                - `file_id?: string | null`

                  The ID of the file to be sent to the model.

                - `file_url?: string | null`

                  The URL of the file to be sent to the model.

                - `filename?: string | null`

                  The name of the file to be sent to the model.

                - `prompt_cache_breakpoint?: PromptCacheBreakpoint | null`

                  Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.

                  - `mode: "explicit"`

                    The breakpoint mode. Always `explicit`.

                    - `"explicit"`

          - `type: "function_call_output"`

            The type of the function tool call output. Always `function_call_output`.

            - `"function_call_output"`

          - `id?: string | null`

            The unique ID of the function tool call output. Populated when this item is returned via API.

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

          - `caller?: Direct | Program | null`

            The execution context that produced this tool call.

            - `Direct`

              - `type: "direct"`

                The caller type. Always `direct`.

                - `"direct"`

            - `Program`

              - `caller_id: string`

                The call ID of the program item that produced this tool call.

              - `type: "program"`

                The caller type. Always `program`.

                - `"program"`

          - `name?: string | null`

            The name of the tool that produced the output.

          - `namespace?: string | null`

            The namespace of the tool that produced the output.

          - `status?: "in_progress" | "completed" | "incomplete" | null`

            The status of the item. One of `in_progress`, `completed`, or `incomplete`. Populated when items are returned via API.

            - `"in_progress"`

            - `"completed"`

            - `"incomplete"`

        - `AgentMessage`

          A message routed between agents.

          - `author: string`

            The sending agent identity.

          - `content: Array<BetaResponseInputTextContent | BetaResponseInputImageContent | EncryptedContent>`

            Plaintext, image, or encrypted content sent between agents.

            - `BetaResponseInputTextContent`

              A text input to the model.

            - `BetaResponseInputImageContent`

              An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision)

            - `EncryptedContent`

              Opaque encrypted content that Responses API decrypts inside trusted model execution.

              - `encrypted_content: string`

                Opaque encrypted content.

              - `type: "encrypted_content"`

                The type of the input item. Always `encrypted_content`.

                - `"encrypted_content"`

          - `recipient: string`

            The destination agent identity.

          - `type: "agent_message"`

            The item type. Always `agent_message`.

            - `"agent_message"`

          - `id?: string | null`

            The unique ID of this agent message item.

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

        - `MultiAgentCall`

          - `action: "spawn_agent" | "interrupt_agent" | "list_agents" | 3 more`

            The multi-agent action that was executed.

            - `"spawn_agent"`

            - `"interrupt_agent"`

            - `"list_agents"`

            - `"send_message"`

            - `"followup_task"`

            - `"wait_agent"`

          - `arguments: string`

            The action arguments as a JSON string.

          - `call_id: string`

            The unique ID linking this call to its output.

          - `type: "multi_agent_call"`

            The item type. Always `multi_agent_call`.

            - `"multi_agent_call"`

          - `id?: string | null`

            The unique ID of this multi-agent call.

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

        - `MultiAgentCallOutput`

          - `action: "spawn_agent" | "interrupt_agent" | "list_agents" | 3 more`

            The multi-agent action that produced this result.

            - `"spawn_agent"`

            - `"interrupt_agent"`

            - `"list_agents"`

            - `"send_message"`

            - `"followup_task"`

            - `"wait_agent"`

          - `call_id: string`

            The unique ID of the multi-agent call.

          - `output: Array<Output>`

            Text output returned by the multi-agent action.

            - `text: string`

              The text content.

            - `type: "output_text"`

              The content type. Always `output_text`.

              - `"output_text"`

            - `annotations?: Array<FileCitation | URLCitation | ContainerFileCitation>`

              Citations associated with the text content.

              - `FileCitation`

                - `file_id: string`

                  The ID of the file.

                - `filename: string`

                  The filename of the file cited.

                - `index: number`

                  The index of the file in the list of files.

                - `type: "file_citation"`

                  The citation type. Always `file_citation`.

                  - `"file_citation"`

              - `URLCitation`

                - `end_index: number`

                  The index of the last character of the citation in the message.

                - `start_index: number`

                  The index of the first character of the citation in the message.

                - `title: string`

                  The title of the cited resource.

                - `type: "url_citation"`

                  The citation type. Always `url_citation`.

                  - `"url_citation"`

                - `url: string`

                  The URL of the cited resource.

              - `ContainerFileCitation`

                - `container_id: string`

                  The ID of the container.

                - `end_index: number`

                  The index of the last character of the citation in the message.

                - `file_id: string`

                  The ID of the container file.

                - `filename: string`

                  The filename of the container file cited.

                - `start_index: number`

                  The index of the first character of the citation in the message.

                - `type: "container_file_citation"`

                  The citation type. Always `container_file_citation`.

                  - `"container_file_citation"`

          - `type: "multi_agent_call_output"`

            The item type. Always `multi_agent_call_output`.

            - `"multi_agent_call_output"`

          - `id?: string | null`

            The unique ID of this multi-agent call output.

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

        - `ToolSearchCall`

          - `arguments: unknown`

            The arguments supplied to the tool search call.

          - `type: "tool_search_call"`

            The item type. Always `tool_search_call`.

            - `"tool_search_call"`

          - `id?: string | null`

            The unique ID of this tool search call.

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

          - `call_id?: string | null`

            The unique ID of the tool search call generated by the model.

          - `execution?: "server" | "client"`

            Whether tool search was executed by the server or by the client.

            - `"server"`

            - `"client"`

          - `status?: "in_progress" | "completed" | "incomplete" | null`

            The status of the tool search call.

            - `"in_progress"`

            - `"completed"`

            - `"incomplete"`

        - `BetaResponseToolSearchOutputItemParam`

          - `tools: Array<BetaTool>`

            The loaded tool definitions returned by the tool search output.

            - `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).

              - `name: string`

                The name of the function to call.

              - `parameters: Record<string, unknown> | null`

                A JSON schema object describing the parameters of the function.

              - `strict: boolean | null`

                Whether strict parameter validation is enforced for this function tool.

              - `type: "function"`

                The type of the function tool. Always `function`.

                - `"function"`

              - `allowed_callers?: Array<"direct" | "programmatic"> | null`

                The tool invocation context(s).

                - `"direct"`

                - `"programmatic"`

              - `defer_loading?: boolean`

                Whether this function is deferred and loaded via tool search.

              - `description?: string | null`

                A description of the function. Used by the model to determine whether or not to call the function.

              - `output_schema?: Record<string, unknown> | null`

                A JSON schema object describing the JSON value encoded in string outputs for this function.

            - `BetaFileSearchTool`

              A tool that searches for relevant content from uploaded files. Learn more about the [file search tool](https://platform.openai.com/docs/guides/tools-file-search).

              - `type: "file_search"`

                The type of the file search tool. Always `file_search`.

                - `"file_search"`

              - `vector_store_ids: Array<string>`

                The IDs of the vector stores to search.

              - `filters?: ComparisonFilter | CompoundFilter | null`

                A filter to apply.

                - `ComparisonFilter`

                  A filter used to compare a specified attribute key to a given value using a defined comparison operation.

                  - `key: string`

                    The key to compare against the value.

                  - `type: "eq" | "ne" | "gt" | 5 more`

                    Specifies the comparison operator: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`, `in`, `nin`.

                    - `eq`: equals
                    - `ne`: not equal
                    - `gt`: greater than
                    - `gte`: greater than or equal
                    - `lt`: less than
                    - `lte`: less than or equal
                    - `in`: in
                    - `nin`: not in

                    - `"eq"`

                    - `"ne"`

                    - `"gt"`

                    - `"gte"`

                    - `"lt"`

                    - `"lte"`

                    - `"in"`

                    - `"nin"`

                  - `value: string | number | boolean | Array<string | number>`

                    The value to compare against the attribute key; supports string, number, or boolean types.

                    - `string`

                    - `number`

                    - `boolean`

                    - `Array<string | number>`

                      - `string`

                      - `number`

                - `CompoundFilter`

                  Combine multiple filters using `and` or `or`.

                  - `filters: Array<ComparisonFilter | unknown>`

                    Array of filters to combine. Items can be `ComparisonFilter` or `CompoundFilter`.

                    - `ComparisonFilter`

                      A filter used to compare a specified attribute key to a given value using a defined comparison operation.

                      - `key: string`

                        The key to compare against the value.

                      - `type: "eq" | "ne" | "gt" | 5 more`

                        Specifies the comparison operator: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`, `in`, `nin`.

                        - `eq`: equals
                        - `ne`: not equal
                        - `gt`: greater than
                        - `gte`: greater than or equal
                        - `lt`: less than
                        - `lte`: less than or equal
                        - `in`: in
                        - `nin`: not in

                        - `"eq"`

                        - `"ne"`

                        - `"gt"`

                        - `"gte"`

                        - `"lt"`

                        - `"lte"`

                        - `"in"`

                        - `"nin"`

                      - `value: string | number | boolean | Array<string | number>`

                        The value to compare against the attribute key; supports string, number, or boolean types.

                        - `string`

                        - `number`

                        - `boolean`

                        - `Array<string | number>`

                          - `string`

                          - `number`

                    - `unknown`

                  - `type: "and" | "or"`

                    Type of operation: `and` or `or`.

                    - `"and"`

                    - `"or"`

              - `max_num_results?: number`

                The maximum number of results to return. This number should be between 1 and 50 inclusive.

              - `ranking_options?: RankingOptions`

                Ranking options for search.

                - `hybrid_search?: HybridSearch`

                  Weights that control how reciprocal rank fusion balances semantic embedding matches versus sparse keyword matches when hybrid search is enabled.

                  - `embedding_weight: number`

                    The weight of the embedding in the reciprocal ranking fusion.

                  - `text_weight: number`

                    The weight of the text in the reciprocal ranking fusion.

                - `ranker?: "auto" | "default-2024-11-15"`

                  The ranker to use for the file search.

                  - `"auto"`

                  - `"default-2024-11-15"`

                - `score_threshold?: number`

                  The score threshold for the file search, a number between 0 and 1. Numbers closer to 1 will attempt to return only the most relevant results, but may return fewer results.

            - `BetaComputerTool`

              A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use).

              - `type: "computer"`

                The type of the computer tool. Always `computer`.

                - `"computer"`

            - `BetaComputerUsePreviewTool`

              A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use).

              - `display_height: number`

                The height of the computer display.

              - `display_width: number`

                The width of the computer display.

              - `environment: "windows" | "mac" | "linux" | 2 more`

                The type of computer environment to control.

                - `"windows"`

                - `"mac"`

                - `"linux"`

                - `"ubuntu"`

                - `"browser"`

              - `type: "computer_use_preview"`

                The type of the computer use tool. Always `computer_use_preview`.

                - `"computer_use_preview"`

            - `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"`

                The type of the web search tool. One of `web_search` or `web_search_2025_08_26`.

                - `"web_search"`

                - `"web_search_2025_08_26"`

              - `external_web_access?: boolean`

                Allow live internet access for web search. Defaults to true when omitted. When false, the web search tool runs in offline/cache-only mode and will not fetch new external content.

              - `filters?: Filters | null`

                Filters for the search.

                - `allowed_domains?: Array<string> | null`

                  Allowed domains for the search. If not provided, all domains are allowed.
                  Subdomains of the provided domains are allowed as well.

                  Example: `["pubmed.ncbi.nlm.nih.gov"]`

              - `search_context_size?: "low" | "medium" | "high"`

                High level guidance for the amount of context window space to use for the search. One of `low`, `medium`, or `high`. `medium` is the default.

                - `"low"`

                - `"medium"`

                - `"high"`

              - `user_location?: UserLocation | null`

                The approximate location of the user.

                - `city?: string | null`

                  Free text input for the city of the user, e.g. `San Francisco`.

                - `country?: string | null`

                  The two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of the user, e.g. `US`.

                - `region?: string | null`

                  Free text input for the region of the user, e.g. `California`.

                - `timezone?: string | null`

                  The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of the user, e.g. `America/Los_Angeles`.

                - `type?: "approximate"`

                  The type of location approximation. Always `approximate`.

                  - `"approximate"`

            - `Mcp`

              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).

              - `server_label: string`

                A label for this MCP server, used to identify it in tool calls.

              - `type: "mcp"`

                The type of the MCP tool. Always `mcp`.

                - `"mcp"`

              - `allowed_callers?: Array<"direct" | "programmatic"> | null`

                The tool invocation context(s).

                - `"direct"`

                - `"programmatic"`

              - `allowed_tools?: Array<string> | McpToolFilter | null`

                List of allowed tool names or a filter object.

                - `Array<string>`

                - `McpToolFilter`

                  A filter object to specify which tools are allowed.

                  - `read_only?: boolean`

                    Indicates whether or not a tool modifies data or is read-only. If an
                    MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint),
                    it will match this filter.

                  - `tool_names?: Array<string>`

                    List of allowed tool names.

              - `authorization?: string`

                An OAuth access token that can be used with a remote MCP server, either
                with a custom MCP server URL or a service connector. Your application
                must handle the OAuth authorization flow and provide the token here.

              - `connector_id?: "connector_dropbox" | "connector_gmail" | "connector_googlecalendar" | 5 more`

                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`

                - `"connector_dropbox"`

                - `"connector_gmail"`

                - `"connector_googlecalendar"`

                - `"connector_googledrive"`

                - `"connector_microsoftteams"`

                - `"connector_outlookcalendar"`

                - `"connector_outlookemail"`

                - `"connector_sharepoint"`

              - `defer_loading?: boolean`

                Whether this MCP tool is deferred and discovered via tool search.

              - `headers?: Record<string, string> | null`

                Optional HTTP headers to send to the MCP server. Use for authentication
                or other purposes.

              - `require_approval?: McpToolApprovalFilter | "always" | "never" | null`

                Specify which of the MCP server's tools require approval.

                - `McpToolApprovalFilter`

                  Specify which of the MCP server's tools require approval. Can be
                  `always`, `never`, or a filter object associated with tools
                  that require approval.

                  - `always?: Always`

                    A filter object to specify which tools are allowed.

                    - `read_only?: boolean`

                      Indicates whether or not a tool modifies data or is read-only. If an
                      MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint),
                      it will match this filter.

                    - `tool_names?: Array<string>`

                      List of allowed tool names.

                  - `never?: Never`

                    A filter object to specify which tools are allowed.

                    - `read_only?: boolean`

                      Indicates whether or not a tool modifies data or is read-only. If an
                      MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint),
                      it will match this filter.

                    - `tool_names?: Array<string>`

                      List of allowed tool names.

                - `"always" | "never"`

                  - `"always"`

                  - `"never"`

              - `server_description?: string`

                Optional description of the MCP server, used to provide more context.

              - `server_url?: string`

                The URL for the MCP server. One of `server_url`, `connector_id`, or
                `tunnel_id` must be provided.

              - `tunnel_id?: string`

                The Secure MCP Tunnel ID to use instead of a direct server URL. One of
                `server_url`, `connector_id`, or `tunnel_id` must be provided.

            - `CodeInterpreter`

              A tool that runs Python code to help generate a response to a prompt.

              - `container: string | CodeInterpreterToolAuto`

                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`

                - `CodeInterpreterToolAuto`

                  Configuration for a code interpreter container. Optionally specify the IDs of the files to run the code on.

                  - `type: "auto"`

                    Always `auto`.

                    - `"auto"`

                  - `file_ids?: Array<string>`

                    An optional list of uploaded files to make available to your code.

                  - `memory_limit?: "1g" | "4g" | "16g" | "64g" | null`

                    The memory limit for the code interpreter container.

                    - `"1g"`

                    - `"4g"`

                    - `"16g"`

                    - `"64g"`

                  - `network_policy?: BetaContainerNetworkPolicyDisabled | BetaContainerNetworkPolicyAllowlist`

                    Network access policy for the container.

                    - `BetaContainerNetworkPolicyDisabled`

                      - `type: "disabled"`

                        Disable outbound network access. Always `disabled`.

                        - `"disabled"`

                    - `BetaContainerNetworkPolicyAllowlist`

                      - `allowed_domains: Array<string>`

                        A list of allowed domains when type is `allowlist`.

                      - `type: "allowlist"`

                        Allow outbound network access only to specified domains. Always `allowlist`.

                        - `"allowlist"`

                      - `domain_secrets?: Array<BetaContainerNetworkPolicyDomainSecret>`

                        Optional domain-scoped secrets for allowlisted domains.

                        - `domain: string`

                          The domain associated with the secret.

                        - `name: string`

                          The name of the secret to inject for the domain.

                        - `value: string`

                          The secret value to inject for the domain.

              - `type: "code_interpreter"`

                The type of the code interpreter tool. Always `code_interpreter`.

                - `"code_interpreter"`

              - `allowed_callers?: Array<"direct" | "programmatic"> | null`

                The tool invocation context(s).

                - `"direct"`

                - `"programmatic"`

            - `ProgrammaticToolCalling`

              - `type: "programmatic_tool_calling"`

                The type of the tool. Always `programmatic_tool_calling`.

                - `"programmatic_tool_calling"`

            - `ImageGeneration`

              A tool that generates images using the GPT image models.

              - `type: "image_generation"`

                The type of the image generation tool. Always `image_generation`.

                - `"image_generation"`

              - `action?: "generate" | "edit" | "auto"`

                Whether to generate a new image or edit an existing image. Default: `auto`.

                - `"generate"`

                - `"edit"`

                - `"auto"`

              - `background?: "transparent" | "opaque" | "auto"`

                Allows to set transparency for the background of the generated image(s).
                Must be one of `transparent`, `opaque`, or `auto` (default value). When
                `auto` is used, the model will automatically determine the best
                background for the image.

                Transparent backgrounds are available for supported GPT Image models.
                For `gpt-image-2` and `gpt-image-2-2026-04-21`, this support is in
                preview. When using `transparent`, set the output format to `png` or
                `webp`.

                - `"transparent"`

                - `"opaque"`

                - `"auto"`

              - `input_fidelity?: "high" | "low" | null`

                Control how much effort the model will exert to match the style and features, especially facial features, of input images. This parameter is only supported for `gpt-image-1` and `gpt-image-1.5` and later models, unsupported for `gpt-image-1-mini`. Supports `high` and `low`. Defaults to `low`.

                - `"high"`

                - `"low"`

              - `input_image_mask?: InputImageMask`

                Optional mask for inpainting. Contains `image_url`
                (string, optional) and `file_id` (string, optional).

                - `file_id?: string`

                  File ID for the mask image.

                - `image_url?: string`

                  Base64-encoded mask image.

              - `model?: (string & {}) | "gpt-image-1" | "gpt-image-1-mini" | "gpt-image-2" | 3 more`

                The image generation model to use. One of `gpt-image-1`,
                `gpt-image-1-mini`, `gpt-image-1.5`, `gpt-image-2`,
                `gpt-image-2-2026-04-21`, or `chatgpt-image-latest`. Default:
                `gpt-image-1`.

                - `(string & {})`

                - `"gpt-image-1" | "gpt-image-1-mini" | "gpt-image-2" | 3 more`

                  - `"gpt-image-1"`

                  - `"gpt-image-1-mini"`

                  - `"gpt-image-2"`

                  - `"gpt-image-2-2026-04-21"`

                  - `"gpt-image-1.5"`

                  - `"chatgpt-image-latest"`

              - `moderation?: "auto" | "low"`

                Moderation level for the generated image. Default: `auto`.

                - `"auto"`

                - `"low"`

              - `output_compression?: number`

                Compression level for the output image. Default: 100.

              - `output_format?: "png" | "webp" | "jpeg"`

                The output format of the generated image. One of `png`, `webp`, or
                `jpeg`. Default: `png`.

                - `"png"`

                - `"webp"`

                - `"jpeg"`

              - `partial_images?: number`

                Number of partial images to generate in streaming mode, from 0 (default value) to 3.

              - `quality?: "low" | "medium" | "high" | "auto"`

                The quality of the generated image. One of `low`, `medium`, `high`,
                or `auto`. Default: `auto`.

                - `"low"`

                - `"medium"`

                - `"high"`

                - `"auto"`

              - `size?: (string & {}) | "1024x1024" | "1024x1536" | "1536x1024" | "auto"`

                The size of the generated images. For `gpt-image-2` and `gpt-image-2-2026-04-21`, arbitrary resolutions are supported as `WIDTHxHEIGHT` strings, for example `1536x864`. Width and height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above `2560x1440` are experimental, and the maximum supported resolution is `3840x2160`. The requested size must also satisfy the model's current pixel and edge limits. The standard sizes `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models; `auto` is supported for models that allow automatic sizing. For `dall-e-2`, use one of `256x256`, `512x512`, or `1024x1024`. For `dall-e-3`, use one of `1024x1024`, `1792x1024`, or `1024x1792`.

                - `(string & {})`

                - `"1024x1024" | "1024x1536" | "1536x1024" | "auto"`

                  - `"1024x1024"`

                  - `"1024x1536"`

                  - `"1536x1024"`

                  - `"auto"`

            - `LocalShell`

              A tool that allows the model to execute shell commands in a local environment.

              - `type: "local_shell"`

                The type of the local shell tool. Always `local_shell`.

                - `"local_shell"`

            - `BetaFunctionShellTool`

              A tool that allows the model to execute shell commands.

              - `type: "shell"`

                The type of the shell tool. Always `shell`.

                - `"shell"`

              - `allowed_callers?: Array<"direct" | "programmatic"> | null`

                The tool invocation context(s).

                - `"direct"`

                - `"programmatic"`

              - `environment?: BetaContainerAuto | BetaLocalEnvironment | BetaContainerReference | null`

                - `BetaContainerAuto`

                  - `type: "container_auto"`

                    Automatically creates a container for this request

                    - `"container_auto"`

                  - `file_ids?: Array<string>`

                    An optional list of uploaded files to make available to your code.

                  - `memory_limit?: "1g" | "4g" | "16g" | "64g" | null`

                    The memory limit for the container.

                    - `"1g"`

                    - `"4g"`

                    - `"16g"`

                    - `"64g"`

                  - `network_policy?: BetaContainerNetworkPolicyDisabled | BetaContainerNetworkPolicyAllowlist`

                    Network access policy for the container.

                    - `BetaContainerNetworkPolicyDisabled`

                    - `BetaContainerNetworkPolicyAllowlist`

                  - `skills?: Array<BetaSkillReference | BetaInlineSkill>`

                    An optional list of skills referenced by id or inline data.

                    - `BetaSkillReference`

                      - `skill_id: string`

                        The ID of the referenced skill.

                      - `type: "skill_reference"`

                        References a skill created with the /v1/skills endpoint.

                        - `"skill_reference"`

                      - `version?: string`

                        Optional skill version. Use a positive integer or 'latest'. Omit for default.

                    - `BetaInlineSkill`

                      - `description: string`

                        The description of the skill.

                      - `name: string`

                        The name of the skill.

                      - `source: BetaInlineSkillSource`

                        Inline skill payload

                        - `data: string`

                          Base64-encoded skill zip bundle.

                        - `media_type: "application/zip"`

                          The media type of the inline skill payload. Must be `application/zip`.

                          - `"application/zip"`

                        - `type: "base64"`

                          The type of the inline skill source. Must be `base64`.

                          - `"base64"`

                      - `type: "inline"`

                        Defines an inline skill for this request.

                        - `"inline"`

                - `BetaLocalEnvironment`

                  - `type: "local"`

                    Use a local computer environment.

                    - `"local"`

                  - `skills?: Array<BetaLocalSkill>`

                    An optional list of skills.

                    - `description: string`

                      The description of the skill.

                    - `name: string`

                      The name of the skill.

                    - `path: string`

                      The path to the directory containing the skill.

                - `BetaContainerReference`

                  - `container_id: string`

                    The ID of the referenced container.

                  - `type: "container_reference"`

                    References a container created with the /v1/containers endpoint

                    - `"container_reference"`

            - `BetaCustomTool`

              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)

              - `name: string`

                The name of the custom tool, used to identify it in tool calls.

              - `type: "custom"`

                The type of the custom tool. Always `custom`.

                - `"custom"`

              - `allowed_callers?: Array<"direct" | "programmatic"> | null`

                The tool invocation context(s).

                - `"direct"`

                - `"programmatic"`

              - `defer_loading?: boolean`

                Whether this tool should be deferred and discovered via tool search.

              - `description?: string`

                Optional description of the custom tool, used to provide more context.

              - `format?: Text | Grammar`

                The input format for the custom tool. Default is unconstrained text.

                - `Text`

                  Unconstrained free-form text.

                  - `type: "text"`

                    Unconstrained text format. Always `text`.

                    - `"text"`

                - `Grammar`

                  A grammar defined by the user.

                  - `definition: string`

                    The grammar definition.

                  - `syntax: "lark" | "regex"`

                    The syntax of the grammar definition. One of `lark` or `regex`.

                    - `"lark"`

                    - `"regex"`

                  - `type: "grammar"`

                    Grammar format. Always `grammar`.

                    - `"grammar"`

            - `BetaNamespaceTool`

              Groups function/custom tools under a shared namespace.

              - `description: string`

                A description of the namespace shown to the model.

              - `name: string`

                The namespace name used in tool calls (for example, `crm`).

              - `tools: Array<Function | BetaCustomTool>`

                The function/custom tools available inside this namespace.

                - `Function`

                  - `name: string`

                  - `type: "function"`

                    - `"function"`

                  - `allowed_callers?: Array<"direct" | "programmatic"> | null`

                    The tool invocation context(s).

                    - `"direct"`

                    - `"programmatic"`

                  - `defer_loading?: boolean`

                    Whether this function should be deferred and discovered via tool search.

                  - `description?: string | null`

                  - `output_schema?: Record<string, unknown> | null`

                    A JSON Schema describing the JSON value encoded in string outputs for this function tool. This does not describe content-array outputs.

                  - `parameters?: unknown`

                  - `strict?: boolean | null`

                    Whether to enforce strict parameter validation. If omitted, Responses attempts to use strict validation when the schema is compatible, and falls back to non-strict validation otherwise.

                - `BetaCustomTool`

                  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: "namespace"`

                The type of the tool. Always `namespace`.

                - `"namespace"`

            - `BetaToolSearchTool`

              Hosted or BYOT tool search configuration for deferred tools.

              - `type: "tool_search"`

                The type of the tool. Always `tool_search`.

                - `"tool_search"`

              - `description?: string | null`

                Description shown to the model for a client-executed tool search tool.

              - `execution?: "server" | "client"`

                Whether tool search is executed by the server or by the client.

                - `"server"`

                - `"client"`

              - `parameters?: unknown`

                Parameter schema for a client-executed tool search tool.

            - `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"`

                The type of the web search tool. One of `web_search_preview` or `web_search_preview_2025_03_11`.

                - `"web_search_preview"`

                - `"web_search_preview_2025_03_11"`

              - `search_content_types?: Array<"text" | "image">`

                - `"text"`

                - `"image"`

              - `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.

                - `"low"`

                - `"medium"`

                - `"high"`

              - `user_location?: UserLocation | null`

                The user's location.

                - `type: "approximate"`

                  The type of location approximation. Always `approximate`.

                  - `"approximate"`

                - `city?: string | null`

                  Free text input for the city of the user, e.g. `San Francisco`.

                - `country?: string | null`

                  The two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of the user, e.g. `US`.

                - `region?: string | null`

                  Free text input for the region of the user, e.g. `California`.

                - `timezone?: string | null`

                  The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of the user, e.g. `America/Los_Angeles`.

            - `BetaApplyPatchTool`

              Allows the assistant to create, delete, or update files using unified diffs.

              - `type: "apply_patch"`

                The type of the tool. Always `apply_patch`.

                - `"apply_patch"`

              - `allowed_callers?: Array<"direct" | "programmatic"> | null`

                The tool invocation context(s).

                - `"direct"`

                - `"programmatic"`

          - `type: "tool_search_output"`

            The item type. Always `tool_search_output`.

            - `"tool_search_output"`

          - `id?: string | null`

            The unique ID of this tool search output.

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

          - `call_id?: string | null`

            The unique ID of the tool search call generated by the model.

          - `execution?: "server" | "client"`

            Whether tool search was executed by the server or by the client.

            - `"server"`

            - `"client"`

          - `status?: "in_progress" | "completed" | "incomplete" | null`

            The status of the tool search output.

            - `"in_progress"`

            - `"completed"`

            - `"incomplete"`

        - `AdditionalTools`

          - `role: "developer"`

            The role that provided the additional tools. Only `developer` is supported.

            - `"developer"`

          - `tools: Array<BetaTool>`

            A list of additional tools made available at this item.

            - `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).

            - `Mcp`

              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).

            - `CodeInterpreter`

              A tool that runs Python code to help generate a response to a prompt.

            - `ProgrammaticToolCalling`

            - `ImageGeneration`

              A tool that generates images using the GPT image models.

            - `LocalShell`

              A tool that allows the model to execute shell commands in a local environment.

            - `BetaFunctionShellTool`

              A tool that allows the model to execute shell commands.

            - `BetaCustomTool`

              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)

            - `BetaNamespaceTool`

              Groups function/custom tools under a shared namespace.

            - `BetaToolSearchTool`

              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).

            - `BetaApplyPatchTool`

              Allows the assistant to create, delete, or update files using unified diffs.

          - `type: "additional_tools"`

            The item type. Always `additional_tools`.

            - `"additional_tools"`

          - `id?: string | null`

            The unique ID of this additional tools item.

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

        - `BetaResponseReasoningItem`

          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).

          - `id: string`

            The unique identifier of the reasoning content.

          - `summary: Array<Summary>`

            Reasoning summary content.

            - `text: string`

              A summary of the reasoning output from the model so far.

            - `type: "summary_text"`

              The type of the object. Always `summary_text`.

              - `"summary_text"`

          - `type: "reasoning"`

            The type of the object. Always `reasoning`.

            - `"reasoning"`

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

          - `content?: Array<Content>`

            Reasoning text content.

            - `text: string`

              The reasoning text from the model.

            - `type: "reasoning_text"`

              The type of the reasoning text. Always `reasoning_text`.

              - `"reasoning_text"`

          - `encrypted_content?: string | null`

            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.

            When streaming, use the completed reasoning item and its
            `encrypted_content` from the `response.output_item.done` event in
            subsequent requests. The `encrypted_content` in
            `response.output_item.added` may be incomplete. This is especially
            important when `store` is `false` or when using Zero Data Retention.

          - `status?: "in_progress" | "completed" | "incomplete"`

            The status of the item. One of `in_progress`, `completed`, or
            `incomplete`. Populated when items are returned via API.

            - `"in_progress"`

            - `"completed"`

            - `"incomplete"`

        - `BetaResponseCompactionItemParam`

          A compaction item generated by the [`v1/responses/compact` API](https://platform.openai.com/docs/api-reference/responses/compact).

          - `encrypted_content: string`

            The encrypted content of the compaction summary.

          - `type: "compaction"`

            The type of the item. Always `compaction`.

            - `"compaction"`

          - `id?: string | null`

            The ID of the compaction item.

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

        - `ImageGenerationCall`

          An image generation request made by the model.

          - `id: string`

            The unique ID of the image generation call.

          - `result: string | null`

            The generated image encoded in base64.

          - `status: "in_progress" | "completed" | "generating" | "failed"`

            The status of the image generation call.

            - `"in_progress"`

            - `"completed"`

            - `"generating"`

            - `"failed"`

          - `type: "image_generation_call"`

            The type of the image generation call. Always `image_generation_call`.

            - `"image_generation_call"`

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

        - `BetaResponseCodeInterpreterToolCall`

          A tool call to run code.

          - `id: string`

            The unique ID of the code interpreter tool call.

          - `code: string | null`

            The code to run, or null if not available.

          - `container_id: string`

            The ID of the container used to run the code.

          - `outputs: Array<Logs | Image> | null`

            The outputs generated by the code interpreter, such as logs or images.
            Can be null if no outputs are available.

            - `Logs`

              The logs output from the code interpreter.

              - `logs: string`

                The logs output from the code interpreter.

              - `type: "logs"`

                The type of the output. Always `logs`.

                - `"logs"`

            - `Image`

              The image output from the code interpreter.

              - `type: "image"`

                The type of the output. Always `image`.

                - `"image"`

              - `url: string`

                The URL of the image output from the code interpreter.

          - `status: "in_progress" | "completed" | "incomplete" | 2 more`

            The status of the code interpreter tool call. Valid values are `in_progress`, `completed`, `incomplete`, `interpreting`, and `failed`.

            - `"in_progress"`

            - `"completed"`

            - `"incomplete"`

            - `"interpreting"`

            - `"failed"`

          - `type: "code_interpreter_call"`

            The type of the code interpreter tool call. Always `code_interpreter_call`.

            - `"code_interpreter_call"`

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

        - `LocalShellCall`

          A tool call to run a command on the local shell.

          - `id: string`

            The unique ID of the local shell call.

          - `action: Action`

            Execute a shell command on the server.

            - `command: Array<string>`

              The command to run.

            - `env: Record<string, string>`

              Environment variables to set for the command.

            - `type: "exec"`

              The type of the local shell action. Always `exec`.

              - `"exec"`

            - `timeout_ms?: number | null`

              Optional timeout in milliseconds for the command.

            - `user?: string | null`

              Optional user to run the command as.

            - `working_directory?: string | null`

              Optional working directory to run the command in.

          - `call_id: string`

            The unique ID of the local shell tool call generated by the model.

          - `status: "in_progress" | "completed" | "incomplete"`

            The status of the local shell call.

            - `"in_progress"`

            - `"completed"`

            - `"incomplete"`

          - `type: "local_shell_call"`

            The type of the local shell call. Always `local_shell_call`.

            - `"local_shell_call"`

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

        - `LocalShellCallOutput`

          The output of a local shell tool call.

          - `id: string`

            The unique ID of the local shell tool call generated by the model.

          - `output: string`

            A JSON string of the output of the local shell tool call.

          - `type: "local_shell_call_output"`

            The type of the local shell tool call output. Always `local_shell_call_output`.

            - `"local_shell_call_output"`

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

          - `status?: "in_progress" | "completed" | "incomplete" | null`

            The status of the item. One of `in_progress`, `completed`, or `incomplete`.

            - `"in_progress"`

            - `"completed"`

            - `"incomplete"`

        - `ShellCall`

          A tool representing a request to execute one or more shell commands.

          - `action: Action`

            The shell commands and limits that describe how to run the tool call.

            - `commands: Array<string>`

              Ordered shell commands for the execution environment to run.

            - `max_output_length?: number | null`

              Maximum number of UTF-8 characters to capture from combined stdout and stderr output.

            - `timeout_ms?: number | null`

              Maximum wall-clock time in milliseconds to allow the shell commands to run.

          - `call_id: string`

            The unique ID of the shell tool call generated by the model.

          - `type: "shell_call"`

            The type of the item. Always `shell_call`.

            - `"shell_call"`

          - `id?: string | null`

            The unique ID of the shell tool call. Populated when this item is returned via API.

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

          - `caller?: Direct | Program | null`

            The execution context that produced this tool call.

            - `Direct`

              - `type: "direct"`

                The caller type. Always `direct`.

                - `"direct"`

            - `Program`

              - `caller_id: string`

                The call ID of the program item that produced this tool call.

              - `type: "program"`

                The caller type. Always `program`.

                - `"program"`

          - `environment?: BetaLocalEnvironment | BetaContainerReference | null`

            The environment to execute the shell commands in.

            - `BetaLocalEnvironment`

            - `BetaContainerReference`

          - `status?: "in_progress" | "completed" | "incomplete" | null`

            The status of the shell call. One of `in_progress`, `completed`, or `incomplete`.

            - `"in_progress"`

            - `"completed"`

            - `"incomplete"`

        - `ShellCallOutput`

          The streamed output items emitted by a shell tool call.

          - `call_id: string`

            The unique ID of the shell tool call generated by the model.

          - `output: Array<BetaResponseFunctionShellCallOutputContent>`

            Captured chunks of stdout and stderr output, along with their associated outcomes.

            - `outcome: Timeout | Exit`

              The exit or timeout outcome associated with this shell call.

              - `Timeout`

                Indicates that the shell call exceeded its configured time limit.

                - `type: "timeout"`

                  The outcome type. Always `timeout`.

                  - `"timeout"`

              - `Exit`

                Indicates that the shell commands finished and returned an exit code.

                - `exit_code: number`

                  The exit code returned by the shell process.

                - `type: "exit"`

                  The outcome type. Always `exit`.

                  - `"exit"`

            - `stderr: string`

              Captured stderr output for the shell call.

            - `stdout: string`

              Captured stdout output for the shell call.

          - `type: "shell_call_output"`

            The type of the item. Always `shell_call_output`.

            - `"shell_call_output"`

          - `id?: string | null`

            The unique ID of the shell tool call output. Populated when this item is returned via API.

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

          - `caller?: Direct | Program | null`

            The execution context that produced this tool call.

            - `Direct`

              - `type: "direct"`

                The caller type. Always `direct`.

                - `"direct"`

            - `Program`

              - `caller_id: string`

                The call ID of the program item that produced this tool call.

              - `type: "program"`

                The caller type. Always `program`.

                - `"program"`

          - `max_output_length?: number | null`

            The maximum number of UTF-8 characters captured for this shell call's combined output.

          - `status?: "in_progress" | "completed" | "incomplete" | null`

            The status of the shell call output.

            - `"in_progress"`

            - `"completed"`

            - `"incomplete"`

        - `ApplyPatchCall`

          A tool call representing a request to create, delete, or update files using diff patches.

          - `call_id: string`

            The unique ID of the apply patch tool call generated by the model.

          - `operation: CreateFile | DeleteFile | UpdateFile`

            The specific create, delete, or update instruction for the apply_patch tool call.

            - `CreateFile`

              Instruction for creating a new file via the apply_patch tool.

              - `diff: string`

                Unified diff content to apply when creating the file.

              - `path: string`

                Path of the file to create relative to the workspace root.

              - `type: "create_file"`

                The operation type. Always `create_file`.

                - `"create_file"`

            - `DeleteFile`

              Instruction for deleting an existing file via the apply_patch tool.

              - `path: string`

                Path of the file to delete relative to the workspace root.

              - `type: "delete_file"`

                The operation type. Always `delete_file`.

                - `"delete_file"`

            - `UpdateFile`

              Instruction for updating an existing file via the apply_patch tool.

              - `diff: string`

                Unified diff content to apply to the existing file.

              - `path: string`

                Path of the file to update relative to the workspace root.

              - `type: "update_file"`

                The operation type. Always `update_file`.

                - `"update_file"`

          - `status: "in_progress" | "completed"`

            The status of the apply patch tool call. One of `in_progress` or `completed`.

            - `"in_progress"`

            - `"completed"`

          - `type: "apply_patch_call"`

            The type of the item. Always `apply_patch_call`.

            - `"apply_patch_call"`

          - `id?: string | null`

            The unique ID of the apply patch tool call. Populated when this item is returned via API.

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

          - `caller?: Direct | Program | null`

            The execution context that produced this tool call.

            - `Direct`

              - `type: "direct"`

                The caller type. Always `direct`.

                - `"direct"`

            - `Program`

              - `caller_id: string`

                The call ID of the program item that produced this tool call.

              - `type: "program"`

                The caller type. Always `program`.

                - `"program"`

        - `ApplyPatchCallOutput`

          The streamed output emitted by an apply patch tool call.

          - `call_id: string`

            The unique ID of the apply patch tool call generated by the model.

          - `status: "completed" | "failed"`

            The status of the apply patch tool call output. One of `completed` or `failed`.

            - `"completed"`

            - `"failed"`

          - `type: "apply_patch_call_output"`

            The type of the item. Always `apply_patch_call_output`.

            - `"apply_patch_call_output"`

          - `id?: string | null`

            The unique ID of the apply patch tool call output. Populated when this item is returned via API.

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

          - `caller?: Direct | Program | null`

            The execution context that produced this tool call.

            - `Direct`

              - `type: "direct"`

                The caller type. Always `direct`.

                - `"direct"`

            - `Program`

              - `caller_id: string`

                The call ID of the program item that produced this tool call.

              - `type: "program"`

                The caller type. Always `program`.

                - `"program"`

          - `output?: string | null`

            Optional human-readable log text from the apply patch tool (e.g., patch results or errors).

        - `McpListTools`

          A list of tools available on an MCP server.

          - `id: string`

            The unique ID of the list.

          - `server_label: string`

            The label of the MCP server.

          - `tools: Array<Tool>`

            The tools available on the server.

            - `input_schema: unknown`

              The JSON schema describing the tool's input.

            - `name: string`

              The name of the tool.

            - `annotations?: unknown`

              Additional annotations about the tool.

            - `description?: string | null`

              The description of the tool.

          - `type: "mcp_list_tools"`

            The type of the item. Always `mcp_list_tools`.

            - `"mcp_list_tools"`

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

          - `error?: string | null`

            Error message if the server could not list tools.

        - `McpApprovalRequest`

          A request for human approval of a tool invocation.

          - `id: string`

            The unique ID of the approval request.

          - `arguments: string`

            A JSON string of arguments for the tool.

          - `name: string`

            The name of the tool to run.

          - `server_label: string`

            The label of the MCP server making the request.

          - `type: "mcp_approval_request"`

            The type of the item. Always `mcp_approval_request`.

            - `"mcp_approval_request"`

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

        - `McpApprovalResponse`

          A response to an MCP approval request.

          - `approval_request_id: string`

            The ID of the approval request being answered.

          - `approve: boolean`

            Whether the request was approved.

          - `type: "mcp_approval_response"`

            The type of the item. Always `mcp_approval_response`.

            - `"mcp_approval_response"`

          - `id?: string | null`

            The unique ID of the approval response

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

          - `reason?: string | null`

            Optional reason for the decision.

        - `McpCall`

          An invocation of a tool on an MCP server.

          - `id: string`

            The unique ID of the tool call.

          - `arguments: string`

            A JSON string of the arguments passed to the tool.

          - `name: string`

            The name of the tool that was run.

          - `server_label: string`

            The label of the MCP server running the tool.

          - `type: "mcp_call"`

            The type of the item. Always `mcp_call`.

            - `"mcp_call"`

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

          - `approval_request_id?: string | null`

            Unique identifier for the MCP tool call approval request.
            Include this value in a subsequent `mcp_approval_response` input to approve or reject the corresponding tool call.

          - `error?: BetaMcpToolCallError | null`

            The error from the tool call, if any.

            - `McpProtocolError`

              - `code: number`

              - `message: string`

              - `type: "mcp_protocol_error"`

                - `"mcp_protocol_error"`

            - `McpToolExecutionError`

              - `content: unknown`

              - `type: "mcp_tool_execution_error"`

                - `"mcp_tool_execution_error"`

            - `HTTPError`

              - `code: number`

              - `message: string`

              - `type: "http_error"`

                - `"http_error"`

          - `output?: string | null`

            The output from the tool call.

          - `status?: "in_progress" | "completed" | "incomplete" | 2 more`

            The status of the tool call. One of `in_progress`, `completed`, `incomplete`, `calling`, or `failed`.

            - `"in_progress"`

            - `"completed"`

            - `"incomplete"`

            - `"calling"`

            - `"failed"`

        - `BetaResponseCustomToolCallOutput`

          The output of a custom tool call from your code, being sent back to the model.

          - `call_id: string`

            The call ID, used to map this custom tool call output to a custom tool call.

          - `output: string | Array<BetaResponseInputText | BetaResponseInputImage | BetaResponseInputFile>`

            The output from the custom tool call generated by your code.
            Can be a string or an list of output content.

            - `string`

            - `Array<BetaResponseInputText | BetaResponseInputImage | BetaResponseInputFile>`

              - `BetaResponseInputText`

                A text input to the model.

              - `BetaResponseInputImage`

                An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision).

              - `BetaResponseInputFile`

                A file input to the model.

          - `type: "custom_tool_call_output"`

            The type of the custom tool call output. Always `custom_tool_call_output`.

            - `"custom_tool_call_output"`

          - `id?: string`

            The unique ID of the custom tool call output in the OpenAI platform.

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

          - `caller?: Direct | Program | null`

            The execution context that produced this tool call.

            - `Direct`

              - `type: "direct"`

                The caller type. Always `direct`.

                - `"direct"`

            - `Program`

              - `caller_id: string`

                The call ID of the program item that produced this tool call.

              - `type: "program"`

                The caller type. Always `program`.

                - `"program"`

        - `BetaResponseCustomToolCall`

          A call to a custom tool created by the model.

          - `call_id: string`

            An identifier used to map this custom tool call to a tool call output.

          - `input: string`

            The input for the custom tool call generated by the model.

          - `name: string`

            The name of the custom tool being called.

          - `type: "custom_tool_call"`

            The type of the custom tool call. Always `custom_tool_call`.

            - `"custom_tool_call"`

          - `id?: string`

            The unique ID of the custom tool call in the OpenAI platform.

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

          - `caller?: Direct | Program | null`

            The execution context that produced this tool call.

            - `Direct`

              - `type: "direct"`

                - `"direct"`

            - `Program`

              - `caller_id: string`

                The call ID of the program item that produced this tool call.

              - `type: "program"`

                - `"program"`

          - `namespace?: string`

            The namespace of the custom tool being called.

        - `CompactionTrigger`

          Compacts the current context. Must be the final input item.

          - `type: "compaction_trigger"`

            The type of the item. Always `compaction_trigger`.

            - `"compaction_trigger"`

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

        - `ItemReference`

          An internal identifier for an item to reference.

          - `id: string`

            The ID of the item to reference.

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

          - `type?: "item_reference" | null`

            The type of item to reference. Always `item_reference`.

            - `"item_reference"`

        - `Program`

          - `id: string`

            The unique ID of this program item.

          - `call_id: string`

            The stable call ID of the program item.

          - `code: string`

            The JavaScript source executed by programmatic tool calling.

          - `fingerprint: string`

            Opaque program replay fingerprint that must be round-tripped.

          - `type: "program"`

            The item type. Always `program`.

            - `"program"`

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

        - `ProgramOutput`

          - `id: string`

            The unique ID of this program output item.

          - `call_id: string`

            The call ID of the program item.

          - `result: string`

            The result produced by the program item.

          - `status: "completed" | "incomplete"`

            The terminal status of the program output.

            - `"completed"`

            - `"incomplete"`

          - `type: "program_output"`

            The item type. Always `program_output`.

            - `"program_output"`

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

    - `metadata: Record<string, string> | null`

      Set of 16 key-value pairs that can be attached to an object. This can be
      useful for storing additional information about the object in a structured
      format, and querying for objects via API or the dashboard.

      Keys are strings with a maximum length of 64 characters. Values are strings
      with a maximum length of 512 characters.

    - `model: "gpt-5.6-sol" | "gpt-5.6-terra" | "gpt-5.6-luna" | 99 more | (string & {})`

      Model ID used to generate the response, like `gpt-4o` or `o3`. OpenAI
      offers a wide range of models with different capabilities, performance
      characteristics, and price points. Refer to the [model guide](https://platform.openai.com/docs/models)
      to browse and compare available models.

      - `"gpt-5.6-sol" | "gpt-5.6-terra" | "gpt-5.6-luna" | 99 more`

        - `"gpt-5.6-sol"`

        - `"gpt-5.6-terra"`

        - `"gpt-5.6-luna"`

        - `"gpt-5.5"`

        - `"gpt-5.5-2026-04-23"`

        - `"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.5-pro"`

        - `"gpt-5.5-pro-2026-04-23"`

        - `"gpt-5-codex"`

        - `"gpt-5-pro"`

        - `"gpt-5-pro-2025-10-06"`

        - `"gpt-5.1-codex-max"`

        - `"gpt-daybreak-blue-latest"`

        - `"gpt-daybreak-red-latest"`

        - `"gpt-5.6-cyber"`

      - `(string & {})`

    - `object: "response"`

      The object type of this resource - always set to `response`.

      - `"response"`

    - `output: Array<BetaResponseOutputItem>`

      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.

      - `BetaResponseOutputMessage`

        An output message from the model.

      - `BetaResponseFileSearchToolCall`

        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.

      - `BetaResponseFunctionToolCall`

        A tool call to run a function. See the
        [function calling guide](https://platform.openai.com/docs/guides/function-calling) for more information.

      - `BetaResponseFunctionToolCallOutputItem`

        - `id: string`

          The unique ID of the function call tool output.

        - `call_id: string`

          The unique ID of the function tool call generated by the model.

        - `output: string | Array<BetaResponseInputText | BetaResponseInputImage | BetaResponseInputFile>`

          The output from the function call generated by your code.
          Can be a string or an list of output content.

          - `string`

          - `Array<BetaResponseInputText | BetaResponseInputImage | BetaResponseInputFile>`

            - `BetaResponseInputText`

              A text input to the model.

            - `BetaResponseInputImage`

              An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision).

            - `BetaResponseInputFile`

              A file input to 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.

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

        - `type: "function_call_output"`

          The type of the function tool call output. Always `function_call_output`.

          - `"function_call_output"`

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `caller?: Direct | Program | null`

          The execution context that produced this tool call.

          - `Direct`

            - `type: "direct"`

              The caller type. Always `direct`.

              - `"direct"`

          - `Program`

            - `caller_id: string`

              The call ID of the program item that produced this tool call.

            - `type: "program"`

              The caller type. Always `program`.

              - `"program"`

        - `created_by?: string`

          The identifier of the actor that created the item.

        - `name?: string`

          The name of the tool that produced the output.

        - `namespace?: string`

          The namespace of the tool that produced the output.

      - `AgentMessage`

        - `id: string`

          The unique ID of the agent message.

        - `author: string`

          The sending agent identity.

        - `content: Array<BetaResponseInputText | BetaResponseOutputText | Text | 7 more>`

          Encrypted content sent between agents.

          - `BetaResponseInputText`

            A text input to the model.

          - `BetaResponseOutputText`

            A text output from the model.

          - `Text`

            A text content.

            - `text: string`

            - `type: "text"`

              - `"text"`

          - `SummaryText`

            A summary text from the model.

            - `text: string`

              A summary of the reasoning output from the model so far.

            - `type: "summary_text"`

              The type of the object. Always `summary_text`.

              - `"summary_text"`

          - `ReasoningText`

            Reasoning text from the model.

            - `text: string`

              The reasoning text from the model.

            - `type: "reasoning_text"`

              The type of the reasoning text. Always `reasoning_text`.

              - `"reasoning_text"`

          - `BetaResponseOutputRefusal`

            A refusal from the model.

          - `BetaResponseInputImage`

            An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision).

          - `ComputerScreenshot`

            A screenshot of a computer.

            - `detail: BetaImageDetail`

              The detail level of the screenshot image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`.

            - `file_id: string | null`

              The identifier of an uploaded file that contains the screenshot.

            - `image_url: string | null`

              The URL of the screenshot image.

            - `type: "computer_screenshot"`

              Specifies the event type. For a computer screenshot, this property is always set to `computer_screenshot`.

              - `"computer_screenshot"`

            - `prompt_cache_breakpoint?: PromptCacheBreakpoint`

              Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.

              - `mode: "explicit"`

                The breakpoint mode. Always `explicit`.

                - `"explicit"`

          - `BetaResponseInputFile`

            A file input to the model.

          - `EncryptedContent`

            Opaque encrypted content that Responses API decrypts inside trusted model execution.

            - `encrypted_content: string`

              Opaque encrypted content.

            - `type: "encrypted_content"`

              The type of the input item. Always `encrypted_content`.

              - `"encrypted_content"`

        - `recipient: string`

          The destination agent identity.

        - `type: "agent_message"`

          The type of the item. Always `agent_message`.

          - `"agent_message"`

        - `agent?: Agent`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

      - `MultiAgentCall`

        - `id: string`

          The unique ID of the multi-agent call item.

        - `action: "spawn_agent" | "interrupt_agent" | "list_agents" | 3 more`

          The multi-agent action to execute.

          - `"spawn_agent"`

          - `"interrupt_agent"`

          - `"list_agents"`

          - `"send_message"`

          - `"followup_task"`

          - `"wait_agent"`

        - `arguments: string`

          The JSON string of arguments generated for the action.

        - `call_id: string`

          The unique ID linking this call to its output.

        - `type: "multi_agent_call"`

          The type of the multi-agent call. Always `multi_agent_call`.

          - `"multi_agent_call"`

        - `agent?: Agent`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

      - `MultiAgentCallOutput`

        - `id: string`

          The unique ID of the multi-agent call output item.

        - `action: "spawn_agent" | "interrupt_agent" | "list_agents" | 3 more`

          The multi-agent action that produced this result.

          - `"spawn_agent"`

          - `"interrupt_agent"`

          - `"list_agents"`

          - `"send_message"`

          - `"followup_task"`

          - `"wait_agent"`

        - `call_id: string`

          The unique ID of the multi-agent call.

        - `output: Array<BetaResponseOutputText>`

          Text output returned by the multi-agent action.

          - `annotations: Array<FileCitation | URLCitation | ContainerFileCitation | FilePath>`

            The annotations of the text output.

          - `text: string`

            The text output from the model.

          - `type: "output_text"`

            The type of the output text. Always `output_text`.

          - `logprobs?: Array<Logprob>`

        - `type: "multi_agent_call_output"`

          The type of the multi-agent result. Always `multi_agent_call_output`.

          - `"multi_agent_call_output"`

        - `agent?: Agent`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

      - `BetaResponseFunctionWebSearch`

        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.

      - `BetaResponseComputerToolCall`

        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.

      - `BetaResponseComputerToolCallOutputItem`

        - `id: string`

          The unique ID of the computer call tool output.

        - `call_id: string`

          The ID of the computer tool call that produced the output.

        - `output: BetaResponseComputerToolCallOutputScreenshot`

          A computer screenshot image used with the computer use tool.

        - `status: "completed" | "incomplete" | "failed" | "in_progress"`

          The status of the message input. One of `in_progress`, `completed`, or
          `incomplete`. Populated when input items are returned via API.

          - `"completed"`

          - `"incomplete"`

          - `"failed"`

          - `"in_progress"`

        - `type: "computer_call_output"`

          The type of the computer tool call output. Always `computer_call_output`.

          - `"computer_call_output"`

        - `acknowledged_safety_checks?: Array<AcknowledgedSafetyCheck>`

          The safety checks reported by the API that have been acknowledged by the
          developer.

          - `id: string`

            The ID of the pending safety check.

          - `code?: string | null`

            The type of the pending safety check.

          - `message?: string | null`

            Details about the pending safety check.

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `created_by?: string`

          The identifier of the actor that created the item.

      - `BetaResponseReasoningItem`

        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).

      - `Program`

        - `id: string`

          The unique ID of the program item.

        - `call_id: string`

          The stable call ID of the program item.

        - `code: string`

          The JavaScript source executed by programmatic tool calling.

        - `fingerprint: string`

          Opaque program replay fingerprint that must be round-tripped.

        - `type: "program"`

          The type of the item. Always `program`.

          - `"program"`

        - `agent?: Agent`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

      - `ProgramOutput`

        - `id: string`

          The unique ID of the program output item.

        - `call_id: string`

          The call ID of the program item.

        - `result: string`

          The result produced by the program item.

        - `status: "completed" | "incomplete"`

          The terminal status of the program output item.

          - `"completed"`

          - `"incomplete"`

        - `type: "program_output"`

          The type of the item. Always `program_output`.

          - `"program_output"`

        - `agent?: Agent`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

      - `BetaResponseToolSearchCall`

        - `id: string`

          The unique ID of the tool search call item.

        - `arguments: unknown`

          Arguments used for the tool search call.

        - `call_id: string | null`

          The unique ID of the tool search call generated by the model.

        - `execution: "server" | "client"`

          Whether tool search was executed by the server or by the client.

          - `"server"`

          - `"client"`

        - `status: "in_progress" | "completed" | "incomplete"`

          The status of the tool search call item that was recorded.

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

        - `type: "tool_search_call"`

          The type of the item. Always `tool_search_call`.

          - `"tool_search_call"`

        - `agent?: Agent`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `created_by?: string`

          The identifier of the actor that created the item.

      - `BetaResponseToolSearchOutputItem`

        - `id: string`

          The unique ID of the tool search output item.

        - `call_id: string | null`

          The unique ID of the tool search call generated by the model.

        - `execution: "server" | "client"`

          Whether tool search was executed by the server or by the client.

          - `"server"`

          - `"client"`

        - `status: "in_progress" | "completed" | "incomplete"`

          The status of the tool search output item that was recorded.

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

        - `tools: Array<BetaTool>`

          The loaded tool definitions returned by tool search.

          - `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).

          - `Mcp`

            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).

          - `CodeInterpreter`

            A tool that runs Python code to help generate a response to a prompt.

          - `ProgrammaticToolCalling`

          - `ImageGeneration`

            A tool that generates images using the GPT image models.

          - `LocalShell`

            A tool that allows the model to execute shell commands in a local environment.

          - `BetaFunctionShellTool`

            A tool that allows the model to execute shell commands.

          - `BetaCustomTool`

            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)

          - `BetaNamespaceTool`

            Groups function/custom tools under a shared namespace.

          - `BetaToolSearchTool`

            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).

          - `BetaApplyPatchTool`

            Allows the assistant to create, delete, or update files using unified diffs.

        - `type: "tool_search_output"`

          The type of the item. Always `tool_search_output`.

          - `"tool_search_output"`

        - `agent?: Agent`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `created_by?: string`

          The identifier of the actor that created the item.

      - `AdditionalTools`

        - `id: string`

          The unique ID of the additional tools item.

        - `role: "unknown" | "user" | "assistant" | 5 more`

          The role that provided the additional tools.

          - `"unknown"`

          - `"user"`

          - `"assistant"`

          - `"system"`

          - `"critic"`

          - `"discriminator"`

          - `"developer"`

          - `"tool"`

        - `tools: Array<BetaTool>`

          The additional tool definitions made available at this item.

          - `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).

          - `Mcp`

            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).

          - `CodeInterpreter`

            A tool that runs Python code to help generate a response to a prompt.

          - `ProgrammaticToolCalling`

          - `ImageGeneration`

            A tool that generates images using the GPT image models.

          - `LocalShell`

            A tool that allows the model to execute shell commands in a local environment.

          - `BetaFunctionShellTool`

            A tool that allows the model to execute shell commands.

          - `BetaCustomTool`

            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)

          - `BetaNamespaceTool`

            Groups function/custom tools under a shared namespace.

          - `BetaToolSearchTool`

            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).

          - `BetaApplyPatchTool`

            Allows the assistant to create, delete, or update files using unified diffs.

        - `type: "additional_tools"`

          The type of the item. Always `additional_tools`.

          - `"additional_tools"`

        - `agent?: Agent`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

      - `BetaResponseCompactionItem`

        A compaction item generated by the [`v1/responses/compact` API](https://platform.openai.com/docs/api-reference/responses/compact).

        - `id: string`

          The unique ID of the compaction item.

        - `encrypted_content: string`

          The encrypted content that was produced by compaction.

        - `type: "compaction"`

          The type of the item. Always `compaction`.

          - `"compaction"`

        - `agent?: Agent`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `created_by?: string`

          The identifier of the actor that created the item.

      - `ImageGenerationCall`

        An image generation request made by the model.

        - `id: string`

          The unique ID of the image generation call.

        - `result: string | null`

          The generated image encoded in base64.

        - `status: "in_progress" | "completed" | "generating" | "failed"`

          The status of the image generation call.

          - `"in_progress"`

          - `"completed"`

          - `"generating"`

          - `"failed"`

        - `type: "image_generation_call"`

          The type of the image generation call. Always `image_generation_call`.

          - `"image_generation_call"`

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

      - `BetaResponseCodeInterpreterToolCall`

        A tool call to run code.

      - `LocalShellCall`

        A tool call to run a command on the local shell.

        - `id: string`

          The unique ID of the local shell call.

        - `action: Action`

          Execute a shell command on the server.

          - `command: Array<string>`

            The command to run.

          - `env: Record<string, string>`

            Environment variables to set for the command.

          - `type: "exec"`

            The type of the local shell action. Always `exec`.

            - `"exec"`

          - `timeout_ms?: number | null`

            Optional timeout in milliseconds for the command.

          - `user?: string | null`

            Optional user to run the command as.

          - `working_directory?: string | null`

            Optional working directory to run the command in.

        - `call_id: string`

          The unique ID of the local shell tool call generated by the model.

        - `status: "in_progress" | "completed" | "incomplete"`

          The status of the local shell call.

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

        - `type: "local_shell_call"`

          The type of the local shell call. Always `local_shell_call`.

          - `"local_shell_call"`

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

      - `LocalShellCallOutput`

        The output of a local shell tool call.

        - `id: string`

          The unique ID of the local shell tool call generated by the model.

        - `output: string`

          A JSON string of the output of the local shell tool call.

        - `type: "local_shell_call_output"`

          The type of the local shell tool call output. Always `local_shell_call_output`.

          - `"local_shell_call_output"`

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `status?: "in_progress" | "completed" | "incomplete" | null`

          The status of the item. One of `in_progress`, `completed`, or `incomplete`.

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

      - `BetaResponseFunctionShellToolCall`

        A tool call that executes one or more shell commands in a managed environment.

        - `id: string`

          The unique ID of the shell tool call. Populated when this item is returned via API.

        - `action: Action`

          The shell commands and limits that describe how to run the tool call.

          - `commands: Array<string>`

          - `max_output_length: number | null`

            Optional maximum number of characters to return from each command.

          - `timeout_ms: number | null`

            Optional timeout in milliseconds for the commands.

        - `call_id: string`

          The unique ID of the shell tool call generated by the model.

        - `environment: BetaResponseLocalEnvironment | BetaResponseContainerReference | null`

          Represents the use of a local environment to perform shell actions.

          - `BetaResponseLocalEnvironment`

            Represents the use of a local environment to perform shell actions.

            - `type: "local"`

              The environment type. Always `local`.

              - `"local"`

          - `BetaResponseContainerReference`

            Represents a container created with /v1/containers.

            - `container_id: string`

            - `type: "container_reference"`

              The environment type. Always `container_reference`.

              - `"container_reference"`

        - `status: "in_progress" | "completed" | "incomplete"`

          The status of the shell call. One of `in_progress`, `completed`, or `incomplete`.

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

        - `type: "shell_call"`

          The type of the item. Always `shell_call`.

          - `"shell_call"`

        - `agent?: Agent`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `caller?: Direct | Program | null`

          The execution context that produced this tool call.

          - `Direct`

            - `type: "direct"`

              - `"direct"`

          - `Program`

            - `caller_id: string`

              The call ID of the program item that produced this tool call.

            - `type: "program"`

              - `"program"`

        - `created_by?: string`

          The ID of the entity that created this tool call.

      - `BetaResponseFunctionShellToolCallOutput`

        The output of a shell tool call that was emitted.

        - `id: string`

          The unique ID of the shell call output. Populated when this item is returned via API.

        - `call_id: string`

          The unique ID of the shell tool call generated by the model.

        - `max_output_length: number | null`

          The maximum length of the shell command output. This is generated by the model and should be passed back with the raw output.

        - `output: Array<Output>`

          An array of shell call output contents

          - `outcome: Timeout | Exit`

            Represents either an exit outcome (with an exit code) or a timeout outcome for a shell call output chunk.

            - `Timeout`

              Indicates that the shell call exceeded its configured time limit.

              - `type: "timeout"`

                The outcome type. Always `timeout`.

                - `"timeout"`

            - `Exit`

              Indicates that the shell commands finished and returned an exit code.

              - `exit_code: number`

                Exit code from the shell process.

              - `type: "exit"`

                The outcome type. Always `exit`.

                - `"exit"`

          - `stderr: string`

            The standard error output that was captured.

          - `stdout: string`

            The standard output that was captured.

          - `created_by?: string`

            The identifier of the actor that created the item.

        - `status: "in_progress" | "completed" | "incomplete"`

          The status of the shell call output. One of `in_progress`, `completed`, or `incomplete`.

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

        - `type: "shell_call_output"`

          The type of the shell call output. Always `shell_call_output`.

          - `"shell_call_output"`

        - `agent?: Agent`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `caller?: Direct | Program | null`

          The execution context that produced this tool call.

          - `Direct`

            - `type: "direct"`

              - `"direct"`

          - `Program`

            - `caller_id: string`

              The call ID of the program item that produced this tool call.

            - `type: "program"`

              - `"program"`

        - `created_by?: string`

          The identifier of the actor that created the item.

      - `BetaResponseApplyPatchToolCall`

        A tool call that applies file diffs by creating, deleting, or updating files.

        - `id: string`

          The unique ID of the apply patch tool call. Populated when this item is returned via API.

        - `call_id: string`

          The unique ID of the apply patch tool call generated by the model.

        - `operation: CreateFile | DeleteFile | UpdateFile`

          One of the create_file, delete_file, or update_file operations applied via apply_patch.

          - `CreateFile`

            Instruction describing how to create a file via the apply_patch tool.

            - `diff: string`

              Diff to apply.

            - `path: string`

              Path of the file to create.

            - `type: "create_file"`

              Create a new file with the provided diff.

              - `"create_file"`

          - `DeleteFile`

            Instruction describing how to delete a file via the apply_patch tool.

            - `path: string`

              Path of the file to delete.

            - `type: "delete_file"`

              Delete the specified file.

              - `"delete_file"`

          - `UpdateFile`

            Instruction describing how to update a file via the apply_patch tool.

            - `diff: string`

              Diff to apply.

            - `path: string`

              Path of the file to update.

            - `type: "update_file"`

              Update an existing file with the provided diff.

              - `"update_file"`

        - `status: "in_progress" | "completed"`

          The status of the apply patch tool call. One of `in_progress` or `completed`.

          - `"in_progress"`

          - `"completed"`

        - `type: "apply_patch_call"`

          The type of the item. Always `apply_patch_call`.

          - `"apply_patch_call"`

        - `agent?: Agent`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `caller?: Direct | Program | null`

          The execution context that produced this tool call.

          - `Direct`

            - `type: "direct"`

              - `"direct"`

          - `Program`

            - `caller_id: string`

              The call ID of the program item that produced this tool call.

            - `type: "program"`

              - `"program"`

        - `created_by?: string`

          The ID of the entity that created this tool call.

      - `BetaResponseApplyPatchToolCallOutput`

        The output emitted by an apply patch tool call.

        - `id: string`

          The unique ID of the apply patch tool call output. Populated when this item is returned via API.

        - `call_id: string`

          The unique ID of the apply patch tool call generated by the model.

        - `status: "completed" | "failed"`

          The status of the apply patch tool call output. One of `completed` or `failed`.

          - `"completed"`

          - `"failed"`

        - `type: "apply_patch_call_output"`

          The type of the item. Always `apply_patch_call_output`.

          - `"apply_patch_call_output"`

        - `agent?: Agent`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `caller?: Direct | Program | null`

          The execution context that produced this tool call.

          - `Direct`

            - `type: "direct"`

              - `"direct"`

          - `Program`

            - `caller_id: string`

              The call ID of the program item that produced this tool call.

            - `type: "program"`

              - `"program"`

        - `created_by?: string`

          The ID of the entity that created this tool call output.

        - `output?: string | null`

          Optional textual output returned by the apply patch tool.

      - `McpCall`

        An invocation of a tool on an MCP server.

        - `id: string`

          The unique ID of the tool call.

        - `arguments: string`

          A JSON string of the arguments passed to the tool.

        - `name: string`

          The name of the tool that was run.

        - `server_label: string`

          The label of the MCP server running the tool.

        - `type: "mcp_call"`

          The type of the item. Always `mcp_call`.

          - `"mcp_call"`

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `approval_request_id?: string | null`

          Unique identifier for the MCP tool call approval request.
          Include this value in a subsequent `mcp_approval_response` input to approve or reject the corresponding tool call.

        - `error?: BetaMcpToolCallError | null`

          The error from the tool call, if any.

        - `output?: string | null`

          The output from the tool call.

        - `status?: "in_progress" | "completed" | "incomplete" | 2 more`

          The status of the tool call. One of `in_progress`, `completed`, `incomplete`, `calling`, or `failed`.

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

          - `"calling"`

          - `"failed"`

      - `McpListTools`

        A list of tools available on an MCP server.

        - `id: string`

          The unique ID of the list.

        - `server_label: string`

          The label of the MCP server.

        - `tools: Array<Tool>`

          The tools available on the server.

          - `input_schema: unknown`

            The JSON schema describing the tool's input.

          - `name: string`

            The name of the tool.

          - `annotations?: unknown`

            Additional annotations about the tool.

          - `description?: string | null`

            The description of the tool.

        - `type: "mcp_list_tools"`

          The type of the item. Always `mcp_list_tools`.

          - `"mcp_list_tools"`

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `error?: string | null`

          Error message if the server could not list tools.

      - `McpApprovalRequest`

        A request for human approval of a tool invocation.

        - `id: string`

          The unique ID of the approval request.

        - `arguments: string`

          A JSON string of arguments for the tool.

        - `name: string`

          The name of the tool to run.

        - `server_label: string`

          The label of the MCP server making the request.

        - `type: "mcp_approval_request"`

          The type of the item. Always `mcp_approval_request`.

          - `"mcp_approval_request"`

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

      - `McpApprovalResponse`

        A response to an MCP approval request.

        - `id: string`

          The unique ID of the approval response

        - `approval_request_id: string`

          The ID of the approval request being answered.

        - `approve: boolean`

          Whether the request was approved.

        - `type: "mcp_approval_response"`

          The type of the item. Always `mcp_approval_response`.

          - `"mcp_approval_response"`

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `reason?: string | null`

          Optional reason for the decision.

      - `BetaResponseCustomToolCall`

        A call to a custom tool created by the model.

      - `BetaResponseCustomToolCallOutputItem extends BetaResponseCustomToolCallOutput`

        The output of a custom tool call from your code, being sent back to the model.

        - `id: string`

          The unique ID of the custom tool call output item.

        - `status: "in_progress" | "completed" | "incomplete"`

          The status of the item. One of `in_progress`, `completed`, or
          `incomplete`. Populated when items are returned via API.

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

        - `created_by?: string`

          The identifier of the actor that created the item.

    - `parallel_tool_calls: boolean`

      Whether to allow the model to run tool calls in parallel.

    - `temperature: number | null`

      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.

    - `tool_choice: BetaToolChoiceOptions | BetaToolChoiceAllowed | BetaToolChoiceTypes | 6 more`

      How the model should select which tool (or tools) to use when generating
      a response. See the `tools` parameter to see how to specify which tools
      the model can call.

      - `BetaToolChoiceOptions = "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.

        - `"none"`

        - `"auto"`

        - `"required"`

      - `BetaToolChoiceAllowed`

        Constrains the tools available to the model to a pre-defined set.

        - `mode: "auto" | "required"`

          Constrains the tools available to the model to a pre-defined set.

          `auto` allows the model to pick from among the allowed tools and generate a
          message.

          `required` requires the model to call one or more of the allowed tools.

          - `"auto"`

          - `"required"`

        - `tools: Array<Record<string, unknown>>`

          A list of tool definitions that the model should be allowed to call.

          For the Responses API, the list of tool definitions might look like:

          ```json
          [
            { "type": "function", "name": "get_weather" },
            { "type": "mcp", "server_label": "deepwiki" },
            { "type": "image_generation" }
          ]
          ```

        - `type: "allowed_tools"`

          Allowed tool configuration type. Always `allowed_tools`.

          - `"allowed_tools"`

      - `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" | 5 more`

          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`

          - `"file_search"`

          - `"web_search_preview"`

          - `"computer"`

          - `"computer_use_preview"`

          - `"computer_use"`

          - `"web_search_preview_2025_03_11"`

          - `"image_generation"`

          - `"code_interpreter"`

      - `BetaToolChoiceFunction`

        Use this option to force the model to call a specific function.

        - `name: string`

          The name of the function to call.

        - `type: "function"`

          For function calling, the type is always `function`.

          - `"function"`

      - `BetaToolChoiceMcp`

        Use this option to force the model to call a specific tool on a remote MCP server.

        - `server_label: string`

          The label of the MCP server to use.

        - `type: "mcp"`

          For MCP tools, the type is always `mcp`.

          - `"mcp"`

        - `name?: string | null`

          The name of the tool to call on the server.

      - `BetaToolChoiceCustom`

        Use this option to force the model to call a specific custom tool.

        - `name: string`

          The name of the custom tool to call.

        - `type: "custom"`

          For custom tool calling, the type is always `custom`.

          - `"custom"`

      - `BetaSpecificProgrammaticToolCallingParam`

        - `type: "programmatic_tool_calling"`

          The tool to call. Always `programmatic_tool_calling`.

          - `"programmatic_tool_calling"`

      - `BetaToolChoiceApplyPatch`

        Forces the model to call the apply_patch tool when executing a tool call.

        - `type: "apply_patch"`

          The tool to call. Always `apply_patch`.

          - `"apply_patch"`

      - `BetaToolChoiceShell`

        Forces the model to call the shell tool when a tool call is required.

        - `type: "shell"`

          The tool to call. Always `shell`.

          - `"shell"`

    - `tools: Array<BetaTool>`

      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.

      - `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).

      - `Mcp`

        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).

      - `CodeInterpreter`

        A tool that runs Python code to help generate a response to a prompt.

      - `ProgrammaticToolCalling`

      - `ImageGeneration`

        A tool that generates images using the GPT image models.

      - `LocalShell`

        A tool that allows the model to execute shell commands in a local environment.

      - `BetaFunctionShellTool`

        A tool that allows the model to execute shell commands.

      - `BetaCustomTool`

        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)

      - `BetaNamespaceTool`

        Groups function/custom tools under a shared namespace.

      - `BetaToolSearchTool`

        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).

      - `BetaApplyPatchTool`

        Allows the assistant to create, delete, or update files using unified diffs.

    - `top_p: number | null`

      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.

    - `background?: boolean | null`

      Whether to run the model response in the background.
      [Learn more](https://platform.openai.com/docs/guides/background).

    - `completed_at?: number | null`

      Unix timestamp (in seconds) of when this Response was completed.
      Only present when the status is `completed`.

    - `conversation?: Conversation | null`

      The conversation that this response belonged to. Input items and output items from this response were automatically added to this conversation.

      - `id: string`

        The unique ID of the conversation that this response was associated with.

    - `max_output_tokens?: number | null`

      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).

    - `max_tool_calls?: number | null`

      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.

    - `moderation?: Moderation | null`

      Moderation results for the response input and output, if moderated completions were requested.

      - `input: ModerationResult | Error`

        Moderation for the response input.

        - `ModerationResult`

          A moderation result produced for the response input or output.

          - `categories: Record<string, boolean>`

            A dictionary of moderation categories to booleans, True if the input is flagged under this category.

          - `category_applied_input_types: Record<string, Array<"text" | "image">>`

            Which modalities of input are reflected by the score for each category.

            - `"text"`

            - `"image"`

          - `category_scores: Record<string, number>`

            A dictionary of moderation categories to scores.

          - `flagged: boolean`

            A boolean indicating whether the content was flagged by any category.

          - `model: string`

            The moderation model that produced this result.

          - `type: "moderation_result"`

            The object type, which was always `moderation_result` for successful moderation results.

            - `"moderation_result"`

        - `Error`

          An error produced while attempting moderation for the response input or output.

          - `code: string`

            The error code.

          - `message: string`

            The error message.

          - `type: "error"`

            The object type, which was always `error` for moderation failures.

            - `"error"`

      - `output: ModerationResult | Error`

        Moderation for the response output.

        - `ModerationResult`

          A moderation result produced for the response input or output.

          - `categories: Record<string, boolean>`

            A dictionary of moderation categories to booleans, True if the input is flagged under this category.

          - `category_applied_input_types: Record<string, Array<"text" | "image">>`

            Which modalities of input are reflected by the score for each category.

            - `"text"`

            - `"image"`

          - `category_scores: Record<string, number>`

            A dictionary of moderation categories to scores.

          - `flagged: boolean`

            A boolean indicating whether the content was flagged by any category.

          - `model: string`

            The moderation model that produced this result.

          - `type: "moderation_result"`

            The object type, which was always `moderation_result` for successful moderation results.

            - `"moderation_result"`

        - `Error`

          An error produced while attempting moderation for the response input or output.

          - `code: string`

            The error code.

          - `message: string`

            The error message.

          - `type: "error"`

            The object type, which was always `error` for moderation failures.

            - `"error"`

    - `previous_response_id?: string | null`

      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`.

    - `prompt?: BetaResponsePrompt | null`

      Reference to a prompt template and its variables.
      [Learn more](https://platform.openai.com/docs/guides/text?api-mode=responses#reusable-prompts).

      - `id: string`

        The unique identifier of the prompt template to use.

      - `variables?: Record<string, string | BetaResponseInputText | BetaResponseInputImage | BetaResponseInputFile> | null`

        Optional map of values to substitute in for variables in your
        prompt. The substitution values can either be strings, or other
        Response input types like images or files.

        - `string`

        - `BetaResponseInputText`

          A text input to the model.

        - `BetaResponseInputImage`

          An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision).

        - `BetaResponseInputFile`

          A file input to the model.

      - `version?: string | null`

        Optional version of the prompt template.

    - `prompt_cache_key?: string | null`

      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).

    - `prompt_cache_options?: PromptCacheOptions`

      The prompt-caching options that were applied to the response. Supported for `gpt-5.6` and later models.

      - `mode: "implicit" | "explicit"`

        Whether implicit prompt-cache breakpoints were enabled.

        - `"implicit"`

        - `"explicit"`

      - `ttl: "30m"`

        The minimum lifetime applied to each cache breakpoint.

        - `"30m"`

    - `prompt_cache_retention?: "in_memory" | "24h" | null`

      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.

      - `"in_memory"`

      - `"24h"`

    - `reasoning?: Reasoning | null`

      **gpt-5 and o-series models only**

      Configuration options for
      [reasoning models](https://platform.openai.com/docs/guides/reasoning).

      - `context?: "auto" | "current_turn" | "all_turns" | null`

        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.

        - `"auto"`

        - `"current_turn"`

        - `"all_turns"`

      - `effort?: "none" | "minimal" | "low" | 4 more | null`

        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.

        - `"none"`

        - `"minimal"`

        - `"low"`

        - `"medium"`

        - `"high"`

        - `"xhigh"`

        - `"max"`

      - `generate_summary?: "auto" | "concise" | "detailed" | null`

        **Deprecated:** use `summary` instead.

        A summary of the reasoning performed by the model. This can be
        useful for debugging and understanding the model's reasoning process.
        One of `auto`, `concise`, or `detailed`.

        - `"auto"`

        - `"concise"`

        - `"detailed"`

      - `mode?: (string & {}) | "standard" | "pro"`

        Controls the reasoning execution mode for the request.

        When returned on a response, this is the effective execution mode.

        - `(string & {})`

        - `"standard" | "pro"`

          - `"standard"`

          - `"pro"`

      - `summary?: "auto" | "concise" | "detailed" | null`

        A summary of the reasoning performed by the model. This can be
        useful for debugging and understanding the model's reasoning process.
        One of `auto`, `concise`, or `detailed`.

        `concise` is supported for `computer-use-preview` models and all reasoning models after `gpt-5`.

        - `"auto"`

        - `"concise"`

        - `"detailed"`

    - `safety_identifier?: string | null`

      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).

    - `service_tier?: BetaServiceTier | null`

      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.
      - If set to 'ultrafast', then the request will be processed with the access-controlled Ultrafast Processing service tier. This tier is currently available for `gpt-5.6-sol`; a response served through it will show `service_tier=ultrafast`.
      - When not set, the default behavior is 'auto'.

      When the `service_tier` parameter is set, the response body will include the `service_tier` value based on the processing mode actually used to serve the request. This response value may be different from the value set in the parameter.

      - `"auto"`

      - `"default"`

      - `"flex"`

      - `"scale"`

      - `"priority"`

      - `"fast"`

      - `"ultrafast"`

    - `status?: BetaResponseStatus`

      The status of the response generation. One of `completed`, `failed`,
      `in_progress`, `cancelled`, `queued`, or `incomplete`.

      - `"completed"`

      - `"failed"`

      - `"in_progress"`

      - `"cancelled"`

      - `"queued"`

      - `"incomplete"`

    - `text?: BetaResponseTextConfig`

      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?: BetaResponseFormatTextConfig`

        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.

        - `Text`

          Default response format. Used to generate text responses.

          - `type: "text"`

            The type of response format being defined. Always `text`.

            - `"text"`

        - `BetaResponseFormatTextJSONSchemaConfig`

          JSON Schema response format. Used to generate structured JSON responses.
          Learn more about [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs).

          - `name: string`

            The name of the response format. Must be a-z, A-Z, 0-9, or contain
            underscores and dashes, with a maximum length of 64.

          - `schema: Record<string, unknown>`

            The schema for the response format, described as a JSON Schema object.
            Learn how to build JSON schemas [here](https://json-schema.org/).

          - `type: "json_schema"`

            The type of response format being defined. Always `json_schema`.

            - `"json_schema"`

          - `description?: string`

            A description of what the response format is for, used by the model to
            determine how to respond in the format.

          - `strict?: boolean | null`

            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).

        - `JSONObject`

          JSON object response format. An older method of generating JSON responses.
          Using `json_schema` is recommended for models that support it. Note that the
          model will not generate JSON without a system or user message instructing it
          to do so.

          - `type: "json_object"`

            The type of response format being defined. Always `json_object`.

            - `"json_object"`

      - `verbosity?: "low" | "medium" | "high" | null`

        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`.

        - `"low"`

        - `"medium"`

        - `"high"`

    - `top_logprobs?: number | null`

      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.

    - `truncation?: "auto" | "disabled" | null`

      The truncation strategy to use for the model response.

      - `auto`: If the input to this Response exceeds
        the model's context window size, the model will truncate the
        response to fit the context window by dropping items from the beginning of the conversation.
      - `disabled` (default): If the input size will exceed the context window
        size for a model, the request will fail with a 400 error.

      - `"auto"`

      - `"disabled"`

    - `usage?: BetaResponseUsage`

      Represents token usage details including input tokens, output tokens,
      a breakdown of output tokens, and the total tokens used.

      - `input_tokens: number`

        The number of input tokens.

      - `input_tokens_details: InputTokensDetails`

        A detailed breakdown of the input tokens.

        - `cache_write_tokens: number`

          The number of input tokens that were written to the cache.

        - `cached_tokens: number`

          The number of tokens that were retrieved from the cache.
          [More on prompt caching](https://platform.openai.com/docs/guides/prompt-caching).

      - `output_tokens: number`

        The number of output tokens.

      - `output_tokens_details: OutputTokensDetails`

        A detailed breakdown of the output tokens.

        - `reasoning_tokens: number`

          The number of reasoning tokens.

      - `total_tokens: number`

        The total number of tokens used.

    - `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).

  - `sequence_number: number`

    The sequence number for this event.

  - `type: "response.queued"`

    The type of the event. Always 'response.queued'.

    - `"response.queued"`

  - `agent?: Agent | null`

    The agent that owns this multi-agent streaming event.

    - `agent_name: string`

      The canonical name of the agent that produced this item.

### Beta Response Reasoning Item

- `BetaResponseReasoningItem`

  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).

  - `id: string`

    The unique identifier of the reasoning content.

  - `summary: Array<Summary>`

    Reasoning summary content.

    - `text: string`

      A summary of the reasoning output from the model so far.

    - `type: "summary_text"`

      The type of the object. Always `summary_text`.

      - `"summary_text"`

  - `type: "reasoning"`

    The type of the object. Always `reasoning`.

    - `"reasoning"`

  - `agent?: Agent | null`

    The agent that produced this item.

    - `agent_name: string`

      The canonical name of the agent that produced this item.

  - `content?: Array<Content>`

    Reasoning text content.

    - `text: string`

      The reasoning text from the model.

    - `type: "reasoning_text"`

      The type of the reasoning text. Always `reasoning_text`.

      - `"reasoning_text"`

  - `encrypted_content?: string | null`

    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.

    When streaming, use the completed reasoning item and its
    `encrypted_content` from the `response.output_item.done` event in
    subsequent requests. The `encrypted_content` in
    `response.output_item.added` may be incomplete. This is especially
    important when `store` is `false` or when using Zero Data Retention.

  - `status?: "in_progress" | "completed" | "incomplete"`

    The status of the item. One of `in_progress`, `completed`, or
    `incomplete`. Populated when items are returned via API.

    - `"in_progress"`

    - `"completed"`

    - `"incomplete"`

### Beta Response Reasoning Summary Part Added Event

- `BetaResponseReasoningSummaryPartAddedEvent`

  Emitted when a new reasoning summary part is added.

  - `item_id: string`

    The ID of the item this summary part is associated with.

  - `output_index: number`

    The index of the output item this summary part is associated with.

  - `part: Part`

    The summary part that was added.

    - `text: string`

      The text of the summary part.

    - `type: "summary_text"`

      The type of the summary part. Always `summary_text`.

      - `"summary_text"`

  - `sequence_number: number`

    The sequence number of this event.

  - `summary_index: number`

    The index of the summary part within the reasoning summary.

  - `type: "response.reasoning_summary_part.added"`

    The type of the event. Always `response.reasoning_summary_part.added`.

    - `"response.reasoning_summary_part.added"`

  - `agent?: Agent | null`

    The agent that owns this multi-agent streaming event.

    - `agent_name: string`

      The canonical name of the agent that produced this item.

### Beta Response Reasoning Summary Part Done Event

- `BetaResponseReasoningSummaryPartDoneEvent`

  Emitted when a reasoning summary part is completed.

  - `item_id: string`

    The ID of the item this summary part is associated with.

  - `output_index: number`

    The index of the output item this summary part is associated with.

  - `part: Part`

    The completed summary part.

    - `text: string`

      The text of the summary part.

    - `type: "summary_text"`

      The type of the summary part. Always `summary_text`.

      - `"summary_text"`

  - `sequence_number: number`

    The sequence number of this event.

  - `summary_index: number`

    The index of the summary part within the reasoning summary.

  - `type: "response.reasoning_summary_part.done"`

    The type of the event. Always `response.reasoning_summary_part.done`.

    - `"response.reasoning_summary_part.done"`

  - `agent?: Agent | null`

    The agent that owns this multi-agent streaming event.

    - `agent_name: string`

      The canonical name of the agent that produced this item.

  - `status?: "incomplete"`

    The completion status of the summary part. Omitted when the part completed
    normally and set to `incomplete` when generation was interrupted.

    - `"incomplete"`

### Beta Response Reasoning Summary Text Delta Event

- `BetaResponseReasoningSummaryTextDeltaEvent`

  Emitted when a delta is added to a reasoning summary text.

  - `delta: string`

    The text delta that was added to the summary.

  - `item_id: string`

    The ID of the item this summary text delta is associated with.

  - `output_index: number`

    The index of the output item this summary text delta is associated with.

  - `sequence_number: number`

    The sequence number of this event.

  - `summary_index: number`

    The index of the summary part within the reasoning summary.

  - `type: "response.reasoning_summary_text.delta"`

    The type of the event. Always `response.reasoning_summary_text.delta`.

    - `"response.reasoning_summary_text.delta"`

  - `agent?: Agent | null`

    The agent that owns this multi-agent streaming event.

    - `agent_name: string`

      The canonical name of the agent that produced this item.

### Beta Response Reasoning Summary Text Done Event

- `BetaResponseReasoningSummaryTextDoneEvent`

  Emitted when a reasoning summary text is completed.

  - `item_id: string`

    The ID of the item this summary text is associated with.

  - `output_index: number`

    The index of the output item this summary text is associated with.

  - `sequence_number: number`

    The sequence number of this event.

  - `summary_index: number`

    The index of the summary part within the reasoning summary.

  - `text: string`

    The full text of the completed reasoning summary.

  - `type: "response.reasoning_summary_text.done"`

    The type of the event. Always `response.reasoning_summary_text.done`.

    - `"response.reasoning_summary_text.done"`

  - `agent?: Agent | null`

    The agent that owns this multi-agent streaming event.

    - `agent_name: string`

      The canonical name of the agent that produced this item.

### Beta Response Reasoning Text Delta Event

- `BetaResponseReasoningTextDeltaEvent`

  Emitted when a delta is added to a reasoning text.

  - `content_index: number`

    The index of the reasoning content part this delta is associated with.

  - `delta: string`

    The text delta that was added to the reasoning content.

  - `item_id: string`

    The ID of the item this reasoning text delta is associated with.

  - `output_index: number`

    The index of the output item this reasoning text delta is associated with.

  - `sequence_number: number`

    The sequence number of this event.

  - `type: "response.reasoning_text.delta"`

    The type of the event. Always `response.reasoning_text.delta`.

    - `"response.reasoning_text.delta"`

  - `agent?: Agent | null`

    The agent that owns this multi-agent streaming event.

    - `agent_name: string`

      The canonical name of the agent that produced this item.

### Beta Response Reasoning Text Done Event

- `BetaResponseReasoningTextDoneEvent`

  Emitted when a reasoning text is completed.

  - `content_index: number`

    The index of the reasoning content part.

  - `item_id: string`

    The ID of the item this reasoning text is associated with.

  - `output_index: number`

    The index of the output item this reasoning text is associated with.

  - `sequence_number: number`

    The sequence number of this event.

  - `text: string`

    The full text of the completed reasoning content.

  - `type: "response.reasoning_text.done"`

    The type of the event. Always `response.reasoning_text.done`.

    - `"response.reasoning_text.done"`

  - `agent?: Agent | null`

    The agent that owns this multi-agent streaming event.

    - `agent_name: string`

      The canonical name of the agent that produced this item.

### Beta Response Refusal Delta Event

- `BetaResponseRefusalDeltaEvent`

  Emitted when there is a partial refusal text.

  - `content_index: number`

    The index of the content part that the refusal text is added to.

  - `delta: string`

    The refusal text that is added.

  - `item_id: string`

    The ID of the output item that the refusal text is added to.

  - `output_index: number`

    The index of the output item that the refusal text is added to.

  - `sequence_number: number`

    The sequence number of this event.

  - `type: "response.refusal.delta"`

    The type of the event. Always `response.refusal.delta`.

    - `"response.refusal.delta"`

  - `agent?: Agent | null`

    The agent that owns this multi-agent streaming event.

    - `agent_name: string`

      The canonical name of the agent that produced this item.

### Beta Response Refusal Done Event

- `BetaResponseRefusalDoneEvent`

  Emitted when refusal text is finalized.

  - `content_index: number`

    The index of the content part that the refusal text is finalized.

  - `item_id: string`

    The ID of the output item that the refusal text is finalized.

  - `output_index: number`

    The index of the output item that the refusal text is finalized.

  - `refusal: string`

    The refusal text that is finalized.

  - `sequence_number: number`

    The sequence number of this event.

  - `type: "response.refusal.done"`

    The type of the event. Always `response.refusal.done`.

    - `"response.refusal.done"`

  - `agent?: Agent | null`

    The agent that owns this multi-agent streaming event.

    - `agent_name: string`

      The canonical name of the agent that produced this item.

### Beta Response Shell Call Command Added Event

- `BetaResponseShellCallCommandAddedEvent`

  A streaming event that indicated a shell command was added to a tool call.

  - `command: string`

    The shell command that was added.

  - `command_index: number`

    The index of the shell command that was added.

  - `output_index: number`

    The index of the output item that was updated.

  - `sequence_number: number`

    The sequence number of the event that was emitted.

  - `type: "response.shell_call_command.added"`

    The type of the event, always `response.shell_call_command.added`.

    - `"response.shell_call_command.added"`

  - `agent?: Agent`

    The agent that owns this multi-agent streaming event.

    - `agent_name: string`

      The canonical name of the agent that produced this item.

### Beta Response Shell Call Command Delta Event

- `BetaResponseShellCallCommandDeltaEvent`

  A streaming event that indicated a shell command was incrementally updated.

  - `command_index: number`

    The index of the shell command that was updated.

  - `delta: string`

    The shell command delta that was appended.

  - `output_index: number`

    The index of the output item that was updated.

  - `sequence_number: number`

    The sequence number of the event that was emitted.

  - `type: "response.shell_call_command.delta"`

    The type of the event, always `response.shell_call_command.delta`.

    - `"response.shell_call_command.delta"`

  - `agent?: Agent`

    The agent that owns this multi-agent streaming event.

    - `agent_name: string`

      The canonical name of the agent that produced this item.

  - `obfuscation?: string`

    An obfuscation string that was added to pad the event payload.

### Beta Response Shell Call Command Done Event

- `BetaResponseShellCallCommandDoneEvent`

  A streaming event that indicated a shell command was completed.

  - `command: string`

    The final shell command that was emitted.

  - `command_index: number`

    The index of the shell command that was completed.

  - `output_index: number`

    The index of the output item that was updated.

  - `sequence_number: number`

    The sequence number of the event that was emitted.

  - `type: "response.shell_call_command.done"`

    The type of the event, always `response.shell_call_command.done`.

    - `"response.shell_call_command.done"`

  - `agent?: Agent`

    The agent that owns this multi-agent streaming event.

    - `agent_name: string`

      The canonical name of the agent that produced this item.

### Beta Response Shell Call Output Content Delta Event

- `BetaResponseShellCallOutputContentDeltaEvent`

  A streaming event that indicated shell call output was incrementally added.

  - `command_index: number`

    The index of the shell command that produced output.

  - `delta: Delta`

    The stdout/stderr delta that was emitted.

    - `stderr?: string`

      The stderr delta that was emitted.

    - `stdout?: string`

      The stdout delta that was emitted.

  - `item_id: string`

    The ID of the output item that was updated.

  - `output_index: number`

    The index of the output item that was updated.

  - `sequence_number: number`

    The sequence number of the event that was emitted.

  - `type: "response.shell_call_output_content.delta"`

    The type of the event, always `response.shell_call_output_content.delta`.

    - `"response.shell_call_output_content.delta"`

  - `agent?: Agent`

    The agent that owns this multi-agent streaming event.

    - `agent_name: string`

      The canonical name of the agent that produced this item.

### Beta Response Shell Call Output Content Done Event

- `BetaResponseShellCallOutputContentDoneEvent`

  A streaming event that indicated shell call output was completed.

  - `command_index: number`

    The index of the shell command that produced output.

  - `item_id: string`

    The ID of the output item that was updated.

  - `output: Array<Output>`

    The output contents emitted for the shell command.

    - `outcome: Timeout | Exit`

      Represents either an exit outcome (with an exit code) or a timeout outcome for a shell call output chunk.

      - `Timeout`

        Indicates that the shell call exceeded its configured time limit.

        - `type: "timeout"`

          The outcome type. Always `timeout`.

          - `"timeout"`

      - `Exit`

        Indicates that the shell commands finished and returned an exit code.

        - `exit_code: number`

          Exit code from the shell process.

        - `type: "exit"`

          The outcome type. Always `exit`.

          - `"exit"`

    - `stderr: string`

      The standard error output that was captured.

    - `stdout: string`

      The standard output that was captured.

    - `created_by?: string`

      The identifier of the actor that created the item.

  - `output_index: number`

    The index of the output item that was updated.

  - `sequence_number: number`

    The sequence number of the event that was emitted.

  - `type: "response.shell_call_output_content.done"`

    The type of the event, always `response.shell_call_output_content.done`.

    - `"response.shell_call_output_content.done"`

  - `agent?: Agent`

    The agent that owns this multi-agent streaming event.

    - `agent_name: string`

      The canonical name of the agent that produced this item.

### Beta Response Status

- `BetaResponseStatus = "completed" | "failed" | "in_progress" | 3 more`

  The status of the response generation. One of `completed`, `failed`,
  `in_progress`, `cancelled`, `queued`, or `incomplete`.

  - `"completed"`

  - `"failed"`

  - `"in_progress"`

  - `"cancelled"`

  - `"queued"`

  - `"incomplete"`

### Beta Response Stream Event

- `BetaResponseStreamEvent = BetaResponseAudioDeltaEvent | BetaResponseAudioDoneEvent | BetaResponseAudioTranscriptDeltaEvent | 55 more`

  Event emitted while a response is streamed.

  - `BetaResponseAudioDeltaEvent`

    Emitted when there is a partial audio response.

    - `delta: string`

      A chunk of Base64 encoded response audio bytes.

    - `sequence_number: number`

      A sequence number for this chunk of the stream response.

    - `type: "response.audio.delta"`

      The type of the event. Always `response.audio.delta`.

      - `"response.audio.delta"`

    - `agent?: Agent | null`

      The agent that owns this multi-agent streaming event.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

  - `BetaResponseAudioDoneEvent`

    Emitted when the audio response is complete.

    - `sequence_number: number`

      The sequence number of the delta.

    - `type: "response.audio.done"`

      The type of the event. Always `response.audio.done`.

      - `"response.audio.done"`

    - `agent?: Agent | null`

      The agent that owns this multi-agent streaming event.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

  - `BetaResponseAudioTranscriptDeltaEvent`

    Emitted when there is a partial transcript of audio.

    - `delta: string`

      The partial transcript of the audio response.

    - `sequence_number: number`

      The sequence number of this event.

    - `type: "response.audio.transcript.delta"`

      The type of the event. Always `response.audio.transcript.delta`.

      - `"response.audio.transcript.delta"`

    - `agent?: Agent | null`

      The agent that owns this multi-agent streaming event.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

  - `BetaResponseAudioTranscriptDoneEvent`

    Emitted when the full audio transcript is completed.

    - `sequence_number: number`

      The sequence number of this event.

    - `type: "response.audio.transcript.done"`

      The type of the event. Always `response.audio.transcript.done`.

      - `"response.audio.transcript.done"`

    - `agent?: Agent | null`

      The agent that owns this multi-agent streaming event.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

  - `BetaResponseCodeInterpreterCallCodeDeltaEvent`

    Emitted when a partial code snippet is streamed by the code interpreter.

    - `delta: string`

      The partial code snippet being streamed by the code interpreter.

    - `item_id: string`

      The unique identifier of the code interpreter tool call item.

    - `output_index: number`

      The index of the output item in the response for which the code is being streamed.

    - `sequence_number: number`

      The sequence number of this event, used to order streaming events.

    - `type: "response.code_interpreter_call_code.delta"`

      The type of the event. Always `response.code_interpreter_call_code.delta`.

      - `"response.code_interpreter_call_code.delta"`

    - `agent?: Agent | null`

      The agent that owns this multi-agent streaming event.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

  - `BetaResponseCodeInterpreterCallCodeDoneEvent`

    Emitted when the code snippet is finalized by the code interpreter.

    - `code: string`

      The final code snippet output by the code interpreter.

    - `item_id: string`

      The unique identifier of the code interpreter tool call item.

    - `output_index: number`

      The index of the output item in the response for which the code is finalized.

    - `sequence_number: number`

      The sequence number of this event, used to order streaming events.

    - `type: "response.code_interpreter_call_code.done"`

      The type of the event. Always `response.code_interpreter_call_code.done`.

      - `"response.code_interpreter_call_code.done"`

    - `agent?: Agent | null`

      The agent that owns this multi-agent streaming event.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

  - `BetaResponseCodeInterpreterCallCompletedEvent`

    Emitted when the code interpreter call is completed.

    - `item_id: string`

      The unique identifier of the code interpreter tool call item.

    - `output_index: number`

      The index of the output item in the response for which the code interpreter call is completed.

    - `sequence_number: number`

      The sequence number of this event, used to order streaming events.

    - `type: "response.code_interpreter_call.completed"`

      The type of the event. Always `response.code_interpreter_call.completed`.

      - `"response.code_interpreter_call.completed"`

    - `agent?: Agent | null`

      The agent that owns this multi-agent streaming event.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

  - `BetaResponseCodeInterpreterCallInProgressEvent`

    Emitted when a code interpreter call is in progress.

    - `item_id: string`

      The unique identifier of the code interpreter tool call item.

    - `output_index: number`

      The index of the output item in the response for which the code interpreter call is in progress.

    - `sequence_number: number`

      The sequence number of this event, used to order streaming events.

    - `type: "response.code_interpreter_call.in_progress"`

      The type of the event. Always `response.code_interpreter_call.in_progress`.

      - `"response.code_interpreter_call.in_progress"`

    - `agent?: Agent | null`

      The agent that owns this multi-agent streaming event.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

  - `BetaResponseCodeInterpreterCallInterpretingEvent`

    Emitted when the code interpreter is actively interpreting the code snippet.

    - `item_id: string`

      The unique identifier of the code interpreter tool call item.

    - `output_index: number`

      The index of the output item in the response for which the code interpreter is interpreting code.

    - `sequence_number: number`

      The sequence number of this event, used to order streaming events.

    - `type: "response.code_interpreter_call.interpreting"`

      The type of the event. Always `response.code_interpreter_call.interpreting`.

      - `"response.code_interpreter_call.interpreting"`

    - `agent?: Agent | null`

      The agent that owns this multi-agent streaming event.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

  - `BetaResponseCompletedEvent`

    Emitted when the model response is complete.

    - `response: BetaResponse`

      Properties of the completed response.

      - `id: string`

        Unique identifier for this Response.

      - `created_at: number`

        Unix timestamp (in seconds) of when this Response was created.

      - `error: BetaResponseError | null`

        An error object returned when the model fails to generate a Response.

        - `code: "server_error" | "rate_limit_exceeded" | "invalid_prompt" | 17 more`

          The error code for the response.

          - `"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"`

        - `message: string`

          A human-readable description of the error.

      - `incomplete_details: IncompleteDetails | null`

        Details about why the response is incomplete.

        - `reason?: "max_output_tokens" | "content_filter"`

          The reason why the response is incomplete.

          - `"max_output_tokens"`

          - `"content_filter"`

      - `instructions: string | Array<BetaResponseInputItem> | null`

        A system (or developer) message inserted into the model's context.

        When using along with `previous_response_id`, the instructions from a previous
        response will not be carried over to the next response. This makes it simple
        to swap out system (or developer) messages in new responses.

        - `string`

        - `Array<BetaResponseInputItem>`

          - `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.

            - `content: string | BetaResponseInputMessageContentList`

              Text, image, or audio input to the model, used to generate a response.
              Can also contain previous assistant responses.

              - `string`

              - `BetaResponseInputMessageContentList = Array<BetaResponseInputContent>`

                A list of one or many input items to the model, containing different content
                types.

                - `BetaResponseInputText`

                  A text input to the model.

                  - `text: string`

                    The text input to the model.

                  - `type: "input_text"`

                    The type of the input item. Always `input_text`.

                    - `"input_text"`

                  - `prompt_cache_breakpoint?: PromptCacheBreakpoint`

                    Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.

                    - `mode: "explicit"`

                      The breakpoint mode. Always `explicit`.

                      - `"explicit"`

                - `BetaResponseInputImage`

                  An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision).

                  - `detail: BetaImageDetail`

                    The detail level of the image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`.

                    - `"low"`

                    - `"high"`

                    - `"auto"`

                    - `"original"`

                  - `type: "input_image"`

                    The type of the input item. Always `input_image`.

                    - `"input_image"`

                  - `file_id?: string | null`

                    The ID of the file to be sent to the model.

                  - `image_url?: string | null`

                    The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.

                  - `prompt_cache_breakpoint?: PromptCacheBreakpoint`

                    Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.

                    - `mode: "explicit"`

                      The breakpoint mode. Always `explicit`.

                      - `"explicit"`

                - `BetaResponseInputFile`

                  A file input to the model.

                  - `type: "input_file"`

                    The type of the input item. Always `input_file`.

                    - `"input_file"`

                  - `detail?: "auto" | "low" | "high"`

                    The detail level of the file to be sent to the model. Use `auto` to let the system select the detail level; for GPT-5.6 and later models, `auto` uses high-quality rendering, which may increase input token usage. Use `low` for lower-cost rendering, or `high` to render the file at higher quality. Defaults to `auto`.

                    - `"auto"`

                    - `"low"`

                    - `"high"`

                  - `file_data?: string`

                    The content of the file to be sent to the model.

                  - `file_id?: string | null`

                    The ID of the file to be sent to the model.

                  - `file_url?: string`

                    The URL of the file to be sent to the model.

                  - `filename?: string`

                    The name of the file to be sent to the model.

                  - `prompt_cache_breakpoint?: PromptCacheBreakpoint`

                    Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.

                    - `mode: "explicit"`

                      The breakpoint mode. Always `explicit`.

                      - `"explicit"`

            - `role: "user" | "assistant" | "system" | "developer"`

              The role of the message input. One of `user`, `assistant`, `system`, or
              `developer`.

              - `"user"`

              - `"assistant"`

              - `"system"`

              - `"developer"`

            - `phase?: "commentary" | "final_answer" | null`

              Labels an `assistant` message as intermediate commentary (`commentary`) or the final answer (`final_answer`).
              For models like `gpt-5.3-codex` and beyond, when sending follow-up requests, preserve and resend
              phase on all assistant messages — dropping it can degrade performance. Not used for user messages.

              - `"commentary"`

              - `"final_answer"`

            - `type?: "message"`

              The type of the message input. Always `message`.

              - `"message"`

          - `Message`

            A message input to the model with a role indicating instruction following
            hierarchy. Instructions given with the `developer` or `system` role take
            precedence over instructions given with the `user` role.

            - `content: BetaResponseInputMessageContentList`

              A list of one or many input items to the model, containing different content
              types.

            - `role: "user" | "system" | "developer"`

              The role of the message input. One of `user`, `system`, or `developer`.

              - `"user"`

              - `"system"`

              - `"developer"`

            - `agent?: Agent | null`

              The agent that produced this item.

              - `agent_name: string`

                The canonical name of the agent that produced this item.

            - `status?: "in_progress" | "completed" | "incomplete"`

              The status of item. One of `in_progress`, `completed`, or
              `incomplete`. Populated when items are returned via API.

              - `"in_progress"`

              - `"completed"`

              - `"incomplete"`

            - `type?: "message"`

              The type of the message input. Always set to `message`.

              - `"message"`

          - `BetaResponseOutputMessage`

            An output message from the model.

            - `id: string`

              The unique ID of the output message.

            - `content: Array<BetaResponseOutputText | BetaResponseOutputRefusal>`

              The content of the output message.

              - `BetaResponseOutputText`

                A text output from the model.

                - `annotations: Array<FileCitation | URLCitation | ContainerFileCitation | FilePath>`

                  The annotations of the text output.

                  - `FileCitation`

                    A citation to a file.

                    - `file_id: string`

                      The ID of the file.

                    - `filename: string`

                      The filename of the file cited.

                    - `index: number`

                      The index of the file in the list of files.

                    - `type: "file_citation"`

                      The type of the file citation. Always `file_citation`.

                      - `"file_citation"`

                  - `URLCitation`

                    A citation for a web resource used to generate a model response.

                    - `end_index: number`

                      The index of the last character of the URL citation in the message.

                    - `start_index: number`

                      The index of the first character of the URL citation in the message.

                    - `title: string`

                      The title of the web resource.

                    - `type: "url_citation"`

                      The type of the URL citation. Always `url_citation`.

                      - `"url_citation"`

                    - `url: string`

                      The URL of the web resource.

                  - `ContainerFileCitation`

                    A citation for a container file used to generate a model response.

                    - `container_id: string`

                      The ID of the container file.

                    - `end_index: number`

                      The index of the last character of the container file citation in the message.

                    - `file_id: string`

                      The ID of the file.

                    - `filename: string`

                      The filename of the container file cited.

                    - `start_index: number`

                      The index of the first character of the container file citation in the message.

                    - `type: "container_file_citation"`

                      The type of the container file citation. Always `container_file_citation`.

                      - `"container_file_citation"`

                  - `FilePath`

                    A path to a file.

                    - `file_id: string`

                      The ID of the file.

                    - `index: number`

                      The index of the file in the list of files.

                    - `type: "file_path"`

                      The type of the file path. Always `file_path`.

                      - `"file_path"`

                - `text: string`

                  The text output from the model.

                - `type: "output_text"`

                  The type of the output text. Always `output_text`.

                  - `"output_text"`

                - `logprobs?: Array<Logprob>`

                  - `token: string`

                  - `bytes: Array<number>`

                  - `logprob: number`

                  - `top_logprobs: Array<TopLogprob>`

                    - `token: string`

                    - `bytes: Array<number>`

                    - `logprob: number`

              - `BetaResponseOutputRefusal`

                A refusal from the model.

                - `refusal: string`

                  The refusal explanation from the model.

                - `type: "refusal"`

                  The type of the refusal. Always `refusal`.

                  - `"refusal"`

            - `role: "assistant"`

              The role of the output message. Always `assistant`.

              - `"assistant"`

            - `status: "in_progress" | "completed" | "incomplete"`

              The status of the message input. One of `in_progress`, `completed`, or
              `incomplete`. Populated when input items are returned via API.

              - `"in_progress"`

              - `"completed"`

              - `"incomplete"`

            - `type: "message"`

              The type of the output message. Always `message`.

              - `"message"`

            - `agent?: Agent | null`

              The agent that produced this item.

              - `agent_name: string`

                The canonical name of the agent that produced this item.

            - `phase?: "commentary" | "final_answer" | null`

              Labels an `assistant` message as intermediate commentary (`commentary`) or the final answer (`final_answer`).
              For models like `gpt-5.3-codex` and beyond, when sending follow-up requests, preserve and resend
              phase on all assistant messages — dropping it can degrade performance. Not used for user messages.

              - `"commentary"`

              - `"final_answer"`

          - `BetaResponseFileSearchToolCall`

            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.

            - `id: string`

              The unique ID of the file search tool call.

            - `queries: Array<string>`

              The queries used to search for files.

            - `status: "in_progress" | "searching" | "completed" | 2 more`

              The status of the file search tool call. One of `in_progress`,
              `searching`, `incomplete` or `failed`,

              - `"in_progress"`

              - `"searching"`

              - `"completed"`

              - `"incomplete"`

              - `"failed"`

            - `type: "file_search_call"`

              The type of the file search tool call. Always `file_search_call`.

              - `"file_search_call"`

            - `agent?: Agent | null`

              The agent that produced this item.

              - `agent_name: string`

                The canonical name of the agent that produced this item.

            - `results?: Array<Result> | null`

              The results of the file search tool call.

              - `attributes?: Record<string, string | number | boolean> | null`

                Set of 16 key-value pairs that can be attached to an object. This can be
                useful for storing additional information about the object in a structured
                format, and querying for objects via API or the dashboard. Keys are strings
                with a maximum length of 64 characters. Values are strings with a maximum
                length of 512 characters, booleans, or numbers.

                - `string`

                - `number`

                - `boolean`

              - `file_id?: string`

                The unique ID of the file.

              - `filename?: string`

                The name of the file.

              - `score?: number`

                The relevance score of the file - a value between 0 and 1.

              - `text?: string`

                The text that was retrieved from the file.

          - `BetaResponseComputerToolCall`

            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.

            - `id: string`

              The unique ID of the computer call.

            - `call_id: string`

              An identifier used when responding to the tool call with output.

            - `pending_safety_checks: Array<PendingSafetyCheck>`

              The pending safety checks for the computer call.

              - `id: string`

                The ID of the pending safety check.

              - `code?: string | null`

                The type of the pending safety check.

              - `message?: string | null`

                Details about the pending safety check.

            - `status: "in_progress" | "completed" | "incomplete"`

              The status of the item. One of `in_progress`, `completed`, or
              `incomplete`. Populated when items are returned via API.

              - `"in_progress"`

              - `"completed"`

              - `"incomplete"`

            - `type: "computer_call"`

              The type of the computer call. Always `computer_call`.

              - `"computer_call"`

            - `action?: BetaComputerAction`

              A click action.

              - `Click`

                A click action.

                - `button: "left" | "right" | "wheel" | 2 more`

                  Indicates which mouse button was pressed during the click. One of `left`, `right`, `wheel`, `back`, or `forward`.

                  - `"left"`

                  - `"right"`

                  - `"wheel"`

                  - `"back"`

                  - `"forward"`

                - `type: "click"`

                  Specifies the event type. For a click action, this property is always `click`.

                  - `"click"`

                - `x: number`

                  The x-coordinate where the click occurred.

                - `y: number`

                  The y-coordinate where the click occurred.

                - `keys?: Array<string> | null`

                  The keys being held while clicking.

              - `DoubleClick`

                A double click action.

                - `keys: Array<string> | null`

                  The keys being held while double-clicking.

                - `type: "double_click"`

                  Specifies the event type. For a double click action, this property is always set to `double_click`.

                  - `"double_click"`

                - `x: number`

                  The x-coordinate where the double click occurred.

                - `y: number`

                  The y-coordinate where the double click occurred.

              - `Drag`

                A drag action.

                - `path: Array<Path>`

                  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 }
                  ]
                  ```

                  - `x: number`

                    The x-coordinate.

                  - `y: number`

                    The y-coordinate.

                - `type: "drag"`

                  Specifies the event type. For a drag action, this property is always set to `drag`.

                  - `"drag"`

                - `keys?: Array<string> | null`

                  The keys being held while dragging the mouse.

              - `Keypress`

                A collection of keypresses the model would like to perform.

                - `keys: Array<string>`

                  The combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key.

                - `type: "keypress"`

                  Specifies the event type. For a keypress action, this property is always set to `keypress`.

                  - `"keypress"`

              - `Move`

                A mouse move action.

                - `type: "move"`

                  Specifies the event type. For a move action, this property is always set to `move`.

                  - `"move"`

                - `x: number`

                  The x-coordinate to move to.

                - `y: number`

                  The y-coordinate to move to.

                - `keys?: Array<string> | null`

                  The keys being held while moving the mouse.

              - `Screenshot`

                A screenshot action.

                - `type: "screenshot"`

                  Specifies the event type. For a screenshot action, this property is always set to `screenshot`.

                  - `"screenshot"`

              - `Scroll`

                A scroll action.

                - `scroll_x: number`

                  The horizontal scroll distance.

                - `scroll_y: number`

                  The vertical scroll distance.

                - `type: "scroll"`

                  Specifies the event type. For a scroll action, this property is always set to `scroll`.

                  - `"scroll"`

                - `x: number`

                  The x-coordinate where the scroll occurred.

                - `y: number`

                  The y-coordinate where the scroll occurred.

                - `keys?: Array<string> | null`

                  The keys being held while scrolling.

              - `Type`

                An action to type in text.

                - `text: string`

                  The text to type.

                - `type: "type"`

                  Specifies the event type. For a type action, this property is always set to `type`.

                  - `"type"`

              - `Wait`

                A wait action.

                - `type: "wait"`

                  Specifies the event type. For a wait action, this property is always set to `wait`.

                  - `"wait"`

            - `actions?: BetaComputerActionList`

              Flattened batched actions for `computer_use`. Each action includes an
              `type` discriminator and action-specific fields.

              - `Click`

                A click action.

              - `DoubleClick`

                A double click action.

              - `Drag`

                A drag action.

              - `Keypress`

                A collection of keypresses the model would like to perform.

              - `Move`

                A mouse move action.

              - `Screenshot`

                A screenshot action.

              - `Scroll`

                A scroll action.

              - `Type`

                An action to type in text.

              - `Wait`

                A wait action.

            - `agent?: Agent | null`

              The agent that produced this item.

              - `agent_name: string`

                The canonical name of the agent that produced this item.

          - `ComputerCallOutput`

            The output of a computer tool call.

            - `call_id: string`

              The ID of the computer tool call that produced the output.

            - `output: BetaResponseComputerToolCallOutputScreenshot`

              A computer screenshot image used with the computer use tool.

              - `type: "computer_screenshot"`

                Specifies the event type. For a computer screenshot, this property is
                always set to `computer_screenshot`.

                - `"computer_screenshot"`

              - `file_id?: string`

                The identifier of an uploaded file that contains the screenshot.

              - `image_url?: string`

                The URL of the screenshot image.

            - `type: "computer_call_output"`

              The type of the computer tool call output. Always `computer_call_output`.

              - `"computer_call_output"`

            - `id?: string | null`

              The ID of the computer tool call output.

            - `acknowledged_safety_checks?: Array<AcknowledgedSafetyCheck> | null`

              The safety checks reported by the API that have been acknowledged by the developer.

              - `id: string`

                The ID of the pending safety check.

              - `code?: string | null`

                The type of the pending safety check.

              - `message?: string | null`

                Details about the pending safety check.

            - `agent?: Agent | null`

              The agent that produced this item.

              - `agent_name: string`

                The canonical name of the agent that produced this item.

            - `status?: "in_progress" | "completed" | "incomplete" | null`

              The status of the message input. One of `in_progress`, `completed`, or `incomplete`. Populated when input items are returned via API.

              - `"in_progress"`

              - `"completed"`

              - `"incomplete"`

          - `BetaResponseFunctionWebSearch`

            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.

            - `id: string`

              The unique ID of the web search tool call.

            - `action: Search | OpenPage | FindInPage`

              An object describing the specific action taken in this web search call.
              Includes details on how the model used the web (search, open_page, find_in_page).

              - `Search`

                Action type "search" - Performs a web search query.

                - `type: "search"`

                  The action type.

                  - `"search"`

                - `queries?: Array<string>`

                  The search queries.

                - `query?: string`

                  The search query.

                - `sources?: Array<Source>`

                  The sources used in the search.

                  - `type: "url"`

                    The type of source. Always `url`.

                    - `"url"`

                  - `url: string`

                    The URL of the source.

              - `OpenPage`

                Action type "open_page" - Opens a specific URL from search results.

                - `type: "open_page"`

                  The action type.

                  - `"open_page"`

                - `url?: string | null`

                  The URL opened by the model.

              - `FindInPage`

                Action type "find_in_page": Searches for a pattern within a loaded page.

                - `pattern: string`

                  The pattern or text to search for within the page.

                - `type: "find_in_page"`

                  The action type.

                  - `"find_in_page"`

                - `url: string`

                  The URL of the page searched for the pattern.

            - `status: "in_progress" | "searching" | "completed" | "failed"`

              The status of the web search tool call.

              - `"in_progress"`

              - `"searching"`

              - `"completed"`

              - `"failed"`

            - `type: "web_search_call"`

              The type of the web search tool call. Always `web_search_call`.

              - `"web_search_call"`

            - `agent?: Agent | null`

              The agent that produced this item.

              - `agent_name: string`

                The canonical name of the agent that produced this item.

          - `BetaResponseFunctionToolCall`

            A tool call to run a function. See the
            [function calling guide](https://platform.openai.com/docs/guides/function-calling) for more information.

            - `arguments: string`

              A JSON string of the arguments to pass to the function.

            - `call_id: string`

              The unique ID of the function tool call generated by the model.

            - `name: string`

              The name of the function to run.

            - `type: "function_call"`

              The type of the function tool call. Always `function_call`.

              - `"function_call"`

            - `id?: string`

              The unique ID of the function tool call.

            - `agent?: Agent | null`

              The agent that produced this item.

              - `agent_name: string`

                The canonical name of the agent that produced this item.

            - `caller?: Direct | Program | null`

              The execution context that produced this tool call.

              - `Direct`

                - `type: "direct"`

                  - `"direct"`

              - `Program`

                - `caller_id: string`

                  The call ID of the program item that produced this tool call.

                - `type: "program"`

                  - `"program"`

            - `namespace?: string`

              The namespace of the function to run.

            - `status?: "in_progress" | "completed" | "incomplete"`

              The status of the item. One of `in_progress`, `completed`, or
              `incomplete`. Populated when items are returned via API.

              - `"in_progress"`

              - `"completed"`

              - `"incomplete"`

          - `FunctionCallOutput`

            The output of a function tool call.

            - `call_id: string`

              The unique ID of the function tool call generated by the model.

            - `output: string | BetaResponseFunctionCallOutputItemList`

              Text, image, or file output of the function tool call.

              - `string`

              - `BetaResponseFunctionCallOutputItemList = Array<BetaResponseFunctionCallOutputItem>`

                An array of content outputs (text, image, file) for the function tool call.

                - `BetaResponseInputTextContent`

                  A text input to the model.

                  - `text: string`

                    The text input to the model.

                  - `type: "input_text"`

                    The type of the input item. Always `input_text`.

                    - `"input_text"`

                  - `prompt_cache_breakpoint?: PromptCacheBreakpoint | null`

                    Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.

                    - `mode: "explicit"`

                      The breakpoint mode. Always `explicit`.

                      - `"explicit"`

                - `BetaResponseInputImageContent`

                  An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision)

                  - `type: "input_image"`

                    The type of the input item. Always `input_image`.

                    - `"input_image"`

                  - `detail?: BetaImageDetail | null`

                    The detail level of the image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`.

                  - `file_id?: string | null`

                    The ID of the file to be sent to the model.

                  - `image_url?: string | null`

                    The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.

                  - `prompt_cache_breakpoint?: PromptCacheBreakpoint | null`

                    Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.

                    - `mode: "explicit"`

                      The breakpoint mode. Always `explicit`.

                      - `"explicit"`

                - `BetaResponseInputFileContent`

                  A file input to the model.

                  - `type: "input_file"`

                    The type of the input item. Always `input_file`.

                    - `"input_file"`

                  - `detail?: "auto" | "low" | "high"`

                    The detail level of the file to be sent to the model. Use `auto` to let the system select the detail level; for GPT-5.6 and later models, `auto` uses high-quality rendering, which may increase input token usage. Use `low` for lower-cost rendering, or `high` to render the file at higher quality. Defaults to `auto`.

                    - `"auto"`

                    - `"low"`

                    - `"high"`

                  - `file_data?: string | null`

                    The base64-encoded data of the file to be sent to the model.

                  - `file_id?: string | null`

                    The ID of the file to be sent to the model.

                  - `file_url?: string | null`

                    The URL of the file to be sent to the model.

                  - `filename?: string | null`

                    The name of the file to be sent to the model.

                  - `prompt_cache_breakpoint?: PromptCacheBreakpoint | null`

                    Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.

                    - `mode: "explicit"`

                      The breakpoint mode. Always `explicit`.

                      - `"explicit"`

            - `type: "function_call_output"`

              The type of the function tool call output. Always `function_call_output`.

              - `"function_call_output"`

            - `id?: string | null`

              The unique ID of the function tool call output. Populated when this item is returned via API.

            - `agent?: Agent | null`

              The agent that produced this item.

              - `agent_name: string`

                The canonical name of the agent that produced this item.

            - `caller?: Direct | Program | null`

              The execution context that produced this tool call.

              - `Direct`

                - `type: "direct"`

                  The caller type. Always `direct`.

                  - `"direct"`

              - `Program`

                - `caller_id: string`

                  The call ID of the program item that produced this tool call.

                - `type: "program"`

                  The caller type. Always `program`.

                  - `"program"`

            - `name?: string | null`

              The name of the tool that produced the output.

            - `namespace?: string | null`

              The namespace of the tool that produced the output.

            - `status?: "in_progress" | "completed" | "incomplete" | null`

              The status of the item. One of `in_progress`, `completed`, or `incomplete`. Populated when items are returned via API.

              - `"in_progress"`

              - `"completed"`

              - `"incomplete"`

          - `AgentMessage`

            A message routed between agents.

            - `author: string`

              The sending agent identity.

            - `content: Array<BetaResponseInputTextContent | BetaResponseInputImageContent | EncryptedContent>`

              Plaintext, image, or encrypted content sent between agents.

              - `BetaResponseInputTextContent`

                A text input to the model.

              - `BetaResponseInputImageContent`

                An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision)

              - `EncryptedContent`

                Opaque encrypted content that Responses API decrypts inside trusted model execution.

                - `encrypted_content: string`

                  Opaque encrypted content.

                - `type: "encrypted_content"`

                  The type of the input item. Always `encrypted_content`.

                  - `"encrypted_content"`

            - `recipient: string`

              The destination agent identity.

            - `type: "agent_message"`

              The item type. Always `agent_message`.

              - `"agent_message"`

            - `id?: string | null`

              The unique ID of this agent message item.

            - `agent?: Agent | null`

              The agent that produced this item.

              - `agent_name: string`

                The canonical name of the agent that produced this item.

          - `MultiAgentCall`

            - `action: "spawn_agent" | "interrupt_agent" | "list_agents" | 3 more`

              The multi-agent action that was executed.

              - `"spawn_agent"`

              - `"interrupt_agent"`

              - `"list_agents"`

              - `"send_message"`

              - `"followup_task"`

              - `"wait_agent"`

            - `arguments: string`

              The action arguments as a JSON string.

            - `call_id: string`

              The unique ID linking this call to its output.

            - `type: "multi_agent_call"`

              The item type. Always `multi_agent_call`.

              - `"multi_agent_call"`

            - `id?: string | null`

              The unique ID of this multi-agent call.

            - `agent?: Agent | null`

              The agent that produced this item.

              - `agent_name: string`

                The canonical name of the agent that produced this item.

          - `MultiAgentCallOutput`

            - `action: "spawn_agent" | "interrupt_agent" | "list_agents" | 3 more`

              The multi-agent action that produced this result.

              - `"spawn_agent"`

              - `"interrupt_agent"`

              - `"list_agents"`

              - `"send_message"`

              - `"followup_task"`

              - `"wait_agent"`

            - `call_id: string`

              The unique ID of the multi-agent call.

            - `output: Array<Output>`

              Text output returned by the multi-agent action.

              - `text: string`

                The text content.

              - `type: "output_text"`

                The content type. Always `output_text`.

                - `"output_text"`

              - `annotations?: Array<FileCitation | URLCitation | ContainerFileCitation>`

                Citations associated with the text content.

                - `FileCitation`

                  - `file_id: string`

                    The ID of the file.

                  - `filename: string`

                    The filename of the file cited.

                  - `index: number`

                    The index of the file in the list of files.

                  - `type: "file_citation"`

                    The citation type. Always `file_citation`.

                    - `"file_citation"`

                - `URLCitation`

                  - `end_index: number`

                    The index of the last character of the citation in the message.

                  - `start_index: number`

                    The index of the first character of the citation in the message.

                  - `title: string`

                    The title of the cited resource.

                  - `type: "url_citation"`

                    The citation type. Always `url_citation`.

                    - `"url_citation"`

                  - `url: string`

                    The URL of the cited resource.

                - `ContainerFileCitation`

                  - `container_id: string`

                    The ID of the container.

                  - `end_index: number`

                    The index of the last character of the citation in the message.

                  - `file_id: string`

                    The ID of the container file.

                  - `filename: string`

                    The filename of the container file cited.

                  - `start_index: number`

                    The index of the first character of the citation in the message.

                  - `type: "container_file_citation"`

                    The citation type. Always `container_file_citation`.

                    - `"container_file_citation"`

            - `type: "multi_agent_call_output"`

              The item type. Always `multi_agent_call_output`.

              - `"multi_agent_call_output"`

            - `id?: string | null`

              The unique ID of this multi-agent call output.

            - `agent?: Agent | null`

              The agent that produced this item.

              - `agent_name: string`

                The canonical name of the agent that produced this item.

          - `ToolSearchCall`

            - `arguments: unknown`

              The arguments supplied to the tool search call.

            - `type: "tool_search_call"`

              The item type. Always `tool_search_call`.

              - `"tool_search_call"`

            - `id?: string | null`

              The unique ID of this tool search call.

            - `agent?: Agent | null`

              The agent that produced this item.

              - `agent_name: string`

                The canonical name of the agent that produced this item.

            - `call_id?: string | null`

              The unique ID of the tool search call generated by the model.

            - `execution?: "server" | "client"`

              Whether tool search was executed by the server or by the client.

              - `"server"`

              - `"client"`

            - `status?: "in_progress" | "completed" | "incomplete" | null`

              The status of the tool search call.

              - `"in_progress"`

              - `"completed"`

              - `"incomplete"`

          - `BetaResponseToolSearchOutputItemParam`

            - `tools: Array<BetaTool>`

              The loaded tool definitions returned by the tool search output.

              - `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).

                - `name: string`

                  The name of the function to call.

                - `parameters: Record<string, unknown> | null`

                  A JSON schema object describing the parameters of the function.

                - `strict: boolean | null`

                  Whether strict parameter validation is enforced for this function tool.

                - `type: "function"`

                  The type of the function tool. Always `function`.

                  - `"function"`

                - `allowed_callers?: Array<"direct" | "programmatic"> | null`

                  The tool invocation context(s).

                  - `"direct"`

                  - `"programmatic"`

                - `defer_loading?: boolean`

                  Whether this function is deferred and loaded via tool search.

                - `description?: string | null`

                  A description of the function. Used by the model to determine whether or not to call the function.

                - `output_schema?: Record<string, unknown> | null`

                  A JSON schema object describing the JSON value encoded in string outputs for this function.

              - `BetaFileSearchTool`

                A tool that searches for relevant content from uploaded files. Learn more about the [file search tool](https://platform.openai.com/docs/guides/tools-file-search).

                - `type: "file_search"`

                  The type of the file search tool. Always `file_search`.

                  - `"file_search"`

                - `vector_store_ids: Array<string>`

                  The IDs of the vector stores to search.

                - `filters?: ComparisonFilter | CompoundFilter | null`

                  A filter to apply.

                  - `ComparisonFilter`

                    A filter used to compare a specified attribute key to a given value using a defined comparison operation.

                    - `key: string`

                      The key to compare against the value.

                    - `type: "eq" | "ne" | "gt" | 5 more`

                      Specifies the comparison operator: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`, `in`, `nin`.

                      - `eq`: equals
                      - `ne`: not equal
                      - `gt`: greater than
                      - `gte`: greater than or equal
                      - `lt`: less than
                      - `lte`: less than or equal
                      - `in`: in
                      - `nin`: not in

                      - `"eq"`

                      - `"ne"`

                      - `"gt"`

                      - `"gte"`

                      - `"lt"`

                      - `"lte"`

                      - `"in"`

                      - `"nin"`

                    - `value: string | number | boolean | Array<string | number>`

                      The value to compare against the attribute key; supports string, number, or boolean types.

                      - `string`

                      - `number`

                      - `boolean`

                      - `Array<string | number>`

                        - `string`

                        - `number`

                  - `CompoundFilter`

                    Combine multiple filters using `and` or `or`.

                    - `filters: Array<ComparisonFilter | unknown>`

                      Array of filters to combine. Items can be `ComparisonFilter` or `CompoundFilter`.

                      - `ComparisonFilter`

                        A filter used to compare a specified attribute key to a given value using a defined comparison operation.

                        - `key: string`

                          The key to compare against the value.

                        - `type: "eq" | "ne" | "gt" | 5 more`

                          Specifies the comparison operator: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`, `in`, `nin`.

                          - `eq`: equals
                          - `ne`: not equal
                          - `gt`: greater than
                          - `gte`: greater than or equal
                          - `lt`: less than
                          - `lte`: less than or equal
                          - `in`: in
                          - `nin`: not in

                          - `"eq"`

                          - `"ne"`

                          - `"gt"`

                          - `"gte"`

                          - `"lt"`

                          - `"lte"`

                          - `"in"`

                          - `"nin"`

                        - `value: string | number | boolean | Array<string | number>`

                          The value to compare against the attribute key; supports string, number, or boolean types.

                          - `string`

                          - `number`

                          - `boolean`

                          - `Array<string | number>`

                            - `string`

                            - `number`

                      - `unknown`

                    - `type: "and" | "or"`

                      Type of operation: `and` or `or`.

                      - `"and"`

                      - `"or"`

                - `max_num_results?: number`

                  The maximum number of results to return. This number should be between 1 and 50 inclusive.

                - `ranking_options?: RankingOptions`

                  Ranking options for search.

                  - `hybrid_search?: HybridSearch`

                    Weights that control how reciprocal rank fusion balances semantic embedding matches versus sparse keyword matches when hybrid search is enabled.

                    - `embedding_weight: number`

                      The weight of the embedding in the reciprocal ranking fusion.

                    - `text_weight: number`

                      The weight of the text in the reciprocal ranking fusion.

                  - `ranker?: "auto" | "default-2024-11-15"`

                    The ranker to use for the file search.

                    - `"auto"`

                    - `"default-2024-11-15"`

                  - `score_threshold?: number`

                    The score threshold for the file search, a number between 0 and 1. Numbers closer to 1 will attempt to return only the most relevant results, but may return fewer results.

              - `BetaComputerTool`

                A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use).

                - `type: "computer"`

                  The type of the computer tool. Always `computer`.

                  - `"computer"`

              - `BetaComputerUsePreviewTool`

                A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use).

                - `display_height: number`

                  The height of the computer display.

                - `display_width: number`

                  The width of the computer display.

                - `environment: "windows" | "mac" | "linux" | 2 more`

                  The type of computer environment to control.

                  - `"windows"`

                  - `"mac"`

                  - `"linux"`

                  - `"ubuntu"`

                  - `"browser"`

                - `type: "computer_use_preview"`

                  The type of the computer use tool. Always `computer_use_preview`.

                  - `"computer_use_preview"`

              - `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"`

                  The type of the web search tool. One of `web_search` or `web_search_2025_08_26`.

                  - `"web_search"`

                  - `"web_search_2025_08_26"`

                - `external_web_access?: boolean`

                  Allow live internet access for web search. Defaults to true when omitted. When false, the web search tool runs in offline/cache-only mode and will not fetch new external content.

                - `filters?: Filters | null`

                  Filters for the search.

                  - `allowed_domains?: Array<string> | null`

                    Allowed domains for the search. If not provided, all domains are allowed.
                    Subdomains of the provided domains are allowed as well.

                    Example: `["pubmed.ncbi.nlm.nih.gov"]`

                - `search_context_size?: "low" | "medium" | "high"`

                  High level guidance for the amount of context window space to use for the search. One of `low`, `medium`, or `high`. `medium` is the default.

                  - `"low"`

                  - `"medium"`

                  - `"high"`

                - `user_location?: UserLocation | null`

                  The approximate location of the user.

                  - `city?: string | null`

                    Free text input for the city of the user, e.g. `San Francisco`.

                  - `country?: string | null`

                    The two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of the user, e.g. `US`.

                  - `region?: string | null`

                    Free text input for the region of the user, e.g. `California`.

                  - `timezone?: string | null`

                    The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of the user, e.g. `America/Los_Angeles`.

                  - `type?: "approximate"`

                    The type of location approximation. Always `approximate`.

                    - `"approximate"`

              - `Mcp`

                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).

                - `server_label: string`

                  A label for this MCP server, used to identify it in tool calls.

                - `type: "mcp"`

                  The type of the MCP tool. Always `mcp`.

                  - `"mcp"`

                - `allowed_callers?: Array<"direct" | "programmatic"> | null`

                  The tool invocation context(s).

                  - `"direct"`

                  - `"programmatic"`

                - `allowed_tools?: Array<string> | McpToolFilter | null`

                  List of allowed tool names or a filter object.

                  - `Array<string>`

                  - `McpToolFilter`

                    A filter object to specify which tools are allowed.

                    - `read_only?: boolean`

                      Indicates whether or not a tool modifies data or is read-only. If an
                      MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint),
                      it will match this filter.

                    - `tool_names?: Array<string>`

                      List of allowed tool names.

                - `authorization?: string`

                  An OAuth access token that can be used with a remote MCP server, either
                  with a custom MCP server URL or a service connector. Your application
                  must handle the OAuth authorization flow and provide the token here.

                - `connector_id?: "connector_dropbox" | "connector_gmail" | "connector_googlecalendar" | 5 more`

                  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`

                  - `"connector_dropbox"`

                  - `"connector_gmail"`

                  - `"connector_googlecalendar"`

                  - `"connector_googledrive"`

                  - `"connector_microsoftteams"`

                  - `"connector_outlookcalendar"`

                  - `"connector_outlookemail"`

                  - `"connector_sharepoint"`

                - `defer_loading?: boolean`

                  Whether this MCP tool is deferred and discovered via tool search.

                - `headers?: Record<string, string> | null`

                  Optional HTTP headers to send to the MCP server. Use for authentication
                  or other purposes.

                - `require_approval?: McpToolApprovalFilter | "always" | "never" | null`

                  Specify which of the MCP server's tools require approval.

                  - `McpToolApprovalFilter`

                    Specify which of the MCP server's tools require approval. Can be
                    `always`, `never`, or a filter object associated with tools
                    that require approval.

                    - `always?: Always`

                      A filter object to specify which tools are allowed.

                      - `read_only?: boolean`

                        Indicates whether or not a tool modifies data or is read-only. If an
                        MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint),
                        it will match this filter.

                      - `tool_names?: Array<string>`

                        List of allowed tool names.

                    - `never?: Never`

                      A filter object to specify which tools are allowed.

                      - `read_only?: boolean`

                        Indicates whether or not a tool modifies data or is read-only. If an
                        MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint),
                        it will match this filter.

                      - `tool_names?: Array<string>`

                        List of allowed tool names.

                  - `"always" | "never"`

                    - `"always"`

                    - `"never"`

                - `server_description?: string`

                  Optional description of the MCP server, used to provide more context.

                - `server_url?: string`

                  The URL for the MCP server. One of `server_url`, `connector_id`, or
                  `tunnel_id` must be provided.

                - `tunnel_id?: string`

                  The Secure MCP Tunnel ID to use instead of a direct server URL. One of
                  `server_url`, `connector_id`, or `tunnel_id` must be provided.

              - `CodeInterpreter`

                A tool that runs Python code to help generate a response to a prompt.

                - `container: string | CodeInterpreterToolAuto`

                  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`

                  - `CodeInterpreterToolAuto`

                    Configuration for a code interpreter container. Optionally specify the IDs of the files to run the code on.

                    - `type: "auto"`

                      Always `auto`.

                      - `"auto"`

                    - `file_ids?: Array<string>`

                      An optional list of uploaded files to make available to your code.

                    - `memory_limit?: "1g" | "4g" | "16g" | "64g" | null`

                      The memory limit for the code interpreter container.

                      - `"1g"`

                      - `"4g"`

                      - `"16g"`

                      - `"64g"`

                    - `network_policy?: BetaContainerNetworkPolicyDisabled | BetaContainerNetworkPolicyAllowlist`

                      Network access policy for the container.

                      - `BetaContainerNetworkPolicyDisabled`

                        - `type: "disabled"`

                          Disable outbound network access. Always `disabled`.

                          - `"disabled"`

                      - `BetaContainerNetworkPolicyAllowlist`

                        - `allowed_domains: Array<string>`

                          A list of allowed domains when type is `allowlist`.

                        - `type: "allowlist"`

                          Allow outbound network access only to specified domains. Always `allowlist`.

                          - `"allowlist"`

                        - `domain_secrets?: Array<BetaContainerNetworkPolicyDomainSecret>`

                          Optional domain-scoped secrets for allowlisted domains.

                          - `domain: string`

                            The domain associated with the secret.

                          - `name: string`

                            The name of the secret to inject for the domain.

                          - `value: string`

                            The secret value to inject for the domain.

                - `type: "code_interpreter"`

                  The type of the code interpreter tool. Always `code_interpreter`.

                  - `"code_interpreter"`

                - `allowed_callers?: Array<"direct" | "programmatic"> | null`

                  The tool invocation context(s).

                  - `"direct"`

                  - `"programmatic"`

              - `ProgrammaticToolCalling`

                - `type: "programmatic_tool_calling"`

                  The type of the tool. Always `programmatic_tool_calling`.

                  - `"programmatic_tool_calling"`

              - `ImageGeneration`

                A tool that generates images using the GPT image models.

                - `type: "image_generation"`

                  The type of the image generation tool. Always `image_generation`.

                  - `"image_generation"`

                - `action?: "generate" | "edit" | "auto"`

                  Whether to generate a new image or edit an existing image. Default: `auto`.

                  - `"generate"`

                  - `"edit"`

                  - `"auto"`

                - `background?: "transparent" | "opaque" | "auto"`

                  Allows to set transparency for the background of the generated image(s).
                  Must be one of `transparent`, `opaque`, or `auto` (default value). When
                  `auto` is used, the model will automatically determine the best
                  background for the image.

                  Transparent backgrounds are available for supported GPT Image models.
                  For `gpt-image-2` and `gpt-image-2-2026-04-21`, this support is in
                  preview. When using `transparent`, set the output format to `png` or
                  `webp`.

                  - `"transparent"`

                  - `"opaque"`

                  - `"auto"`

                - `input_fidelity?: "high" | "low" | null`

                  Control how much effort the model will exert to match the style and features, especially facial features, of input images. This parameter is only supported for `gpt-image-1` and `gpt-image-1.5` and later models, unsupported for `gpt-image-1-mini`. Supports `high` and `low`. Defaults to `low`.

                  - `"high"`

                  - `"low"`

                - `input_image_mask?: InputImageMask`

                  Optional mask for inpainting. Contains `image_url`
                  (string, optional) and `file_id` (string, optional).

                  - `file_id?: string`

                    File ID for the mask image.

                  - `image_url?: string`

                    Base64-encoded mask image.

                - `model?: (string & {}) | "gpt-image-1" | "gpt-image-1-mini" | "gpt-image-2" | 3 more`

                  The image generation model to use. One of `gpt-image-1`,
                  `gpt-image-1-mini`, `gpt-image-1.5`, `gpt-image-2`,
                  `gpt-image-2-2026-04-21`, or `chatgpt-image-latest`. Default:
                  `gpt-image-1`.

                  - `(string & {})`

                  - `"gpt-image-1" | "gpt-image-1-mini" | "gpt-image-2" | 3 more`

                    - `"gpt-image-1"`

                    - `"gpt-image-1-mini"`

                    - `"gpt-image-2"`

                    - `"gpt-image-2-2026-04-21"`

                    - `"gpt-image-1.5"`

                    - `"chatgpt-image-latest"`

                - `moderation?: "auto" | "low"`

                  Moderation level for the generated image. Default: `auto`.

                  - `"auto"`

                  - `"low"`

                - `output_compression?: number`

                  Compression level for the output image. Default: 100.

                - `output_format?: "png" | "webp" | "jpeg"`

                  The output format of the generated image. One of `png`, `webp`, or
                  `jpeg`. Default: `png`.

                  - `"png"`

                  - `"webp"`

                  - `"jpeg"`

                - `partial_images?: number`

                  Number of partial images to generate in streaming mode, from 0 (default value) to 3.

                - `quality?: "low" | "medium" | "high" | "auto"`

                  The quality of the generated image. One of `low`, `medium`, `high`,
                  or `auto`. Default: `auto`.

                  - `"low"`

                  - `"medium"`

                  - `"high"`

                  - `"auto"`

                - `size?: (string & {}) | "1024x1024" | "1024x1536" | "1536x1024" | "auto"`

                  The size of the generated images. For `gpt-image-2` and `gpt-image-2-2026-04-21`, arbitrary resolutions are supported as `WIDTHxHEIGHT` strings, for example `1536x864`. Width and height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above `2560x1440` are experimental, and the maximum supported resolution is `3840x2160`. The requested size must also satisfy the model's current pixel and edge limits. The standard sizes `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models; `auto` is supported for models that allow automatic sizing. For `dall-e-2`, use one of `256x256`, `512x512`, or `1024x1024`. For `dall-e-3`, use one of `1024x1024`, `1792x1024`, or `1024x1792`.

                  - `(string & {})`

                  - `"1024x1024" | "1024x1536" | "1536x1024" | "auto"`

                    - `"1024x1024"`

                    - `"1024x1536"`

                    - `"1536x1024"`

                    - `"auto"`

              - `LocalShell`

                A tool that allows the model to execute shell commands in a local environment.

                - `type: "local_shell"`

                  The type of the local shell tool. Always `local_shell`.

                  - `"local_shell"`

              - `BetaFunctionShellTool`

                A tool that allows the model to execute shell commands.

                - `type: "shell"`

                  The type of the shell tool. Always `shell`.

                  - `"shell"`

                - `allowed_callers?: Array<"direct" | "programmatic"> | null`

                  The tool invocation context(s).

                  - `"direct"`

                  - `"programmatic"`

                - `environment?: BetaContainerAuto | BetaLocalEnvironment | BetaContainerReference | null`

                  - `BetaContainerAuto`

                    - `type: "container_auto"`

                      Automatically creates a container for this request

                      - `"container_auto"`

                    - `file_ids?: Array<string>`

                      An optional list of uploaded files to make available to your code.

                    - `memory_limit?: "1g" | "4g" | "16g" | "64g" | null`

                      The memory limit for the container.

                      - `"1g"`

                      - `"4g"`

                      - `"16g"`

                      - `"64g"`

                    - `network_policy?: BetaContainerNetworkPolicyDisabled | BetaContainerNetworkPolicyAllowlist`

                      Network access policy for the container.

                      - `BetaContainerNetworkPolicyDisabled`

                      - `BetaContainerNetworkPolicyAllowlist`

                    - `skills?: Array<BetaSkillReference | BetaInlineSkill>`

                      An optional list of skills referenced by id or inline data.

                      - `BetaSkillReference`

                        - `skill_id: string`

                          The ID of the referenced skill.

                        - `type: "skill_reference"`

                          References a skill created with the /v1/skills endpoint.

                          - `"skill_reference"`

                        - `version?: string`

                          Optional skill version. Use a positive integer or 'latest'. Omit for default.

                      - `BetaInlineSkill`

                        - `description: string`

                          The description of the skill.

                        - `name: string`

                          The name of the skill.

                        - `source: BetaInlineSkillSource`

                          Inline skill payload

                          - `data: string`

                            Base64-encoded skill zip bundle.

                          - `media_type: "application/zip"`

                            The media type of the inline skill payload. Must be `application/zip`.

                            - `"application/zip"`

                          - `type: "base64"`

                            The type of the inline skill source. Must be `base64`.

                            - `"base64"`

                        - `type: "inline"`

                          Defines an inline skill for this request.

                          - `"inline"`

                  - `BetaLocalEnvironment`

                    - `type: "local"`

                      Use a local computer environment.

                      - `"local"`

                    - `skills?: Array<BetaLocalSkill>`

                      An optional list of skills.

                      - `description: string`

                        The description of the skill.

                      - `name: string`

                        The name of the skill.

                      - `path: string`

                        The path to the directory containing the skill.

                  - `BetaContainerReference`

                    - `container_id: string`

                      The ID of the referenced container.

                    - `type: "container_reference"`

                      References a container created with the /v1/containers endpoint

                      - `"container_reference"`

              - `BetaCustomTool`

                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)

                - `name: string`

                  The name of the custom tool, used to identify it in tool calls.

                - `type: "custom"`

                  The type of the custom tool. Always `custom`.

                  - `"custom"`

                - `allowed_callers?: Array<"direct" | "programmatic"> | null`

                  The tool invocation context(s).

                  - `"direct"`

                  - `"programmatic"`

                - `defer_loading?: boolean`

                  Whether this tool should be deferred and discovered via tool search.

                - `description?: string`

                  Optional description of the custom tool, used to provide more context.

                - `format?: Text | Grammar`

                  The input format for the custom tool. Default is unconstrained text.

                  - `Text`

                    Unconstrained free-form text.

                    - `type: "text"`

                      Unconstrained text format. Always `text`.

                      - `"text"`

                  - `Grammar`

                    A grammar defined by the user.

                    - `definition: string`

                      The grammar definition.

                    - `syntax: "lark" | "regex"`

                      The syntax of the grammar definition. One of `lark` or `regex`.

                      - `"lark"`

                      - `"regex"`

                    - `type: "grammar"`

                      Grammar format. Always `grammar`.

                      - `"grammar"`

              - `BetaNamespaceTool`

                Groups function/custom tools under a shared namespace.

                - `description: string`

                  A description of the namespace shown to the model.

                - `name: string`

                  The namespace name used in tool calls (for example, `crm`).

                - `tools: Array<Function | BetaCustomTool>`

                  The function/custom tools available inside this namespace.

                  - `Function`

                    - `name: string`

                    - `type: "function"`

                      - `"function"`

                    - `allowed_callers?: Array<"direct" | "programmatic"> | null`

                      The tool invocation context(s).

                      - `"direct"`

                      - `"programmatic"`

                    - `defer_loading?: boolean`

                      Whether this function should be deferred and discovered via tool search.

                    - `description?: string | null`

                    - `output_schema?: Record<string, unknown> | null`

                      A JSON Schema describing the JSON value encoded in string outputs for this function tool. This does not describe content-array outputs.

                    - `parameters?: unknown`

                    - `strict?: boolean | null`

                      Whether to enforce strict parameter validation. If omitted, Responses attempts to use strict validation when the schema is compatible, and falls back to non-strict validation otherwise.

                  - `BetaCustomTool`

                    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: "namespace"`

                  The type of the tool. Always `namespace`.

                  - `"namespace"`

              - `BetaToolSearchTool`

                Hosted or BYOT tool search configuration for deferred tools.

                - `type: "tool_search"`

                  The type of the tool. Always `tool_search`.

                  - `"tool_search"`

                - `description?: string | null`

                  Description shown to the model for a client-executed tool search tool.

                - `execution?: "server" | "client"`

                  Whether tool search is executed by the server or by the client.

                  - `"server"`

                  - `"client"`

                - `parameters?: unknown`

                  Parameter schema for a client-executed tool search tool.

              - `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"`

                  The type of the web search tool. One of `web_search_preview` or `web_search_preview_2025_03_11`.

                  - `"web_search_preview"`

                  - `"web_search_preview_2025_03_11"`

                - `search_content_types?: Array<"text" | "image">`

                  - `"text"`

                  - `"image"`

                - `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.

                  - `"low"`

                  - `"medium"`

                  - `"high"`

                - `user_location?: UserLocation | null`

                  The user's location.

                  - `type: "approximate"`

                    The type of location approximation. Always `approximate`.

                    - `"approximate"`

                  - `city?: string | null`

                    Free text input for the city of the user, e.g. `San Francisco`.

                  - `country?: string | null`

                    The two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of the user, e.g. `US`.

                  - `region?: string | null`

                    Free text input for the region of the user, e.g. `California`.

                  - `timezone?: string | null`

                    The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of the user, e.g. `America/Los_Angeles`.

              - `BetaApplyPatchTool`

                Allows the assistant to create, delete, or update files using unified diffs.

                - `type: "apply_patch"`

                  The type of the tool. Always `apply_patch`.

                  - `"apply_patch"`

                - `allowed_callers?: Array<"direct" | "programmatic"> | null`

                  The tool invocation context(s).

                  - `"direct"`

                  - `"programmatic"`

            - `type: "tool_search_output"`

              The item type. Always `tool_search_output`.

              - `"tool_search_output"`

            - `id?: string | null`

              The unique ID of this tool search output.

            - `agent?: Agent | null`

              The agent that produced this item.

              - `agent_name: string`

                The canonical name of the agent that produced this item.

            - `call_id?: string | null`

              The unique ID of the tool search call generated by the model.

            - `execution?: "server" | "client"`

              Whether tool search was executed by the server or by the client.

              - `"server"`

              - `"client"`

            - `status?: "in_progress" | "completed" | "incomplete" | null`

              The status of the tool search output.

              - `"in_progress"`

              - `"completed"`

              - `"incomplete"`

          - `AdditionalTools`

            - `role: "developer"`

              The role that provided the additional tools. Only `developer` is supported.

              - `"developer"`

            - `tools: Array<BetaTool>`

              A list of additional tools made available at this item.

              - `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).

              - `Mcp`

                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).

              - `CodeInterpreter`

                A tool that runs Python code to help generate a response to a prompt.

              - `ProgrammaticToolCalling`

              - `ImageGeneration`

                A tool that generates images using the GPT image models.

              - `LocalShell`

                A tool that allows the model to execute shell commands in a local environment.

              - `BetaFunctionShellTool`

                A tool that allows the model to execute shell commands.

              - `BetaCustomTool`

                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)

              - `BetaNamespaceTool`

                Groups function/custom tools under a shared namespace.

              - `BetaToolSearchTool`

                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).

              - `BetaApplyPatchTool`

                Allows the assistant to create, delete, or update files using unified diffs.

            - `type: "additional_tools"`

              The item type. Always `additional_tools`.

              - `"additional_tools"`

            - `id?: string | null`

              The unique ID of this additional tools item.

            - `agent?: Agent | null`

              The agent that produced this item.

              - `agent_name: string`

                The canonical name of the agent that produced this item.

          - `BetaResponseReasoningItem`

            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).

            - `id: string`

              The unique identifier of the reasoning content.

            - `summary: Array<Summary>`

              Reasoning summary content.

              - `text: string`

                A summary of the reasoning output from the model so far.

              - `type: "summary_text"`

                The type of the object. Always `summary_text`.

                - `"summary_text"`

            - `type: "reasoning"`

              The type of the object. Always `reasoning`.

              - `"reasoning"`

            - `agent?: Agent | null`

              The agent that produced this item.

              - `agent_name: string`

                The canonical name of the agent that produced this item.

            - `content?: Array<Content>`

              Reasoning text content.

              - `text: string`

                The reasoning text from the model.

              - `type: "reasoning_text"`

                The type of the reasoning text. Always `reasoning_text`.

                - `"reasoning_text"`

            - `encrypted_content?: string | null`

              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.

              When streaming, use the completed reasoning item and its
              `encrypted_content` from the `response.output_item.done` event in
              subsequent requests. The `encrypted_content` in
              `response.output_item.added` may be incomplete. This is especially
              important when `store` is `false` or when using Zero Data Retention.

            - `status?: "in_progress" | "completed" | "incomplete"`

              The status of the item. One of `in_progress`, `completed`, or
              `incomplete`. Populated when items are returned via API.

              - `"in_progress"`

              - `"completed"`

              - `"incomplete"`

          - `BetaResponseCompactionItemParam`

            A compaction item generated by the [`v1/responses/compact` API](https://platform.openai.com/docs/api-reference/responses/compact).

            - `encrypted_content: string`

              The encrypted content of the compaction summary.

            - `type: "compaction"`

              The type of the item. Always `compaction`.

              - `"compaction"`

            - `id?: string | null`

              The ID of the compaction item.

            - `agent?: Agent | null`

              The agent that produced this item.

              - `agent_name: string`

                The canonical name of the agent that produced this item.

          - `ImageGenerationCall`

            An image generation request made by the model.

            - `id: string`

              The unique ID of the image generation call.

            - `result: string | null`

              The generated image encoded in base64.

            - `status: "in_progress" | "completed" | "generating" | "failed"`

              The status of the image generation call.

              - `"in_progress"`

              - `"completed"`

              - `"generating"`

              - `"failed"`

            - `type: "image_generation_call"`

              The type of the image generation call. Always `image_generation_call`.

              - `"image_generation_call"`

            - `agent?: Agent | null`

              The agent that produced this item.

              - `agent_name: string`

                The canonical name of the agent that produced this item.

          - `BetaResponseCodeInterpreterToolCall`

            A tool call to run code.

            - `id: string`

              The unique ID of the code interpreter tool call.

            - `code: string | null`

              The code to run, or null if not available.

            - `container_id: string`

              The ID of the container used to run the code.

            - `outputs: Array<Logs | Image> | null`

              The outputs generated by the code interpreter, such as logs or images.
              Can be null if no outputs are available.

              - `Logs`

                The logs output from the code interpreter.

                - `logs: string`

                  The logs output from the code interpreter.

                - `type: "logs"`

                  The type of the output. Always `logs`.

                  - `"logs"`

              - `Image`

                The image output from the code interpreter.

                - `type: "image"`

                  The type of the output. Always `image`.

                  - `"image"`

                - `url: string`

                  The URL of the image output from the code interpreter.

            - `status: "in_progress" | "completed" | "incomplete" | 2 more`

              The status of the code interpreter tool call. Valid values are `in_progress`, `completed`, `incomplete`, `interpreting`, and `failed`.

              - `"in_progress"`

              - `"completed"`

              - `"incomplete"`

              - `"interpreting"`

              - `"failed"`

            - `type: "code_interpreter_call"`

              The type of the code interpreter tool call. Always `code_interpreter_call`.

              - `"code_interpreter_call"`

            - `agent?: Agent | null`

              The agent that produced this item.

              - `agent_name: string`

                The canonical name of the agent that produced this item.

          - `LocalShellCall`

            A tool call to run a command on the local shell.

            - `id: string`

              The unique ID of the local shell call.

            - `action: Action`

              Execute a shell command on the server.

              - `command: Array<string>`

                The command to run.

              - `env: Record<string, string>`

                Environment variables to set for the command.

              - `type: "exec"`

                The type of the local shell action. Always `exec`.

                - `"exec"`

              - `timeout_ms?: number | null`

                Optional timeout in milliseconds for the command.

              - `user?: string | null`

                Optional user to run the command as.

              - `working_directory?: string | null`

                Optional working directory to run the command in.

            - `call_id: string`

              The unique ID of the local shell tool call generated by the model.

            - `status: "in_progress" | "completed" | "incomplete"`

              The status of the local shell call.

              - `"in_progress"`

              - `"completed"`

              - `"incomplete"`

            - `type: "local_shell_call"`

              The type of the local shell call. Always `local_shell_call`.

              - `"local_shell_call"`

            - `agent?: Agent | null`

              The agent that produced this item.

              - `agent_name: string`

                The canonical name of the agent that produced this item.

          - `LocalShellCallOutput`

            The output of a local shell tool call.

            - `id: string`

              The unique ID of the local shell tool call generated by the model.

            - `output: string`

              A JSON string of the output of the local shell tool call.

            - `type: "local_shell_call_output"`

              The type of the local shell tool call output. Always `local_shell_call_output`.

              - `"local_shell_call_output"`

            - `agent?: Agent | null`

              The agent that produced this item.

              - `agent_name: string`

                The canonical name of the agent that produced this item.

            - `status?: "in_progress" | "completed" | "incomplete" | null`

              The status of the item. One of `in_progress`, `completed`, or `incomplete`.

              - `"in_progress"`

              - `"completed"`

              - `"incomplete"`

          - `ShellCall`

            A tool representing a request to execute one or more shell commands.

            - `action: Action`

              The shell commands and limits that describe how to run the tool call.

              - `commands: Array<string>`

                Ordered shell commands for the execution environment to run.

              - `max_output_length?: number | null`

                Maximum number of UTF-8 characters to capture from combined stdout and stderr output.

              - `timeout_ms?: number | null`

                Maximum wall-clock time in milliseconds to allow the shell commands to run.

            - `call_id: string`

              The unique ID of the shell tool call generated by the model.

            - `type: "shell_call"`

              The type of the item. Always `shell_call`.

              - `"shell_call"`

            - `id?: string | null`

              The unique ID of the shell tool call. Populated when this item is returned via API.

            - `agent?: Agent | null`

              The agent that produced this item.

              - `agent_name: string`

                The canonical name of the agent that produced this item.

            - `caller?: Direct | Program | null`

              The execution context that produced this tool call.

              - `Direct`

                - `type: "direct"`

                  The caller type. Always `direct`.

                  - `"direct"`

              - `Program`

                - `caller_id: string`

                  The call ID of the program item that produced this tool call.

                - `type: "program"`

                  The caller type. Always `program`.

                  - `"program"`

            - `environment?: BetaLocalEnvironment | BetaContainerReference | null`

              The environment to execute the shell commands in.

              - `BetaLocalEnvironment`

              - `BetaContainerReference`

            - `status?: "in_progress" | "completed" | "incomplete" | null`

              The status of the shell call. One of `in_progress`, `completed`, or `incomplete`.

              - `"in_progress"`

              - `"completed"`

              - `"incomplete"`

          - `ShellCallOutput`

            The streamed output items emitted by a shell tool call.

            - `call_id: string`

              The unique ID of the shell tool call generated by the model.

            - `output: Array<BetaResponseFunctionShellCallOutputContent>`

              Captured chunks of stdout and stderr output, along with their associated outcomes.

              - `outcome: Timeout | Exit`

                The exit or timeout outcome associated with this shell call.

                - `Timeout`

                  Indicates that the shell call exceeded its configured time limit.

                  - `type: "timeout"`

                    The outcome type. Always `timeout`.

                    - `"timeout"`

                - `Exit`

                  Indicates that the shell commands finished and returned an exit code.

                  - `exit_code: number`

                    The exit code returned by the shell process.

                  - `type: "exit"`

                    The outcome type. Always `exit`.

                    - `"exit"`

              - `stderr: string`

                Captured stderr output for the shell call.

              - `stdout: string`

                Captured stdout output for the shell call.

            - `type: "shell_call_output"`

              The type of the item. Always `shell_call_output`.

              - `"shell_call_output"`

            - `id?: string | null`

              The unique ID of the shell tool call output. Populated when this item is returned via API.

            - `agent?: Agent | null`

              The agent that produced this item.

              - `agent_name: string`

                The canonical name of the agent that produced this item.

            - `caller?: Direct | Program | null`

              The execution context that produced this tool call.

              - `Direct`

                - `type: "direct"`

                  The caller type. Always `direct`.

                  - `"direct"`

              - `Program`

                - `caller_id: string`

                  The call ID of the program item that produced this tool call.

                - `type: "program"`

                  The caller type. Always `program`.

                  - `"program"`

            - `max_output_length?: number | null`

              The maximum number of UTF-8 characters captured for this shell call's combined output.

            - `status?: "in_progress" | "completed" | "incomplete" | null`

              The status of the shell call output.

              - `"in_progress"`

              - `"completed"`

              - `"incomplete"`

          - `ApplyPatchCall`

            A tool call representing a request to create, delete, or update files using diff patches.

            - `call_id: string`

              The unique ID of the apply patch tool call generated by the model.

            - `operation: CreateFile | DeleteFile | UpdateFile`

              The specific create, delete, or update instruction for the apply_patch tool call.

              - `CreateFile`

                Instruction for creating a new file via the apply_patch tool.

                - `diff: string`

                  Unified diff content to apply when creating the file.

                - `path: string`

                  Path of the file to create relative to the workspace root.

                - `type: "create_file"`

                  The operation type. Always `create_file`.

                  - `"create_file"`

              - `DeleteFile`

                Instruction for deleting an existing file via the apply_patch tool.

                - `path: string`

                  Path of the file to delete relative to the workspace root.

                - `type: "delete_file"`

                  The operation type. Always `delete_file`.

                  - `"delete_file"`

              - `UpdateFile`

                Instruction for updating an existing file via the apply_patch tool.

                - `diff: string`

                  Unified diff content to apply to the existing file.

                - `path: string`

                  Path of the file to update relative to the workspace root.

                - `type: "update_file"`

                  The operation type. Always `update_file`.

                  - `"update_file"`

            - `status: "in_progress" | "completed"`

              The status of the apply patch tool call. One of `in_progress` or `completed`.

              - `"in_progress"`

              - `"completed"`

            - `type: "apply_patch_call"`

              The type of the item. Always `apply_patch_call`.

              - `"apply_patch_call"`

            - `id?: string | null`

              The unique ID of the apply patch tool call. Populated when this item is returned via API.

            - `agent?: Agent | null`

              The agent that produced this item.

              - `agent_name: string`

                The canonical name of the agent that produced this item.

            - `caller?: Direct | Program | null`

              The execution context that produced this tool call.

              - `Direct`

                - `type: "direct"`

                  The caller type. Always `direct`.

                  - `"direct"`

              - `Program`

                - `caller_id: string`

                  The call ID of the program item that produced this tool call.

                - `type: "program"`

                  The caller type. Always `program`.

                  - `"program"`

          - `ApplyPatchCallOutput`

            The streamed output emitted by an apply patch tool call.

            - `call_id: string`

              The unique ID of the apply patch tool call generated by the model.

            - `status: "completed" | "failed"`

              The status of the apply patch tool call output. One of `completed` or `failed`.

              - `"completed"`

              - `"failed"`

            - `type: "apply_patch_call_output"`

              The type of the item. Always `apply_patch_call_output`.

              - `"apply_patch_call_output"`

            - `id?: string | null`

              The unique ID of the apply patch tool call output. Populated when this item is returned via API.

            - `agent?: Agent | null`

              The agent that produced this item.

              - `agent_name: string`

                The canonical name of the agent that produced this item.

            - `caller?: Direct | Program | null`

              The execution context that produced this tool call.

              - `Direct`

                - `type: "direct"`

                  The caller type. Always `direct`.

                  - `"direct"`

              - `Program`

                - `caller_id: string`

                  The call ID of the program item that produced this tool call.

                - `type: "program"`

                  The caller type. Always `program`.

                  - `"program"`

            - `output?: string | null`

              Optional human-readable log text from the apply patch tool (e.g., patch results or errors).

          - `McpListTools`

            A list of tools available on an MCP server.

            - `id: string`

              The unique ID of the list.

            - `server_label: string`

              The label of the MCP server.

            - `tools: Array<Tool>`

              The tools available on the server.

              - `input_schema: unknown`

                The JSON schema describing the tool's input.

              - `name: string`

                The name of the tool.

              - `annotations?: unknown`

                Additional annotations about the tool.

              - `description?: string | null`

                The description of the tool.

            - `type: "mcp_list_tools"`

              The type of the item. Always `mcp_list_tools`.

              - `"mcp_list_tools"`

            - `agent?: Agent | null`

              The agent that produced this item.

              - `agent_name: string`

                The canonical name of the agent that produced this item.

            - `error?: string | null`

              Error message if the server could not list tools.

          - `McpApprovalRequest`

            A request for human approval of a tool invocation.

            - `id: string`

              The unique ID of the approval request.

            - `arguments: string`

              A JSON string of arguments for the tool.

            - `name: string`

              The name of the tool to run.

            - `server_label: string`

              The label of the MCP server making the request.

            - `type: "mcp_approval_request"`

              The type of the item. Always `mcp_approval_request`.

              - `"mcp_approval_request"`

            - `agent?: Agent | null`

              The agent that produced this item.

              - `agent_name: string`

                The canonical name of the agent that produced this item.

          - `McpApprovalResponse`

            A response to an MCP approval request.

            - `approval_request_id: string`

              The ID of the approval request being answered.

            - `approve: boolean`

              Whether the request was approved.

            - `type: "mcp_approval_response"`

              The type of the item. Always `mcp_approval_response`.

              - `"mcp_approval_response"`

            - `id?: string | null`

              The unique ID of the approval response

            - `agent?: Agent | null`

              The agent that produced this item.

              - `agent_name: string`

                The canonical name of the agent that produced this item.

            - `reason?: string | null`

              Optional reason for the decision.

          - `McpCall`

            An invocation of a tool on an MCP server.

            - `id: string`

              The unique ID of the tool call.

            - `arguments: string`

              A JSON string of the arguments passed to the tool.

            - `name: string`

              The name of the tool that was run.

            - `server_label: string`

              The label of the MCP server running the tool.

            - `type: "mcp_call"`

              The type of the item. Always `mcp_call`.

              - `"mcp_call"`

            - `agent?: Agent | null`

              The agent that produced this item.

              - `agent_name: string`

                The canonical name of the agent that produced this item.

            - `approval_request_id?: string | null`

              Unique identifier for the MCP tool call approval request.
              Include this value in a subsequent `mcp_approval_response` input to approve or reject the corresponding tool call.

            - `error?: BetaMcpToolCallError | null`

              The error from the tool call, if any.

              - `McpProtocolError`

                - `code: number`

                - `message: string`

                - `type: "mcp_protocol_error"`

                  - `"mcp_protocol_error"`

              - `McpToolExecutionError`

                - `content: unknown`

                - `type: "mcp_tool_execution_error"`

                  - `"mcp_tool_execution_error"`

              - `HTTPError`

                - `code: number`

                - `message: string`

                - `type: "http_error"`

                  - `"http_error"`

            - `output?: string | null`

              The output from the tool call.

            - `status?: "in_progress" | "completed" | "incomplete" | 2 more`

              The status of the tool call. One of `in_progress`, `completed`, `incomplete`, `calling`, or `failed`.

              - `"in_progress"`

              - `"completed"`

              - `"incomplete"`

              - `"calling"`

              - `"failed"`

          - `BetaResponseCustomToolCallOutput`

            The output of a custom tool call from your code, being sent back to the model.

            - `call_id: string`

              The call ID, used to map this custom tool call output to a custom tool call.

            - `output: string | Array<BetaResponseInputText | BetaResponseInputImage | BetaResponseInputFile>`

              The output from the custom tool call generated by your code.
              Can be a string or an list of output content.

              - `string`

              - `Array<BetaResponseInputText | BetaResponseInputImage | BetaResponseInputFile>`

                - `BetaResponseInputText`

                  A text input to the model.

                - `BetaResponseInputImage`

                  An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision).

                - `BetaResponseInputFile`

                  A file input to the model.

            - `type: "custom_tool_call_output"`

              The type of the custom tool call output. Always `custom_tool_call_output`.

              - `"custom_tool_call_output"`

            - `id?: string`

              The unique ID of the custom tool call output in the OpenAI platform.

            - `agent?: Agent | null`

              The agent that produced this item.

              - `agent_name: string`

                The canonical name of the agent that produced this item.

            - `caller?: Direct | Program | null`

              The execution context that produced this tool call.

              - `Direct`

                - `type: "direct"`

                  The caller type. Always `direct`.

                  - `"direct"`

              - `Program`

                - `caller_id: string`

                  The call ID of the program item that produced this tool call.

                - `type: "program"`

                  The caller type. Always `program`.

                  - `"program"`

          - `BetaResponseCustomToolCall`

            A call to a custom tool created by the model.

            - `call_id: string`

              An identifier used to map this custom tool call to a tool call output.

            - `input: string`

              The input for the custom tool call generated by the model.

            - `name: string`

              The name of the custom tool being called.

            - `type: "custom_tool_call"`

              The type of the custom tool call. Always `custom_tool_call`.

              - `"custom_tool_call"`

            - `id?: string`

              The unique ID of the custom tool call in the OpenAI platform.

            - `agent?: Agent | null`

              The agent that produced this item.

              - `agent_name: string`

                The canonical name of the agent that produced this item.

            - `caller?: Direct | Program | null`

              The execution context that produced this tool call.

              - `Direct`

                - `type: "direct"`

                  - `"direct"`

              - `Program`

                - `caller_id: string`

                  The call ID of the program item that produced this tool call.

                - `type: "program"`

                  - `"program"`

            - `namespace?: string`

              The namespace of the custom tool being called.

          - `CompactionTrigger`

            Compacts the current context. Must be the final input item.

            - `type: "compaction_trigger"`

              The type of the item. Always `compaction_trigger`.

              - `"compaction_trigger"`

            - `agent?: Agent | null`

              The agent that produced this item.

              - `agent_name: string`

                The canonical name of the agent that produced this item.

          - `ItemReference`

            An internal identifier for an item to reference.

            - `id: string`

              The ID of the item to reference.

            - `agent?: Agent | null`

              The agent that produced this item.

              - `agent_name: string`

                The canonical name of the agent that produced this item.

            - `type?: "item_reference" | null`

              The type of item to reference. Always `item_reference`.

              - `"item_reference"`

          - `Program`

            - `id: string`

              The unique ID of this program item.

            - `call_id: string`

              The stable call ID of the program item.

            - `code: string`

              The JavaScript source executed by programmatic tool calling.

            - `fingerprint: string`

              Opaque program replay fingerprint that must be round-tripped.

            - `type: "program"`

              The item type. Always `program`.

              - `"program"`

            - `agent?: Agent | null`

              The agent that produced this item.

              - `agent_name: string`

                The canonical name of the agent that produced this item.

          - `ProgramOutput`

            - `id: string`

              The unique ID of this program output item.

            - `call_id: string`

              The call ID of the program item.

            - `result: string`

              The result produced by the program item.

            - `status: "completed" | "incomplete"`

              The terminal status of the program output.

              - `"completed"`

              - `"incomplete"`

            - `type: "program_output"`

              The item type. Always `program_output`.

              - `"program_output"`

            - `agent?: Agent | null`

              The agent that produced this item.

              - `agent_name: string`

                The canonical name of the agent that produced this item.

      - `metadata: Record<string, string> | null`

        Set of 16 key-value pairs that can be attached to an object. This can be
        useful for storing additional information about the object in a structured
        format, and querying for objects via API or the dashboard.

        Keys are strings with a maximum length of 64 characters. Values are strings
        with a maximum length of 512 characters.

      - `model: "gpt-5.6-sol" | "gpt-5.6-terra" | "gpt-5.6-luna" | 99 more | (string & {})`

        Model ID used to generate the response, like `gpt-4o` or `o3`. OpenAI
        offers a wide range of models with different capabilities, performance
        characteristics, and price points. Refer to the [model guide](https://platform.openai.com/docs/models)
        to browse and compare available models.

        - `"gpt-5.6-sol" | "gpt-5.6-terra" | "gpt-5.6-luna" | 99 more`

          - `"gpt-5.6-sol"`

          - `"gpt-5.6-terra"`

          - `"gpt-5.6-luna"`

          - `"gpt-5.5"`

          - `"gpt-5.5-2026-04-23"`

          - `"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.5-pro"`

          - `"gpt-5.5-pro-2026-04-23"`

          - `"gpt-5-codex"`

          - `"gpt-5-pro"`

          - `"gpt-5-pro-2025-10-06"`

          - `"gpt-5.1-codex-max"`

          - `"gpt-daybreak-blue-latest"`

          - `"gpt-daybreak-red-latest"`

          - `"gpt-5.6-cyber"`

        - `(string & {})`

      - `object: "response"`

        The object type of this resource - always set to `response`.

        - `"response"`

      - `output: Array<BetaResponseOutputItem>`

        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.

        - `BetaResponseOutputMessage`

          An output message from the model.

        - `BetaResponseFileSearchToolCall`

          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.

        - `BetaResponseFunctionToolCall`

          A tool call to run a function. See the
          [function calling guide](https://platform.openai.com/docs/guides/function-calling) for more information.

        - `BetaResponseFunctionToolCallOutputItem`

          - `id: string`

            The unique ID of the function call tool output.

          - `call_id: string`

            The unique ID of the function tool call generated by the model.

          - `output: string | Array<BetaResponseInputText | BetaResponseInputImage | BetaResponseInputFile>`

            The output from the function call generated by your code.
            Can be a string or an list of output content.

            - `string`

            - `Array<BetaResponseInputText | BetaResponseInputImage | BetaResponseInputFile>`

              - `BetaResponseInputText`

                A text input to the model.

              - `BetaResponseInputImage`

                An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision).

              - `BetaResponseInputFile`

                A file input to 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.

            - `"in_progress"`

            - `"completed"`

            - `"incomplete"`

          - `type: "function_call_output"`

            The type of the function tool call output. Always `function_call_output`.

            - `"function_call_output"`

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

          - `caller?: Direct | Program | null`

            The execution context that produced this tool call.

            - `Direct`

              - `type: "direct"`

                The caller type. Always `direct`.

                - `"direct"`

            - `Program`

              - `caller_id: string`

                The call ID of the program item that produced this tool call.

              - `type: "program"`

                The caller type. Always `program`.

                - `"program"`

          - `created_by?: string`

            The identifier of the actor that created the item.

          - `name?: string`

            The name of the tool that produced the output.

          - `namespace?: string`

            The namespace of the tool that produced the output.

        - `AgentMessage`

          - `id: string`

            The unique ID of the agent message.

          - `author: string`

            The sending agent identity.

          - `content: Array<BetaResponseInputText | BetaResponseOutputText | Text | 7 more>`

            Encrypted content sent between agents.

            - `BetaResponseInputText`

              A text input to the model.

            - `BetaResponseOutputText`

              A text output from the model.

            - `Text`

              A text content.

              - `text: string`

              - `type: "text"`

                - `"text"`

            - `SummaryText`

              A summary text from the model.

              - `text: string`

                A summary of the reasoning output from the model so far.

              - `type: "summary_text"`

                The type of the object. Always `summary_text`.

                - `"summary_text"`

            - `ReasoningText`

              Reasoning text from the model.

              - `text: string`

                The reasoning text from the model.

              - `type: "reasoning_text"`

                The type of the reasoning text. Always `reasoning_text`.

                - `"reasoning_text"`

            - `BetaResponseOutputRefusal`

              A refusal from the model.

            - `BetaResponseInputImage`

              An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision).

            - `ComputerScreenshot`

              A screenshot of a computer.

              - `detail: BetaImageDetail`

                The detail level of the screenshot image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`.

              - `file_id: string | null`

                The identifier of an uploaded file that contains the screenshot.

              - `image_url: string | null`

                The URL of the screenshot image.

              - `type: "computer_screenshot"`

                Specifies the event type. For a computer screenshot, this property is always set to `computer_screenshot`.

                - `"computer_screenshot"`

              - `prompt_cache_breakpoint?: PromptCacheBreakpoint`

                Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.

                - `mode: "explicit"`

                  The breakpoint mode. Always `explicit`.

                  - `"explicit"`

            - `BetaResponseInputFile`

              A file input to the model.

            - `EncryptedContent`

              Opaque encrypted content that Responses API decrypts inside trusted model execution.

              - `encrypted_content: string`

                Opaque encrypted content.

              - `type: "encrypted_content"`

                The type of the input item. Always `encrypted_content`.

                - `"encrypted_content"`

          - `recipient: string`

            The destination agent identity.

          - `type: "agent_message"`

            The type of the item. Always `agent_message`.

            - `"agent_message"`

          - `agent?: Agent`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

        - `MultiAgentCall`

          - `id: string`

            The unique ID of the multi-agent call item.

          - `action: "spawn_agent" | "interrupt_agent" | "list_agents" | 3 more`

            The multi-agent action to execute.

            - `"spawn_agent"`

            - `"interrupt_agent"`

            - `"list_agents"`

            - `"send_message"`

            - `"followup_task"`

            - `"wait_agent"`

          - `arguments: string`

            The JSON string of arguments generated for the action.

          - `call_id: string`

            The unique ID linking this call to its output.

          - `type: "multi_agent_call"`

            The type of the multi-agent call. Always `multi_agent_call`.

            - `"multi_agent_call"`

          - `agent?: Agent`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

        - `MultiAgentCallOutput`

          - `id: string`

            The unique ID of the multi-agent call output item.

          - `action: "spawn_agent" | "interrupt_agent" | "list_agents" | 3 more`

            The multi-agent action that produced this result.

            - `"spawn_agent"`

            - `"interrupt_agent"`

            - `"list_agents"`

            - `"send_message"`

            - `"followup_task"`

            - `"wait_agent"`

          - `call_id: string`

            The unique ID of the multi-agent call.

          - `output: Array<BetaResponseOutputText>`

            Text output returned by the multi-agent action.

            - `annotations: Array<FileCitation | URLCitation | ContainerFileCitation | FilePath>`

              The annotations of the text output.

            - `text: string`

              The text output from the model.

            - `type: "output_text"`

              The type of the output text. Always `output_text`.

            - `logprobs?: Array<Logprob>`

          - `type: "multi_agent_call_output"`

            The type of the multi-agent result. Always `multi_agent_call_output`.

            - `"multi_agent_call_output"`

          - `agent?: Agent`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

        - `BetaResponseFunctionWebSearch`

          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.

        - `BetaResponseComputerToolCall`

          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.

        - `BetaResponseComputerToolCallOutputItem`

          - `id: string`

            The unique ID of the computer call tool output.

          - `call_id: string`

            The ID of the computer tool call that produced the output.

          - `output: BetaResponseComputerToolCallOutputScreenshot`

            A computer screenshot image used with the computer use tool.

          - `status: "completed" | "incomplete" | "failed" | "in_progress"`

            The status of the message input. One of `in_progress`, `completed`, or
            `incomplete`. Populated when input items are returned via API.

            - `"completed"`

            - `"incomplete"`

            - `"failed"`

            - `"in_progress"`

          - `type: "computer_call_output"`

            The type of the computer tool call output. Always `computer_call_output`.

            - `"computer_call_output"`

          - `acknowledged_safety_checks?: Array<AcknowledgedSafetyCheck>`

            The safety checks reported by the API that have been acknowledged by the
            developer.

            - `id: string`

              The ID of the pending safety check.

            - `code?: string | null`

              The type of the pending safety check.

            - `message?: string | null`

              Details about the pending safety check.

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

          - `created_by?: string`

            The identifier of the actor that created the item.

        - `BetaResponseReasoningItem`

          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).

        - `Program`

          - `id: string`

            The unique ID of the program item.

          - `call_id: string`

            The stable call ID of the program item.

          - `code: string`

            The JavaScript source executed by programmatic tool calling.

          - `fingerprint: string`

            Opaque program replay fingerprint that must be round-tripped.

          - `type: "program"`

            The type of the item. Always `program`.

            - `"program"`

          - `agent?: Agent`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

        - `ProgramOutput`

          - `id: string`

            The unique ID of the program output item.

          - `call_id: string`

            The call ID of the program item.

          - `result: string`

            The result produced by the program item.

          - `status: "completed" | "incomplete"`

            The terminal status of the program output item.

            - `"completed"`

            - `"incomplete"`

          - `type: "program_output"`

            The type of the item. Always `program_output`.

            - `"program_output"`

          - `agent?: Agent`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

        - `BetaResponseToolSearchCall`

          - `id: string`

            The unique ID of the tool search call item.

          - `arguments: unknown`

            Arguments used for the tool search call.

          - `call_id: string | null`

            The unique ID of the tool search call generated by the model.

          - `execution: "server" | "client"`

            Whether tool search was executed by the server or by the client.

            - `"server"`

            - `"client"`

          - `status: "in_progress" | "completed" | "incomplete"`

            The status of the tool search call item that was recorded.

            - `"in_progress"`

            - `"completed"`

            - `"incomplete"`

          - `type: "tool_search_call"`

            The type of the item. Always `tool_search_call`.

            - `"tool_search_call"`

          - `agent?: Agent`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

          - `created_by?: string`

            The identifier of the actor that created the item.

        - `BetaResponseToolSearchOutputItem`

          - `id: string`

            The unique ID of the tool search output item.

          - `call_id: string | null`

            The unique ID of the tool search call generated by the model.

          - `execution: "server" | "client"`

            Whether tool search was executed by the server or by the client.

            - `"server"`

            - `"client"`

          - `status: "in_progress" | "completed" | "incomplete"`

            The status of the tool search output item that was recorded.

            - `"in_progress"`

            - `"completed"`

            - `"incomplete"`

          - `tools: Array<BetaTool>`

            The loaded tool definitions returned by tool search.

            - `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).

            - `Mcp`

              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).

            - `CodeInterpreter`

              A tool that runs Python code to help generate a response to a prompt.

            - `ProgrammaticToolCalling`

            - `ImageGeneration`

              A tool that generates images using the GPT image models.

            - `LocalShell`

              A tool that allows the model to execute shell commands in a local environment.

            - `BetaFunctionShellTool`

              A tool that allows the model to execute shell commands.

            - `BetaCustomTool`

              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)

            - `BetaNamespaceTool`

              Groups function/custom tools under a shared namespace.

            - `BetaToolSearchTool`

              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).

            - `BetaApplyPatchTool`

              Allows the assistant to create, delete, or update files using unified diffs.

          - `type: "tool_search_output"`

            The type of the item. Always `tool_search_output`.

            - `"tool_search_output"`

          - `agent?: Agent`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

          - `created_by?: string`

            The identifier of the actor that created the item.

        - `AdditionalTools`

          - `id: string`

            The unique ID of the additional tools item.

          - `role: "unknown" | "user" | "assistant" | 5 more`

            The role that provided the additional tools.

            - `"unknown"`

            - `"user"`

            - `"assistant"`

            - `"system"`

            - `"critic"`

            - `"discriminator"`

            - `"developer"`

            - `"tool"`

          - `tools: Array<BetaTool>`

            The additional tool definitions made available at this item.

            - `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).

            - `Mcp`

              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).

            - `CodeInterpreter`

              A tool that runs Python code to help generate a response to a prompt.

            - `ProgrammaticToolCalling`

            - `ImageGeneration`

              A tool that generates images using the GPT image models.

            - `LocalShell`

              A tool that allows the model to execute shell commands in a local environment.

            - `BetaFunctionShellTool`

              A tool that allows the model to execute shell commands.

            - `BetaCustomTool`

              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)

            - `BetaNamespaceTool`

              Groups function/custom tools under a shared namespace.

            - `BetaToolSearchTool`

              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).

            - `BetaApplyPatchTool`

              Allows the assistant to create, delete, or update files using unified diffs.

          - `type: "additional_tools"`

            The type of the item. Always `additional_tools`.

            - `"additional_tools"`

          - `agent?: Agent`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

        - `BetaResponseCompactionItem`

          A compaction item generated by the [`v1/responses/compact` API](https://platform.openai.com/docs/api-reference/responses/compact).

          - `id: string`

            The unique ID of the compaction item.

          - `encrypted_content: string`

            The encrypted content that was produced by compaction.

          - `type: "compaction"`

            The type of the item. Always `compaction`.

            - `"compaction"`

          - `agent?: Agent`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

          - `created_by?: string`

            The identifier of the actor that created the item.

        - `ImageGenerationCall`

          An image generation request made by the model.

          - `id: string`

            The unique ID of the image generation call.

          - `result: string | null`

            The generated image encoded in base64.

          - `status: "in_progress" | "completed" | "generating" | "failed"`

            The status of the image generation call.

            - `"in_progress"`

            - `"completed"`

            - `"generating"`

            - `"failed"`

          - `type: "image_generation_call"`

            The type of the image generation call. Always `image_generation_call`.

            - `"image_generation_call"`

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

        - `BetaResponseCodeInterpreterToolCall`

          A tool call to run code.

        - `LocalShellCall`

          A tool call to run a command on the local shell.

          - `id: string`

            The unique ID of the local shell call.

          - `action: Action`

            Execute a shell command on the server.

            - `command: Array<string>`

              The command to run.

            - `env: Record<string, string>`

              Environment variables to set for the command.

            - `type: "exec"`

              The type of the local shell action. Always `exec`.

              - `"exec"`

            - `timeout_ms?: number | null`

              Optional timeout in milliseconds for the command.

            - `user?: string | null`

              Optional user to run the command as.

            - `working_directory?: string | null`

              Optional working directory to run the command in.

          - `call_id: string`

            The unique ID of the local shell tool call generated by the model.

          - `status: "in_progress" | "completed" | "incomplete"`

            The status of the local shell call.

            - `"in_progress"`

            - `"completed"`

            - `"incomplete"`

          - `type: "local_shell_call"`

            The type of the local shell call. Always `local_shell_call`.

            - `"local_shell_call"`

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

        - `LocalShellCallOutput`

          The output of a local shell tool call.

          - `id: string`

            The unique ID of the local shell tool call generated by the model.

          - `output: string`

            A JSON string of the output of the local shell tool call.

          - `type: "local_shell_call_output"`

            The type of the local shell tool call output. Always `local_shell_call_output`.

            - `"local_shell_call_output"`

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

          - `status?: "in_progress" | "completed" | "incomplete" | null`

            The status of the item. One of `in_progress`, `completed`, or `incomplete`.

            - `"in_progress"`

            - `"completed"`

            - `"incomplete"`

        - `BetaResponseFunctionShellToolCall`

          A tool call that executes one or more shell commands in a managed environment.

          - `id: string`

            The unique ID of the shell tool call. Populated when this item is returned via API.

          - `action: Action`

            The shell commands and limits that describe how to run the tool call.

            - `commands: Array<string>`

            - `max_output_length: number | null`

              Optional maximum number of characters to return from each command.

            - `timeout_ms: number | null`

              Optional timeout in milliseconds for the commands.

          - `call_id: string`

            The unique ID of the shell tool call generated by the model.

          - `environment: BetaResponseLocalEnvironment | BetaResponseContainerReference | null`

            Represents the use of a local environment to perform shell actions.

            - `BetaResponseLocalEnvironment`

              Represents the use of a local environment to perform shell actions.

              - `type: "local"`

                The environment type. Always `local`.

                - `"local"`

            - `BetaResponseContainerReference`

              Represents a container created with /v1/containers.

              - `container_id: string`

              - `type: "container_reference"`

                The environment type. Always `container_reference`.

                - `"container_reference"`

          - `status: "in_progress" | "completed" | "incomplete"`

            The status of the shell call. One of `in_progress`, `completed`, or `incomplete`.

            - `"in_progress"`

            - `"completed"`

            - `"incomplete"`

          - `type: "shell_call"`

            The type of the item. Always `shell_call`.

            - `"shell_call"`

          - `agent?: Agent`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

          - `caller?: Direct | Program | null`

            The execution context that produced this tool call.

            - `Direct`

              - `type: "direct"`

                - `"direct"`

            - `Program`

              - `caller_id: string`

                The call ID of the program item that produced this tool call.

              - `type: "program"`

                - `"program"`

          - `created_by?: string`

            The ID of the entity that created this tool call.

        - `BetaResponseFunctionShellToolCallOutput`

          The output of a shell tool call that was emitted.

          - `id: string`

            The unique ID of the shell call output. Populated when this item is returned via API.

          - `call_id: string`

            The unique ID of the shell tool call generated by the model.

          - `max_output_length: number | null`

            The maximum length of the shell command output. This is generated by the model and should be passed back with the raw output.

          - `output: Array<Output>`

            An array of shell call output contents

            - `outcome: Timeout | Exit`

              Represents either an exit outcome (with an exit code) or a timeout outcome for a shell call output chunk.

              - `Timeout`

                Indicates that the shell call exceeded its configured time limit.

                - `type: "timeout"`

                  The outcome type. Always `timeout`.

                  - `"timeout"`

              - `Exit`

                Indicates that the shell commands finished and returned an exit code.

                - `exit_code: number`

                  Exit code from the shell process.

                - `type: "exit"`

                  The outcome type. Always `exit`.

                  - `"exit"`

            - `stderr: string`

              The standard error output that was captured.

            - `stdout: string`

              The standard output that was captured.

            - `created_by?: string`

              The identifier of the actor that created the item.

          - `status: "in_progress" | "completed" | "incomplete"`

            The status of the shell call output. One of `in_progress`, `completed`, or `incomplete`.

            - `"in_progress"`

            - `"completed"`

            - `"incomplete"`

          - `type: "shell_call_output"`

            The type of the shell call output. Always `shell_call_output`.

            - `"shell_call_output"`

          - `agent?: Agent`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

          - `caller?: Direct | Program | null`

            The execution context that produced this tool call.

            - `Direct`

              - `type: "direct"`

                - `"direct"`

            - `Program`

              - `caller_id: string`

                The call ID of the program item that produced this tool call.

              - `type: "program"`

                - `"program"`

          - `created_by?: string`

            The identifier of the actor that created the item.

        - `BetaResponseApplyPatchToolCall`

          A tool call that applies file diffs by creating, deleting, or updating files.

          - `id: string`

            The unique ID of the apply patch tool call. Populated when this item is returned via API.

          - `call_id: string`

            The unique ID of the apply patch tool call generated by the model.

          - `operation: CreateFile | DeleteFile | UpdateFile`

            One of the create_file, delete_file, or update_file operations applied via apply_patch.

            - `CreateFile`

              Instruction describing how to create a file via the apply_patch tool.

              - `diff: string`

                Diff to apply.

              - `path: string`

                Path of the file to create.

              - `type: "create_file"`

                Create a new file with the provided diff.

                - `"create_file"`

            - `DeleteFile`

              Instruction describing how to delete a file via the apply_patch tool.

              - `path: string`

                Path of the file to delete.

              - `type: "delete_file"`

                Delete the specified file.

                - `"delete_file"`

            - `UpdateFile`

              Instruction describing how to update a file via the apply_patch tool.

              - `diff: string`

                Diff to apply.

              - `path: string`

                Path of the file to update.

              - `type: "update_file"`

                Update an existing file with the provided diff.

                - `"update_file"`

          - `status: "in_progress" | "completed"`

            The status of the apply patch tool call. One of `in_progress` or `completed`.

            - `"in_progress"`

            - `"completed"`

          - `type: "apply_patch_call"`

            The type of the item. Always `apply_patch_call`.

            - `"apply_patch_call"`

          - `agent?: Agent`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

          - `caller?: Direct | Program | null`

            The execution context that produced this tool call.

            - `Direct`

              - `type: "direct"`

                - `"direct"`

            - `Program`

              - `caller_id: string`

                The call ID of the program item that produced this tool call.

              - `type: "program"`

                - `"program"`

          - `created_by?: string`

            The ID of the entity that created this tool call.

        - `BetaResponseApplyPatchToolCallOutput`

          The output emitted by an apply patch tool call.

          - `id: string`

            The unique ID of the apply patch tool call output. Populated when this item is returned via API.

          - `call_id: string`

            The unique ID of the apply patch tool call generated by the model.

          - `status: "completed" | "failed"`

            The status of the apply patch tool call output. One of `completed` or `failed`.

            - `"completed"`

            - `"failed"`

          - `type: "apply_patch_call_output"`

            The type of the item. Always `apply_patch_call_output`.

            - `"apply_patch_call_output"`

          - `agent?: Agent`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

          - `caller?: Direct | Program | null`

            The execution context that produced this tool call.

            - `Direct`

              - `type: "direct"`

                - `"direct"`

            - `Program`

              - `caller_id: string`

                The call ID of the program item that produced this tool call.

              - `type: "program"`

                - `"program"`

          - `created_by?: string`

            The ID of the entity that created this tool call output.

          - `output?: string | null`

            Optional textual output returned by the apply patch tool.

        - `McpCall`

          An invocation of a tool on an MCP server.

          - `id: string`

            The unique ID of the tool call.

          - `arguments: string`

            A JSON string of the arguments passed to the tool.

          - `name: string`

            The name of the tool that was run.

          - `server_label: string`

            The label of the MCP server running the tool.

          - `type: "mcp_call"`

            The type of the item. Always `mcp_call`.

            - `"mcp_call"`

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

          - `approval_request_id?: string | null`

            Unique identifier for the MCP tool call approval request.
            Include this value in a subsequent `mcp_approval_response` input to approve or reject the corresponding tool call.

          - `error?: BetaMcpToolCallError | null`

            The error from the tool call, if any.

          - `output?: string | null`

            The output from the tool call.

          - `status?: "in_progress" | "completed" | "incomplete" | 2 more`

            The status of the tool call. One of `in_progress`, `completed`, `incomplete`, `calling`, or `failed`.

            - `"in_progress"`

            - `"completed"`

            - `"incomplete"`

            - `"calling"`

            - `"failed"`

        - `McpListTools`

          A list of tools available on an MCP server.

          - `id: string`

            The unique ID of the list.

          - `server_label: string`

            The label of the MCP server.

          - `tools: Array<Tool>`

            The tools available on the server.

            - `input_schema: unknown`

              The JSON schema describing the tool's input.

            - `name: string`

              The name of the tool.

            - `annotations?: unknown`

              Additional annotations about the tool.

            - `description?: string | null`

              The description of the tool.

          - `type: "mcp_list_tools"`

            The type of the item. Always `mcp_list_tools`.

            - `"mcp_list_tools"`

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

          - `error?: string | null`

            Error message if the server could not list tools.

        - `McpApprovalRequest`

          A request for human approval of a tool invocation.

          - `id: string`

            The unique ID of the approval request.

          - `arguments: string`

            A JSON string of arguments for the tool.

          - `name: string`

            The name of the tool to run.

          - `server_label: string`

            The label of the MCP server making the request.

          - `type: "mcp_approval_request"`

            The type of the item. Always `mcp_approval_request`.

            - `"mcp_approval_request"`

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

        - `McpApprovalResponse`

          A response to an MCP approval request.

          - `id: string`

            The unique ID of the approval response

          - `approval_request_id: string`

            The ID of the approval request being answered.

          - `approve: boolean`

            Whether the request was approved.

          - `type: "mcp_approval_response"`

            The type of the item. Always `mcp_approval_response`.

            - `"mcp_approval_response"`

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

          - `reason?: string | null`

            Optional reason for the decision.

        - `BetaResponseCustomToolCall`

          A call to a custom tool created by the model.

        - `BetaResponseCustomToolCallOutputItem extends BetaResponseCustomToolCallOutput`

          The output of a custom tool call from your code, being sent back to the model.

          - `id: string`

            The unique ID of the custom tool call output item.

          - `status: "in_progress" | "completed" | "incomplete"`

            The status of the item. One of `in_progress`, `completed`, or
            `incomplete`. Populated when items are returned via API.

            - `"in_progress"`

            - `"completed"`

            - `"incomplete"`

          - `created_by?: string`

            The identifier of the actor that created the item.

      - `parallel_tool_calls: boolean`

        Whether to allow the model to run tool calls in parallel.

      - `temperature: number | null`

        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.

      - `tool_choice: BetaToolChoiceOptions | BetaToolChoiceAllowed | BetaToolChoiceTypes | 6 more`

        How the model should select which tool (or tools) to use when generating
        a response. See the `tools` parameter to see how to specify which tools
        the model can call.

        - `BetaToolChoiceOptions = "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.

          - `"none"`

          - `"auto"`

          - `"required"`

        - `BetaToolChoiceAllowed`

          Constrains the tools available to the model to a pre-defined set.

          - `mode: "auto" | "required"`

            Constrains the tools available to the model to a pre-defined set.

            `auto` allows the model to pick from among the allowed tools and generate a
            message.

            `required` requires the model to call one or more of the allowed tools.

            - `"auto"`

            - `"required"`

          - `tools: Array<Record<string, unknown>>`

            A list of tool definitions that the model should be allowed to call.

            For the Responses API, the list of tool definitions might look like:

            ```json
            [
              { "type": "function", "name": "get_weather" },
              { "type": "mcp", "server_label": "deepwiki" },
              { "type": "image_generation" }
            ]
            ```

          - `type: "allowed_tools"`

            Allowed tool configuration type. Always `allowed_tools`.

            - `"allowed_tools"`

        - `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" | 5 more`

            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`

            - `"file_search"`

            - `"web_search_preview"`

            - `"computer"`

            - `"computer_use_preview"`

            - `"computer_use"`

            - `"web_search_preview_2025_03_11"`

            - `"image_generation"`

            - `"code_interpreter"`

        - `BetaToolChoiceFunction`

          Use this option to force the model to call a specific function.

          - `name: string`

            The name of the function to call.

          - `type: "function"`

            For function calling, the type is always `function`.

            - `"function"`

        - `BetaToolChoiceMcp`

          Use this option to force the model to call a specific tool on a remote MCP server.

          - `server_label: string`

            The label of the MCP server to use.

          - `type: "mcp"`

            For MCP tools, the type is always `mcp`.

            - `"mcp"`

          - `name?: string | null`

            The name of the tool to call on the server.

        - `BetaToolChoiceCustom`

          Use this option to force the model to call a specific custom tool.

          - `name: string`

            The name of the custom tool to call.

          - `type: "custom"`

            For custom tool calling, the type is always `custom`.

            - `"custom"`

        - `BetaSpecificProgrammaticToolCallingParam`

          - `type: "programmatic_tool_calling"`

            The tool to call. Always `programmatic_tool_calling`.

            - `"programmatic_tool_calling"`

        - `BetaToolChoiceApplyPatch`

          Forces the model to call the apply_patch tool when executing a tool call.

          - `type: "apply_patch"`

            The tool to call. Always `apply_patch`.

            - `"apply_patch"`

        - `BetaToolChoiceShell`

          Forces the model to call the shell tool when a tool call is required.

          - `type: "shell"`

            The tool to call. Always `shell`.

            - `"shell"`

      - `tools: Array<BetaTool>`

        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.

        - `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).

        - `Mcp`

          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).

        - `CodeInterpreter`

          A tool that runs Python code to help generate a response to a prompt.

        - `ProgrammaticToolCalling`

        - `ImageGeneration`

          A tool that generates images using the GPT image models.

        - `LocalShell`

          A tool that allows the model to execute shell commands in a local environment.

        - `BetaFunctionShellTool`

          A tool that allows the model to execute shell commands.

        - `BetaCustomTool`

          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)

        - `BetaNamespaceTool`

          Groups function/custom tools under a shared namespace.

        - `BetaToolSearchTool`

          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).

        - `BetaApplyPatchTool`

          Allows the assistant to create, delete, or update files using unified diffs.

      - `top_p: number | null`

        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.

      - `background?: boolean | null`

        Whether to run the model response in the background.
        [Learn more](https://platform.openai.com/docs/guides/background).

      - `completed_at?: number | null`

        Unix timestamp (in seconds) of when this Response was completed.
        Only present when the status is `completed`.

      - `conversation?: Conversation | null`

        The conversation that this response belonged to. Input items and output items from this response were automatically added to this conversation.

        - `id: string`

          The unique ID of the conversation that this response was associated with.

      - `max_output_tokens?: number | null`

        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).

      - `max_tool_calls?: number | null`

        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.

      - `moderation?: Moderation | null`

        Moderation results for the response input and output, if moderated completions were requested.

        - `input: ModerationResult | Error`

          Moderation for the response input.

          - `ModerationResult`

            A moderation result produced for the response input or output.

            - `categories: Record<string, boolean>`

              A dictionary of moderation categories to booleans, True if the input is flagged under this category.

            - `category_applied_input_types: Record<string, Array<"text" | "image">>`

              Which modalities of input are reflected by the score for each category.

              - `"text"`

              - `"image"`

            - `category_scores: Record<string, number>`

              A dictionary of moderation categories to scores.

            - `flagged: boolean`

              A boolean indicating whether the content was flagged by any category.

            - `model: string`

              The moderation model that produced this result.

            - `type: "moderation_result"`

              The object type, which was always `moderation_result` for successful moderation results.

              - `"moderation_result"`

          - `Error`

            An error produced while attempting moderation for the response input or output.

            - `code: string`

              The error code.

            - `message: string`

              The error message.

            - `type: "error"`

              The object type, which was always `error` for moderation failures.

              - `"error"`

        - `output: ModerationResult | Error`

          Moderation for the response output.

          - `ModerationResult`

            A moderation result produced for the response input or output.

            - `categories: Record<string, boolean>`

              A dictionary of moderation categories to booleans, True if the input is flagged under this category.

            - `category_applied_input_types: Record<string, Array<"text" | "image">>`

              Which modalities of input are reflected by the score for each category.

              - `"text"`

              - `"image"`

            - `category_scores: Record<string, number>`

              A dictionary of moderation categories to scores.

            - `flagged: boolean`

              A boolean indicating whether the content was flagged by any category.

            - `model: string`

              The moderation model that produced this result.

            - `type: "moderation_result"`

              The object type, which was always `moderation_result` for successful moderation results.

              - `"moderation_result"`

          - `Error`

            An error produced while attempting moderation for the response input or output.

            - `code: string`

              The error code.

            - `message: string`

              The error message.

            - `type: "error"`

              The object type, which was always `error` for moderation failures.

              - `"error"`

      - `previous_response_id?: string | null`

        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`.

      - `prompt?: BetaResponsePrompt | null`

        Reference to a prompt template and its variables.
        [Learn more](https://platform.openai.com/docs/guides/text?api-mode=responses#reusable-prompts).

        - `id: string`

          The unique identifier of the prompt template to use.

        - `variables?: Record<string, string | BetaResponseInputText | BetaResponseInputImage | BetaResponseInputFile> | null`

          Optional map of values to substitute in for variables in your
          prompt. The substitution values can either be strings, or other
          Response input types like images or files.

          - `string`

          - `BetaResponseInputText`

            A text input to the model.

          - `BetaResponseInputImage`

            An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision).

          - `BetaResponseInputFile`

            A file input to the model.

        - `version?: string | null`

          Optional version of the prompt template.

      - `prompt_cache_key?: string | null`

        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).

      - `prompt_cache_options?: PromptCacheOptions`

        The prompt-caching options that were applied to the response. Supported for `gpt-5.6` and later models.

        - `mode: "implicit" | "explicit"`

          Whether implicit prompt-cache breakpoints were enabled.

          - `"implicit"`

          - `"explicit"`

        - `ttl: "30m"`

          The minimum lifetime applied to each cache breakpoint.

          - `"30m"`

      - `prompt_cache_retention?: "in_memory" | "24h" | null`

        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.

        - `"in_memory"`

        - `"24h"`

      - `reasoning?: Reasoning | null`

        **gpt-5 and o-series models only**

        Configuration options for
        [reasoning models](https://platform.openai.com/docs/guides/reasoning).

        - `context?: "auto" | "current_turn" | "all_turns" | null`

          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.

          - `"auto"`

          - `"current_turn"`

          - `"all_turns"`

        - `effort?: "none" | "minimal" | "low" | 4 more | null`

          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.

          - `"none"`

          - `"minimal"`

          - `"low"`

          - `"medium"`

          - `"high"`

          - `"xhigh"`

          - `"max"`

        - `generate_summary?: "auto" | "concise" | "detailed" | null`

          **Deprecated:** use `summary` instead.

          A summary of the reasoning performed by the model. This can be
          useful for debugging and understanding the model's reasoning process.
          One of `auto`, `concise`, or `detailed`.

          - `"auto"`

          - `"concise"`

          - `"detailed"`

        - `mode?: (string & {}) | "standard" | "pro"`

          Controls the reasoning execution mode for the request.

          When returned on a response, this is the effective execution mode.

          - `(string & {})`

          - `"standard" | "pro"`

            - `"standard"`

            - `"pro"`

        - `summary?: "auto" | "concise" | "detailed" | null`

          A summary of the reasoning performed by the model. This can be
          useful for debugging and understanding the model's reasoning process.
          One of `auto`, `concise`, or `detailed`.

          `concise` is supported for `computer-use-preview` models and all reasoning models after `gpt-5`.

          - `"auto"`

          - `"concise"`

          - `"detailed"`

      - `safety_identifier?: string | null`

        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).

      - `service_tier?: BetaServiceTier | null`

        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.
        - If set to 'ultrafast', then the request will be processed with the access-controlled Ultrafast Processing service tier. This tier is currently available for `gpt-5.6-sol`; a response served through it will show `service_tier=ultrafast`.
        - When not set, the default behavior is 'auto'.

        When the `service_tier` parameter is set, the response body will include the `service_tier` value based on the processing mode actually used to serve the request. This response value may be different from the value set in the parameter.

        - `"auto"`

        - `"default"`

        - `"flex"`

        - `"scale"`

        - `"priority"`

        - `"fast"`

        - `"ultrafast"`

      - `status?: BetaResponseStatus`

        The status of the response generation. One of `completed`, `failed`,
        `in_progress`, `cancelled`, `queued`, or `incomplete`.

        - `"completed"`

        - `"failed"`

        - `"in_progress"`

        - `"cancelled"`

        - `"queued"`

        - `"incomplete"`

      - `text?: BetaResponseTextConfig`

        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?: BetaResponseFormatTextConfig`

          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.

          - `Text`

            Default response format. Used to generate text responses.

            - `type: "text"`

              The type of response format being defined. Always `text`.

              - `"text"`

          - `BetaResponseFormatTextJSONSchemaConfig`

            JSON Schema response format. Used to generate structured JSON responses.
            Learn more about [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs).

            - `name: string`

              The name of the response format. Must be a-z, A-Z, 0-9, or contain
              underscores and dashes, with a maximum length of 64.

            - `schema: Record<string, unknown>`

              The schema for the response format, described as a JSON Schema object.
              Learn how to build JSON schemas [here](https://json-schema.org/).

            - `type: "json_schema"`

              The type of response format being defined. Always `json_schema`.

              - `"json_schema"`

            - `description?: string`

              A description of what the response format is for, used by the model to
              determine how to respond in the format.

            - `strict?: boolean | null`

              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).

          - `JSONObject`

            JSON object response format. An older method of generating JSON responses.
            Using `json_schema` is recommended for models that support it. Note that the
            model will not generate JSON without a system or user message instructing it
            to do so.

            - `type: "json_object"`

              The type of response format being defined. Always `json_object`.

              - `"json_object"`

        - `verbosity?: "low" | "medium" | "high" | null`

          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`.

          - `"low"`

          - `"medium"`

          - `"high"`

      - `top_logprobs?: number | null`

        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.

      - `truncation?: "auto" | "disabled" | null`

        The truncation strategy to use for the model response.

        - `auto`: If the input to this Response exceeds
          the model's context window size, the model will truncate the
          response to fit the context window by dropping items from the beginning of the conversation.
        - `disabled` (default): If the input size will exceed the context window
          size for a model, the request will fail with a 400 error.

        - `"auto"`

        - `"disabled"`

      - `usage?: BetaResponseUsage`

        Represents token usage details including input tokens, output tokens,
        a breakdown of output tokens, and the total tokens used.

        - `input_tokens: number`

          The number of input tokens.

        - `input_tokens_details: InputTokensDetails`

          A detailed breakdown of the input tokens.

          - `cache_write_tokens: number`

            The number of input tokens that were written to the cache.

          - `cached_tokens: number`

            The number of tokens that were retrieved from the cache.
            [More on prompt caching](https://platform.openai.com/docs/guides/prompt-caching).

        - `output_tokens: number`

          The number of output tokens.

        - `output_tokens_details: OutputTokensDetails`

          A detailed breakdown of the output tokens.

          - `reasoning_tokens: number`

            The number of reasoning tokens.

        - `total_tokens: number`

          The total number of tokens used.

      - `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).

    - `sequence_number: number`

      The sequence number for this event.

    - `type: "response.completed"`

      The type of the event. Always `response.completed`.

      - `"response.completed"`

    - `agent?: Agent | null`

      The agent that owns this multi-agent streaming event.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

  - `BetaResponseContentPartAddedEvent`

    Emitted when a new content part is added.

    - `content_index: number`

      The index of the content part that was added.

    - `item_id: string`

      The ID of the output item that the content part was added to.

    - `output_index: number`

      The index of the output item that the content part was added to.

    - `part: BetaResponseOutputText | BetaResponseOutputRefusal | ReasoningText`

      The content part that was added.

      - `BetaResponseOutputText`

        A text output from the model.

      - `BetaResponseOutputRefusal`

        A refusal from the model.

      - `ReasoningText`

        Reasoning text from the model.

        - `text: string`

          The reasoning text from the model.

        - `type: "reasoning_text"`

          The type of the reasoning text. Always `reasoning_text`.

          - `"reasoning_text"`

    - `sequence_number: number`

      The sequence number of this event.

    - `type: "response.content_part.added"`

      The type of the event. Always `response.content_part.added`.

      - `"response.content_part.added"`

    - `agent?: Agent | null`

      The agent that owns this multi-agent streaming event.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

  - `BetaResponseContentPartDoneEvent`

    Emitted when a content part is done.

    - `content_index: number`

      The index of the content part that is done.

    - `item_id: string`

      The ID of the output item that the content part was added to.

    - `output_index: number`

      The index of the output item that the content part was added to.

    - `part: BetaResponseOutputText | BetaResponseOutputRefusal | ReasoningText`

      The content part that is done.

      - `BetaResponseOutputText`

        A text output from the model.

      - `BetaResponseOutputRefusal`

        A refusal from the model.

      - `ReasoningText`

        Reasoning text from the model.

        - `text: string`

          The reasoning text from the model.

        - `type: "reasoning_text"`

          The type of the reasoning text. Always `reasoning_text`.

          - `"reasoning_text"`

    - `sequence_number: number`

      The sequence number of this event.

    - `type: "response.content_part.done"`

      The type of the event. Always `response.content_part.done`.

      - `"response.content_part.done"`

    - `agent?: Agent | null`

      The agent that owns this multi-agent streaming event.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

  - `BetaResponseCreatedEvent`

    An event that is emitted when a response is created.

    - `response: BetaResponse`

      The response that was created.

    - `sequence_number: number`

      The sequence number for this event.

    - `type: "response.created"`

      The type of the event. Always `response.created`.

      - `"response.created"`

    - `agent?: Agent | null`

      The agent that owns this multi-agent streaming event.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

  - `BetaResponseErrorEvent`

    Emitted when an error occurs.

    - `code: string | null`

      The error code.

    - `message: string`

      The error message.

    - `param: string | null`

      The error parameter.

    - `sequence_number: number`

      The sequence number of this event.

    - `type: "error"`

      The type of the event. Always `error`.

      - `"error"`

    - `agent?: Agent | null`

      The agent that owns this multi-agent streaming event.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

  - `BetaResponseFileSearchCallCompletedEvent`

    Emitted when a file search call is completed (results found).

    - `item_id: string`

      The ID of the output item that the file search call is initiated.

    - `output_index: number`

      The index of the output item that the file search call is initiated.

    - `sequence_number: number`

      The sequence number of this event.

    - `type: "response.file_search_call.completed"`

      The type of the event. Always `response.file_search_call.completed`.

      - `"response.file_search_call.completed"`

    - `agent?: Agent | null`

      The agent that owns this multi-agent streaming event.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

  - `BetaResponseFileSearchCallInProgressEvent`

    Emitted when a file search call is initiated.

    - `item_id: string`

      The ID of the output item that the file search call is initiated.

    - `output_index: number`

      The index of the output item that the file search call is initiated.

    - `sequence_number: number`

      The sequence number of this event.

    - `type: "response.file_search_call.in_progress"`

      The type of the event. Always `response.file_search_call.in_progress`.

      - `"response.file_search_call.in_progress"`

    - `agent?: Agent | null`

      The agent that owns this multi-agent streaming event.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

  - `BetaResponseFileSearchCallSearchingEvent`

    Emitted when a file search is currently searching.

    - `item_id: string`

      The ID of the output item that the file search call is initiated.

    - `output_index: number`

      The index of the output item that the file search call is searching.

    - `sequence_number: number`

      The sequence number of this event.

    - `type: "response.file_search_call.searching"`

      The type of the event. Always `response.file_search_call.searching`.

      - `"response.file_search_call.searching"`

    - `agent?: Agent | null`

      The agent that owns this multi-agent streaming event.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

  - `BetaResponseFunctionCallArgumentsDeltaEvent`

    Emitted when there is a partial function-call arguments delta.

    - `delta: string`

      The function-call arguments delta that is added.

    - `item_id: string`

      The ID of the output item that the function-call arguments delta is added to.

    - `output_index: number`

      The index of the output item that the function-call arguments delta is added to.

    - `sequence_number: number`

      The sequence number of this event.

    - `type: "response.function_call_arguments.delta"`

      The type of the event. Always `response.function_call_arguments.delta`.

      - `"response.function_call_arguments.delta"`

    - `agent?: Agent | null`

      The agent that owns this multi-agent streaming event.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

  - `BetaResponseFunctionCallArgumentsDoneEvent`

    Emitted when function-call arguments are finalized.

    - `arguments: string`

      The function-call arguments.

    - `item_id: string`

      The ID of the item.

    - `name: string`

      The name of the function that was called.

    - `output_index: number`

      The index of the output item.

    - `sequence_number: number`

      The sequence number of this event.

    - `type: "response.function_call_arguments.done"`

      - `"response.function_call_arguments.done"`

    - `agent?: Agent | null`

      The agent that owns this multi-agent streaming event.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

  - `BetaResponseShellCallCommandAddedEvent`

    A streaming event that indicated a shell command was added to a tool call.

    - `command: string`

      The shell command that was added.

    - `command_index: number`

      The index of the shell command that was added.

    - `output_index: number`

      The index of the output item that was updated.

    - `sequence_number: number`

      The sequence number of the event that was emitted.

    - `type: "response.shell_call_command.added"`

      The type of the event, always `response.shell_call_command.added`.

      - `"response.shell_call_command.added"`

    - `agent?: Agent`

      The agent that owns this multi-agent streaming event.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

  - `BetaResponseShellCallCommandDeltaEvent`

    A streaming event that indicated a shell command was incrementally updated.

    - `command_index: number`

      The index of the shell command that was updated.

    - `delta: string`

      The shell command delta that was appended.

    - `output_index: number`

      The index of the output item that was updated.

    - `sequence_number: number`

      The sequence number of the event that was emitted.

    - `type: "response.shell_call_command.delta"`

      The type of the event, always `response.shell_call_command.delta`.

      - `"response.shell_call_command.delta"`

    - `agent?: Agent`

      The agent that owns this multi-agent streaming event.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

    - `obfuscation?: string`

      An obfuscation string that was added to pad the event payload.

  - `BetaResponseShellCallCommandDoneEvent`

    A streaming event that indicated a shell command was completed.

    - `command: string`

      The final shell command that was emitted.

    - `command_index: number`

      The index of the shell command that was completed.

    - `output_index: number`

      The index of the output item that was updated.

    - `sequence_number: number`

      The sequence number of the event that was emitted.

    - `type: "response.shell_call_command.done"`

      The type of the event, always `response.shell_call_command.done`.

      - `"response.shell_call_command.done"`

    - `agent?: Agent`

      The agent that owns this multi-agent streaming event.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

  - `BetaResponseShellCallOutputContentDeltaEvent`

    A streaming event that indicated shell call output was incrementally added.

    - `command_index: number`

      The index of the shell command that produced output.

    - `delta: Delta`

      The stdout/stderr delta that was emitted.

      - `stderr?: string`

        The stderr delta that was emitted.

      - `stdout?: string`

        The stdout delta that was emitted.

    - `item_id: string`

      The ID of the output item that was updated.

    - `output_index: number`

      The index of the output item that was updated.

    - `sequence_number: number`

      The sequence number of the event that was emitted.

    - `type: "response.shell_call_output_content.delta"`

      The type of the event, always `response.shell_call_output_content.delta`.

      - `"response.shell_call_output_content.delta"`

    - `agent?: Agent`

      The agent that owns this multi-agent streaming event.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

  - `BetaResponseShellCallOutputContentDoneEvent`

    A streaming event that indicated shell call output was completed.

    - `command_index: number`

      The index of the shell command that produced output.

    - `item_id: string`

      The ID of the output item that was updated.

    - `output: Array<Output>`

      The output contents emitted for the shell command.

      - `outcome: Timeout | Exit`

        Represents either an exit outcome (with an exit code) or a timeout outcome for a shell call output chunk.

        - `Timeout`

          Indicates that the shell call exceeded its configured time limit.

          - `type: "timeout"`

            The outcome type. Always `timeout`.

            - `"timeout"`

        - `Exit`

          Indicates that the shell commands finished and returned an exit code.

          - `exit_code: number`

            Exit code from the shell process.

          - `type: "exit"`

            The outcome type. Always `exit`.

            - `"exit"`

      - `stderr: string`

        The standard error output that was captured.

      - `stdout: string`

        The standard output that was captured.

      - `created_by?: string`

        The identifier of the actor that created the item.

    - `output_index: number`

      The index of the output item that was updated.

    - `sequence_number: number`

      The sequence number of the event that was emitted.

    - `type: "response.shell_call_output_content.done"`

      The type of the event, always `response.shell_call_output_content.done`.

      - `"response.shell_call_output_content.done"`

    - `agent?: Agent`

      The agent that owns this multi-agent streaming event.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

  - `BetaResponseInProgressEvent`

    Emitted when the response is in progress.

    - `response: BetaResponse`

      The response that is in progress.

    - `sequence_number: number`

      The sequence number of this event.

    - `type: "response.in_progress"`

      The type of the event. Always `response.in_progress`.

      - `"response.in_progress"`

    - `agent?: Agent | null`

      The agent that owns this multi-agent streaming event.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

  - `BetaResponseFailedEvent`

    An event that is emitted when a response fails.

    - `response: BetaResponse`

      The response that failed.

    - `sequence_number: number`

      The sequence number of this event.

    - `type: "response.failed"`

      The type of the event. Always `response.failed`.

      - `"response.failed"`

    - `agent?: Agent | null`

      The agent that owns this multi-agent streaming event.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

  - `BetaResponseIncompleteEvent`

    An event that is emitted when a response finishes as incomplete.

    - `response: BetaResponse`

      The response that was incomplete.

    - `sequence_number: number`

      The sequence number of this event.

    - `type: "response.incomplete"`

      The type of the event. Always `response.incomplete`.

      - `"response.incomplete"`

    - `agent?: Agent | null`

      The agent that owns this multi-agent streaming event.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

  - `BetaResponseOutputItemAddedEvent`

    Emitted when a new output item is added.

    - `item: BetaResponseOutputItem`

      The output item that was added. For reasoning items, `encrypted_content`
      may be incomplete while the item is in progress. Use the reasoning item
      from the corresponding `response.output_item.done` event when passing it
      as input to a subsequent request.

      - `BetaResponseOutputMessage`

        An output message from the model.

      - `BetaResponseFileSearchToolCall`

        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.

      - `BetaResponseFunctionToolCall`

        A tool call to run a function. See the
        [function calling guide](https://platform.openai.com/docs/guides/function-calling) for more information.

      - `BetaResponseFunctionToolCallOutputItem`

      - `AgentMessage`

      - `MultiAgentCall`

      - `MultiAgentCallOutput`

      - `BetaResponseFunctionWebSearch`

        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.

      - `BetaResponseComputerToolCall`

        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.

      - `BetaResponseComputerToolCallOutputItem`

      - `BetaResponseReasoningItem`

        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).

      - `Program`

      - `ProgramOutput`

      - `BetaResponseToolSearchCall`

      - `BetaResponseToolSearchOutputItem`

      - `AdditionalTools`

      - `BetaResponseCompactionItem`

        A compaction item generated by the [`v1/responses/compact` API](https://platform.openai.com/docs/api-reference/responses/compact).

      - `ImageGenerationCall`

        An image generation request made by the model.

      - `BetaResponseCodeInterpreterToolCall`

        A tool call to run code.

      - `LocalShellCall`

        A tool call to run a command on the local shell.

      - `LocalShellCallOutput`

        The output of a local shell tool call.

      - `BetaResponseFunctionShellToolCall`

        A tool call that executes one or more shell commands in a managed environment.

      - `BetaResponseFunctionShellToolCallOutput`

        The output of a shell tool call that was emitted.

      - `BetaResponseApplyPatchToolCall`

        A tool call that applies file diffs by creating, deleting, or updating files.

      - `BetaResponseApplyPatchToolCallOutput`

        The output emitted by an apply patch tool call.

      - `McpCall`

        An invocation of a tool on an MCP server.

      - `McpListTools`

        A list of tools available on an MCP server.

      - `McpApprovalRequest`

        A request for human approval of a tool invocation.

      - `McpApprovalResponse`

        A response to an MCP approval request.

      - `BetaResponseCustomToolCall`

        A call to a custom tool created by the model.

      - `BetaResponseCustomToolCallOutputItem extends BetaResponseCustomToolCallOutput`

        The output of a custom tool call from your code, being sent back to the model.

    - `output_index: number`

      The index of the output item that was added.

    - `sequence_number: number`

      The sequence number of this event.

    - `type: "response.output_item.added"`

      The type of the event. Always `response.output_item.added`.

      - `"response.output_item.added"`

    - `agent?: Agent | null`

      The agent that owns this multi-agent streaming event.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

  - `BetaResponseOutputItemDoneEvent`

    Emitted when an output item is marked done.

    - `item: BetaResponseOutputItem`

      The output item that was marked done.

    - `output_index: number`

      The index of the output item that was marked done.

    - `sequence_number: number`

      The sequence number of this event.

    - `type: "response.output_item.done"`

      The type of the event. Always `response.output_item.done`.

      - `"response.output_item.done"`

    - `agent?: Agent | null`

      The agent that owns this multi-agent streaming event.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

  - `BetaResponseReasoningSummaryPartAddedEvent`

    Emitted when a new reasoning summary part is added.

    - `item_id: string`

      The ID of the item this summary part is associated with.

    - `output_index: number`

      The index of the output item this summary part is associated with.

    - `part: Part`

      The summary part that was added.

      - `text: string`

        The text of the summary part.

      - `type: "summary_text"`

        The type of the summary part. Always `summary_text`.

        - `"summary_text"`

    - `sequence_number: number`

      The sequence number of this event.

    - `summary_index: number`

      The index of the summary part within the reasoning summary.

    - `type: "response.reasoning_summary_part.added"`

      The type of the event. Always `response.reasoning_summary_part.added`.

      - `"response.reasoning_summary_part.added"`

    - `agent?: Agent | null`

      The agent that owns this multi-agent streaming event.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

  - `BetaResponseReasoningSummaryPartDoneEvent`

    Emitted when a reasoning summary part is completed.

    - `item_id: string`

      The ID of the item this summary part is associated with.

    - `output_index: number`

      The index of the output item this summary part is associated with.

    - `part: Part`

      The completed summary part.

      - `text: string`

        The text of the summary part.

      - `type: "summary_text"`

        The type of the summary part. Always `summary_text`.

        - `"summary_text"`

    - `sequence_number: number`

      The sequence number of this event.

    - `summary_index: number`

      The index of the summary part within the reasoning summary.

    - `type: "response.reasoning_summary_part.done"`

      The type of the event. Always `response.reasoning_summary_part.done`.

      - `"response.reasoning_summary_part.done"`

    - `agent?: Agent | null`

      The agent that owns this multi-agent streaming event.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

    - `status?: "incomplete"`

      The completion status of the summary part. Omitted when the part completed
      normally and set to `incomplete` when generation was interrupted.

      - `"incomplete"`

  - `BetaResponseReasoningSummaryTextDeltaEvent`

    Emitted when a delta is added to a reasoning summary text.

    - `delta: string`

      The text delta that was added to the summary.

    - `item_id: string`

      The ID of the item this summary text delta is associated with.

    - `output_index: number`

      The index of the output item this summary text delta is associated with.

    - `sequence_number: number`

      The sequence number of this event.

    - `summary_index: number`

      The index of the summary part within the reasoning summary.

    - `type: "response.reasoning_summary_text.delta"`

      The type of the event. Always `response.reasoning_summary_text.delta`.

      - `"response.reasoning_summary_text.delta"`

    - `agent?: Agent | null`

      The agent that owns this multi-agent streaming event.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

  - `BetaResponseReasoningSummaryTextDoneEvent`

    Emitted when a reasoning summary text is completed.

    - `item_id: string`

      The ID of the item this summary text is associated with.

    - `output_index: number`

      The index of the output item this summary text is associated with.

    - `sequence_number: number`

      The sequence number of this event.

    - `summary_index: number`

      The index of the summary part within the reasoning summary.

    - `text: string`

      The full text of the completed reasoning summary.

    - `type: "response.reasoning_summary_text.done"`

      The type of the event. Always `response.reasoning_summary_text.done`.

      - `"response.reasoning_summary_text.done"`

    - `agent?: Agent | null`

      The agent that owns this multi-agent streaming event.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

  - `BetaResponseReasoningTextDeltaEvent`

    Emitted when a delta is added to a reasoning text.

    - `content_index: number`

      The index of the reasoning content part this delta is associated with.

    - `delta: string`

      The text delta that was added to the reasoning content.

    - `item_id: string`

      The ID of the item this reasoning text delta is associated with.

    - `output_index: number`

      The index of the output item this reasoning text delta is associated with.

    - `sequence_number: number`

      The sequence number of this event.

    - `type: "response.reasoning_text.delta"`

      The type of the event. Always `response.reasoning_text.delta`.

      - `"response.reasoning_text.delta"`

    - `agent?: Agent | null`

      The agent that owns this multi-agent streaming event.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

  - `BetaResponseReasoningTextDoneEvent`

    Emitted when a reasoning text is completed.

    - `content_index: number`

      The index of the reasoning content part.

    - `item_id: string`

      The ID of the item this reasoning text is associated with.

    - `output_index: number`

      The index of the output item this reasoning text is associated with.

    - `sequence_number: number`

      The sequence number of this event.

    - `text: string`

      The full text of the completed reasoning content.

    - `type: "response.reasoning_text.done"`

      The type of the event. Always `response.reasoning_text.done`.

      - `"response.reasoning_text.done"`

    - `agent?: Agent | null`

      The agent that owns this multi-agent streaming event.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

  - `BetaResponseRefusalDeltaEvent`

    Emitted when there is a partial refusal text.

    - `content_index: number`

      The index of the content part that the refusal text is added to.

    - `delta: string`

      The refusal text that is added.

    - `item_id: string`

      The ID of the output item that the refusal text is added to.

    - `output_index: number`

      The index of the output item that the refusal text is added to.

    - `sequence_number: number`

      The sequence number of this event.

    - `type: "response.refusal.delta"`

      The type of the event. Always `response.refusal.delta`.

      - `"response.refusal.delta"`

    - `agent?: Agent | null`

      The agent that owns this multi-agent streaming event.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

  - `BetaResponseRefusalDoneEvent`

    Emitted when refusal text is finalized.

    - `content_index: number`

      The index of the content part that the refusal text is finalized.

    - `item_id: string`

      The ID of the output item that the refusal text is finalized.

    - `output_index: number`

      The index of the output item that the refusal text is finalized.

    - `refusal: string`

      The refusal text that is finalized.

    - `sequence_number: number`

      The sequence number of this event.

    - `type: "response.refusal.done"`

      The type of the event. Always `response.refusal.done`.

      - `"response.refusal.done"`

    - `agent?: Agent | null`

      The agent that owns this multi-agent streaming event.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

  - `BetaResponseTextDeltaEvent`

    Emitted when there is an additional text delta.

    - `content_index: number`

      The index of the content part that the text delta was added to.

    - `delta: string`

      The text delta that was added.

    - `item_id: string`

      The ID of the output item that the text delta was added to.

    - `logprobs: Array<Logprob>`

      The log probabilities of the tokens in the delta.

      - `token: string`

        A possible text token.

      - `logprob: number`

        The log probability of this token.

      - `top_logprobs?: Array<TopLogprob>`

        The log probabilities of up to 20 of the most likely tokens.

        - `token?: string`

          A possible text token.

        - `logprob?: number`

          The log probability of this token.

    - `output_index: number`

      The index of the output item that the text delta was added to.

    - `sequence_number: number`

      The sequence number for this event.

    - `type: "response.output_text.delta"`

      The type of the event. Always `response.output_text.delta`.

      - `"response.output_text.delta"`

    - `agent?: Agent | null`

      The agent that owns this multi-agent streaming event.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

  - `BetaResponseTextDoneEvent`

    Emitted when text content is finalized.

    - `content_index: number`

      The index of the content part that the text content is finalized.

    - `item_id: string`

      The ID of the output item that the text content is finalized.

    - `logprobs: Array<Logprob>`

      The log probabilities of the tokens in the delta.

      - `token: string`

        A possible text token.

      - `logprob: number`

        The log probability of this token.

      - `top_logprobs?: Array<TopLogprob>`

        The log probabilities of up to 20 of the most likely tokens.

        - `token?: string`

          A possible text token.

        - `logprob?: number`

          The log probability of this token.

    - `output_index: number`

      The index of the output item that the text content is finalized.

    - `sequence_number: number`

      The sequence number for this event.

    - `text: string`

      The text content that is finalized.

    - `type: "response.output_text.done"`

      The type of the event. Always `response.output_text.done`.

      - `"response.output_text.done"`

    - `agent?: Agent | null`

      The agent that owns this multi-agent streaming event.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

  - `BetaResponseWebSearchCallCompletedEvent`

    Emitted when a web search call is completed.

    - `item_id: string`

      Unique ID for the output item associated with the web search call.

    - `output_index: number`

      The index of the output item that the web search call is associated with.

    - `sequence_number: number`

      The sequence number of the web search call being processed.

    - `type: "response.web_search_call.completed"`

      The type of the event. Always `response.web_search_call.completed`.

      - `"response.web_search_call.completed"`

    - `agent?: Agent | null`

      The agent that owns this multi-agent streaming event.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

  - `BetaResponseWebSearchCallInProgressEvent`

    Emitted when a web search call is initiated.

    - `item_id: string`

      Unique ID for the output item associated with the web search call.

    - `output_index: number`

      The index of the output item that the web search call is associated with.

    - `sequence_number: number`

      The sequence number of the web search call being processed.

    - `type: "response.web_search_call.in_progress"`

      The type of the event. Always `response.web_search_call.in_progress`.

      - `"response.web_search_call.in_progress"`

    - `agent?: Agent | null`

      The agent that owns this multi-agent streaming event.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

  - `BetaResponseWebSearchCallSearchingEvent`

    Emitted when a web search call is executing.

    - `item_id: string`

      Unique ID for the output item associated with the web search call.

    - `output_index: number`

      The index of the output item that the web search call is associated with.

    - `sequence_number: number`

      The sequence number of the web search call being processed.

    - `type: "response.web_search_call.searching"`

      The type of the event. Always `response.web_search_call.searching`.

      - `"response.web_search_call.searching"`

    - `agent?: Agent | null`

      The agent that owns this multi-agent streaming event.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

  - `BetaResponseImageGenCallCompletedEvent`

    Emitted when an image generation tool call has completed and the final image is available.

    - `item_id: string`

      The unique identifier of the image generation item being processed.

    - `output_index: number`

      The index of the output item in the response's output array.

    - `sequence_number: number`

      The sequence number of this event.

    - `type: "response.image_generation_call.completed"`

      The type of the event. Always 'response.image_generation_call.completed'.

      - `"response.image_generation_call.completed"`

    - `agent?: Agent | null`

      The agent that owns this multi-agent streaming event.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

  - `BetaResponseImageGenCallGeneratingEvent`

    Emitted when an image generation tool call is actively generating an image (intermediate state).

    - `item_id: string`

      The unique identifier of the image generation item being processed.

    - `output_index: number`

      The index of the output item in the response's output array.

    - `sequence_number: number`

      The sequence number of the image generation item being processed.

    - `type: "response.image_generation_call.generating"`

      The type of the event. Always 'response.image_generation_call.generating'.

      - `"response.image_generation_call.generating"`

    - `agent?: Agent | null`

      The agent that owns this multi-agent streaming event.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

  - `BetaResponseImageGenCallInProgressEvent`

    Emitted when an image generation tool call is in progress.

    - `item_id: string`

      The unique identifier of the image generation item being processed.

    - `output_index: number`

      The index of the output item in the response's output array.

    - `sequence_number: number`

      The sequence number of the image generation item being processed.

    - `type: "response.image_generation_call.in_progress"`

      The type of the event. Always 'response.image_generation_call.in_progress'.

      - `"response.image_generation_call.in_progress"`

    - `agent?: Agent | null`

      The agent that owns this multi-agent streaming event.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

  - `BetaResponseImageGenCallPartialImageEvent`

    Emitted when a partial image is available during image generation streaming.

    - `item_id: string`

      The unique identifier of the image generation item being processed.

    - `output_index: number`

      The index of the output item in the response's output array.

    - `partial_image_b64: string`

      Base64-encoded partial image data, suitable for rendering as an image.

    - `partial_image_index: number`

      0-based index for the partial image (backend is 1-based, but this is 0-based for the user).

    - `sequence_number: number`

      The sequence number of the image generation item being processed.

    - `type: "response.image_generation_call.partial_image"`

      The type of the event. Always 'response.image_generation_call.partial_image'.

      - `"response.image_generation_call.partial_image"`

    - `agent?: Agent | null`

      The agent that owns this multi-agent streaming event.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

    - `background?: string`

      The background setting that was used.

    - `output_format?: string`

      The output format that was used.

    - `quality?: string`

      The image quality that was used.

    - `size?: string`

      The image size that was used.

  - `BetaResponseMcpCallArgumentsDeltaEvent`

    Emitted when there is a delta (partial update) to the arguments of an MCP tool call.

    - `delta: string`

      A JSON string containing the partial update to the arguments for the MCP tool call.

    - `item_id: string`

      The unique identifier of the MCP tool call item being processed.

    - `output_index: number`

      The index of the output item in the response's output array.

    - `sequence_number: number`

      The sequence number of this event.

    - `type: "response.mcp_call_arguments.delta"`

      The type of the event. Always 'response.mcp_call_arguments.delta'.

      - `"response.mcp_call_arguments.delta"`

    - `agent?: Agent | null`

      The agent that owns this multi-agent streaming event.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

  - `BetaResponseMcpCallArgumentsDoneEvent`

    Emitted when the arguments for an MCP tool call are finalized.

    - `arguments: string`

      A JSON string containing the finalized arguments for the MCP tool call.

    - `item_id: string`

      The unique identifier of the MCP tool call item being processed.

    - `output_index: number`

      The index of the output item in the response's output array.

    - `sequence_number: number`

      The sequence number of this event.

    - `type: "response.mcp_call_arguments.done"`

      The type of the event. Always 'response.mcp_call_arguments.done'.

      - `"response.mcp_call_arguments.done"`

    - `agent?: Agent | null`

      The agent that owns this multi-agent streaming event.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

  - `BetaResponseMcpCallCompletedEvent`

    Emitted when an MCP  tool call has completed successfully.

    - `item_id: string`

      The ID of the MCP tool call item that completed.

    - `output_index: number`

      The index of the output item that completed.

    - `sequence_number: number`

      The sequence number of this event.

    - `type: "response.mcp_call.completed"`

      The type of the event. Always 'response.mcp_call.completed'.

      - `"response.mcp_call.completed"`

    - `agent?: Agent | null`

      The agent that owns this multi-agent streaming event.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

  - `BetaResponseMcpCallFailedEvent`

    Emitted when an MCP  tool call has failed.

    - `item_id: string`

      The ID of the MCP tool call item that failed.

    - `output_index: number`

      The index of the output item that failed.

    - `sequence_number: number`

      The sequence number of this event.

    - `type: "response.mcp_call.failed"`

      The type of the event. Always 'response.mcp_call.failed'.

      - `"response.mcp_call.failed"`

    - `agent?: Agent | null`

      The agent that owns this multi-agent streaming event.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

  - `BetaResponseMcpCallInProgressEvent`

    Emitted when an MCP  tool call is in progress.

    - `item_id: string`

      The unique identifier of the MCP tool call item being processed.

    - `output_index: number`

      The index of the output item in the response's output array.

    - `sequence_number: number`

      The sequence number of this event.

    - `type: "response.mcp_call.in_progress"`

      The type of the event. Always 'response.mcp_call.in_progress'.

      - `"response.mcp_call.in_progress"`

    - `agent?: Agent | null`

      The agent that owns this multi-agent streaming event.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

  - `BetaResponseMcpListToolsCompletedEvent`

    Emitted when the list of available MCP tools has been successfully retrieved.

    - `item_id: string`

      The ID of the MCP tool call item that produced this output.

    - `output_index: number`

      The index of the output item that was processed.

    - `sequence_number: number`

      The sequence number of this event.

    - `type: "response.mcp_list_tools.completed"`

      The type of the event. Always 'response.mcp_list_tools.completed'.

      - `"response.mcp_list_tools.completed"`

    - `agent?: Agent | null`

      The agent that owns this multi-agent streaming event.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

  - `BetaResponseMcpListToolsFailedEvent`

    Emitted when the attempt to list available MCP tools has failed.

    - `item_id: string`

      The ID of the MCP tool call item that failed.

    - `output_index: number`

      The index of the output item that failed.

    - `sequence_number: number`

      The sequence number of this event.

    - `type: "response.mcp_list_tools.failed"`

      The type of the event. Always 'response.mcp_list_tools.failed'.

      - `"response.mcp_list_tools.failed"`

    - `agent?: Agent | null`

      The agent that owns this multi-agent streaming event.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

  - `BetaResponseMcpListToolsInProgressEvent`

    Emitted when the system is in the process of retrieving the list of available MCP tools.

    - `item_id: string`

      The ID of the MCP tool call item that is being processed.

    - `output_index: number`

      The index of the output item that is being processed.

    - `sequence_number: number`

      The sequence number of this event.

    - `type: "response.mcp_list_tools.in_progress"`

      The type of the event. Always 'response.mcp_list_tools.in_progress'.

      - `"response.mcp_list_tools.in_progress"`

    - `agent?: Agent | null`

      The agent that owns this multi-agent streaming event.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

  - `BetaResponseOutputTextAnnotationAddedEvent`

    Emitted when an annotation is added to output text content.

    - `annotation: FileCitation | URLCitation | ContainerFileCitation | FilePath | null`

      An annotation that applies to a span of output text.

      - `FileCitation`

        A citation to a file.

        - `file_id: string`

          The ID of the file.

        - `filename: string`

          The filename of the file cited.

        - `index: number`

          The index of the file in the list of files.

        - `type: "file_citation"`

          The type of the file citation. Always `file_citation`.

          - `"file_citation"`

      - `URLCitation`

        A citation for a web resource used to generate a model response.

        - `end_index: number`

          The index of the last character of the URL citation in the message.

        - `start_index: number`

          The index of the first character of the URL citation in the message.

        - `title: string`

          The title of the web resource.

        - `type: "url_citation"`

          The type of the URL citation. Always `url_citation`.

          - `"url_citation"`

        - `url: string`

          The URL of the web resource.

      - `ContainerFileCitation`

        A citation for a container file used to generate a model response.

        - `container_id: string`

          The ID of the container file.

        - `end_index: number`

          The index of the last character of the container file citation in the message.

        - `file_id: string`

          The ID of the file.

        - `filename: string`

          The filename of the container file cited.

        - `start_index: number`

          The index of the first character of the container file citation in the message.

        - `type: "container_file_citation"`

          The type of the container file citation. Always `container_file_citation`.

          - `"container_file_citation"`

      - `FilePath`

        A path to a file.

        - `file_id: string`

          The ID of the file.

        - `index: number`

          The index of the file in the list of files.

        - `type: "file_path"`

          The type of the file path. Always `file_path`.

          - `"file_path"`

    - `annotation_index: number`

      The index of the annotation within the content part.

    - `content_index: number`

      The index of the content part within the output item.

    - `item_id: string`

      The unique identifier of the item to which the annotation is being added.

    - `output_index: number`

      The index of the output item in the response's output array.

    - `sequence_number: number`

      The sequence number of this event.

    - `type: "response.output_text.annotation.added"`

      The type of the event. Always 'response.output_text.annotation.added'.

      - `"response.output_text.annotation.added"`

    - `agent?: Agent | null`

      The agent that owns this multi-agent streaming event.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

  - `BetaResponseQueuedEvent`

    Emitted when a response is queued and waiting to be processed.

    - `response: BetaResponse`

      The full response object that is queued.

    - `sequence_number: number`

      The sequence number for this event.

    - `type: "response.queued"`

      The type of the event. Always 'response.queued'.

      - `"response.queued"`

    - `agent?: Agent | null`

      The agent that owns this multi-agent streaming event.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

  - `BetaResponseCustomToolCallInputDeltaEvent`

    Event representing a delta (partial update) to the input of a custom tool call.

    - `delta: string`

      The incremental input data (delta) for the custom tool call.

    - `item_id: string`

      Unique identifier for the API item associated with this event.

    - `output_index: number`

      The index of the output this delta applies to.

    - `sequence_number: number`

      The sequence number of this event.

    - `type: "response.custom_tool_call_input.delta"`

      The event type identifier.

      - `"response.custom_tool_call_input.delta"`

    - `agent?: Agent | null`

      The agent that owns this multi-agent streaming event.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

  - `BetaResponseCustomToolCallInputDoneEvent`

    Event indicating that input for a custom tool call is complete.

    - `input: string`

      The complete input data for the custom tool call.

    - `item_id: string`

      Unique identifier for the API item associated with this event.

    - `output_index: number`

      The index of the output this event applies to.

    - `sequence_number: number`

      The sequence number of this event.

    - `type: "response.custom_tool_call_input.done"`

      The event type identifier.

      - `"response.custom_tool_call_input.done"`

    - `agent?: Agent | null`

      The agent that owns this multi-agent streaming event.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

### Beta Response Text Config

- `BetaResponseTextConfig`

  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?: BetaResponseFormatTextConfig`

    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.

    - `Text`

      Default response format. Used to generate text responses.

      - `type: "text"`

        The type of response format being defined. Always `text`.

        - `"text"`

    - `BetaResponseFormatTextJSONSchemaConfig`

      JSON Schema response format. Used to generate structured JSON responses.
      Learn more about [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs).

      - `name: string`

        The name of the response format. Must be a-z, A-Z, 0-9, or contain
        underscores and dashes, with a maximum length of 64.

      - `schema: Record<string, unknown>`

        The schema for the response format, described as a JSON Schema object.
        Learn how to build JSON schemas [here](https://json-schema.org/).

      - `type: "json_schema"`

        The type of response format being defined. Always `json_schema`.

        - `"json_schema"`

      - `description?: string`

        A description of what the response format is for, used by the model to
        determine how to respond in the format.

      - `strict?: boolean | null`

        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).

    - `JSONObject`

      JSON object response format. An older method of generating JSON responses.
      Using `json_schema` is recommended for models that support it. Note that the
      model will not generate JSON without a system or user message instructing it
      to do so.

      - `type: "json_object"`

        The type of response format being defined. Always `json_object`.

        - `"json_object"`

  - `verbosity?: "low" | "medium" | "high" | null`

    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`.

    - `"low"`

    - `"medium"`

    - `"high"`

### Beta Response Text Delta Event

- `BetaResponseTextDeltaEvent`

  Emitted when there is an additional text delta.

  - `content_index: number`

    The index of the content part that the text delta was added to.

  - `delta: string`

    The text delta that was added.

  - `item_id: string`

    The ID of the output item that the text delta was added to.

  - `logprobs: Array<Logprob>`

    The log probabilities of the tokens in the delta.

    - `token: string`

      A possible text token.

    - `logprob: number`

      The log probability of this token.

    - `top_logprobs?: Array<TopLogprob>`

      The log probabilities of up to 20 of the most likely tokens.

      - `token?: string`

        A possible text token.

      - `logprob?: number`

        The log probability of this token.

  - `output_index: number`

    The index of the output item that the text delta was added to.

  - `sequence_number: number`

    The sequence number for this event.

  - `type: "response.output_text.delta"`

    The type of the event. Always `response.output_text.delta`.

    - `"response.output_text.delta"`

  - `agent?: Agent | null`

    The agent that owns this multi-agent streaming event.

    - `agent_name: string`

      The canonical name of the agent that produced this item.

### Beta Response Text Done Event

- `BetaResponseTextDoneEvent`

  Emitted when text content is finalized.

  - `content_index: number`

    The index of the content part that the text content is finalized.

  - `item_id: string`

    The ID of the output item that the text content is finalized.

  - `logprobs: Array<Logprob>`

    The log probabilities of the tokens in the delta.

    - `token: string`

      A possible text token.

    - `logprob: number`

      The log probability of this token.

    - `top_logprobs?: Array<TopLogprob>`

      The log probabilities of up to 20 of the most likely tokens.

      - `token?: string`

        A possible text token.

      - `logprob?: number`

        The log probability of this token.

  - `output_index: number`

    The index of the output item that the text content is finalized.

  - `sequence_number: number`

    The sequence number for this event.

  - `text: string`

    The text content that is finalized.

  - `type: "response.output_text.done"`

    The type of the event. Always `response.output_text.done`.

    - `"response.output_text.done"`

  - `agent?: Agent | null`

    The agent that owns this multi-agent streaming event.

    - `agent_name: string`

      The canonical name of the agent that produced this item.

### Beta Response Tool Search Call

- `BetaResponseToolSearchCall`

  - `id: string`

    The unique ID of the tool search call item.

  - `arguments: unknown`

    Arguments used for the tool search call.

  - `call_id: string | null`

    The unique ID of the tool search call generated by the model.

  - `execution: "server" | "client"`

    Whether tool search was executed by the server or by the client.

    - `"server"`

    - `"client"`

  - `status: "in_progress" | "completed" | "incomplete"`

    The status of the tool search call item that was recorded.

    - `"in_progress"`

    - `"completed"`

    - `"incomplete"`

  - `type: "tool_search_call"`

    The type of the item. Always `tool_search_call`.

    - `"tool_search_call"`

  - `agent?: Agent`

    The agent that produced this item.

    - `agent_name: string`

      The canonical name of the agent that produced this item.

  - `created_by?: string`

    The identifier of the actor that created the item.

### Beta Response Tool Search Output Item

- `BetaResponseToolSearchOutputItem`

  - `id: string`

    The unique ID of the tool search output item.

  - `call_id: string | null`

    The unique ID of the tool search call generated by the model.

  - `execution: "server" | "client"`

    Whether tool search was executed by the server or by the client.

    - `"server"`

    - `"client"`

  - `status: "in_progress" | "completed" | "incomplete"`

    The status of the tool search output item that was recorded.

    - `"in_progress"`

    - `"completed"`

    - `"incomplete"`

  - `tools: Array<BetaTool>`

    The loaded tool definitions returned by tool search.

    - `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).

      - `name: string`

        The name of the function to call.

      - `parameters: Record<string, unknown> | null`

        A JSON schema object describing the parameters of the function.

      - `strict: boolean | null`

        Whether strict parameter validation is enforced for this function tool.

      - `type: "function"`

        The type of the function tool. Always `function`.

        - `"function"`

      - `allowed_callers?: Array<"direct" | "programmatic"> | null`

        The tool invocation context(s).

        - `"direct"`

        - `"programmatic"`

      - `defer_loading?: boolean`

        Whether this function is deferred and loaded via tool search.

      - `description?: string | null`

        A description of the function. Used by the model to determine whether or not to call the function.

      - `output_schema?: Record<string, unknown> | null`

        A JSON schema object describing the JSON value encoded in string outputs for this function.

    - `BetaFileSearchTool`

      A tool that searches for relevant content from uploaded files. Learn more about the [file search tool](https://platform.openai.com/docs/guides/tools-file-search).

      - `type: "file_search"`

        The type of the file search tool. Always `file_search`.

        - `"file_search"`

      - `vector_store_ids: Array<string>`

        The IDs of the vector stores to search.

      - `filters?: ComparisonFilter | CompoundFilter | null`

        A filter to apply.

        - `ComparisonFilter`

          A filter used to compare a specified attribute key to a given value using a defined comparison operation.

          - `key: string`

            The key to compare against the value.

          - `type: "eq" | "ne" | "gt" | 5 more`

            Specifies the comparison operator: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`, `in`, `nin`.

            - `eq`: equals
            - `ne`: not equal
            - `gt`: greater than
            - `gte`: greater than or equal
            - `lt`: less than
            - `lte`: less than or equal
            - `in`: in
            - `nin`: not in

            - `"eq"`

            - `"ne"`

            - `"gt"`

            - `"gte"`

            - `"lt"`

            - `"lte"`

            - `"in"`

            - `"nin"`

          - `value: string | number | boolean | Array<string | number>`

            The value to compare against the attribute key; supports string, number, or boolean types.

            - `string`

            - `number`

            - `boolean`

            - `Array<string | number>`

              - `string`

              - `number`

        - `CompoundFilter`

          Combine multiple filters using `and` or `or`.

          - `filters: Array<ComparisonFilter | unknown>`

            Array of filters to combine. Items can be `ComparisonFilter` or `CompoundFilter`.

            - `ComparisonFilter`

              A filter used to compare a specified attribute key to a given value using a defined comparison operation.

              - `key: string`

                The key to compare against the value.

              - `type: "eq" | "ne" | "gt" | 5 more`

                Specifies the comparison operator: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`, `in`, `nin`.

                - `eq`: equals
                - `ne`: not equal
                - `gt`: greater than
                - `gte`: greater than or equal
                - `lt`: less than
                - `lte`: less than or equal
                - `in`: in
                - `nin`: not in

                - `"eq"`

                - `"ne"`

                - `"gt"`

                - `"gte"`

                - `"lt"`

                - `"lte"`

                - `"in"`

                - `"nin"`

              - `value: string | number | boolean | Array<string | number>`

                The value to compare against the attribute key; supports string, number, or boolean types.

                - `string`

                - `number`

                - `boolean`

                - `Array<string | number>`

                  - `string`

                  - `number`

            - `unknown`

          - `type: "and" | "or"`

            Type of operation: `and` or `or`.

            - `"and"`

            - `"or"`

      - `max_num_results?: number`

        The maximum number of results to return. This number should be between 1 and 50 inclusive.

      - `ranking_options?: RankingOptions`

        Ranking options for search.

        - `hybrid_search?: HybridSearch`

          Weights that control how reciprocal rank fusion balances semantic embedding matches versus sparse keyword matches when hybrid search is enabled.

          - `embedding_weight: number`

            The weight of the embedding in the reciprocal ranking fusion.

          - `text_weight: number`

            The weight of the text in the reciprocal ranking fusion.

        - `ranker?: "auto" | "default-2024-11-15"`

          The ranker to use for the file search.

          - `"auto"`

          - `"default-2024-11-15"`

        - `score_threshold?: number`

          The score threshold for the file search, a number between 0 and 1. Numbers closer to 1 will attempt to return only the most relevant results, but may return fewer results.

    - `BetaComputerTool`

      A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use).

      - `type: "computer"`

        The type of the computer tool. Always `computer`.

        - `"computer"`

    - `BetaComputerUsePreviewTool`

      A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use).

      - `display_height: number`

        The height of the computer display.

      - `display_width: number`

        The width of the computer display.

      - `environment: "windows" | "mac" | "linux" | 2 more`

        The type of computer environment to control.

        - `"windows"`

        - `"mac"`

        - `"linux"`

        - `"ubuntu"`

        - `"browser"`

      - `type: "computer_use_preview"`

        The type of the computer use tool. Always `computer_use_preview`.

        - `"computer_use_preview"`

    - `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"`

        The type of the web search tool. One of `web_search` or `web_search_2025_08_26`.

        - `"web_search"`

        - `"web_search_2025_08_26"`

      - `external_web_access?: boolean`

        Allow live internet access for web search. Defaults to true when omitted. When false, the web search tool runs in offline/cache-only mode and will not fetch new external content.

      - `filters?: Filters | null`

        Filters for the search.

        - `allowed_domains?: Array<string> | null`

          Allowed domains for the search. If not provided, all domains are allowed.
          Subdomains of the provided domains are allowed as well.

          Example: `["pubmed.ncbi.nlm.nih.gov"]`

      - `search_context_size?: "low" | "medium" | "high"`

        High level guidance for the amount of context window space to use for the search. One of `low`, `medium`, or `high`. `medium` is the default.

        - `"low"`

        - `"medium"`

        - `"high"`

      - `user_location?: UserLocation | null`

        The approximate location of the user.

        - `city?: string | null`

          Free text input for the city of the user, e.g. `San Francisco`.

        - `country?: string | null`

          The two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of the user, e.g. `US`.

        - `region?: string | null`

          Free text input for the region of the user, e.g. `California`.

        - `timezone?: string | null`

          The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of the user, e.g. `America/Los_Angeles`.

        - `type?: "approximate"`

          The type of location approximation. Always `approximate`.

          - `"approximate"`

    - `Mcp`

      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).

      - `server_label: string`

        A label for this MCP server, used to identify it in tool calls.

      - `type: "mcp"`

        The type of the MCP tool. Always `mcp`.

        - `"mcp"`

      - `allowed_callers?: Array<"direct" | "programmatic"> | null`

        The tool invocation context(s).

        - `"direct"`

        - `"programmatic"`

      - `allowed_tools?: Array<string> | McpToolFilter | null`

        List of allowed tool names or a filter object.

        - `Array<string>`

        - `McpToolFilter`

          A filter object to specify which tools are allowed.

          - `read_only?: boolean`

            Indicates whether or not a tool modifies data or is read-only. If an
            MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint),
            it will match this filter.

          - `tool_names?: Array<string>`

            List of allowed tool names.

      - `authorization?: string`

        An OAuth access token that can be used with a remote MCP server, either
        with a custom MCP server URL or a service connector. Your application
        must handle the OAuth authorization flow and provide the token here.

      - `connector_id?: "connector_dropbox" | "connector_gmail" | "connector_googlecalendar" | 5 more`

        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`

        - `"connector_dropbox"`

        - `"connector_gmail"`

        - `"connector_googlecalendar"`

        - `"connector_googledrive"`

        - `"connector_microsoftteams"`

        - `"connector_outlookcalendar"`

        - `"connector_outlookemail"`

        - `"connector_sharepoint"`

      - `defer_loading?: boolean`

        Whether this MCP tool is deferred and discovered via tool search.

      - `headers?: Record<string, string> | null`

        Optional HTTP headers to send to the MCP server. Use for authentication
        or other purposes.

      - `require_approval?: McpToolApprovalFilter | "always" | "never" | null`

        Specify which of the MCP server's tools require approval.

        - `McpToolApprovalFilter`

          Specify which of the MCP server's tools require approval. Can be
          `always`, `never`, or a filter object associated with tools
          that require approval.

          - `always?: Always`

            A filter object to specify which tools are allowed.

            - `read_only?: boolean`

              Indicates whether or not a tool modifies data or is read-only. If an
              MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint),
              it will match this filter.

            - `tool_names?: Array<string>`

              List of allowed tool names.

          - `never?: Never`

            A filter object to specify which tools are allowed.

            - `read_only?: boolean`

              Indicates whether or not a tool modifies data or is read-only. If an
              MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint),
              it will match this filter.

            - `tool_names?: Array<string>`

              List of allowed tool names.

        - `"always" | "never"`

          - `"always"`

          - `"never"`

      - `server_description?: string`

        Optional description of the MCP server, used to provide more context.

      - `server_url?: string`

        The URL for the MCP server. One of `server_url`, `connector_id`, or
        `tunnel_id` must be provided.

      - `tunnel_id?: string`

        The Secure MCP Tunnel ID to use instead of a direct server URL. One of
        `server_url`, `connector_id`, or `tunnel_id` must be provided.

    - `CodeInterpreter`

      A tool that runs Python code to help generate a response to a prompt.

      - `container: string | CodeInterpreterToolAuto`

        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`

        - `CodeInterpreterToolAuto`

          Configuration for a code interpreter container. Optionally specify the IDs of the files to run the code on.

          - `type: "auto"`

            Always `auto`.

            - `"auto"`

          - `file_ids?: Array<string>`

            An optional list of uploaded files to make available to your code.

          - `memory_limit?: "1g" | "4g" | "16g" | "64g" | null`

            The memory limit for the code interpreter container.

            - `"1g"`

            - `"4g"`

            - `"16g"`

            - `"64g"`

          - `network_policy?: BetaContainerNetworkPolicyDisabled | BetaContainerNetworkPolicyAllowlist`

            Network access policy for the container.

            - `BetaContainerNetworkPolicyDisabled`

              - `type: "disabled"`

                Disable outbound network access. Always `disabled`.

                - `"disabled"`

            - `BetaContainerNetworkPolicyAllowlist`

              - `allowed_domains: Array<string>`

                A list of allowed domains when type is `allowlist`.

              - `type: "allowlist"`

                Allow outbound network access only to specified domains. Always `allowlist`.

                - `"allowlist"`

              - `domain_secrets?: Array<BetaContainerNetworkPolicyDomainSecret>`

                Optional domain-scoped secrets for allowlisted domains.

                - `domain: string`

                  The domain associated with the secret.

                - `name: string`

                  The name of the secret to inject for the domain.

                - `value: string`

                  The secret value to inject for the domain.

      - `type: "code_interpreter"`

        The type of the code interpreter tool. Always `code_interpreter`.

        - `"code_interpreter"`

      - `allowed_callers?: Array<"direct" | "programmatic"> | null`

        The tool invocation context(s).

        - `"direct"`

        - `"programmatic"`

    - `ProgrammaticToolCalling`

      - `type: "programmatic_tool_calling"`

        The type of the tool. Always `programmatic_tool_calling`.

        - `"programmatic_tool_calling"`

    - `ImageGeneration`

      A tool that generates images using the GPT image models.

      - `type: "image_generation"`

        The type of the image generation tool. Always `image_generation`.

        - `"image_generation"`

      - `action?: "generate" | "edit" | "auto"`

        Whether to generate a new image or edit an existing image. Default: `auto`.

        - `"generate"`

        - `"edit"`

        - `"auto"`

      - `background?: "transparent" | "opaque" | "auto"`

        Allows to set transparency for the background of the generated image(s).
        Must be one of `transparent`, `opaque`, or `auto` (default value). When
        `auto` is used, the model will automatically determine the best
        background for the image.

        Transparent backgrounds are available for supported GPT Image models.
        For `gpt-image-2` and `gpt-image-2-2026-04-21`, this support is in
        preview. When using `transparent`, set the output format to `png` or
        `webp`.

        - `"transparent"`

        - `"opaque"`

        - `"auto"`

      - `input_fidelity?: "high" | "low" | null`

        Control how much effort the model will exert to match the style and features, especially facial features, of input images. This parameter is only supported for `gpt-image-1` and `gpt-image-1.5` and later models, unsupported for `gpt-image-1-mini`. Supports `high` and `low`. Defaults to `low`.

        - `"high"`

        - `"low"`

      - `input_image_mask?: InputImageMask`

        Optional mask for inpainting. Contains `image_url`
        (string, optional) and `file_id` (string, optional).

        - `file_id?: string`

          File ID for the mask image.

        - `image_url?: string`

          Base64-encoded mask image.

      - `model?: (string & {}) | "gpt-image-1" | "gpt-image-1-mini" | "gpt-image-2" | 3 more`

        The image generation model to use. One of `gpt-image-1`,
        `gpt-image-1-mini`, `gpt-image-1.5`, `gpt-image-2`,
        `gpt-image-2-2026-04-21`, or `chatgpt-image-latest`. Default:
        `gpt-image-1`.

        - `(string & {})`

        - `"gpt-image-1" | "gpt-image-1-mini" | "gpt-image-2" | 3 more`

          - `"gpt-image-1"`

          - `"gpt-image-1-mini"`

          - `"gpt-image-2"`

          - `"gpt-image-2-2026-04-21"`

          - `"gpt-image-1.5"`

          - `"chatgpt-image-latest"`

      - `moderation?: "auto" | "low"`

        Moderation level for the generated image. Default: `auto`.

        - `"auto"`

        - `"low"`

      - `output_compression?: number`

        Compression level for the output image. Default: 100.

      - `output_format?: "png" | "webp" | "jpeg"`

        The output format of the generated image. One of `png`, `webp`, or
        `jpeg`. Default: `png`.

        - `"png"`

        - `"webp"`

        - `"jpeg"`

      - `partial_images?: number`

        Number of partial images to generate in streaming mode, from 0 (default value) to 3.

      - `quality?: "low" | "medium" | "high" | "auto"`

        The quality of the generated image. One of `low`, `medium`, `high`,
        or `auto`. Default: `auto`.

        - `"low"`

        - `"medium"`

        - `"high"`

        - `"auto"`

      - `size?: (string & {}) | "1024x1024" | "1024x1536" | "1536x1024" | "auto"`

        The size of the generated images. For `gpt-image-2` and `gpt-image-2-2026-04-21`, arbitrary resolutions are supported as `WIDTHxHEIGHT` strings, for example `1536x864`. Width and height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above `2560x1440` are experimental, and the maximum supported resolution is `3840x2160`. The requested size must also satisfy the model's current pixel and edge limits. The standard sizes `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models; `auto` is supported for models that allow automatic sizing. For `dall-e-2`, use one of `256x256`, `512x512`, or `1024x1024`. For `dall-e-3`, use one of `1024x1024`, `1792x1024`, or `1024x1792`.

        - `(string & {})`

        - `"1024x1024" | "1024x1536" | "1536x1024" | "auto"`

          - `"1024x1024"`

          - `"1024x1536"`

          - `"1536x1024"`

          - `"auto"`

    - `LocalShell`

      A tool that allows the model to execute shell commands in a local environment.

      - `type: "local_shell"`

        The type of the local shell tool. Always `local_shell`.

        - `"local_shell"`

    - `BetaFunctionShellTool`

      A tool that allows the model to execute shell commands.

      - `type: "shell"`

        The type of the shell tool. Always `shell`.

        - `"shell"`

      - `allowed_callers?: Array<"direct" | "programmatic"> | null`

        The tool invocation context(s).

        - `"direct"`

        - `"programmatic"`

      - `environment?: BetaContainerAuto | BetaLocalEnvironment | BetaContainerReference | null`

        - `BetaContainerAuto`

          - `type: "container_auto"`

            Automatically creates a container for this request

            - `"container_auto"`

          - `file_ids?: Array<string>`

            An optional list of uploaded files to make available to your code.

          - `memory_limit?: "1g" | "4g" | "16g" | "64g" | null`

            The memory limit for the container.

            - `"1g"`

            - `"4g"`

            - `"16g"`

            - `"64g"`

          - `network_policy?: BetaContainerNetworkPolicyDisabled | BetaContainerNetworkPolicyAllowlist`

            Network access policy for the container.

            - `BetaContainerNetworkPolicyDisabled`

            - `BetaContainerNetworkPolicyAllowlist`

          - `skills?: Array<BetaSkillReference | BetaInlineSkill>`

            An optional list of skills referenced by id or inline data.

            - `BetaSkillReference`

              - `skill_id: string`

                The ID of the referenced skill.

              - `type: "skill_reference"`

                References a skill created with the /v1/skills endpoint.

                - `"skill_reference"`

              - `version?: string`

                Optional skill version. Use a positive integer or 'latest'. Omit for default.

            - `BetaInlineSkill`

              - `description: string`

                The description of the skill.

              - `name: string`

                The name of the skill.

              - `source: BetaInlineSkillSource`

                Inline skill payload

                - `data: string`

                  Base64-encoded skill zip bundle.

                - `media_type: "application/zip"`

                  The media type of the inline skill payload. Must be `application/zip`.

                  - `"application/zip"`

                - `type: "base64"`

                  The type of the inline skill source. Must be `base64`.

                  - `"base64"`

              - `type: "inline"`

                Defines an inline skill for this request.

                - `"inline"`

        - `BetaLocalEnvironment`

          - `type: "local"`

            Use a local computer environment.

            - `"local"`

          - `skills?: Array<BetaLocalSkill>`

            An optional list of skills.

            - `description: string`

              The description of the skill.

            - `name: string`

              The name of the skill.

            - `path: string`

              The path to the directory containing the skill.

        - `BetaContainerReference`

          - `container_id: string`

            The ID of the referenced container.

          - `type: "container_reference"`

            References a container created with the /v1/containers endpoint

            - `"container_reference"`

    - `BetaCustomTool`

      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)

      - `name: string`

        The name of the custom tool, used to identify it in tool calls.

      - `type: "custom"`

        The type of the custom tool. Always `custom`.

        - `"custom"`

      - `allowed_callers?: Array<"direct" | "programmatic"> | null`

        The tool invocation context(s).

        - `"direct"`

        - `"programmatic"`

      - `defer_loading?: boolean`

        Whether this tool should be deferred and discovered via tool search.

      - `description?: string`

        Optional description of the custom tool, used to provide more context.

      - `format?: Text | Grammar`

        The input format for the custom tool. Default is unconstrained text.

        - `Text`

          Unconstrained free-form text.

          - `type: "text"`

            Unconstrained text format. Always `text`.

            - `"text"`

        - `Grammar`

          A grammar defined by the user.

          - `definition: string`

            The grammar definition.

          - `syntax: "lark" | "regex"`

            The syntax of the grammar definition. One of `lark` or `regex`.

            - `"lark"`

            - `"regex"`

          - `type: "grammar"`

            Grammar format. Always `grammar`.

            - `"grammar"`

    - `BetaNamespaceTool`

      Groups function/custom tools under a shared namespace.

      - `description: string`

        A description of the namespace shown to the model.

      - `name: string`

        The namespace name used in tool calls (for example, `crm`).

      - `tools: Array<Function | BetaCustomTool>`

        The function/custom tools available inside this namespace.

        - `Function`

          - `name: string`

          - `type: "function"`

            - `"function"`

          - `allowed_callers?: Array<"direct" | "programmatic"> | null`

            The tool invocation context(s).

            - `"direct"`

            - `"programmatic"`

          - `defer_loading?: boolean`

            Whether this function should be deferred and discovered via tool search.

          - `description?: string | null`

          - `output_schema?: Record<string, unknown> | null`

            A JSON Schema describing the JSON value encoded in string outputs for this function tool. This does not describe content-array outputs.

          - `parameters?: unknown`

          - `strict?: boolean | null`

            Whether to enforce strict parameter validation. If omitted, Responses attempts to use strict validation when the schema is compatible, and falls back to non-strict validation otherwise.

        - `BetaCustomTool`

          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: "namespace"`

        The type of the tool. Always `namespace`.

        - `"namespace"`

    - `BetaToolSearchTool`

      Hosted or BYOT tool search configuration for deferred tools.

      - `type: "tool_search"`

        The type of the tool. Always `tool_search`.

        - `"tool_search"`

      - `description?: string | null`

        Description shown to the model for a client-executed tool search tool.

      - `execution?: "server" | "client"`

        Whether tool search is executed by the server or by the client.

        - `"server"`

        - `"client"`

      - `parameters?: unknown`

        Parameter schema for a client-executed tool search tool.

    - `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"`

        The type of the web search tool. One of `web_search_preview` or `web_search_preview_2025_03_11`.

        - `"web_search_preview"`

        - `"web_search_preview_2025_03_11"`

      - `search_content_types?: Array<"text" | "image">`

        - `"text"`

        - `"image"`

      - `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.

        - `"low"`

        - `"medium"`

        - `"high"`

      - `user_location?: UserLocation | null`

        The user's location.

        - `type: "approximate"`

          The type of location approximation. Always `approximate`.

          - `"approximate"`

        - `city?: string | null`

          Free text input for the city of the user, e.g. `San Francisco`.

        - `country?: string | null`

          The two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of the user, e.g. `US`.

        - `region?: string | null`

          Free text input for the region of the user, e.g. `California`.

        - `timezone?: string | null`

          The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of the user, e.g. `America/Los_Angeles`.

    - `BetaApplyPatchTool`

      Allows the assistant to create, delete, or update files using unified diffs.

      - `type: "apply_patch"`

        The type of the tool. Always `apply_patch`.

        - `"apply_patch"`

      - `allowed_callers?: Array<"direct" | "programmatic"> | null`

        The tool invocation context(s).

        - `"direct"`

        - `"programmatic"`

  - `type: "tool_search_output"`

    The type of the item. Always `tool_search_output`.

    - `"tool_search_output"`

  - `agent?: Agent`

    The agent that produced this item.

    - `agent_name: string`

      The canonical name of the agent that produced this item.

  - `created_by?: string`

    The identifier of the actor that created the item.

### Beta Response Tool Search Output Item Param

- `BetaResponseToolSearchOutputItemParam`

  - `tools: Array<BetaTool>`

    The loaded tool definitions returned by the tool search output.

    - `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).

      - `name: string`

        The name of the function to call.

      - `parameters: Record<string, unknown> | null`

        A JSON schema object describing the parameters of the function.

      - `strict: boolean | null`

        Whether strict parameter validation is enforced for this function tool.

      - `type: "function"`

        The type of the function tool. Always `function`.

        - `"function"`

      - `allowed_callers?: Array<"direct" | "programmatic"> | null`

        The tool invocation context(s).

        - `"direct"`

        - `"programmatic"`

      - `defer_loading?: boolean`

        Whether this function is deferred and loaded via tool search.

      - `description?: string | null`

        A description of the function. Used by the model to determine whether or not to call the function.

      - `output_schema?: Record<string, unknown> | null`

        A JSON schema object describing the JSON value encoded in string outputs for this function.

    - `BetaFileSearchTool`

      A tool that searches for relevant content from uploaded files. Learn more about the [file search tool](https://platform.openai.com/docs/guides/tools-file-search).

      - `type: "file_search"`

        The type of the file search tool. Always `file_search`.

        - `"file_search"`

      - `vector_store_ids: Array<string>`

        The IDs of the vector stores to search.

      - `filters?: ComparisonFilter | CompoundFilter | null`

        A filter to apply.

        - `ComparisonFilter`

          A filter used to compare a specified attribute key to a given value using a defined comparison operation.

          - `key: string`

            The key to compare against the value.

          - `type: "eq" | "ne" | "gt" | 5 more`

            Specifies the comparison operator: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`, `in`, `nin`.

            - `eq`: equals
            - `ne`: not equal
            - `gt`: greater than
            - `gte`: greater than or equal
            - `lt`: less than
            - `lte`: less than or equal
            - `in`: in
            - `nin`: not in

            - `"eq"`

            - `"ne"`

            - `"gt"`

            - `"gte"`

            - `"lt"`

            - `"lte"`

            - `"in"`

            - `"nin"`

          - `value: string | number | boolean | Array<string | number>`

            The value to compare against the attribute key; supports string, number, or boolean types.

            - `string`

            - `number`

            - `boolean`

            - `Array<string | number>`

              - `string`

              - `number`

        - `CompoundFilter`

          Combine multiple filters using `and` or `or`.

          - `filters: Array<ComparisonFilter | unknown>`

            Array of filters to combine. Items can be `ComparisonFilter` or `CompoundFilter`.

            - `ComparisonFilter`

              A filter used to compare a specified attribute key to a given value using a defined comparison operation.

              - `key: string`

                The key to compare against the value.

              - `type: "eq" | "ne" | "gt" | 5 more`

                Specifies the comparison operator: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`, `in`, `nin`.

                - `eq`: equals
                - `ne`: not equal
                - `gt`: greater than
                - `gte`: greater than or equal
                - `lt`: less than
                - `lte`: less than or equal
                - `in`: in
                - `nin`: not in

                - `"eq"`

                - `"ne"`

                - `"gt"`

                - `"gte"`

                - `"lt"`

                - `"lte"`

                - `"in"`

                - `"nin"`

              - `value: string | number | boolean | Array<string | number>`

                The value to compare against the attribute key; supports string, number, or boolean types.

                - `string`

                - `number`

                - `boolean`

                - `Array<string | number>`

                  - `string`

                  - `number`

            - `unknown`

          - `type: "and" | "or"`

            Type of operation: `and` or `or`.

            - `"and"`

            - `"or"`

      - `max_num_results?: number`

        The maximum number of results to return. This number should be between 1 and 50 inclusive.

      - `ranking_options?: RankingOptions`

        Ranking options for search.

        - `hybrid_search?: HybridSearch`

          Weights that control how reciprocal rank fusion balances semantic embedding matches versus sparse keyword matches when hybrid search is enabled.

          - `embedding_weight: number`

            The weight of the embedding in the reciprocal ranking fusion.

          - `text_weight: number`

            The weight of the text in the reciprocal ranking fusion.

        - `ranker?: "auto" | "default-2024-11-15"`

          The ranker to use for the file search.

          - `"auto"`

          - `"default-2024-11-15"`

        - `score_threshold?: number`

          The score threshold for the file search, a number between 0 and 1. Numbers closer to 1 will attempt to return only the most relevant results, but may return fewer results.

    - `BetaComputerTool`

      A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use).

      - `type: "computer"`

        The type of the computer tool. Always `computer`.

        - `"computer"`

    - `BetaComputerUsePreviewTool`

      A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use).

      - `display_height: number`

        The height of the computer display.

      - `display_width: number`

        The width of the computer display.

      - `environment: "windows" | "mac" | "linux" | 2 more`

        The type of computer environment to control.

        - `"windows"`

        - `"mac"`

        - `"linux"`

        - `"ubuntu"`

        - `"browser"`

      - `type: "computer_use_preview"`

        The type of the computer use tool. Always `computer_use_preview`.

        - `"computer_use_preview"`

    - `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"`

        The type of the web search tool. One of `web_search` or `web_search_2025_08_26`.

        - `"web_search"`

        - `"web_search_2025_08_26"`

      - `external_web_access?: boolean`

        Allow live internet access for web search. Defaults to true when omitted. When false, the web search tool runs in offline/cache-only mode and will not fetch new external content.

      - `filters?: Filters | null`

        Filters for the search.

        - `allowed_domains?: Array<string> | null`

          Allowed domains for the search. If not provided, all domains are allowed.
          Subdomains of the provided domains are allowed as well.

          Example: `["pubmed.ncbi.nlm.nih.gov"]`

      - `search_context_size?: "low" | "medium" | "high"`

        High level guidance for the amount of context window space to use for the search. One of `low`, `medium`, or `high`. `medium` is the default.

        - `"low"`

        - `"medium"`

        - `"high"`

      - `user_location?: UserLocation | null`

        The approximate location of the user.

        - `city?: string | null`

          Free text input for the city of the user, e.g. `San Francisco`.

        - `country?: string | null`

          The two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of the user, e.g. `US`.

        - `region?: string | null`

          Free text input for the region of the user, e.g. `California`.

        - `timezone?: string | null`

          The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of the user, e.g. `America/Los_Angeles`.

        - `type?: "approximate"`

          The type of location approximation. Always `approximate`.

          - `"approximate"`

    - `Mcp`

      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).

      - `server_label: string`

        A label for this MCP server, used to identify it in tool calls.

      - `type: "mcp"`

        The type of the MCP tool. Always `mcp`.

        - `"mcp"`

      - `allowed_callers?: Array<"direct" | "programmatic"> | null`

        The tool invocation context(s).

        - `"direct"`

        - `"programmatic"`

      - `allowed_tools?: Array<string> | McpToolFilter | null`

        List of allowed tool names or a filter object.

        - `Array<string>`

        - `McpToolFilter`

          A filter object to specify which tools are allowed.

          - `read_only?: boolean`

            Indicates whether or not a tool modifies data or is read-only. If an
            MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint),
            it will match this filter.

          - `tool_names?: Array<string>`

            List of allowed tool names.

      - `authorization?: string`

        An OAuth access token that can be used with a remote MCP server, either
        with a custom MCP server URL or a service connector. Your application
        must handle the OAuth authorization flow and provide the token here.

      - `connector_id?: "connector_dropbox" | "connector_gmail" | "connector_googlecalendar" | 5 more`

        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`

        - `"connector_dropbox"`

        - `"connector_gmail"`

        - `"connector_googlecalendar"`

        - `"connector_googledrive"`

        - `"connector_microsoftteams"`

        - `"connector_outlookcalendar"`

        - `"connector_outlookemail"`

        - `"connector_sharepoint"`

      - `defer_loading?: boolean`

        Whether this MCP tool is deferred and discovered via tool search.

      - `headers?: Record<string, string> | null`

        Optional HTTP headers to send to the MCP server. Use for authentication
        or other purposes.

      - `require_approval?: McpToolApprovalFilter | "always" | "never" | null`

        Specify which of the MCP server's tools require approval.

        - `McpToolApprovalFilter`

          Specify which of the MCP server's tools require approval. Can be
          `always`, `never`, or a filter object associated with tools
          that require approval.

          - `always?: Always`

            A filter object to specify which tools are allowed.

            - `read_only?: boolean`

              Indicates whether or not a tool modifies data or is read-only. If an
              MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint),
              it will match this filter.

            - `tool_names?: Array<string>`

              List of allowed tool names.

          - `never?: Never`

            A filter object to specify which tools are allowed.

            - `read_only?: boolean`

              Indicates whether or not a tool modifies data or is read-only. If an
              MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint),
              it will match this filter.

            - `tool_names?: Array<string>`

              List of allowed tool names.

        - `"always" | "never"`

          - `"always"`

          - `"never"`

      - `server_description?: string`

        Optional description of the MCP server, used to provide more context.

      - `server_url?: string`

        The URL for the MCP server. One of `server_url`, `connector_id`, or
        `tunnel_id` must be provided.

      - `tunnel_id?: string`

        The Secure MCP Tunnel ID to use instead of a direct server URL. One of
        `server_url`, `connector_id`, or `tunnel_id` must be provided.

    - `CodeInterpreter`

      A tool that runs Python code to help generate a response to a prompt.

      - `container: string | CodeInterpreterToolAuto`

        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`

        - `CodeInterpreterToolAuto`

          Configuration for a code interpreter container. Optionally specify the IDs of the files to run the code on.

          - `type: "auto"`

            Always `auto`.

            - `"auto"`

          - `file_ids?: Array<string>`

            An optional list of uploaded files to make available to your code.

          - `memory_limit?: "1g" | "4g" | "16g" | "64g" | null`

            The memory limit for the code interpreter container.

            - `"1g"`

            - `"4g"`

            - `"16g"`

            - `"64g"`

          - `network_policy?: BetaContainerNetworkPolicyDisabled | BetaContainerNetworkPolicyAllowlist`

            Network access policy for the container.

            - `BetaContainerNetworkPolicyDisabled`

              - `type: "disabled"`

                Disable outbound network access. Always `disabled`.

                - `"disabled"`

            - `BetaContainerNetworkPolicyAllowlist`

              - `allowed_domains: Array<string>`

                A list of allowed domains when type is `allowlist`.

              - `type: "allowlist"`

                Allow outbound network access only to specified domains. Always `allowlist`.

                - `"allowlist"`

              - `domain_secrets?: Array<BetaContainerNetworkPolicyDomainSecret>`

                Optional domain-scoped secrets for allowlisted domains.

                - `domain: string`

                  The domain associated with the secret.

                - `name: string`

                  The name of the secret to inject for the domain.

                - `value: string`

                  The secret value to inject for the domain.

      - `type: "code_interpreter"`

        The type of the code interpreter tool. Always `code_interpreter`.

        - `"code_interpreter"`

      - `allowed_callers?: Array<"direct" | "programmatic"> | null`

        The tool invocation context(s).

        - `"direct"`

        - `"programmatic"`

    - `ProgrammaticToolCalling`

      - `type: "programmatic_tool_calling"`

        The type of the tool. Always `programmatic_tool_calling`.

        - `"programmatic_tool_calling"`

    - `ImageGeneration`

      A tool that generates images using the GPT image models.

      - `type: "image_generation"`

        The type of the image generation tool. Always `image_generation`.

        - `"image_generation"`

      - `action?: "generate" | "edit" | "auto"`

        Whether to generate a new image or edit an existing image. Default: `auto`.

        - `"generate"`

        - `"edit"`

        - `"auto"`

      - `background?: "transparent" | "opaque" | "auto"`

        Allows to set transparency for the background of the generated image(s).
        Must be one of `transparent`, `opaque`, or `auto` (default value). When
        `auto` is used, the model will automatically determine the best
        background for the image.

        Transparent backgrounds are available for supported GPT Image models.
        For `gpt-image-2` and `gpt-image-2-2026-04-21`, this support is in
        preview. When using `transparent`, set the output format to `png` or
        `webp`.

        - `"transparent"`

        - `"opaque"`

        - `"auto"`

      - `input_fidelity?: "high" | "low" | null`

        Control how much effort the model will exert to match the style and features, especially facial features, of input images. This parameter is only supported for `gpt-image-1` and `gpt-image-1.5` and later models, unsupported for `gpt-image-1-mini`. Supports `high` and `low`. Defaults to `low`.

        - `"high"`

        - `"low"`

      - `input_image_mask?: InputImageMask`

        Optional mask for inpainting. Contains `image_url`
        (string, optional) and `file_id` (string, optional).

        - `file_id?: string`

          File ID for the mask image.

        - `image_url?: string`

          Base64-encoded mask image.

      - `model?: (string & {}) | "gpt-image-1" | "gpt-image-1-mini" | "gpt-image-2" | 3 more`

        The image generation model to use. One of `gpt-image-1`,
        `gpt-image-1-mini`, `gpt-image-1.5`, `gpt-image-2`,
        `gpt-image-2-2026-04-21`, or `chatgpt-image-latest`. Default:
        `gpt-image-1`.

        - `(string & {})`

        - `"gpt-image-1" | "gpt-image-1-mini" | "gpt-image-2" | 3 more`

          - `"gpt-image-1"`

          - `"gpt-image-1-mini"`

          - `"gpt-image-2"`

          - `"gpt-image-2-2026-04-21"`

          - `"gpt-image-1.5"`

          - `"chatgpt-image-latest"`

      - `moderation?: "auto" | "low"`

        Moderation level for the generated image. Default: `auto`.

        - `"auto"`

        - `"low"`

      - `output_compression?: number`

        Compression level for the output image. Default: 100.

      - `output_format?: "png" | "webp" | "jpeg"`

        The output format of the generated image. One of `png`, `webp`, or
        `jpeg`. Default: `png`.

        - `"png"`

        - `"webp"`

        - `"jpeg"`

      - `partial_images?: number`

        Number of partial images to generate in streaming mode, from 0 (default value) to 3.

      - `quality?: "low" | "medium" | "high" | "auto"`

        The quality of the generated image. One of `low`, `medium`, `high`,
        or `auto`. Default: `auto`.

        - `"low"`

        - `"medium"`

        - `"high"`

        - `"auto"`

      - `size?: (string & {}) | "1024x1024" | "1024x1536" | "1536x1024" | "auto"`

        The size of the generated images. For `gpt-image-2` and `gpt-image-2-2026-04-21`, arbitrary resolutions are supported as `WIDTHxHEIGHT` strings, for example `1536x864`. Width and height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above `2560x1440` are experimental, and the maximum supported resolution is `3840x2160`. The requested size must also satisfy the model's current pixel and edge limits. The standard sizes `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models; `auto` is supported for models that allow automatic sizing. For `dall-e-2`, use one of `256x256`, `512x512`, or `1024x1024`. For `dall-e-3`, use one of `1024x1024`, `1792x1024`, or `1024x1792`.

        - `(string & {})`

        - `"1024x1024" | "1024x1536" | "1536x1024" | "auto"`

          - `"1024x1024"`

          - `"1024x1536"`

          - `"1536x1024"`

          - `"auto"`

    - `LocalShell`

      A tool that allows the model to execute shell commands in a local environment.

      - `type: "local_shell"`

        The type of the local shell tool. Always `local_shell`.

        - `"local_shell"`

    - `BetaFunctionShellTool`

      A tool that allows the model to execute shell commands.

      - `type: "shell"`

        The type of the shell tool. Always `shell`.

        - `"shell"`

      - `allowed_callers?: Array<"direct" | "programmatic"> | null`

        The tool invocation context(s).

        - `"direct"`

        - `"programmatic"`

      - `environment?: BetaContainerAuto | BetaLocalEnvironment | BetaContainerReference | null`

        - `BetaContainerAuto`

          - `type: "container_auto"`

            Automatically creates a container for this request

            - `"container_auto"`

          - `file_ids?: Array<string>`

            An optional list of uploaded files to make available to your code.

          - `memory_limit?: "1g" | "4g" | "16g" | "64g" | null`

            The memory limit for the container.

            - `"1g"`

            - `"4g"`

            - `"16g"`

            - `"64g"`

          - `network_policy?: BetaContainerNetworkPolicyDisabled | BetaContainerNetworkPolicyAllowlist`

            Network access policy for the container.

            - `BetaContainerNetworkPolicyDisabled`

            - `BetaContainerNetworkPolicyAllowlist`

          - `skills?: Array<BetaSkillReference | BetaInlineSkill>`

            An optional list of skills referenced by id or inline data.

            - `BetaSkillReference`

              - `skill_id: string`

                The ID of the referenced skill.

              - `type: "skill_reference"`

                References a skill created with the /v1/skills endpoint.

                - `"skill_reference"`

              - `version?: string`

                Optional skill version. Use a positive integer or 'latest'. Omit for default.

            - `BetaInlineSkill`

              - `description: string`

                The description of the skill.

              - `name: string`

                The name of the skill.

              - `source: BetaInlineSkillSource`

                Inline skill payload

                - `data: string`

                  Base64-encoded skill zip bundle.

                - `media_type: "application/zip"`

                  The media type of the inline skill payload. Must be `application/zip`.

                  - `"application/zip"`

                - `type: "base64"`

                  The type of the inline skill source. Must be `base64`.

                  - `"base64"`

              - `type: "inline"`

                Defines an inline skill for this request.

                - `"inline"`

        - `BetaLocalEnvironment`

          - `type: "local"`

            Use a local computer environment.

            - `"local"`

          - `skills?: Array<BetaLocalSkill>`

            An optional list of skills.

            - `description: string`

              The description of the skill.

            - `name: string`

              The name of the skill.

            - `path: string`

              The path to the directory containing the skill.

        - `BetaContainerReference`

          - `container_id: string`

            The ID of the referenced container.

          - `type: "container_reference"`

            References a container created with the /v1/containers endpoint

            - `"container_reference"`

    - `BetaCustomTool`

      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)

      - `name: string`

        The name of the custom tool, used to identify it in tool calls.

      - `type: "custom"`

        The type of the custom tool. Always `custom`.

        - `"custom"`

      - `allowed_callers?: Array<"direct" | "programmatic"> | null`

        The tool invocation context(s).

        - `"direct"`

        - `"programmatic"`

      - `defer_loading?: boolean`

        Whether this tool should be deferred and discovered via tool search.

      - `description?: string`

        Optional description of the custom tool, used to provide more context.

      - `format?: Text | Grammar`

        The input format for the custom tool. Default is unconstrained text.

        - `Text`

          Unconstrained free-form text.

          - `type: "text"`

            Unconstrained text format. Always `text`.

            - `"text"`

        - `Grammar`

          A grammar defined by the user.

          - `definition: string`

            The grammar definition.

          - `syntax: "lark" | "regex"`

            The syntax of the grammar definition. One of `lark` or `regex`.

            - `"lark"`

            - `"regex"`

          - `type: "grammar"`

            Grammar format. Always `grammar`.

            - `"grammar"`

    - `BetaNamespaceTool`

      Groups function/custom tools under a shared namespace.

      - `description: string`

        A description of the namespace shown to the model.

      - `name: string`

        The namespace name used in tool calls (for example, `crm`).

      - `tools: Array<Function | BetaCustomTool>`

        The function/custom tools available inside this namespace.

        - `Function`

          - `name: string`

          - `type: "function"`

            - `"function"`

          - `allowed_callers?: Array<"direct" | "programmatic"> | null`

            The tool invocation context(s).

            - `"direct"`

            - `"programmatic"`

          - `defer_loading?: boolean`

            Whether this function should be deferred and discovered via tool search.

          - `description?: string | null`

          - `output_schema?: Record<string, unknown> | null`

            A JSON Schema describing the JSON value encoded in string outputs for this function tool. This does not describe content-array outputs.

          - `parameters?: unknown`

          - `strict?: boolean | null`

            Whether to enforce strict parameter validation. If omitted, Responses attempts to use strict validation when the schema is compatible, and falls back to non-strict validation otherwise.

        - `BetaCustomTool`

          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: "namespace"`

        The type of the tool. Always `namespace`.

        - `"namespace"`

    - `BetaToolSearchTool`

      Hosted or BYOT tool search configuration for deferred tools.

      - `type: "tool_search"`

        The type of the tool. Always `tool_search`.

        - `"tool_search"`

      - `description?: string | null`

        Description shown to the model for a client-executed tool search tool.

      - `execution?: "server" | "client"`

        Whether tool search is executed by the server or by the client.

        - `"server"`

        - `"client"`

      - `parameters?: unknown`

        Parameter schema for a client-executed tool search tool.

    - `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"`

        The type of the web search tool. One of `web_search_preview` or `web_search_preview_2025_03_11`.

        - `"web_search_preview"`

        - `"web_search_preview_2025_03_11"`

      - `search_content_types?: Array<"text" | "image">`

        - `"text"`

        - `"image"`

      - `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.

        - `"low"`

        - `"medium"`

        - `"high"`

      - `user_location?: UserLocation | null`

        The user's location.

        - `type: "approximate"`

          The type of location approximation. Always `approximate`.

          - `"approximate"`

        - `city?: string | null`

          Free text input for the city of the user, e.g. `San Francisco`.

        - `country?: string | null`

          The two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of the user, e.g. `US`.

        - `region?: string | null`

          Free text input for the region of the user, e.g. `California`.

        - `timezone?: string | null`

          The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of the user, e.g. `America/Los_Angeles`.

    - `BetaApplyPatchTool`

      Allows the assistant to create, delete, or update files using unified diffs.

      - `type: "apply_patch"`

        The type of the tool. Always `apply_patch`.

        - `"apply_patch"`

      - `allowed_callers?: Array<"direct" | "programmatic"> | null`

        The tool invocation context(s).

        - `"direct"`

        - `"programmatic"`

  - `type: "tool_search_output"`

    The item type. Always `tool_search_output`.

    - `"tool_search_output"`

  - `id?: string | null`

    The unique ID of this tool search output.

  - `agent?: Agent | null`

    The agent that produced this item.

    - `agent_name: string`

      The canonical name of the agent that produced this item.

  - `call_id?: string | null`

    The unique ID of the tool search call generated by the model.

  - `execution?: "server" | "client"`

    Whether tool search was executed by the server or by the client.

    - `"server"`

    - `"client"`

  - `status?: "in_progress" | "completed" | "incomplete" | null`

    The status of the tool search output.

    - `"in_progress"`

    - `"completed"`

    - `"incomplete"`

### Beta Response Usage

- `BetaResponseUsage`

  Represents token usage details including input tokens, output tokens,
  a breakdown of output tokens, and the total tokens used.

  - `input_tokens: number`

    The number of input tokens.

  - `input_tokens_details: InputTokensDetails`

    A detailed breakdown of the input tokens.

    - `cache_write_tokens: number`

      The number of input tokens that were written to the cache.

    - `cached_tokens: number`

      The number of tokens that were retrieved from the cache.
      [More on prompt caching](https://platform.openai.com/docs/guides/prompt-caching).

  - `output_tokens: number`

    The number of output tokens.

  - `output_tokens_details: OutputTokensDetails`

    A detailed breakdown of the output tokens.

    - `reasoning_tokens: number`

      The number of reasoning tokens.

  - `total_tokens: number`

    The total number of tokens used.

### Beta Response Web Search Call Completed Event

- `BetaResponseWebSearchCallCompletedEvent`

  Emitted when a web search call is completed.

  - `item_id: string`

    Unique ID for the output item associated with the web search call.

  - `output_index: number`

    The index of the output item that the web search call is associated with.

  - `sequence_number: number`

    The sequence number of the web search call being processed.

  - `type: "response.web_search_call.completed"`

    The type of the event. Always `response.web_search_call.completed`.

    - `"response.web_search_call.completed"`

  - `agent?: Agent | null`

    The agent that owns this multi-agent streaming event.

    - `agent_name: string`

      The canonical name of the agent that produced this item.

### Beta Response Web Search Call In Progress Event

- `BetaResponseWebSearchCallInProgressEvent`

  Emitted when a web search call is initiated.

  - `item_id: string`

    Unique ID for the output item associated with the web search call.

  - `output_index: number`

    The index of the output item that the web search call is associated with.

  - `sequence_number: number`

    The sequence number of the web search call being processed.

  - `type: "response.web_search_call.in_progress"`

    The type of the event. Always `response.web_search_call.in_progress`.

    - `"response.web_search_call.in_progress"`

  - `agent?: Agent | null`

    The agent that owns this multi-agent streaming event.

    - `agent_name: string`

      The canonical name of the agent that produced this item.

### Beta Response Web Search Call Searching Event

- `BetaResponseWebSearchCallSearchingEvent`

  Emitted when a web search call is executing.

  - `item_id: string`

    Unique ID for the output item associated with the web search call.

  - `output_index: number`

    The index of the output item that the web search call is associated with.

  - `sequence_number: number`

    The sequence number of the web search call being processed.

  - `type: "response.web_search_call.searching"`

    The type of the event. Always `response.web_search_call.searching`.

    - `"response.web_search_call.searching"`

  - `agent?: Agent | null`

    The agent that owns this multi-agent streaming event.

    - `agent_name: string`

      The canonical name of the agent that produced this item.

### Beta Responses Client Event

- `BetaResponsesClientEvent = ResponseCreate | BetaResponseInjectEvent`

  Client events accepted by the Responses WebSocket server.

  - `ResponseCreate`

    Client event for creating a response over a persistent WebSocket connection.
    This payload uses the same top-level fields as `POST /v1/responses`, plus
    WebSocket-only envelope metadata.

    Notes:

    - `stream` is implicit over WebSocket and should not be sent.
    - `background` is not supported over WebSocket.
    - `stream_id` is WebSocket-only and is not part of `POST /v1/responses`.

    - `type: "response.create"`

      The type of the client event. Always `response.create`.

      - `"response.create"`

    - `background?: boolean | null`

      Whether to run the model response in the background.
      [Learn more](https://platform.openai.com/docs/guides/background).

    - `context_management?: Array<ContextManagement> | null`

      Context management configuration for this request.

      - `type: string`

        The context management entry type. Currently only 'compaction' is supported.

      - `compact_threshold?: number | null`

        Token threshold at which compaction should be triggered for this entry.

    - `conversation?: string | BetaResponseConversationParam | null`

      The conversation that this response belongs to. Items from this conversation are prepended to `input_items` for this response request.
      Input items and output items from this response are automatically added to this conversation after this response completes.

      - `string`

      - `BetaResponseConversationParam`

        The conversation that this response belongs to.

        - `id: string`

          The unique ID of the conversation.

    - `include?: Array<BetaResponseIncludable> | null`

      Specify additional output data to include in the model response. Currently supported values are:

      - `web_search_call.action.sources`: Include the sources of the web search tool call.
      - `code_interpreter_call.outputs`: Includes the outputs of python code execution in code interpreter tool call items.
      - `computer_call_output.output.image_url`: Include image urls from the computer call output.
      - `file_search_call.results`: Include the search results of the file search tool call.
      - `message.input_image.image_url`: Include image urls from the input message.
      - `message.output_text.logprobs`: Include logprobs with assistant messages.
      - `reasoning.encrypted_content`: Includes an encrypted version of reasoning tokens in reasoning item outputs. This enables reasoning items to be used in multi-turn conversations when using the Responses API statelessly (like when the `store` parameter is set to `false`, or when an organization is enrolled in the zero data retention program).

      - `"file_search_call.results"`

      - `"web_search_call.results"`

      - `"web_search_call.action.sources"`

      - `"message.input_image.image_url"`

      - `"computer_call_output.output.image_url"`

      - `"code_interpreter_call.outputs"`

      - `"reasoning.encrypted_content"`

      - `"message.output_text.logprobs"`

    - `input?: string | BetaResponseInput`

      Text, image, or file inputs to the model, used to generate a response.

      Learn more:

      - [Text inputs and outputs](https://platform.openai.com/docs/guides/text)
      - [Image inputs](https://platform.openai.com/docs/guides/images)
      - [File inputs](https://platform.openai.com/docs/guides/pdf-files)
      - [Conversation state](https://platform.openai.com/docs/guides/conversation-state)
      - [Function calling](https://platform.openai.com/docs/guides/function-calling)

      - `string`

      - `BetaResponseInput = Array<BetaResponseInputItem>`

        A list of one or many input items to the model, containing
        different content types.

        - `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.

          - `content: string | BetaResponseInputMessageContentList`

            Text, image, or audio input to the model, used to generate a response.
            Can also contain previous assistant responses.

            - `string`

            - `BetaResponseInputMessageContentList = Array<BetaResponseInputContent>`

              A list of one or many input items to the model, containing different content
              types.

              - `BetaResponseInputText`

                A text input to the model.

                - `text: string`

                  The text input to the model.

                - `type: "input_text"`

                  The type of the input item. Always `input_text`.

                  - `"input_text"`

                - `prompt_cache_breakpoint?: PromptCacheBreakpoint`

                  Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.

                  - `mode: "explicit"`

                    The breakpoint mode. Always `explicit`.

                    - `"explicit"`

              - `BetaResponseInputImage`

                An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision).

                - `detail: BetaImageDetail`

                  The detail level of the image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`.

                  - `"low"`

                  - `"high"`

                  - `"auto"`

                  - `"original"`

                - `type: "input_image"`

                  The type of the input item. Always `input_image`.

                  - `"input_image"`

                - `file_id?: string | null`

                  The ID of the file to be sent to the model.

                - `image_url?: string | null`

                  The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.

                - `prompt_cache_breakpoint?: PromptCacheBreakpoint`

                  Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.

                  - `mode: "explicit"`

                    The breakpoint mode. Always `explicit`.

                    - `"explicit"`

              - `BetaResponseInputFile`

                A file input to the model.

                - `type: "input_file"`

                  The type of the input item. Always `input_file`.

                  - `"input_file"`

                - `detail?: "auto" | "low" | "high"`

                  The detail level of the file to be sent to the model. Use `auto` to let the system select the detail level; for GPT-5.6 and later models, `auto` uses high-quality rendering, which may increase input token usage. Use `low` for lower-cost rendering, or `high` to render the file at higher quality. Defaults to `auto`.

                  - `"auto"`

                  - `"low"`

                  - `"high"`

                - `file_data?: string`

                  The content of the file to be sent to the model.

                - `file_id?: string | null`

                  The ID of the file to be sent to the model.

                - `file_url?: string`

                  The URL of the file to be sent to the model.

                - `filename?: string`

                  The name of the file to be sent to the model.

                - `prompt_cache_breakpoint?: PromptCacheBreakpoint`

                  Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.

                  - `mode: "explicit"`

                    The breakpoint mode. Always `explicit`.

                    - `"explicit"`

          - `role: "user" | "assistant" | "system" | "developer"`

            The role of the message input. One of `user`, `assistant`, `system`, or
            `developer`.

            - `"user"`

            - `"assistant"`

            - `"system"`

            - `"developer"`

          - `phase?: "commentary" | "final_answer" | null`

            Labels an `assistant` message as intermediate commentary (`commentary`) or the final answer (`final_answer`).
            For models like `gpt-5.3-codex` and beyond, when sending follow-up requests, preserve and resend
            phase on all assistant messages — dropping it can degrade performance. Not used for user messages.

            - `"commentary"`

            - `"final_answer"`

          - `type?: "message"`

            The type of the message input. Always `message`.

            - `"message"`

        - `Message`

          A message input to the model with a role indicating instruction following
          hierarchy. Instructions given with the `developer` or `system` role take
          precedence over instructions given with the `user` role.

          - `content: BetaResponseInputMessageContentList`

            A list of one or many input items to the model, containing different content
            types.

          - `role: "user" | "system" | "developer"`

            The role of the message input. One of `user`, `system`, or `developer`.

            - `"user"`

            - `"system"`

            - `"developer"`

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

          - `status?: "in_progress" | "completed" | "incomplete"`

            The status of item. One of `in_progress`, `completed`, or
            `incomplete`. Populated when items are returned via API.

            - `"in_progress"`

            - `"completed"`

            - `"incomplete"`

          - `type?: "message"`

            The type of the message input. Always set to `message`.

            - `"message"`

        - `BetaResponseOutputMessage`

          An output message from the model.

          - `id: string`

            The unique ID of the output message.

          - `content: Array<BetaResponseOutputText | BetaResponseOutputRefusal>`

            The content of the output message.

            - `BetaResponseOutputText`

              A text output from the model.

              - `annotations: Array<FileCitation | URLCitation | ContainerFileCitation | FilePath>`

                The annotations of the text output.

                - `FileCitation`

                  A citation to a file.

                  - `file_id: string`

                    The ID of the file.

                  - `filename: string`

                    The filename of the file cited.

                  - `index: number`

                    The index of the file in the list of files.

                  - `type: "file_citation"`

                    The type of the file citation. Always `file_citation`.

                    - `"file_citation"`

                - `URLCitation`

                  A citation for a web resource used to generate a model response.

                  - `end_index: number`

                    The index of the last character of the URL citation in the message.

                  - `start_index: number`

                    The index of the first character of the URL citation in the message.

                  - `title: string`

                    The title of the web resource.

                  - `type: "url_citation"`

                    The type of the URL citation. Always `url_citation`.

                    - `"url_citation"`

                  - `url: string`

                    The URL of the web resource.

                - `ContainerFileCitation`

                  A citation for a container file used to generate a model response.

                  - `container_id: string`

                    The ID of the container file.

                  - `end_index: number`

                    The index of the last character of the container file citation in the message.

                  - `file_id: string`

                    The ID of the file.

                  - `filename: string`

                    The filename of the container file cited.

                  - `start_index: number`

                    The index of the first character of the container file citation in the message.

                  - `type: "container_file_citation"`

                    The type of the container file citation. Always `container_file_citation`.

                    - `"container_file_citation"`

                - `FilePath`

                  A path to a file.

                  - `file_id: string`

                    The ID of the file.

                  - `index: number`

                    The index of the file in the list of files.

                  - `type: "file_path"`

                    The type of the file path. Always `file_path`.

                    - `"file_path"`

              - `text: string`

                The text output from the model.

              - `type: "output_text"`

                The type of the output text. Always `output_text`.

                - `"output_text"`

              - `logprobs?: Array<Logprob>`

                - `token: string`

                - `bytes: Array<number>`

                - `logprob: number`

                - `top_logprobs: Array<TopLogprob>`

                  - `token: string`

                  - `bytes: Array<number>`

                  - `logprob: number`

            - `BetaResponseOutputRefusal`

              A refusal from the model.

              - `refusal: string`

                The refusal explanation from the model.

              - `type: "refusal"`

                The type of the refusal. Always `refusal`.

                - `"refusal"`

          - `role: "assistant"`

            The role of the output message. Always `assistant`.

            - `"assistant"`

          - `status: "in_progress" | "completed" | "incomplete"`

            The status of the message input. One of `in_progress`, `completed`, or
            `incomplete`. Populated when input items are returned via API.

            - `"in_progress"`

            - `"completed"`

            - `"incomplete"`

          - `type: "message"`

            The type of the output message. Always `message`.

            - `"message"`

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

          - `phase?: "commentary" | "final_answer" | null`

            Labels an `assistant` message as intermediate commentary (`commentary`) or the final answer (`final_answer`).
            For models like `gpt-5.3-codex` and beyond, when sending follow-up requests, preserve and resend
            phase on all assistant messages — dropping it can degrade performance. Not used for user messages.

            - `"commentary"`

            - `"final_answer"`

        - `BetaResponseFileSearchToolCall`

          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.

          - `id: string`

            The unique ID of the file search tool call.

          - `queries: Array<string>`

            The queries used to search for files.

          - `status: "in_progress" | "searching" | "completed" | 2 more`

            The status of the file search tool call. One of `in_progress`,
            `searching`, `incomplete` or `failed`,

            - `"in_progress"`

            - `"searching"`

            - `"completed"`

            - `"incomplete"`

            - `"failed"`

          - `type: "file_search_call"`

            The type of the file search tool call. Always `file_search_call`.

            - `"file_search_call"`

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

          - `results?: Array<Result> | null`

            The results of the file search tool call.

            - `attributes?: Record<string, string | number | boolean> | null`

              Set of 16 key-value pairs that can be attached to an object. This can be
              useful for storing additional information about the object in a structured
              format, and querying for objects via API or the dashboard. Keys are strings
              with a maximum length of 64 characters. Values are strings with a maximum
              length of 512 characters, booleans, or numbers.

              - `string`

              - `number`

              - `boolean`

            - `file_id?: string`

              The unique ID of the file.

            - `filename?: string`

              The name of the file.

            - `score?: number`

              The relevance score of the file - a value between 0 and 1.

            - `text?: string`

              The text that was retrieved from the file.

        - `BetaResponseComputerToolCall`

          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.

          - `id: string`

            The unique ID of the computer call.

          - `call_id: string`

            An identifier used when responding to the tool call with output.

          - `pending_safety_checks: Array<PendingSafetyCheck>`

            The pending safety checks for the computer call.

            - `id: string`

              The ID of the pending safety check.

            - `code?: string | null`

              The type of the pending safety check.

            - `message?: string | null`

              Details about the pending safety check.

          - `status: "in_progress" | "completed" | "incomplete"`

            The status of the item. One of `in_progress`, `completed`, or
            `incomplete`. Populated when items are returned via API.

            - `"in_progress"`

            - `"completed"`

            - `"incomplete"`

          - `type: "computer_call"`

            The type of the computer call. Always `computer_call`.

            - `"computer_call"`

          - `action?: BetaComputerAction`

            A click action.

            - `Click`

              A click action.

              - `button: "left" | "right" | "wheel" | 2 more`

                Indicates which mouse button was pressed during the click. One of `left`, `right`, `wheel`, `back`, or `forward`.

                - `"left"`

                - `"right"`

                - `"wheel"`

                - `"back"`

                - `"forward"`

              - `type: "click"`

                Specifies the event type. For a click action, this property is always `click`.

                - `"click"`

              - `x: number`

                The x-coordinate where the click occurred.

              - `y: number`

                The y-coordinate where the click occurred.

              - `keys?: Array<string> | null`

                The keys being held while clicking.

            - `DoubleClick`

              A double click action.

              - `keys: Array<string> | null`

                The keys being held while double-clicking.

              - `type: "double_click"`

                Specifies the event type. For a double click action, this property is always set to `double_click`.

                - `"double_click"`

              - `x: number`

                The x-coordinate where the double click occurred.

              - `y: number`

                The y-coordinate where the double click occurred.

            - `Drag`

              A drag action.

              - `path: Array<Path>`

                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 }
                ]
                ```

                - `x: number`

                  The x-coordinate.

                - `y: number`

                  The y-coordinate.

              - `type: "drag"`

                Specifies the event type. For a drag action, this property is always set to `drag`.

                - `"drag"`

              - `keys?: Array<string> | null`

                The keys being held while dragging the mouse.

            - `Keypress`

              A collection of keypresses the model would like to perform.

              - `keys: Array<string>`

                The combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key.

              - `type: "keypress"`

                Specifies the event type. For a keypress action, this property is always set to `keypress`.

                - `"keypress"`

            - `Move`

              A mouse move action.

              - `type: "move"`

                Specifies the event type. For a move action, this property is always set to `move`.

                - `"move"`

              - `x: number`

                The x-coordinate to move to.

              - `y: number`

                The y-coordinate to move to.

              - `keys?: Array<string> | null`

                The keys being held while moving the mouse.

            - `Screenshot`

              A screenshot action.

              - `type: "screenshot"`

                Specifies the event type. For a screenshot action, this property is always set to `screenshot`.

                - `"screenshot"`

            - `Scroll`

              A scroll action.

              - `scroll_x: number`

                The horizontal scroll distance.

              - `scroll_y: number`

                The vertical scroll distance.

              - `type: "scroll"`

                Specifies the event type. For a scroll action, this property is always set to `scroll`.

                - `"scroll"`

              - `x: number`

                The x-coordinate where the scroll occurred.

              - `y: number`

                The y-coordinate where the scroll occurred.

              - `keys?: Array<string> | null`

                The keys being held while scrolling.

            - `Type`

              An action to type in text.

              - `text: string`

                The text to type.

              - `type: "type"`

                Specifies the event type. For a type action, this property is always set to `type`.

                - `"type"`

            - `Wait`

              A wait action.

              - `type: "wait"`

                Specifies the event type. For a wait action, this property is always set to `wait`.

                - `"wait"`

          - `actions?: BetaComputerActionList`

            Flattened batched actions for `computer_use`. Each action includes an
            `type` discriminator and action-specific fields.

            - `Click`

              A click action.

            - `DoubleClick`

              A double click action.

            - `Drag`

              A drag action.

            - `Keypress`

              A collection of keypresses the model would like to perform.

            - `Move`

              A mouse move action.

            - `Screenshot`

              A screenshot action.

            - `Scroll`

              A scroll action.

            - `Type`

              An action to type in text.

            - `Wait`

              A wait action.

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

        - `ComputerCallOutput`

          The output of a computer tool call.

          - `call_id: string`

            The ID of the computer tool call that produced the output.

          - `output: BetaResponseComputerToolCallOutputScreenshot`

            A computer screenshot image used with the computer use tool.

            - `type: "computer_screenshot"`

              Specifies the event type. For a computer screenshot, this property is
              always set to `computer_screenshot`.

              - `"computer_screenshot"`

            - `file_id?: string`

              The identifier of an uploaded file that contains the screenshot.

            - `image_url?: string`

              The URL of the screenshot image.

          - `type: "computer_call_output"`

            The type of the computer tool call output. Always `computer_call_output`.

            - `"computer_call_output"`

          - `id?: string | null`

            The ID of the computer tool call output.

          - `acknowledged_safety_checks?: Array<AcknowledgedSafetyCheck> | null`

            The safety checks reported by the API that have been acknowledged by the developer.

            - `id: string`

              The ID of the pending safety check.

            - `code?: string | null`

              The type of the pending safety check.

            - `message?: string | null`

              Details about the pending safety check.

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

          - `status?: "in_progress" | "completed" | "incomplete" | null`

            The status of the message input. One of `in_progress`, `completed`, or `incomplete`. Populated when input items are returned via API.

            - `"in_progress"`

            - `"completed"`

            - `"incomplete"`

        - `BetaResponseFunctionWebSearch`

          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.

          - `id: string`

            The unique ID of the web search tool call.

          - `action: Search | OpenPage | FindInPage`

            An object describing the specific action taken in this web search call.
            Includes details on how the model used the web (search, open_page, find_in_page).

            - `Search`

              Action type "search" - Performs a web search query.

              - `type: "search"`

                The action type.

                - `"search"`

              - `queries?: Array<string>`

                The search queries.

              - `query?: string`

                The search query.

              - `sources?: Array<Source>`

                The sources used in the search.

                - `type: "url"`

                  The type of source. Always `url`.

                  - `"url"`

                - `url: string`

                  The URL of the source.

            - `OpenPage`

              Action type "open_page" - Opens a specific URL from search results.

              - `type: "open_page"`

                The action type.

                - `"open_page"`

              - `url?: string | null`

                The URL opened by the model.

            - `FindInPage`

              Action type "find_in_page": Searches for a pattern within a loaded page.

              - `pattern: string`

                The pattern or text to search for within the page.

              - `type: "find_in_page"`

                The action type.

                - `"find_in_page"`

              - `url: string`

                The URL of the page searched for the pattern.

          - `status: "in_progress" | "searching" | "completed" | "failed"`

            The status of the web search tool call.

            - `"in_progress"`

            - `"searching"`

            - `"completed"`

            - `"failed"`

          - `type: "web_search_call"`

            The type of the web search tool call. Always `web_search_call`.

            - `"web_search_call"`

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

        - `BetaResponseFunctionToolCall`

          A tool call to run a function. See the
          [function calling guide](https://platform.openai.com/docs/guides/function-calling) for more information.

          - `arguments: string`

            A JSON string of the arguments to pass to the function.

          - `call_id: string`

            The unique ID of the function tool call generated by the model.

          - `name: string`

            The name of the function to run.

          - `type: "function_call"`

            The type of the function tool call. Always `function_call`.

            - `"function_call"`

          - `id?: string`

            The unique ID of the function tool call.

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

          - `caller?: Direct | Program | null`

            The execution context that produced this tool call.

            - `Direct`

              - `type: "direct"`

                - `"direct"`

            - `Program`

              - `caller_id: string`

                The call ID of the program item that produced this tool call.

              - `type: "program"`

                - `"program"`

          - `namespace?: string`

            The namespace of the function to run.

          - `status?: "in_progress" | "completed" | "incomplete"`

            The status of the item. One of `in_progress`, `completed`, or
            `incomplete`. Populated when items are returned via API.

            - `"in_progress"`

            - `"completed"`

            - `"incomplete"`

        - `FunctionCallOutput`

          The output of a function tool call.

          - `call_id: string`

            The unique ID of the function tool call generated by the model.

          - `output: string | BetaResponseFunctionCallOutputItemList`

            Text, image, or file output of the function tool call.

            - `string`

            - `BetaResponseFunctionCallOutputItemList = Array<BetaResponseFunctionCallOutputItem>`

              An array of content outputs (text, image, file) for the function tool call.

              - `BetaResponseInputTextContent`

                A text input to the model.

                - `text: string`

                  The text input to the model.

                - `type: "input_text"`

                  The type of the input item. Always `input_text`.

                  - `"input_text"`

                - `prompt_cache_breakpoint?: PromptCacheBreakpoint | null`

                  Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.

                  - `mode: "explicit"`

                    The breakpoint mode. Always `explicit`.

                    - `"explicit"`

              - `BetaResponseInputImageContent`

                An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision)

                - `type: "input_image"`

                  The type of the input item. Always `input_image`.

                  - `"input_image"`

                - `detail?: BetaImageDetail | null`

                  The detail level of the image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`.

                - `file_id?: string | null`

                  The ID of the file to be sent to the model.

                - `image_url?: string | null`

                  The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.

                - `prompt_cache_breakpoint?: PromptCacheBreakpoint | null`

                  Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.

                  - `mode: "explicit"`

                    The breakpoint mode. Always `explicit`.

                    - `"explicit"`

              - `BetaResponseInputFileContent`

                A file input to the model.

                - `type: "input_file"`

                  The type of the input item. Always `input_file`.

                  - `"input_file"`

                - `detail?: "auto" | "low" | "high"`

                  The detail level of the file to be sent to the model. Use `auto` to let the system select the detail level; for GPT-5.6 and later models, `auto` uses high-quality rendering, which may increase input token usage. Use `low` for lower-cost rendering, or `high` to render the file at higher quality. Defaults to `auto`.

                  - `"auto"`

                  - `"low"`

                  - `"high"`

                - `file_data?: string | null`

                  The base64-encoded data of the file to be sent to the model.

                - `file_id?: string | null`

                  The ID of the file to be sent to the model.

                - `file_url?: string | null`

                  The URL of the file to be sent to the model.

                - `filename?: string | null`

                  The name of the file to be sent to the model.

                - `prompt_cache_breakpoint?: PromptCacheBreakpoint | null`

                  Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.

                  - `mode: "explicit"`

                    The breakpoint mode. Always `explicit`.

                    - `"explicit"`

          - `type: "function_call_output"`

            The type of the function tool call output. Always `function_call_output`.

            - `"function_call_output"`

          - `id?: string | null`

            The unique ID of the function tool call output. Populated when this item is returned via API.

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

          - `caller?: Direct | Program | null`

            The execution context that produced this tool call.

            - `Direct`

              - `type: "direct"`

                The caller type. Always `direct`.

                - `"direct"`

            - `Program`

              - `caller_id: string`

                The call ID of the program item that produced this tool call.

              - `type: "program"`

                The caller type. Always `program`.

                - `"program"`

          - `name?: string | null`

            The name of the tool that produced the output.

          - `namespace?: string | null`

            The namespace of the tool that produced the output.

          - `status?: "in_progress" | "completed" | "incomplete" | null`

            The status of the item. One of `in_progress`, `completed`, or `incomplete`. Populated when items are returned via API.

            - `"in_progress"`

            - `"completed"`

            - `"incomplete"`

        - `AgentMessage`

          A message routed between agents.

          - `author: string`

            The sending agent identity.

          - `content: Array<BetaResponseInputTextContent | BetaResponseInputImageContent | EncryptedContent>`

            Plaintext, image, or encrypted content sent between agents.

            - `BetaResponseInputTextContent`

              A text input to the model.

            - `BetaResponseInputImageContent`

              An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision)

            - `EncryptedContent`

              Opaque encrypted content that Responses API decrypts inside trusted model execution.

              - `encrypted_content: string`

                Opaque encrypted content.

              - `type: "encrypted_content"`

                The type of the input item. Always `encrypted_content`.

                - `"encrypted_content"`

          - `recipient: string`

            The destination agent identity.

          - `type: "agent_message"`

            The item type. Always `agent_message`.

            - `"agent_message"`

          - `id?: string | null`

            The unique ID of this agent message item.

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

        - `MultiAgentCall`

          - `action: "spawn_agent" | "interrupt_agent" | "list_agents" | 3 more`

            The multi-agent action that was executed.

            - `"spawn_agent"`

            - `"interrupt_agent"`

            - `"list_agents"`

            - `"send_message"`

            - `"followup_task"`

            - `"wait_agent"`

          - `arguments: string`

            The action arguments as a JSON string.

          - `call_id: string`

            The unique ID linking this call to its output.

          - `type: "multi_agent_call"`

            The item type. Always `multi_agent_call`.

            - `"multi_agent_call"`

          - `id?: string | null`

            The unique ID of this multi-agent call.

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

        - `MultiAgentCallOutput`

          - `action: "spawn_agent" | "interrupt_agent" | "list_agents" | 3 more`

            The multi-agent action that produced this result.

            - `"spawn_agent"`

            - `"interrupt_agent"`

            - `"list_agents"`

            - `"send_message"`

            - `"followup_task"`

            - `"wait_agent"`

          - `call_id: string`

            The unique ID of the multi-agent call.

          - `output: Array<Output>`

            Text output returned by the multi-agent action.

            - `text: string`

              The text content.

            - `type: "output_text"`

              The content type. Always `output_text`.

              - `"output_text"`

            - `annotations?: Array<FileCitation | URLCitation | ContainerFileCitation>`

              Citations associated with the text content.

              - `FileCitation`

                - `file_id: string`

                  The ID of the file.

                - `filename: string`

                  The filename of the file cited.

                - `index: number`

                  The index of the file in the list of files.

                - `type: "file_citation"`

                  The citation type. Always `file_citation`.

                  - `"file_citation"`

              - `URLCitation`

                - `end_index: number`

                  The index of the last character of the citation in the message.

                - `start_index: number`

                  The index of the first character of the citation in the message.

                - `title: string`

                  The title of the cited resource.

                - `type: "url_citation"`

                  The citation type. Always `url_citation`.

                  - `"url_citation"`

                - `url: string`

                  The URL of the cited resource.

              - `ContainerFileCitation`

                - `container_id: string`

                  The ID of the container.

                - `end_index: number`

                  The index of the last character of the citation in the message.

                - `file_id: string`

                  The ID of the container file.

                - `filename: string`

                  The filename of the container file cited.

                - `start_index: number`

                  The index of the first character of the citation in the message.

                - `type: "container_file_citation"`

                  The citation type. Always `container_file_citation`.

                  - `"container_file_citation"`

          - `type: "multi_agent_call_output"`

            The item type. Always `multi_agent_call_output`.

            - `"multi_agent_call_output"`

          - `id?: string | null`

            The unique ID of this multi-agent call output.

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

        - `ToolSearchCall`

          - `arguments: unknown`

            The arguments supplied to the tool search call.

          - `type: "tool_search_call"`

            The item type. Always `tool_search_call`.

            - `"tool_search_call"`

          - `id?: string | null`

            The unique ID of this tool search call.

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

          - `call_id?: string | null`

            The unique ID of the tool search call generated by the model.

          - `execution?: "server" | "client"`

            Whether tool search was executed by the server or by the client.

            - `"server"`

            - `"client"`

          - `status?: "in_progress" | "completed" | "incomplete" | null`

            The status of the tool search call.

            - `"in_progress"`

            - `"completed"`

            - `"incomplete"`

        - `BetaResponseToolSearchOutputItemParam`

          - `tools: Array<BetaTool>`

            The loaded tool definitions returned by the tool search output.

            - `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).

              - `name: string`

                The name of the function to call.

              - `parameters: Record<string, unknown> | null`

                A JSON schema object describing the parameters of the function.

              - `strict: boolean | null`

                Whether strict parameter validation is enforced for this function tool.

              - `type: "function"`

                The type of the function tool. Always `function`.

                - `"function"`

              - `allowed_callers?: Array<"direct" | "programmatic"> | null`

                The tool invocation context(s).

                - `"direct"`

                - `"programmatic"`

              - `defer_loading?: boolean`

                Whether this function is deferred and loaded via tool search.

              - `description?: string | null`

                A description of the function. Used by the model to determine whether or not to call the function.

              - `output_schema?: Record<string, unknown> | null`

                A JSON schema object describing the JSON value encoded in string outputs for this function.

            - `BetaFileSearchTool`

              A tool that searches for relevant content from uploaded files. Learn more about the [file search tool](https://platform.openai.com/docs/guides/tools-file-search).

              - `type: "file_search"`

                The type of the file search tool. Always `file_search`.

                - `"file_search"`

              - `vector_store_ids: Array<string>`

                The IDs of the vector stores to search.

              - `filters?: ComparisonFilter | CompoundFilter | null`

                A filter to apply.

                - `ComparisonFilter`

                  A filter used to compare a specified attribute key to a given value using a defined comparison operation.

                  - `key: string`

                    The key to compare against the value.

                  - `type: "eq" | "ne" | "gt" | 5 more`

                    Specifies the comparison operator: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`, `in`, `nin`.

                    - `eq`: equals
                    - `ne`: not equal
                    - `gt`: greater than
                    - `gte`: greater than or equal
                    - `lt`: less than
                    - `lte`: less than or equal
                    - `in`: in
                    - `nin`: not in

                    - `"eq"`

                    - `"ne"`

                    - `"gt"`

                    - `"gte"`

                    - `"lt"`

                    - `"lte"`

                    - `"in"`

                    - `"nin"`

                  - `value: string | number | boolean | Array<string | number>`

                    The value to compare against the attribute key; supports string, number, or boolean types.

                    - `string`

                    - `number`

                    - `boolean`

                    - `Array<string | number>`

                      - `string`

                      - `number`

                - `CompoundFilter`

                  Combine multiple filters using `and` or `or`.

                  - `filters: Array<ComparisonFilter | unknown>`

                    Array of filters to combine. Items can be `ComparisonFilter` or `CompoundFilter`.

                    - `ComparisonFilter`

                      A filter used to compare a specified attribute key to a given value using a defined comparison operation.

                      - `key: string`

                        The key to compare against the value.

                      - `type: "eq" | "ne" | "gt" | 5 more`

                        Specifies the comparison operator: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`, `in`, `nin`.

                        - `eq`: equals
                        - `ne`: not equal
                        - `gt`: greater than
                        - `gte`: greater than or equal
                        - `lt`: less than
                        - `lte`: less than or equal
                        - `in`: in
                        - `nin`: not in

                        - `"eq"`

                        - `"ne"`

                        - `"gt"`

                        - `"gte"`

                        - `"lt"`

                        - `"lte"`

                        - `"in"`

                        - `"nin"`

                      - `value: string | number | boolean | Array<string | number>`

                        The value to compare against the attribute key; supports string, number, or boolean types.

                        - `string`

                        - `number`

                        - `boolean`

                        - `Array<string | number>`

                          - `string`

                          - `number`

                    - `unknown`

                  - `type: "and" | "or"`

                    Type of operation: `and` or `or`.

                    - `"and"`

                    - `"or"`

              - `max_num_results?: number`

                The maximum number of results to return. This number should be between 1 and 50 inclusive.

              - `ranking_options?: RankingOptions`

                Ranking options for search.

                - `hybrid_search?: HybridSearch`

                  Weights that control how reciprocal rank fusion balances semantic embedding matches versus sparse keyword matches when hybrid search is enabled.

                  - `embedding_weight: number`

                    The weight of the embedding in the reciprocal ranking fusion.

                  - `text_weight: number`

                    The weight of the text in the reciprocal ranking fusion.

                - `ranker?: "auto" | "default-2024-11-15"`

                  The ranker to use for the file search.

                  - `"auto"`

                  - `"default-2024-11-15"`

                - `score_threshold?: number`

                  The score threshold for the file search, a number between 0 and 1. Numbers closer to 1 will attempt to return only the most relevant results, but may return fewer results.

            - `BetaComputerTool`

              A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use).

              - `type: "computer"`

                The type of the computer tool. Always `computer`.

                - `"computer"`

            - `BetaComputerUsePreviewTool`

              A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use).

              - `display_height: number`

                The height of the computer display.

              - `display_width: number`

                The width of the computer display.

              - `environment: "windows" | "mac" | "linux" | 2 more`

                The type of computer environment to control.

                - `"windows"`

                - `"mac"`

                - `"linux"`

                - `"ubuntu"`

                - `"browser"`

              - `type: "computer_use_preview"`

                The type of the computer use tool. Always `computer_use_preview`.

                - `"computer_use_preview"`

            - `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"`

                The type of the web search tool. One of `web_search` or `web_search_2025_08_26`.

                - `"web_search"`

                - `"web_search_2025_08_26"`

              - `external_web_access?: boolean`

                Allow live internet access for web search. Defaults to true when omitted. When false, the web search tool runs in offline/cache-only mode and will not fetch new external content.

              - `filters?: Filters | null`

                Filters for the search.

                - `allowed_domains?: Array<string> | null`

                  Allowed domains for the search. If not provided, all domains are allowed.
                  Subdomains of the provided domains are allowed as well.

                  Example: `["pubmed.ncbi.nlm.nih.gov"]`

              - `search_context_size?: "low" | "medium" | "high"`

                High level guidance for the amount of context window space to use for the search. One of `low`, `medium`, or `high`. `medium` is the default.

                - `"low"`

                - `"medium"`

                - `"high"`

              - `user_location?: UserLocation | null`

                The approximate location of the user.

                - `city?: string | null`

                  Free text input for the city of the user, e.g. `San Francisco`.

                - `country?: string | null`

                  The two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of the user, e.g. `US`.

                - `region?: string | null`

                  Free text input for the region of the user, e.g. `California`.

                - `timezone?: string | null`

                  The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of the user, e.g. `America/Los_Angeles`.

                - `type?: "approximate"`

                  The type of location approximation. Always `approximate`.

                  - `"approximate"`

            - `Mcp`

              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).

              - `server_label: string`

                A label for this MCP server, used to identify it in tool calls.

              - `type: "mcp"`

                The type of the MCP tool. Always `mcp`.

                - `"mcp"`

              - `allowed_callers?: Array<"direct" | "programmatic"> | null`

                The tool invocation context(s).

                - `"direct"`

                - `"programmatic"`

              - `allowed_tools?: Array<string> | McpToolFilter | null`

                List of allowed tool names or a filter object.

                - `Array<string>`

                - `McpToolFilter`

                  A filter object to specify which tools are allowed.

                  - `read_only?: boolean`

                    Indicates whether or not a tool modifies data or is read-only. If an
                    MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint),
                    it will match this filter.

                  - `tool_names?: Array<string>`

                    List of allowed tool names.

              - `authorization?: string`

                An OAuth access token that can be used with a remote MCP server, either
                with a custom MCP server URL or a service connector. Your application
                must handle the OAuth authorization flow and provide the token here.

              - `connector_id?: "connector_dropbox" | "connector_gmail" | "connector_googlecalendar" | 5 more`

                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`

                - `"connector_dropbox"`

                - `"connector_gmail"`

                - `"connector_googlecalendar"`

                - `"connector_googledrive"`

                - `"connector_microsoftteams"`

                - `"connector_outlookcalendar"`

                - `"connector_outlookemail"`

                - `"connector_sharepoint"`

              - `defer_loading?: boolean`

                Whether this MCP tool is deferred and discovered via tool search.

              - `headers?: Record<string, string> | null`

                Optional HTTP headers to send to the MCP server. Use for authentication
                or other purposes.

              - `require_approval?: McpToolApprovalFilter | "always" | "never" | null`

                Specify which of the MCP server's tools require approval.

                - `McpToolApprovalFilter`

                  Specify which of the MCP server's tools require approval. Can be
                  `always`, `never`, or a filter object associated with tools
                  that require approval.

                  - `always?: Always`

                    A filter object to specify which tools are allowed.

                    - `read_only?: boolean`

                      Indicates whether or not a tool modifies data or is read-only. If an
                      MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint),
                      it will match this filter.

                    - `tool_names?: Array<string>`

                      List of allowed tool names.

                  - `never?: Never`

                    A filter object to specify which tools are allowed.

                    - `read_only?: boolean`

                      Indicates whether or not a tool modifies data or is read-only. If an
                      MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint),
                      it will match this filter.

                    - `tool_names?: Array<string>`

                      List of allowed tool names.

                - `"always" | "never"`

                  - `"always"`

                  - `"never"`

              - `server_description?: string`

                Optional description of the MCP server, used to provide more context.

              - `server_url?: string`

                The URL for the MCP server. One of `server_url`, `connector_id`, or
                `tunnel_id` must be provided.

              - `tunnel_id?: string`

                The Secure MCP Tunnel ID to use instead of a direct server URL. One of
                `server_url`, `connector_id`, or `tunnel_id` must be provided.

            - `CodeInterpreter`

              A tool that runs Python code to help generate a response to a prompt.

              - `container: string | CodeInterpreterToolAuto`

                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`

                - `CodeInterpreterToolAuto`

                  Configuration for a code interpreter container. Optionally specify the IDs of the files to run the code on.

                  - `type: "auto"`

                    Always `auto`.

                    - `"auto"`

                  - `file_ids?: Array<string>`

                    An optional list of uploaded files to make available to your code.

                  - `memory_limit?: "1g" | "4g" | "16g" | "64g" | null`

                    The memory limit for the code interpreter container.

                    - `"1g"`

                    - `"4g"`

                    - `"16g"`

                    - `"64g"`

                  - `network_policy?: BetaContainerNetworkPolicyDisabled | BetaContainerNetworkPolicyAllowlist`

                    Network access policy for the container.

                    - `BetaContainerNetworkPolicyDisabled`

                      - `type: "disabled"`

                        Disable outbound network access. Always `disabled`.

                        - `"disabled"`

                    - `BetaContainerNetworkPolicyAllowlist`

                      - `allowed_domains: Array<string>`

                        A list of allowed domains when type is `allowlist`.

                      - `type: "allowlist"`

                        Allow outbound network access only to specified domains. Always `allowlist`.

                        - `"allowlist"`

                      - `domain_secrets?: Array<BetaContainerNetworkPolicyDomainSecret>`

                        Optional domain-scoped secrets for allowlisted domains.

                        - `domain: string`

                          The domain associated with the secret.

                        - `name: string`

                          The name of the secret to inject for the domain.

                        - `value: string`

                          The secret value to inject for the domain.

              - `type: "code_interpreter"`

                The type of the code interpreter tool. Always `code_interpreter`.

                - `"code_interpreter"`

              - `allowed_callers?: Array<"direct" | "programmatic"> | null`

                The tool invocation context(s).

                - `"direct"`

                - `"programmatic"`

            - `ProgrammaticToolCalling`

              - `type: "programmatic_tool_calling"`

                The type of the tool. Always `programmatic_tool_calling`.

                - `"programmatic_tool_calling"`

            - `ImageGeneration`

              A tool that generates images using the GPT image models.

              - `type: "image_generation"`

                The type of the image generation tool. Always `image_generation`.

                - `"image_generation"`

              - `action?: "generate" | "edit" | "auto"`

                Whether to generate a new image or edit an existing image. Default: `auto`.

                - `"generate"`

                - `"edit"`

                - `"auto"`

              - `background?: "transparent" | "opaque" | "auto"`

                Allows to set transparency for the background of the generated image(s).
                Must be one of `transparent`, `opaque`, or `auto` (default value). When
                `auto` is used, the model will automatically determine the best
                background for the image.

                Transparent backgrounds are available for supported GPT Image models.
                For `gpt-image-2` and `gpt-image-2-2026-04-21`, this support is in
                preview. When using `transparent`, set the output format to `png` or
                `webp`.

                - `"transparent"`

                - `"opaque"`

                - `"auto"`

              - `input_fidelity?: "high" | "low" | null`

                Control how much effort the model will exert to match the style and features, especially facial features, of input images. This parameter is only supported for `gpt-image-1` and `gpt-image-1.5` and later models, unsupported for `gpt-image-1-mini`. Supports `high` and `low`. Defaults to `low`.

                - `"high"`

                - `"low"`

              - `input_image_mask?: InputImageMask`

                Optional mask for inpainting. Contains `image_url`
                (string, optional) and `file_id` (string, optional).

                - `file_id?: string`

                  File ID for the mask image.

                - `image_url?: string`

                  Base64-encoded mask image.

              - `model?: (string & {}) | "gpt-image-1" | "gpt-image-1-mini" | "gpt-image-2" | 3 more`

                The image generation model to use. One of `gpt-image-1`,
                `gpt-image-1-mini`, `gpt-image-1.5`, `gpt-image-2`,
                `gpt-image-2-2026-04-21`, or `chatgpt-image-latest`. Default:
                `gpt-image-1`.

                - `(string & {})`

                - `"gpt-image-1" | "gpt-image-1-mini" | "gpt-image-2" | 3 more`

                  - `"gpt-image-1"`

                  - `"gpt-image-1-mini"`

                  - `"gpt-image-2"`

                  - `"gpt-image-2-2026-04-21"`

                  - `"gpt-image-1.5"`

                  - `"chatgpt-image-latest"`

              - `moderation?: "auto" | "low"`

                Moderation level for the generated image. Default: `auto`.

                - `"auto"`

                - `"low"`

              - `output_compression?: number`

                Compression level for the output image. Default: 100.

              - `output_format?: "png" | "webp" | "jpeg"`

                The output format of the generated image. One of `png`, `webp`, or
                `jpeg`. Default: `png`.

                - `"png"`

                - `"webp"`

                - `"jpeg"`

              - `partial_images?: number`

                Number of partial images to generate in streaming mode, from 0 (default value) to 3.

              - `quality?: "low" | "medium" | "high" | "auto"`

                The quality of the generated image. One of `low`, `medium`, `high`,
                or `auto`. Default: `auto`.

                - `"low"`

                - `"medium"`

                - `"high"`

                - `"auto"`

              - `size?: (string & {}) | "1024x1024" | "1024x1536" | "1536x1024" | "auto"`

                The size of the generated images. For `gpt-image-2` and `gpt-image-2-2026-04-21`, arbitrary resolutions are supported as `WIDTHxHEIGHT` strings, for example `1536x864`. Width and height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above `2560x1440` are experimental, and the maximum supported resolution is `3840x2160`. The requested size must also satisfy the model's current pixel and edge limits. The standard sizes `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models; `auto` is supported for models that allow automatic sizing. For `dall-e-2`, use one of `256x256`, `512x512`, or `1024x1024`. For `dall-e-3`, use one of `1024x1024`, `1792x1024`, or `1024x1792`.

                - `(string & {})`

                - `"1024x1024" | "1024x1536" | "1536x1024" | "auto"`

                  - `"1024x1024"`

                  - `"1024x1536"`

                  - `"1536x1024"`

                  - `"auto"`

            - `LocalShell`

              A tool that allows the model to execute shell commands in a local environment.

              - `type: "local_shell"`

                The type of the local shell tool. Always `local_shell`.

                - `"local_shell"`

            - `BetaFunctionShellTool`

              A tool that allows the model to execute shell commands.

              - `type: "shell"`

                The type of the shell tool. Always `shell`.

                - `"shell"`

              - `allowed_callers?: Array<"direct" | "programmatic"> | null`

                The tool invocation context(s).

                - `"direct"`

                - `"programmatic"`

              - `environment?: BetaContainerAuto | BetaLocalEnvironment | BetaContainerReference | null`

                - `BetaContainerAuto`

                  - `type: "container_auto"`

                    Automatically creates a container for this request

                    - `"container_auto"`

                  - `file_ids?: Array<string>`

                    An optional list of uploaded files to make available to your code.

                  - `memory_limit?: "1g" | "4g" | "16g" | "64g" | null`

                    The memory limit for the container.

                    - `"1g"`

                    - `"4g"`

                    - `"16g"`

                    - `"64g"`

                  - `network_policy?: BetaContainerNetworkPolicyDisabled | BetaContainerNetworkPolicyAllowlist`

                    Network access policy for the container.

                    - `BetaContainerNetworkPolicyDisabled`

                    - `BetaContainerNetworkPolicyAllowlist`

                  - `skills?: Array<BetaSkillReference | BetaInlineSkill>`

                    An optional list of skills referenced by id or inline data.

                    - `BetaSkillReference`

                      - `skill_id: string`

                        The ID of the referenced skill.

                      - `type: "skill_reference"`

                        References a skill created with the /v1/skills endpoint.

                        - `"skill_reference"`

                      - `version?: string`

                        Optional skill version. Use a positive integer or 'latest'. Omit for default.

                    - `BetaInlineSkill`

                      - `description: string`

                        The description of the skill.

                      - `name: string`

                        The name of the skill.

                      - `source: BetaInlineSkillSource`

                        Inline skill payload

                        - `data: string`

                          Base64-encoded skill zip bundle.

                        - `media_type: "application/zip"`

                          The media type of the inline skill payload. Must be `application/zip`.

                          - `"application/zip"`

                        - `type: "base64"`

                          The type of the inline skill source. Must be `base64`.

                          - `"base64"`

                      - `type: "inline"`

                        Defines an inline skill for this request.

                        - `"inline"`

                - `BetaLocalEnvironment`

                  - `type: "local"`

                    Use a local computer environment.

                    - `"local"`

                  - `skills?: Array<BetaLocalSkill>`

                    An optional list of skills.

                    - `description: string`

                      The description of the skill.

                    - `name: string`

                      The name of the skill.

                    - `path: string`

                      The path to the directory containing the skill.

                - `BetaContainerReference`

                  - `container_id: string`

                    The ID of the referenced container.

                  - `type: "container_reference"`

                    References a container created with the /v1/containers endpoint

                    - `"container_reference"`

            - `BetaCustomTool`

              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)

              - `name: string`

                The name of the custom tool, used to identify it in tool calls.

              - `type: "custom"`

                The type of the custom tool. Always `custom`.

                - `"custom"`

              - `allowed_callers?: Array<"direct" | "programmatic"> | null`

                The tool invocation context(s).

                - `"direct"`

                - `"programmatic"`

              - `defer_loading?: boolean`

                Whether this tool should be deferred and discovered via tool search.

              - `description?: string`

                Optional description of the custom tool, used to provide more context.

              - `format?: Text | Grammar`

                The input format for the custom tool. Default is unconstrained text.

                - `Text`

                  Unconstrained free-form text.

                  - `type: "text"`

                    Unconstrained text format. Always `text`.

                    - `"text"`

                - `Grammar`

                  A grammar defined by the user.

                  - `definition: string`

                    The grammar definition.

                  - `syntax: "lark" | "regex"`

                    The syntax of the grammar definition. One of `lark` or `regex`.

                    - `"lark"`

                    - `"regex"`

                  - `type: "grammar"`

                    Grammar format. Always `grammar`.

                    - `"grammar"`

            - `BetaNamespaceTool`

              Groups function/custom tools under a shared namespace.

              - `description: string`

                A description of the namespace shown to the model.

              - `name: string`

                The namespace name used in tool calls (for example, `crm`).

              - `tools: Array<Function | BetaCustomTool>`

                The function/custom tools available inside this namespace.

                - `Function`

                  - `name: string`

                  - `type: "function"`

                    - `"function"`

                  - `allowed_callers?: Array<"direct" | "programmatic"> | null`

                    The tool invocation context(s).

                    - `"direct"`

                    - `"programmatic"`

                  - `defer_loading?: boolean`

                    Whether this function should be deferred and discovered via tool search.

                  - `description?: string | null`

                  - `output_schema?: Record<string, unknown> | null`

                    A JSON Schema describing the JSON value encoded in string outputs for this function tool. This does not describe content-array outputs.

                  - `parameters?: unknown`

                  - `strict?: boolean | null`

                    Whether to enforce strict parameter validation. If omitted, Responses attempts to use strict validation when the schema is compatible, and falls back to non-strict validation otherwise.

                - `BetaCustomTool`

                  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: "namespace"`

                The type of the tool. Always `namespace`.

                - `"namespace"`

            - `BetaToolSearchTool`

              Hosted or BYOT tool search configuration for deferred tools.

              - `type: "tool_search"`

                The type of the tool. Always `tool_search`.

                - `"tool_search"`

              - `description?: string | null`

                Description shown to the model for a client-executed tool search tool.

              - `execution?: "server" | "client"`

                Whether tool search is executed by the server or by the client.

                - `"server"`

                - `"client"`

              - `parameters?: unknown`

                Parameter schema for a client-executed tool search tool.

            - `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"`

                The type of the web search tool. One of `web_search_preview` or `web_search_preview_2025_03_11`.

                - `"web_search_preview"`

                - `"web_search_preview_2025_03_11"`

              - `search_content_types?: Array<"text" | "image">`

                - `"text"`

                - `"image"`

              - `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.

                - `"low"`

                - `"medium"`

                - `"high"`

              - `user_location?: UserLocation | null`

                The user's location.

                - `type: "approximate"`

                  The type of location approximation. Always `approximate`.

                  - `"approximate"`

                - `city?: string | null`

                  Free text input for the city of the user, e.g. `San Francisco`.

                - `country?: string | null`

                  The two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of the user, e.g. `US`.

                - `region?: string | null`

                  Free text input for the region of the user, e.g. `California`.

                - `timezone?: string | null`

                  The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of the user, e.g. `America/Los_Angeles`.

            - `BetaApplyPatchTool`

              Allows the assistant to create, delete, or update files using unified diffs.

              - `type: "apply_patch"`

                The type of the tool. Always `apply_patch`.

                - `"apply_patch"`

              - `allowed_callers?: Array<"direct" | "programmatic"> | null`

                The tool invocation context(s).

                - `"direct"`

                - `"programmatic"`

          - `type: "tool_search_output"`

            The item type. Always `tool_search_output`.

            - `"tool_search_output"`

          - `id?: string | null`

            The unique ID of this tool search output.

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

          - `call_id?: string | null`

            The unique ID of the tool search call generated by the model.

          - `execution?: "server" | "client"`

            Whether tool search was executed by the server or by the client.

            - `"server"`

            - `"client"`

          - `status?: "in_progress" | "completed" | "incomplete" | null`

            The status of the tool search output.

            - `"in_progress"`

            - `"completed"`

            - `"incomplete"`

        - `AdditionalTools`

          - `role: "developer"`

            The role that provided the additional tools. Only `developer` is supported.

            - `"developer"`

          - `tools: Array<BetaTool>`

            A list of additional tools made available at this item.

            - `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).

            - `Mcp`

              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).

            - `CodeInterpreter`

              A tool that runs Python code to help generate a response to a prompt.

            - `ProgrammaticToolCalling`

            - `ImageGeneration`

              A tool that generates images using the GPT image models.

            - `LocalShell`

              A tool that allows the model to execute shell commands in a local environment.

            - `BetaFunctionShellTool`

              A tool that allows the model to execute shell commands.

            - `BetaCustomTool`

              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)

            - `BetaNamespaceTool`

              Groups function/custom tools under a shared namespace.

            - `BetaToolSearchTool`

              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).

            - `BetaApplyPatchTool`

              Allows the assistant to create, delete, or update files using unified diffs.

          - `type: "additional_tools"`

            The item type. Always `additional_tools`.

            - `"additional_tools"`

          - `id?: string | null`

            The unique ID of this additional tools item.

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

        - `BetaResponseReasoningItem`

          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).

          - `id: string`

            The unique identifier of the reasoning content.

          - `summary: Array<Summary>`

            Reasoning summary content.

            - `text: string`

              A summary of the reasoning output from the model so far.

            - `type: "summary_text"`

              The type of the object. Always `summary_text`.

              - `"summary_text"`

          - `type: "reasoning"`

            The type of the object. Always `reasoning`.

            - `"reasoning"`

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

          - `content?: Array<Content>`

            Reasoning text content.

            - `text: string`

              The reasoning text from the model.

            - `type: "reasoning_text"`

              The type of the reasoning text. Always `reasoning_text`.

              - `"reasoning_text"`

          - `encrypted_content?: string | null`

            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.

            When streaming, use the completed reasoning item and its
            `encrypted_content` from the `response.output_item.done` event in
            subsequent requests. The `encrypted_content` in
            `response.output_item.added` may be incomplete. This is especially
            important when `store` is `false` or when using Zero Data Retention.

          - `status?: "in_progress" | "completed" | "incomplete"`

            The status of the item. One of `in_progress`, `completed`, or
            `incomplete`. Populated when items are returned via API.

            - `"in_progress"`

            - `"completed"`

            - `"incomplete"`

        - `BetaResponseCompactionItemParam`

          A compaction item generated by the [`v1/responses/compact` API](https://platform.openai.com/docs/api-reference/responses/compact).

          - `encrypted_content: string`

            The encrypted content of the compaction summary.

          - `type: "compaction"`

            The type of the item. Always `compaction`.

            - `"compaction"`

          - `id?: string | null`

            The ID of the compaction item.

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

        - `ImageGenerationCall`

          An image generation request made by the model.

          - `id: string`

            The unique ID of the image generation call.

          - `result: string | null`

            The generated image encoded in base64.

          - `status: "in_progress" | "completed" | "generating" | "failed"`

            The status of the image generation call.

            - `"in_progress"`

            - `"completed"`

            - `"generating"`

            - `"failed"`

          - `type: "image_generation_call"`

            The type of the image generation call. Always `image_generation_call`.

            - `"image_generation_call"`

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

        - `BetaResponseCodeInterpreterToolCall`

          A tool call to run code.

          - `id: string`

            The unique ID of the code interpreter tool call.

          - `code: string | null`

            The code to run, or null if not available.

          - `container_id: string`

            The ID of the container used to run the code.

          - `outputs: Array<Logs | Image> | null`

            The outputs generated by the code interpreter, such as logs or images.
            Can be null if no outputs are available.

            - `Logs`

              The logs output from the code interpreter.

              - `logs: string`

                The logs output from the code interpreter.

              - `type: "logs"`

                The type of the output. Always `logs`.

                - `"logs"`

            - `Image`

              The image output from the code interpreter.

              - `type: "image"`

                The type of the output. Always `image`.

                - `"image"`

              - `url: string`

                The URL of the image output from the code interpreter.

          - `status: "in_progress" | "completed" | "incomplete" | 2 more`

            The status of the code interpreter tool call. Valid values are `in_progress`, `completed`, `incomplete`, `interpreting`, and `failed`.

            - `"in_progress"`

            - `"completed"`

            - `"incomplete"`

            - `"interpreting"`

            - `"failed"`

          - `type: "code_interpreter_call"`

            The type of the code interpreter tool call. Always `code_interpreter_call`.

            - `"code_interpreter_call"`

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

        - `LocalShellCall`

          A tool call to run a command on the local shell.

          - `id: string`

            The unique ID of the local shell call.

          - `action: Action`

            Execute a shell command on the server.

            - `command: Array<string>`

              The command to run.

            - `env: Record<string, string>`

              Environment variables to set for the command.

            - `type: "exec"`

              The type of the local shell action. Always `exec`.

              - `"exec"`

            - `timeout_ms?: number | null`

              Optional timeout in milliseconds for the command.

            - `user?: string | null`

              Optional user to run the command as.

            - `working_directory?: string | null`

              Optional working directory to run the command in.

          - `call_id: string`

            The unique ID of the local shell tool call generated by the model.

          - `status: "in_progress" | "completed" | "incomplete"`

            The status of the local shell call.

            - `"in_progress"`

            - `"completed"`

            - `"incomplete"`

          - `type: "local_shell_call"`

            The type of the local shell call. Always `local_shell_call`.

            - `"local_shell_call"`

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

        - `LocalShellCallOutput`

          The output of a local shell tool call.

          - `id: string`

            The unique ID of the local shell tool call generated by the model.

          - `output: string`

            A JSON string of the output of the local shell tool call.

          - `type: "local_shell_call_output"`

            The type of the local shell tool call output. Always `local_shell_call_output`.

            - `"local_shell_call_output"`

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

          - `status?: "in_progress" | "completed" | "incomplete" | null`

            The status of the item. One of `in_progress`, `completed`, or `incomplete`.

            - `"in_progress"`

            - `"completed"`

            - `"incomplete"`

        - `ShellCall`

          A tool representing a request to execute one or more shell commands.

          - `action: Action`

            The shell commands and limits that describe how to run the tool call.

            - `commands: Array<string>`

              Ordered shell commands for the execution environment to run.

            - `max_output_length?: number | null`

              Maximum number of UTF-8 characters to capture from combined stdout and stderr output.

            - `timeout_ms?: number | null`

              Maximum wall-clock time in milliseconds to allow the shell commands to run.

          - `call_id: string`

            The unique ID of the shell tool call generated by the model.

          - `type: "shell_call"`

            The type of the item. Always `shell_call`.

            - `"shell_call"`

          - `id?: string | null`

            The unique ID of the shell tool call. Populated when this item is returned via API.

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

          - `caller?: Direct | Program | null`

            The execution context that produced this tool call.

            - `Direct`

              - `type: "direct"`

                The caller type. Always `direct`.

                - `"direct"`

            - `Program`

              - `caller_id: string`

                The call ID of the program item that produced this tool call.

              - `type: "program"`

                The caller type. Always `program`.

                - `"program"`

          - `environment?: BetaLocalEnvironment | BetaContainerReference | null`

            The environment to execute the shell commands in.

            - `BetaLocalEnvironment`

            - `BetaContainerReference`

          - `status?: "in_progress" | "completed" | "incomplete" | null`

            The status of the shell call. One of `in_progress`, `completed`, or `incomplete`.

            - `"in_progress"`

            - `"completed"`

            - `"incomplete"`

        - `ShellCallOutput`

          The streamed output items emitted by a shell tool call.

          - `call_id: string`

            The unique ID of the shell tool call generated by the model.

          - `output: Array<BetaResponseFunctionShellCallOutputContent>`

            Captured chunks of stdout and stderr output, along with their associated outcomes.

            - `outcome: Timeout | Exit`

              The exit or timeout outcome associated with this shell call.

              - `Timeout`

                Indicates that the shell call exceeded its configured time limit.

                - `type: "timeout"`

                  The outcome type. Always `timeout`.

                  - `"timeout"`

              - `Exit`

                Indicates that the shell commands finished and returned an exit code.

                - `exit_code: number`

                  The exit code returned by the shell process.

                - `type: "exit"`

                  The outcome type. Always `exit`.

                  - `"exit"`

            - `stderr: string`

              Captured stderr output for the shell call.

            - `stdout: string`

              Captured stdout output for the shell call.

          - `type: "shell_call_output"`

            The type of the item. Always `shell_call_output`.

            - `"shell_call_output"`

          - `id?: string | null`

            The unique ID of the shell tool call output. Populated when this item is returned via API.

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

          - `caller?: Direct | Program | null`

            The execution context that produced this tool call.

            - `Direct`

              - `type: "direct"`

                The caller type. Always `direct`.

                - `"direct"`

            - `Program`

              - `caller_id: string`

                The call ID of the program item that produced this tool call.

              - `type: "program"`

                The caller type. Always `program`.

                - `"program"`

          - `max_output_length?: number | null`

            The maximum number of UTF-8 characters captured for this shell call's combined output.

          - `status?: "in_progress" | "completed" | "incomplete" | null`

            The status of the shell call output.

            - `"in_progress"`

            - `"completed"`

            - `"incomplete"`

        - `ApplyPatchCall`

          A tool call representing a request to create, delete, or update files using diff patches.

          - `call_id: string`

            The unique ID of the apply patch tool call generated by the model.

          - `operation: CreateFile | DeleteFile | UpdateFile`

            The specific create, delete, or update instruction for the apply_patch tool call.

            - `CreateFile`

              Instruction for creating a new file via the apply_patch tool.

              - `diff: string`

                Unified diff content to apply when creating the file.

              - `path: string`

                Path of the file to create relative to the workspace root.

              - `type: "create_file"`

                The operation type. Always `create_file`.

                - `"create_file"`

            - `DeleteFile`

              Instruction for deleting an existing file via the apply_patch tool.

              - `path: string`

                Path of the file to delete relative to the workspace root.

              - `type: "delete_file"`

                The operation type. Always `delete_file`.

                - `"delete_file"`

            - `UpdateFile`

              Instruction for updating an existing file via the apply_patch tool.

              - `diff: string`

                Unified diff content to apply to the existing file.

              - `path: string`

                Path of the file to update relative to the workspace root.

              - `type: "update_file"`

                The operation type. Always `update_file`.

                - `"update_file"`

          - `status: "in_progress" | "completed"`

            The status of the apply patch tool call. One of `in_progress` or `completed`.

            - `"in_progress"`

            - `"completed"`

          - `type: "apply_patch_call"`

            The type of the item. Always `apply_patch_call`.

            - `"apply_patch_call"`

          - `id?: string | null`

            The unique ID of the apply patch tool call. Populated when this item is returned via API.

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

          - `caller?: Direct | Program | null`

            The execution context that produced this tool call.

            - `Direct`

              - `type: "direct"`

                The caller type. Always `direct`.

                - `"direct"`

            - `Program`

              - `caller_id: string`

                The call ID of the program item that produced this tool call.

              - `type: "program"`

                The caller type. Always `program`.

                - `"program"`

        - `ApplyPatchCallOutput`

          The streamed output emitted by an apply patch tool call.

          - `call_id: string`

            The unique ID of the apply patch tool call generated by the model.

          - `status: "completed" | "failed"`

            The status of the apply patch tool call output. One of `completed` or `failed`.

            - `"completed"`

            - `"failed"`

          - `type: "apply_patch_call_output"`

            The type of the item. Always `apply_patch_call_output`.

            - `"apply_patch_call_output"`

          - `id?: string | null`

            The unique ID of the apply patch tool call output. Populated when this item is returned via API.

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

          - `caller?: Direct | Program | null`

            The execution context that produced this tool call.

            - `Direct`

              - `type: "direct"`

                The caller type. Always `direct`.

                - `"direct"`

            - `Program`

              - `caller_id: string`

                The call ID of the program item that produced this tool call.

              - `type: "program"`

                The caller type. Always `program`.

                - `"program"`

          - `output?: string | null`

            Optional human-readable log text from the apply patch tool (e.g., patch results or errors).

        - `McpListTools`

          A list of tools available on an MCP server.

          - `id: string`

            The unique ID of the list.

          - `server_label: string`

            The label of the MCP server.

          - `tools: Array<Tool>`

            The tools available on the server.

            - `input_schema: unknown`

              The JSON schema describing the tool's input.

            - `name: string`

              The name of the tool.

            - `annotations?: unknown`

              Additional annotations about the tool.

            - `description?: string | null`

              The description of the tool.

          - `type: "mcp_list_tools"`

            The type of the item. Always `mcp_list_tools`.

            - `"mcp_list_tools"`

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

          - `error?: string | null`

            Error message if the server could not list tools.

        - `McpApprovalRequest`

          A request for human approval of a tool invocation.

          - `id: string`

            The unique ID of the approval request.

          - `arguments: string`

            A JSON string of arguments for the tool.

          - `name: string`

            The name of the tool to run.

          - `server_label: string`

            The label of the MCP server making the request.

          - `type: "mcp_approval_request"`

            The type of the item. Always `mcp_approval_request`.

            - `"mcp_approval_request"`

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

        - `McpApprovalResponse`

          A response to an MCP approval request.

          - `approval_request_id: string`

            The ID of the approval request being answered.

          - `approve: boolean`

            Whether the request was approved.

          - `type: "mcp_approval_response"`

            The type of the item. Always `mcp_approval_response`.

            - `"mcp_approval_response"`

          - `id?: string | null`

            The unique ID of the approval response

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

          - `reason?: string | null`

            Optional reason for the decision.

        - `McpCall`

          An invocation of a tool on an MCP server.

          - `id: string`

            The unique ID of the tool call.

          - `arguments: string`

            A JSON string of the arguments passed to the tool.

          - `name: string`

            The name of the tool that was run.

          - `server_label: string`

            The label of the MCP server running the tool.

          - `type: "mcp_call"`

            The type of the item. Always `mcp_call`.

            - `"mcp_call"`

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

          - `approval_request_id?: string | null`

            Unique identifier for the MCP tool call approval request.
            Include this value in a subsequent `mcp_approval_response` input to approve or reject the corresponding tool call.

          - `error?: BetaMcpToolCallError | null`

            The error from the tool call, if any.

            - `McpProtocolError`

              - `code: number`

              - `message: string`

              - `type: "mcp_protocol_error"`

                - `"mcp_protocol_error"`

            - `McpToolExecutionError`

              - `content: unknown`

              - `type: "mcp_tool_execution_error"`

                - `"mcp_tool_execution_error"`

            - `HTTPError`

              - `code: number`

              - `message: string`

              - `type: "http_error"`

                - `"http_error"`

          - `output?: string | null`

            The output from the tool call.

          - `status?: "in_progress" | "completed" | "incomplete" | 2 more`

            The status of the tool call. One of `in_progress`, `completed`, `incomplete`, `calling`, or `failed`.

            - `"in_progress"`

            - `"completed"`

            - `"incomplete"`

            - `"calling"`

            - `"failed"`

        - `BetaResponseCustomToolCallOutput`

          The output of a custom tool call from your code, being sent back to the model.

          - `call_id: string`

            The call ID, used to map this custom tool call output to a custom tool call.

          - `output: string | Array<BetaResponseInputText | BetaResponseInputImage | BetaResponseInputFile>`

            The output from the custom tool call generated by your code.
            Can be a string or an list of output content.

            - `string`

            - `Array<BetaResponseInputText | BetaResponseInputImage | BetaResponseInputFile>`

              - `BetaResponseInputText`

                A text input to the model.

              - `BetaResponseInputImage`

                An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision).

              - `BetaResponseInputFile`

                A file input to the model.

          - `type: "custom_tool_call_output"`

            The type of the custom tool call output. Always `custom_tool_call_output`.

            - `"custom_tool_call_output"`

          - `id?: string`

            The unique ID of the custom tool call output in the OpenAI platform.

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

          - `caller?: Direct | Program | null`

            The execution context that produced this tool call.

            - `Direct`

              - `type: "direct"`

                The caller type. Always `direct`.

                - `"direct"`

            - `Program`

              - `caller_id: string`

                The call ID of the program item that produced this tool call.

              - `type: "program"`

                The caller type. Always `program`.

                - `"program"`

        - `BetaResponseCustomToolCall`

          A call to a custom tool created by the model.

          - `call_id: string`

            An identifier used to map this custom tool call to a tool call output.

          - `input: string`

            The input for the custom tool call generated by the model.

          - `name: string`

            The name of the custom tool being called.

          - `type: "custom_tool_call"`

            The type of the custom tool call. Always `custom_tool_call`.

            - `"custom_tool_call"`

          - `id?: string`

            The unique ID of the custom tool call in the OpenAI platform.

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

          - `caller?: Direct | Program | null`

            The execution context that produced this tool call.

            - `Direct`

              - `type: "direct"`

                - `"direct"`

            - `Program`

              - `caller_id: string`

                The call ID of the program item that produced this tool call.

              - `type: "program"`

                - `"program"`

          - `namespace?: string`

            The namespace of the custom tool being called.

        - `CompactionTrigger`

          Compacts the current context. Must be the final input item.

          - `type: "compaction_trigger"`

            The type of the item. Always `compaction_trigger`.

            - `"compaction_trigger"`

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

        - `ItemReference`

          An internal identifier for an item to reference.

          - `id: string`

            The ID of the item to reference.

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

          - `type?: "item_reference" | null`

            The type of item to reference. Always `item_reference`.

            - `"item_reference"`

        - `Program`

          - `id: string`

            The unique ID of this program item.

          - `call_id: string`

            The stable call ID of the program item.

          - `code: string`

            The JavaScript source executed by programmatic tool calling.

          - `fingerprint: string`

            Opaque program replay fingerprint that must be round-tripped.

          - `type: "program"`

            The item type. Always `program`.

            - `"program"`

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

        - `ProgramOutput`

          - `id: string`

            The unique ID of this program output item.

          - `call_id: string`

            The call ID of the program item.

          - `result: string`

            The result produced by the program item.

          - `status: "completed" | "incomplete"`

            The terminal status of the program output.

            - `"completed"`

            - `"incomplete"`

          - `type: "program_output"`

            The item type. Always `program_output`.

            - `"program_output"`

          - `agent?: Agent | null`

            The agent that produced this item.

            - `agent_name: string`

              The canonical name of the agent that produced this item.

    - `instructions?: string | null`

      A system (or developer) message inserted into the model's context.

      When using along with `previous_response_id`, the instructions from a previous
      response will not be carried over to the next response. This makes it simple
      to swap out system (or developer) messages in new responses.

    - `max_output_tokens?: number | null`

      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).

    - `max_tool_calls?: number | null`

      The maximum number of total calls to built-in tools that can be processed in a response. This maximum number applies across all built-in tool calls, not per individual tool. Any further attempts to call a tool by the model will be ignored.

    - `metadata?: Record<string, string> | null`

      Set of 16 key-value pairs that can be attached to an object. This can be
      useful for storing additional information about the object in a structured
      format, and querying for objects via API or the dashboard.

      Keys are strings with a maximum length of 64 characters. Values are strings
      with a maximum length of 512 characters.

    - `model?: "gpt-5.6-sol" | "gpt-5.6-terra" | "gpt-5.6-luna" | 99 more | (string & {})`

      Model ID used to generate the response, like `gpt-4o` or `o3`. OpenAI
      offers a wide range of models with different capabilities, performance
      characteristics, and price points. Refer to the [model guide](https://platform.openai.com/docs/models)
      to browse and compare available models.

      - `"gpt-5.6-sol" | "gpt-5.6-terra" | "gpt-5.6-luna" | 99 more`

        - `"gpt-5.6-sol"`

        - `"gpt-5.6-terra"`

        - `"gpt-5.6-luna"`

        - `"gpt-5.5"`

        - `"gpt-5.5-2026-04-23"`

        - `"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.5-pro"`

        - `"gpt-5.5-pro-2026-04-23"`

        - `"gpt-5-codex"`

        - `"gpt-5-pro"`

        - `"gpt-5-pro-2025-10-06"`

        - `"gpt-5.1-codex-max"`

        - `"gpt-daybreak-blue-latest"`

        - `"gpt-daybreak-red-latest"`

        - `"gpt-5.6-cyber"`

      - `(string & {})`

    - `moderation?: Moderation | null`

      Configuration for running moderation on the input and output of this response.

      - `model: string`

        The moderation model to use for moderated completions, e.g. 'omni-moderation-latest'.

      - `policy?: Policy | null`

        The policy to apply to moderated response input and output.

        - `input?: Input | null`

          The moderation policy for the response input.

          - `mode: "score" | "block"`

            - `"score"`

            - `"block"`

        - `output?: Output | null`

          The moderation policy for the response output.

          - `mode: "score" | "block"`

            - `"score"`

            - `"block"`

    - `multi_agent?: MultiAgent | null`

      Configuration for server-hosted multi-agent execution.

      - `enabled: boolean`

        Whether to enable server-hosted multi-agent execution for this response.

      - `max_concurrent_subagents?: number`

        `max_concurrent_subagents` sets the maximum number of subagents that can be active simultaneously across the entire agent tree. It includes all descendants—children, grandchildren, and deeper subagents—but excludes the root agent.
        The API does not impose a fixed upper bound on this setting. The default is `3`, which is recommended for most workloads. Multi-agent runs also have no fixed limit on tree depth or the total number of subagents created during a run.

    - `parallel_tool_calls?: boolean | null`

      Whether to allow the model to run tool calls in parallel.

    - `previous_response_id?: string | null`

      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`.

    - `prompt?: BetaResponsePrompt | null`

      Reference to a prompt template and its variables.
      [Learn more](https://platform.openai.com/docs/guides/text?api-mode=responses#reusable-prompts).

      - `id: string`

        The unique identifier of the prompt template to use.

      - `variables?: Record<string, string | BetaResponseInputText | BetaResponseInputImage | BetaResponseInputFile> | null`

        Optional map of values to substitute in for variables in your
        prompt. The substitution values can either be strings, or other
        Response input types like images or files.

        - `string`

        - `BetaResponseInputText`

          A text input to the model.

        - `BetaResponseInputImage`

          An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision).

        - `BetaResponseInputFile`

          A file input to the model.

      - `version?: string | null`

        Optional version of the prompt template.

    - `prompt_cache_key?: string | null`

      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).

    - `prompt_cache_options?: PromptCacheOptions`

      Options for prompt caching. Supported for `gpt-5.6` and later models. By default, OpenAI automatically chooses one implicit cache breakpoint. You can add explicit breakpoints to content blocks with `prompt_cache_breakpoint`. Each request can write up to four breakpoints. For cache matching, OpenAI considers up to the latest 80 breakpoints in the conversation, without a content-block lookback limit. Set `mode` to `explicit` to disable the implicit breakpoint. The `ttl` defaults to `30m`, which is currently the only supported value. See the [prompt caching guide](https://platform.openai.com/docs/guides/prompt-caching) for current details.

      - `mode?: "implicit" | "explicit"`

        Controls whether OpenAI automatically creates an implicit cache breakpoint. Defaults to `implicit`. With `implicit`, OpenAI creates one implicit breakpoint and writes up to the latest three explicit breakpoints in the request. With `explicit`, OpenAI does not create an implicit breakpoint and writes up to the latest four explicit breakpoints. If there are no explicit breakpoints, the request does not use prompt caching.

        - `"implicit"`

        - `"explicit"`

      - `ttl?: "30m"`

        The minimum lifetime applied to every implicit and explicit cache breakpoint written by the request. Defaults to `30m`, which is currently the only supported value. The backend may retain cache entries for longer.

        - `"30m"`

    - `prompt_cache_retention?: "in_memory" | "24h" | null`

      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.

      - `"in_memory"`

      - `"24h"`

    - `reasoning?: Reasoning | null`

      **gpt-5 and o-series models only**

      Configuration options for
      [reasoning models](https://platform.openai.com/docs/guides/reasoning).

      - `context?: "auto" | "current_turn" | "all_turns" | null`

        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.

        - `"auto"`

        - `"current_turn"`

        - `"all_turns"`

      - `effort?: "none" | "minimal" | "low" | 4 more | null`

        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.

        - `"none"`

        - `"minimal"`

        - `"low"`

        - `"medium"`

        - `"high"`

        - `"xhigh"`

        - `"max"`

      - `generate_summary?: "auto" | "concise" | "detailed" | null`

        **Deprecated:** use `summary` instead.

        A summary of the reasoning performed by the model. This can be
        useful for debugging and understanding the model's reasoning process.
        One of `auto`, `concise`, or `detailed`.

        - `"auto"`

        - `"concise"`

        - `"detailed"`

      - `mode?: (string & {}) | "standard" | "pro"`

        Controls the reasoning execution mode for the request.

        When returned on a response, this is the effective execution mode.

        - `(string & {})`

        - `"standard" | "pro"`

          - `"standard"`

          - `"pro"`

      - `summary?: "auto" | "concise" | "detailed" | null`

        A summary of the reasoning performed by the model. This can be
        useful for debugging and understanding the model's reasoning process.
        One of `auto`, `concise`, or `detailed`.

        `concise` is supported for `computer-use-preview` models and all reasoning models after `gpt-5`.

        - `"auto"`

        - `"concise"`

        - `"detailed"`

    - `safety_identifier?: string | null`

      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).

    - `service_tier?: BetaServiceTier | null`

      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.
      - If set to 'ultrafast', then the request will be processed with the access-controlled Ultrafast Processing service tier. This tier is currently available for `gpt-5.6-sol`; a response served through it will show `service_tier=ultrafast`.
      - When not set, the default behavior is 'auto'.

      When the `service_tier` parameter is set, the response body will include the `service_tier` value based on the processing mode actually used to serve the request. This response value may be different from the value set in the parameter.

      - `"auto"`

      - `"default"`

      - `"flex"`

      - `"scale"`

      - `"priority"`

      - `"fast"`

      - `"ultrafast"`

    - `store?: boolean | null`

      Whether to store the generated model response for later retrieval via
      API.

    - `stream?: boolean | null`

      If set to true, the model response data will be streamed to the client
      as it is generated using [server-sent events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events#Event_stream_format).
      See the [Streaming section below](https://platform.openai.com/docs/api-reference/responses-streaming)
      for more information.

    - `stream_id?: string`

      The WebSocket lane for this response. Requests with the same
      `stream_id` are processed FIFO, and events for the response echo the
      same `stream_id`.

      `stream_id` controls routing; `previous_response_id` controls
      conversation lineage, so a new lane can fork from a response created
      on another lane.

    - `stream_options?: StreamOptions | null`

      Options for streaming responses. Only set this when you set `stream: true`.

      - `include_obfuscation?: boolean`

        When true, stream obfuscation will be enabled. Stream obfuscation adds
        random characters to an `obfuscation` field on streaming delta events to
        normalize payload sizes as a mitigation to certain side-channel attacks.
        These obfuscation fields are included by default, but add a small amount
        of overhead to the data stream. You can set `include_obfuscation` to
        false to optimize for bandwidth if you trust the network links between
        your application and the OpenAI API.

    - `temperature?: number | null`

      What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic.
      We generally recommend altering this or `top_p` but not both.

    - `text?: BetaResponseTextConfig`

      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?: BetaResponseFormatTextConfig`

        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.

        - `Text`

          Default response format. Used to generate text responses.

          - `type: "text"`

            The type of response format being defined. Always `text`.

            - `"text"`

        - `BetaResponseFormatTextJSONSchemaConfig`

          JSON Schema response format. Used to generate structured JSON responses.
          Learn more about [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs).

          - `name: string`

            The name of the response format. Must be a-z, A-Z, 0-9, or contain
            underscores and dashes, with a maximum length of 64.

          - `schema: Record<string, unknown>`

            The schema for the response format, described as a JSON Schema object.
            Learn how to build JSON schemas [here](https://json-schema.org/).

          - `type: "json_schema"`

            The type of response format being defined. Always `json_schema`.

            - `"json_schema"`

          - `description?: string`

            A description of what the response format is for, used by the model to
            determine how to respond in the format.

          - `strict?: boolean | null`

            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).

        - `JSONObject`

          JSON object response format. An older method of generating JSON responses.
          Using `json_schema` is recommended for models that support it. Note that the
          model will not generate JSON without a system or user message instructing it
          to do so.

          - `type: "json_object"`

            The type of response format being defined. Always `json_object`.

            - `"json_object"`

      - `verbosity?: "low" | "medium" | "high" | null`

        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`.

        - `"low"`

        - `"medium"`

        - `"high"`

    - `tool_choice?: BetaToolChoiceOptions | BetaToolChoiceAllowed | BetaToolChoiceTypes | 6 more`

      How the model should select which tool (or tools) to use when generating
      a response. See the `tools` parameter to see how to specify which tools
      the model can call.

      - `BetaToolChoiceOptions = "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.

        - `"none"`

        - `"auto"`

        - `"required"`

      - `BetaToolChoiceAllowed`

        Constrains the tools available to the model to a pre-defined set.

        - `mode: "auto" | "required"`

          Constrains the tools available to the model to a pre-defined set.

          `auto` allows the model to pick from among the allowed tools and generate a
          message.

          `required` requires the model to call one or more of the allowed tools.

          - `"auto"`

          - `"required"`

        - `tools: Array<Record<string, unknown>>`

          A list of tool definitions that the model should be allowed to call.

          For the Responses API, the list of tool definitions might look like:

          ```json
          [
            { "type": "function", "name": "get_weather" },
            { "type": "mcp", "server_label": "deepwiki" },
            { "type": "image_generation" }
          ]
          ```

        - `type: "allowed_tools"`

          Allowed tool configuration type. Always `allowed_tools`.

          - `"allowed_tools"`

      - `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" | 5 more`

          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`

          - `"file_search"`

          - `"web_search_preview"`

          - `"computer"`

          - `"computer_use_preview"`

          - `"computer_use"`

          - `"web_search_preview_2025_03_11"`

          - `"image_generation"`

          - `"code_interpreter"`

      - `BetaToolChoiceFunction`

        Use this option to force the model to call a specific function.

        - `name: string`

          The name of the function to call.

        - `type: "function"`

          For function calling, the type is always `function`.

          - `"function"`

      - `BetaToolChoiceMcp`

        Use this option to force the model to call a specific tool on a remote MCP server.

        - `server_label: string`

          The label of the MCP server to use.

        - `type: "mcp"`

          For MCP tools, the type is always `mcp`.

          - `"mcp"`

        - `name?: string | null`

          The name of the tool to call on the server.

      - `BetaToolChoiceCustom`

        Use this option to force the model to call a specific custom tool.

        - `name: string`

          The name of the custom tool to call.

        - `type: "custom"`

          For custom tool calling, the type is always `custom`.

          - `"custom"`

      - `BetaSpecificProgrammaticToolCallingParam`

        - `type: "programmatic_tool_calling"`

          The tool to call. Always `programmatic_tool_calling`.

          - `"programmatic_tool_calling"`

      - `BetaToolChoiceApplyPatch`

        Forces the model to call the apply_patch tool when executing a tool call.

        - `type: "apply_patch"`

          The tool to call. Always `apply_patch`.

          - `"apply_patch"`

      - `BetaToolChoiceShell`

        Forces the model to call the shell tool when a tool call is required.

        - `type: "shell"`

          The tool to call. Always `shell`.

          - `"shell"`

    - `tools?: Array<BetaTool>`

      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.

      - `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).

      - `Mcp`

        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).

      - `CodeInterpreter`

        A tool that runs Python code to help generate a response to a prompt.

      - `ProgrammaticToolCalling`

      - `ImageGeneration`

        A tool that generates images using the GPT image models.

      - `LocalShell`

        A tool that allows the model to execute shell commands in a local environment.

      - `BetaFunctionShellTool`

        A tool that allows the model to execute shell commands.

      - `BetaCustomTool`

        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)

      - `BetaNamespaceTool`

        Groups function/custom tools under a shared namespace.

      - `BetaToolSearchTool`

        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).

      - `BetaApplyPatchTool`

        Allows the assistant to create, delete, or update files using unified diffs.

    - `top_logprobs?: number | null`

      An integer between 0 and 20 specifying the maximum number of most likely
      tokens to return at each token position, each with an associated log
      probability. In some cases, the number of returned tokens may be fewer than
      requested.

    - `top_p?: number | null`

      An alternative to sampling with temperature, called nucleus sampling,
      where the model considers the results of the tokens with top_p probability
      mass. So 0.1 means only the tokens comprising the top 10% probability mass
      are considered.

      We generally recommend altering this or `temperature` but not both.

    - `truncation?: "auto" | "disabled" | null`

      The truncation strategy to use for the model response.

      - `auto`: If the input to this Response exceeds
        the model's context window size, the model will truncate the
        response to fit the context window by dropping items from the beginning of the conversation.
      - `disabled` (default): If the input size will exceed the context window
        size for a model, the request will fail with a 400 error.

      - `"auto"`

      - `"disabled"`

    - `user?: 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).

  - `BetaResponseInjectEvent`

    Injects input items into an active response over a WebSocket connection.
    The items are validated and committed atomically. Currently, the server
    accepts client-owned tool outputs that resume a waiting agent.

    - `input: Array<BetaResponseInputItem>`

      Input items to inject into the active response.

      - `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.

      - `Message`

        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.

      - `BetaResponseOutputMessage`

        An output message from the model.

      - `BetaResponseFileSearchToolCall`

        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.

      - `BetaResponseComputerToolCall`

        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.

      - `ComputerCallOutput`

        The output of a computer tool call.

      - `BetaResponseFunctionWebSearch`

        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.

      - `BetaResponseFunctionToolCall`

        A tool call to run a function. See the
        [function calling guide](https://platform.openai.com/docs/guides/function-calling) for more information.

      - `FunctionCallOutput`

        The output of a function tool call.

      - `AgentMessage`

        A message routed between agents.

      - `MultiAgentCall`

      - `MultiAgentCallOutput`

      - `ToolSearchCall`

      - `BetaResponseToolSearchOutputItemParam`

      - `AdditionalTools`

      - `BetaResponseReasoningItem`

        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).

      - `BetaResponseCompactionItemParam`

        A compaction item generated by the [`v1/responses/compact` API](https://platform.openai.com/docs/api-reference/responses/compact).

      - `ImageGenerationCall`

        An image generation request made by the model.

      - `BetaResponseCodeInterpreterToolCall`

        A tool call to run code.

      - `LocalShellCall`

        A tool call to run a command on the local shell.

      - `LocalShellCallOutput`

        The output of a local shell tool call.

      - `ShellCall`

        A tool representing a request to execute one or more shell commands.

      - `ShellCallOutput`

        The streamed output items emitted by a shell tool call.

      - `ApplyPatchCall`

        A tool call representing a request to create, delete, or update files using diff patches.

      - `ApplyPatchCallOutput`

        The streamed output emitted by an apply patch tool call.

      - `McpListTools`

        A list of tools available on an MCP server.

      - `McpApprovalRequest`

        A request for human approval of a tool invocation.

      - `McpApprovalResponse`

        A response to an MCP approval request.

      - `McpCall`

        An invocation of a tool on an MCP server.

      - `BetaResponseCustomToolCallOutput`

        The output of a custom tool call from your code, being sent back to the model.

      - `BetaResponseCustomToolCall`

        A call to a custom tool created by the model.

      - `CompactionTrigger`

        Compacts the current context. Must be the final input item.

      - `ItemReference`

        An internal identifier for an item to reference.

      - `Program`

      - `ProgramOutput`

    - `response_id: string`

      The ID of the active response that should receive the input.

    - `type: "response.inject"`

      The event discriminator. Always `response.inject`.

      - `"response.inject"`

### Beta Responses Server Event

- `BetaResponsesServerEvent = BetaResponseAudioWsDelta | BetaResponseAudioWsDone | BetaResponseAudioTranscriptWsDelta | 57 more`

  Server events emitted by the Responses WebSocket server.

  - `BetaResponseAudioWsDelta extends BetaResponseAudioDeltaEvent`

    Emitted when there is a partial audio response.

    - `stream_id?: string`

      The WebSocket lane that emitted this event. This field is present
      when the originating `response.create` event supplied a
      `stream_id`.

  - `BetaResponseAudioWsDone extends BetaResponseAudioDoneEvent`

    Emitted when the audio response is complete.

    - `stream_id?: string`

      The WebSocket lane that emitted this event. This field is present
      when the originating `response.create` event supplied a
      `stream_id`.

  - `BetaResponseAudioTranscriptWsDelta extends BetaResponseAudioTranscriptDeltaEvent`

    Emitted when there is a partial transcript of audio.

    - `stream_id?: string`

      The WebSocket lane that emitted this event. This field is present
      when the originating `response.create` event supplied a
      `stream_id`.

  - `BetaResponseAudioTranscriptWsDone extends BetaResponseAudioTranscriptDoneEvent`

    Emitted when the full audio transcript is completed.

    - `stream_id?: string`

      The WebSocket lane that emitted this event. This field is present
      when the originating `response.create` event supplied a
      `stream_id`.

  - `BetaResponseCodeInterpreterCallCodeWsDelta extends BetaResponseCodeInterpreterCallCodeDeltaEvent`

    Emitted when a partial code snippet is streamed by the code interpreter.

    - `stream_id?: string`

      The WebSocket lane that emitted this event. This field is present
      when the originating `response.create` event supplied a
      `stream_id`.

  - `BetaResponseCodeInterpreterCallCodeWsDone extends BetaResponseCodeInterpreterCallCodeDoneEvent`

    Emitted when the code snippet is finalized by the code interpreter.

    - `stream_id?: string`

      The WebSocket lane that emitted this event. This field is present
      when the originating `response.create` event supplied a
      `stream_id`.

  - `BetaResponseCodeInterpreterCallWsCompleted extends BetaResponseCodeInterpreterCallCompletedEvent`

    Emitted when the code interpreter call is completed.

    - `stream_id?: string`

      The WebSocket lane that emitted this event. This field is present
      when the originating `response.create` event supplied a
      `stream_id`.

  - `BetaResponseCodeInterpreterCallInWsProgress extends BetaResponseCodeInterpreterCallInProgressEvent`

    Emitted when a code interpreter call is in progress.

    - `stream_id?: string`

      The WebSocket lane that emitted this event. This field is present
      when the originating `response.create` event supplied a
      `stream_id`.

  - `BetaResponseCodeInterpreterCallWsInterpreting extends BetaResponseCodeInterpreterCallInterpretingEvent`

    Emitted when the code interpreter is actively interpreting the code snippet.

    - `stream_id?: string`

      The WebSocket lane that emitted this event. This field is present
      when the originating `response.create` event supplied a
      `stream_id`.

  - `BetaResponseWsCompleted extends BetaResponseCompletedEvent`

    Emitted when the model response is complete.

    - `stream_id?: string`

      The WebSocket lane that emitted this event. This field is present
      when the originating `response.create` event supplied a
      `stream_id`.

  - `BetaResponseContentPartWsAdded extends BetaResponseContentPartAddedEvent`

    Emitted when a new content part is added.

    - `stream_id?: string`

      The WebSocket lane that emitted this event. This field is present
      when the originating `response.create` event supplied a
      `stream_id`.

  - `BetaResponseContentPartWsDone extends BetaResponseContentPartDoneEvent`

    Emitted when a content part is done.

    - `stream_id?: string`

      The WebSocket lane that emitted this event. This field is present
      when the originating `response.create` event supplied a
      `stream_id`.

  - `BetaResponseWsCreated extends BetaResponseCreatedEvent`

    An event that is emitted when a response is created.

    - `stream_id?: string`

      The WebSocket lane that emitted this event. This field is present
      when the originating `response.create` event supplied a
      `stream_id`.

  - `BetaResponseFileSearchCallWsCompleted extends BetaResponseFileSearchCallCompletedEvent`

    Emitted when a file search call is completed (results found).

    - `stream_id?: string`

      The WebSocket lane that emitted this event. This field is present
      when the originating `response.create` event supplied a
      `stream_id`.

  - `BetaResponseFileSearchCallInWsProgress extends BetaResponseFileSearchCallInProgressEvent`

    Emitted when a file search call is initiated.

    - `stream_id?: string`

      The WebSocket lane that emitted this event. This field is present
      when the originating `response.create` event supplied a
      `stream_id`.

  - `BetaResponseFileSearchCallWsSearching extends BetaResponseFileSearchCallSearchingEvent`

    Emitted when a file search is currently searching.

    - `stream_id?: string`

      The WebSocket lane that emitted this event. This field is present
      when the originating `response.create` event supplied a
      `stream_id`.

  - `BetaResponseFunctionCallArgumentsWsDelta extends BetaResponseFunctionCallArgumentsDeltaEvent`

    Emitted when there is a partial function-call arguments delta.

    - `stream_id?: string`

      The WebSocket lane that emitted this event. This field is present
      when the originating `response.create` event supplied a
      `stream_id`.

  - `BetaResponseFunctionCallArgumentsWsDone extends BetaResponseFunctionCallArgumentsDoneEvent`

    Emitted when function-call arguments are finalized.

    - `stream_id?: string`

      The WebSocket lane that emitted this event. This field is present
      when the originating `response.create` event supplied a
      `stream_id`.

  - `BetaResponseShellCallCommandWsAdded extends BetaResponseShellCallCommandAddedEvent`

    A streaming event that indicated a shell command was added to a tool call.

    - `stream_id?: string`

      The WebSocket lane that emitted this event. This field is present
      when the originating `response.create` event supplied a
      `stream_id`.

  - `BetaResponseShellCallCommandWsDelta extends BetaResponseShellCallCommandDeltaEvent`

    A streaming event that indicated a shell command was incrementally updated.

    - `stream_id?: string`

      The WebSocket lane that emitted this event. This field is present
      when the originating `response.create` event supplied a
      `stream_id`.

  - `BetaResponseShellCallCommandWsDone extends BetaResponseShellCallCommandDoneEvent`

    A streaming event that indicated a shell command was completed.

    - `stream_id?: string`

      The WebSocket lane that emitted this event. This field is present
      when the originating `response.create` event supplied a
      `stream_id`.

  - `BetaResponseShellCallOutputContentWsDelta extends BetaResponseShellCallOutputContentDeltaEvent`

    A streaming event that indicated shell call output was incrementally added.

    - `stream_id?: string`

      The WebSocket lane that emitted this event. This field is present
      when the originating `response.create` event supplied a
      `stream_id`.

  - `BetaResponseShellCallOutputContentWsDone extends BetaResponseShellCallOutputContentDoneEvent`

    A streaming event that indicated shell call output was completed.

    - `stream_id?: string`

      The WebSocket lane that emitted this event. This field is present
      when the originating `response.create` event supplied a
      `stream_id`.

  - `BetaResponseInWsProgress extends BetaResponseInProgressEvent`

    Emitted when the response is in progress.

    - `stream_id?: string`

      The WebSocket lane that emitted this event. This field is present
      when the originating `response.create` event supplied a
      `stream_id`.

  - `BetaResponseWsFailed extends BetaResponseFailedEvent`

    An event that is emitted when a response fails.

    - `stream_id?: string`

      The WebSocket lane that emitted this event. This field is present
      when the originating `response.create` event supplied a
      `stream_id`.

  - `BetaResponseWsIncomplete extends BetaResponseIncompleteEvent`

    An event that is emitted when a response finishes as incomplete.

    - `stream_id?: string`

      The WebSocket lane that emitted this event. This field is present
      when the originating `response.create` event supplied a
      `stream_id`.

  - `BetaResponseOutputItemWsAdded extends BetaResponseOutputItemAddedEvent`

    Emitted when a new output item is added.

    - `stream_id?: string`

      The WebSocket lane that emitted this event. This field is present
      when the originating `response.create` event supplied a
      `stream_id`.

  - `BetaResponseOutputItemWsDone extends BetaResponseOutputItemDoneEvent`

    Emitted when an output item is marked done.

    - `stream_id?: string`

      The WebSocket lane that emitted this event. This field is present
      when the originating `response.create` event supplied a
      `stream_id`.

  - `BetaResponseReasoningSummaryPartWsAdded extends BetaResponseReasoningSummaryPartAddedEvent`

    Emitted when a new reasoning summary part is added.

    - `stream_id?: string`

      The WebSocket lane that emitted this event. This field is present
      when the originating `response.create` event supplied a
      `stream_id`.

  - `BetaResponseReasoningSummaryPartWsDone extends BetaResponseReasoningSummaryPartDoneEvent`

    Emitted when a reasoning summary part is completed.

    - `stream_id?: string`

      The WebSocket lane that emitted this event. This field is present
      when the originating `response.create` event supplied a
      `stream_id`.

  - `BetaResponseReasoningSummaryTextWsDelta extends BetaResponseReasoningSummaryTextDeltaEvent`

    Emitted when a delta is added to a reasoning summary text.

    - `stream_id?: string`

      The WebSocket lane that emitted this event. This field is present
      when the originating `response.create` event supplied a
      `stream_id`.

  - `BetaResponseReasoningSummaryTextWsDone extends BetaResponseReasoningSummaryTextDoneEvent`

    Emitted when a reasoning summary text is completed.

    - `stream_id?: string`

      The WebSocket lane that emitted this event. This field is present
      when the originating `response.create` event supplied a
      `stream_id`.

  - `BetaResponseReasoningTextWsDelta extends BetaResponseReasoningTextDeltaEvent`

    Emitted when a delta is added to a reasoning text.

    - `stream_id?: string`

      The WebSocket lane that emitted this event. This field is present
      when the originating `response.create` event supplied a
      `stream_id`.

  - `BetaResponseReasoningTextWsDone extends BetaResponseReasoningTextDoneEvent`

    Emitted when a reasoning text is completed.

    - `stream_id?: string`

      The WebSocket lane that emitted this event. This field is present
      when the originating `response.create` event supplied a
      `stream_id`.

  - `BetaResponseRefusalWsDelta extends BetaResponseRefusalDeltaEvent`

    Emitted when there is a partial refusal text.

    - `stream_id?: string`

      The WebSocket lane that emitted this event. This field is present
      when the originating `response.create` event supplied a
      `stream_id`.

  - `BetaResponseRefusalWsDone extends BetaResponseRefusalDoneEvent`

    Emitted when refusal text is finalized.

    - `stream_id?: string`

      The WebSocket lane that emitted this event. This field is present
      when the originating `response.create` event supplied a
      `stream_id`.

  - `BetaResponseTextWsDelta extends BetaResponseTextDeltaEvent`

    Emitted when there is an additional text delta.

    - `stream_id?: string`

      The WebSocket lane that emitted this event. This field is present
      when the originating `response.create` event supplied a
      `stream_id`.

  - `BetaResponseTextWsDone extends BetaResponseTextDoneEvent`

    Emitted when text content is finalized.

    - `stream_id?: string`

      The WebSocket lane that emitted this event. This field is present
      when the originating `response.create` event supplied a
      `stream_id`.

  - `BetaResponseWebSearchCallWsCompleted extends BetaResponseWebSearchCallCompletedEvent`

    Emitted when a web search call is completed.

    - `stream_id?: string`

      The WebSocket lane that emitted this event. This field is present
      when the originating `response.create` event supplied a
      `stream_id`.

  - `BetaResponseWebSearchCallInWsProgress extends BetaResponseWebSearchCallInProgressEvent`

    Emitted when a web search call is initiated.

    - `stream_id?: string`

      The WebSocket lane that emitted this event. This field is present
      when the originating `response.create` event supplied a
      `stream_id`.

  - `BetaResponseWebSearchCallWsSearching extends BetaResponseWebSearchCallSearchingEvent`

    Emitted when a web search call is executing.

    - `stream_id?: string`

      The WebSocket lane that emitted this event. This field is present
      when the originating `response.create` event supplied a
      `stream_id`.

  - `BetaResponseImageGenCallWsCompleted extends BetaResponseImageGenCallCompletedEvent`

    Emitted when an image generation tool call has completed and the final image is available.

    - `stream_id?: string`

      The WebSocket lane that emitted this event. This field is present
      when the originating `response.create` event supplied a
      `stream_id`.

  - `BetaResponseImageGenCallWsGenerating extends BetaResponseImageGenCallGeneratingEvent`

    Emitted when an image generation tool call is actively generating an image (intermediate state).

    - `stream_id?: string`

      The WebSocket lane that emitted this event. This field is present
      when the originating `response.create` event supplied a
      `stream_id`.

  - `BetaResponseImageGenCallInWsProgress extends BetaResponseImageGenCallInProgressEvent`

    Emitted when an image generation tool call is in progress.

    - `stream_id?: string`

      The WebSocket lane that emitted this event. This field is present
      when the originating `response.create` event supplied a
      `stream_id`.

  - `BetaResponseImageGenCallPartialWsImage extends BetaResponseImageGenCallPartialImageEvent`

    Emitted when a partial image is available during image generation streaming.

    - `stream_id?: string`

      The WebSocket lane that emitted this event. This field is present
      when the originating `response.create` event supplied a
      `stream_id`.

  - `BetaResponseMcpCallArgumentsWsDelta extends BetaResponseMcpCallArgumentsDeltaEvent`

    Emitted when there is a delta (partial update) to the arguments of an MCP tool call.

    - `stream_id?: string`

      The WebSocket lane that emitted this event. This field is present
      when the originating `response.create` event supplied a
      `stream_id`.

  - `BetaResponseMcpCallArgumentsWsDone extends BetaResponseMcpCallArgumentsDoneEvent`

    Emitted when the arguments for an MCP tool call are finalized.

    - `stream_id?: string`

      The WebSocket lane that emitted this event. This field is present
      when the originating `response.create` event supplied a
      `stream_id`.

  - `BetaResponseMcpCallWsCompleted extends BetaResponseMcpCallCompletedEvent`

    Emitted when an MCP  tool call has completed successfully.

    - `stream_id?: string`

      The WebSocket lane that emitted this event. This field is present
      when the originating `response.create` event supplied a
      `stream_id`.

  - `BetaResponseMcpCallWsFailed extends BetaResponseMcpCallFailedEvent`

    Emitted when an MCP  tool call has failed.

    - `stream_id?: string`

      The WebSocket lane that emitted this event. This field is present
      when the originating `response.create` event supplied a
      `stream_id`.

  - `BetaResponseMcpCallInWsProgress extends BetaResponseMcpCallInProgressEvent`

    Emitted when an MCP  tool call is in progress.

    - `stream_id?: string`

      The WebSocket lane that emitted this event. This field is present
      when the originating `response.create` event supplied a
      `stream_id`.

  - `BetaResponseMcpListToolsWsCompleted extends BetaResponseMcpListToolsCompletedEvent`

    Emitted when the list of available MCP tools has been successfully retrieved.

    - `stream_id?: string`

      The WebSocket lane that emitted this event. This field is present
      when the originating `response.create` event supplied a
      `stream_id`.

  - `BetaResponseMcpListToolsWsFailed extends BetaResponseMcpListToolsFailedEvent`

    Emitted when the attempt to list available MCP tools has failed.

    - `stream_id?: string`

      The WebSocket lane that emitted this event. This field is present
      when the originating `response.create` event supplied a
      `stream_id`.

  - `BetaResponseMcpListToolsInWsProgress extends BetaResponseMcpListToolsInProgressEvent`

    Emitted when the system is in the process of retrieving the list of available MCP tools.

    - `stream_id?: string`

      The WebSocket lane that emitted this event. This field is present
      when the originating `response.create` event supplied a
      `stream_id`.

  - `BetaResponseOutputTextAnnotationWsAdded extends BetaResponseOutputTextAnnotationAddedEvent`

    Emitted when an annotation is added to output text content.

    - `stream_id?: string`

      The WebSocket lane that emitted this event. This field is present
      when the originating `response.create` event supplied a
      `stream_id`.

  - `BetaResponseWsQueued extends BetaResponseQueuedEvent`

    Emitted when a response is queued and waiting to be processed.

    - `stream_id?: string`

      The WebSocket lane that emitted this event. This field is present
      when the originating `response.create` event supplied a
      `stream_id`.

  - `BetaResponseCustomToolCallInputWsDelta extends BetaResponseCustomToolCallInputDeltaEvent`

    Event representing a delta (partial update) to the input of a custom tool call.

    - `stream_id?: string`

      The WebSocket lane that emitted this event. This field is present
      when the originating `response.create` event supplied a
      `stream_id`.

  - `BetaResponseCustomToolCallInputWsDone extends BetaResponseCustomToolCallInputDoneEvent`

    Event indicating that input for a custom tool call is complete.

    - `stream_id?: string`

      The WebSocket lane that emitted this event. This field is present
      when the originating `response.create` event supplied a
      `stream_id`.

  - `BetaResponseWsError`

    Emitted when an error occurs while processing a Responses WebSocket request.

    - `error: Error`

      Details about the error.

      - `code: string | null`

        The error code that was emitted, if any.

      - `message: string`

        The human-readable error message that was emitted.

      - `param: string | null`

        The parameter name that was associated with the error, if any.

      - `type: string`

        The error type that was emitted.

      - `headers?: Record<string, string>`

        The response headers that were emitted with the error, if any.

    - `type: "error"`

      The type of the event. Always `error`.

      - `"error"`

    - `agent?: Agent | null`

      The agent that owns this multi-agent streaming event.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

    - `sequence_number?: number`

      The sequence number of an error emitted by the response stream.

    - `status?: number`

      The HTTP status code associated with a WebSocket protocol error.

    - `stream_id?: string`

      The WebSocket lane that emitted this event. This field is present when the
      originating `response.create` event supplied a `stream_id`.

  - `BetaResponseInjectCreatedEvent`

    Emitted when all injected input items were validated and committed to the
    active response.

    - `response_id: string`

      The ID of the response that accepted the input.

    - `sequence_number: number`

      The sequence number for this event.

    - `type: "response.inject.created"`

      The event discriminator. Always `response.inject.created`.

      - `"response.inject.created"`

    - `stream_id?: string`

      The multiplexed WebSocket stream that emitted the event. This field is
      present only when WebSocket multiplexing is enabled separately.

  - `BetaResponseInjectFailedEvent`

    Emitted when injected input could not be committed to a response. The event
    returns the uncommitted raw input so the client can retry it in another
    response when appropriate.

    - `error: Error`

      Information about why the input was not committed.

      - `code: "response_already_completed" | "response_not_found"`

        A machine-readable error code.

        - `"response_already_completed"`

        - `"response_not_found"`

      - `message: string`

        A human-readable description of the error.

    - `input: Array<BetaResponseInputItem>`

      The raw input items that were not committed.

      - `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.

        - `content: string | BetaResponseInputMessageContentList`

          Text, image, or audio input to the model, used to generate a response.
          Can also contain previous assistant responses.

          - `string`

          - `BetaResponseInputMessageContentList = Array<BetaResponseInputContent>`

            A list of one or many input items to the model, containing different content
            types.

            - `BetaResponseInputText`

              A text input to the model.

              - `text: string`

                The text input to the model.

              - `type: "input_text"`

                The type of the input item. Always `input_text`.

                - `"input_text"`

              - `prompt_cache_breakpoint?: PromptCacheBreakpoint`

                Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.

                - `mode: "explicit"`

                  The breakpoint mode. Always `explicit`.

                  - `"explicit"`

            - `BetaResponseInputImage`

              An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision).

              - `detail: BetaImageDetail`

                The detail level of the image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`.

                - `"low"`

                - `"high"`

                - `"auto"`

                - `"original"`

              - `type: "input_image"`

                The type of the input item. Always `input_image`.

                - `"input_image"`

              - `file_id?: string | null`

                The ID of the file to be sent to the model.

              - `image_url?: string | null`

                The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.

              - `prompt_cache_breakpoint?: PromptCacheBreakpoint`

                Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.

                - `mode: "explicit"`

                  The breakpoint mode. Always `explicit`.

                  - `"explicit"`

            - `BetaResponseInputFile`

              A file input to the model.

              - `type: "input_file"`

                The type of the input item. Always `input_file`.

                - `"input_file"`

              - `detail?: "auto" | "low" | "high"`

                The detail level of the file to be sent to the model. Use `auto` to let the system select the detail level; for GPT-5.6 and later models, `auto` uses high-quality rendering, which may increase input token usage. Use `low` for lower-cost rendering, or `high` to render the file at higher quality. Defaults to `auto`.

                - `"auto"`

                - `"low"`

                - `"high"`

              - `file_data?: string`

                The content of the file to be sent to the model.

              - `file_id?: string | null`

                The ID of the file to be sent to the model.

              - `file_url?: string`

                The URL of the file to be sent to the model.

              - `filename?: string`

                The name of the file to be sent to the model.

              - `prompt_cache_breakpoint?: PromptCacheBreakpoint`

                Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.

                - `mode: "explicit"`

                  The breakpoint mode. Always `explicit`.

                  - `"explicit"`

        - `role: "user" | "assistant" | "system" | "developer"`

          The role of the message input. One of `user`, `assistant`, `system`, or
          `developer`.

          - `"user"`

          - `"assistant"`

          - `"system"`

          - `"developer"`

        - `phase?: "commentary" | "final_answer" | null`

          Labels an `assistant` message as intermediate commentary (`commentary`) or the final answer (`final_answer`).
          For models like `gpt-5.3-codex` and beyond, when sending follow-up requests, preserve and resend
          phase on all assistant messages — dropping it can degrade performance. Not used for user messages.

          - `"commentary"`

          - `"final_answer"`

        - `type?: "message"`

          The type of the message input. Always `message`.

          - `"message"`

      - `Message`

        A message input to the model with a role indicating instruction following
        hierarchy. Instructions given with the `developer` or `system` role take
        precedence over instructions given with the `user` role.

        - `content: BetaResponseInputMessageContentList`

          A list of one or many input items to the model, containing different content
          types.

        - `role: "user" | "system" | "developer"`

          The role of the message input. One of `user`, `system`, or `developer`.

          - `"user"`

          - `"system"`

          - `"developer"`

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `status?: "in_progress" | "completed" | "incomplete"`

          The status of item. One of `in_progress`, `completed`, or
          `incomplete`. Populated when items are returned via API.

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

        - `type?: "message"`

          The type of the message input. Always set to `message`.

          - `"message"`

      - `BetaResponseOutputMessage`

        An output message from the model.

        - `id: string`

          The unique ID of the output message.

        - `content: Array<BetaResponseOutputText | BetaResponseOutputRefusal>`

          The content of the output message.

          - `BetaResponseOutputText`

            A text output from the model.

            - `annotations: Array<FileCitation | URLCitation | ContainerFileCitation | FilePath>`

              The annotations of the text output.

              - `FileCitation`

                A citation to a file.

                - `file_id: string`

                  The ID of the file.

                - `filename: string`

                  The filename of the file cited.

                - `index: number`

                  The index of the file in the list of files.

                - `type: "file_citation"`

                  The type of the file citation. Always `file_citation`.

                  - `"file_citation"`

              - `URLCitation`

                A citation for a web resource used to generate a model response.

                - `end_index: number`

                  The index of the last character of the URL citation in the message.

                - `start_index: number`

                  The index of the first character of the URL citation in the message.

                - `title: string`

                  The title of the web resource.

                - `type: "url_citation"`

                  The type of the URL citation. Always `url_citation`.

                  - `"url_citation"`

                - `url: string`

                  The URL of the web resource.

              - `ContainerFileCitation`

                A citation for a container file used to generate a model response.

                - `container_id: string`

                  The ID of the container file.

                - `end_index: number`

                  The index of the last character of the container file citation in the message.

                - `file_id: string`

                  The ID of the file.

                - `filename: string`

                  The filename of the container file cited.

                - `start_index: number`

                  The index of the first character of the container file citation in the message.

                - `type: "container_file_citation"`

                  The type of the container file citation. Always `container_file_citation`.

                  - `"container_file_citation"`

              - `FilePath`

                A path to a file.

                - `file_id: string`

                  The ID of the file.

                - `index: number`

                  The index of the file in the list of files.

                - `type: "file_path"`

                  The type of the file path. Always `file_path`.

                  - `"file_path"`

            - `text: string`

              The text output from the model.

            - `type: "output_text"`

              The type of the output text. Always `output_text`.

              - `"output_text"`

            - `logprobs?: Array<Logprob>`

              - `token: string`

              - `bytes: Array<number>`

              - `logprob: number`

              - `top_logprobs: Array<TopLogprob>`

                - `token: string`

                - `bytes: Array<number>`

                - `logprob: number`

          - `BetaResponseOutputRefusal`

            A refusal from the model.

            - `refusal: string`

              The refusal explanation from the model.

            - `type: "refusal"`

              The type of the refusal. Always `refusal`.

              - `"refusal"`

        - `role: "assistant"`

          The role of the output message. Always `assistant`.

          - `"assistant"`

        - `status: "in_progress" | "completed" | "incomplete"`

          The status of the message input. One of `in_progress`, `completed`, or
          `incomplete`. Populated when input items are returned via API.

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

        - `type: "message"`

          The type of the output message. Always `message`.

          - `"message"`

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `phase?: "commentary" | "final_answer" | null`

          Labels an `assistant` message as intermediate commentary (`commentary`) or the final answer (`final_answer`).
          For models like `gpt-5.3-codex` and beyond, when sending follow-up requests, preserve and resend
          phase on all assistant messages — dropping it can degrade performance. Not used for user messages.

          - `"commentary"`

          - `"final_answer"`

      - `BetaResponseFileSearchToolCall`

        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.

        - `id: string`

          The unique ID of the file search tool call.

        - `queries: Array<string>`

          The queries used to search for files.

        - `status: "in_progress" | "searching" | "completed" | 2 more`

          The status of the file search tool call. One of `in_progress`,
          `searching`, `incomplete` or `failed`,

          - `"in_progress"`

          - `"searching"`

          - `"completed"`

          - `"incomplete"`

          - `"failed"`

        - `type: "file_search_call"`

          The type of the file search tool call. Always `file_search_call`.

          - `"file_search_call"`

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `results?: Array<Result> | null`

          The results of the file search tool call.

          - `attributes?: Record<string, string | number | boolean> | null`

            Set of 16 key-value pairs that can be attached to an object. This can be
            useful for storing additional information about the object in a structured
            format, and querying for objects via API or the dashboard. Keys are strings
            with a maximum length of 64 characters. Values are strings with a maximum
            length of 512 characters, booleans, or numbers.

            - `string`

            - `number`

            - `boolean`

          - `file_id?: string`

            The unique ID of the file.

          - `filename?: string`

            The name of the file.

          - `score?: number`

            The relevance score of the file - a value between 0 and 1.

          - `text?: string`

            The text that was retrieved from the file.

      - `BetaResponseComputerToolCall`

        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.

        - `id: string`

          The unique ID of the computer call.

        - `call_id: string`

          An identifier used when responding to the tool call with output.

        - `pending_safety_checks: Array<PendingSafetyCheck>`

          The pending safety checks for the computer call.

          - `id: string`

            The ID of the pending safety check.

          - `code?: string | null`

            The type of the pending safety check.

          - `message?: string | null`

            Details about the pending safety check.

        - `status: "in_progress" | "completed" | "incomplete"`

          The status of the item. One of `in_progress`, `completed`, or
          `incomplete`. Populated when items are returned via API.

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

        - `type: "computer_call"`

          The type of the computer call. Always `computer_call`.

          - `"computer_call"`

        - `action?: BetaComputerAction`

          A click action.

          - `Click`

            A click action.

            - `button: "left" | "right" | "wheel" | 2 more`

              Indicates which mouse button was pressed during the click. One of `left`, `right`, `wheel`, `back`, or `forward`.

              - `"left"`

              - `"right"`

              - `"wheel"`

              - `"back"`

              - `"forward"`

            - `type: "click"`

              Specifies the event type. For a click action, this property is always `click`.

              - `"click"`

            - `x: number`

              The x-coordinate where the click occurred.

            - `y: number`

              The y-coordinate where the click occurred.

            - `keys?: Array<string> | null`

              The keys being held while clicking.

          - `DoubleClick`

            A double click action.

            - `keys: Array<string> | null`

              The keys being held while double-clicking.

            - `type: "double_click"`

              Specifies the event type. For a double click action, this property is always set to `double_click`.

              - `"double_click"`

            - `x: number`

              The x-coordinate where the double click occurred.

            - `y: number`

              The y-coordinate where the double click occurred.

          - `Drag`

            A drag action.

            - `path: Array<Path>`

              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 }
              ]
              ```

              - `x: number`

                The x-coordinate.

              - `y: number`

                The y-coordinate.

            - `type: "drag"`

              Specifies the event type. For a drag action, this property is always set to `drag`.

              - `"drag"`

            - `keys?: Array<string> | null`

              The keys being held while dragging the mouse.

          - `Keypress`

            A collection of keypresses the model would like to perform.

            - `keys: Array<string>`

              The combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key.

            - `type: "keypress"`

              Specifies the event type. For a keypress action, this property is always set to `keypress`.

              - `"keypress"`

          - `Move`

            A mouse move action.

            - `type: "move"`

              Specifies the event type. For a move action, this property is always set to `move`.

              - `"move"`

            - `x: number`

              The x-coordinate to move to.

            - `y: number`

              The y-coordinate to move to.

            - `keys?: Array<string> | null`

              The keys being held while moving the mouse.

          - `Screenshot`

            A screenshot action.

            - `type: "screenshot"`

              Specifies the event type. For a screenshot action, this property is always set to `screenshot`.

              - `"screenshot"`

          - `Scroll`

            A scroll action.

            - `scroll_x: number`

              The horizontal scroll distance.

            - `scroll_y: number`

              The vertical scroll distance.

            - `type: "scroll"`

              Specifies the event type. For a scroll action, this property is always set to `scroll`.

              - `"scroll"`

            - `x: number`

              The x-coordinate where the scroll occurred.

            - `y: number`

              The y-coordinate where the scroll occurred.

            - `keys?: Array<string> | null`

              The keys being held while scrolling.

          - `Type`

            An action to type in text.

            - `text: string`

              The text to type.

            - `type: "type"`

              Specifies the event type. For a type action, this property is always set to `type`.

              - `"type"`

          - `Wait`

            A wait action.

            - `type: "wait"`

              Specifies the event type. For a wait action, this property is always set to `wait`.

              - `"wait"`

        - `actions?: BetaComputerActionList`

          Flattened batched actions for `computer_use`. Each action includes an
          `type` discriminator and action-specific fields.

          - `Click`

            A click action.

          - `DoubleClick`

            A double click action.

          - `Drag`

            A drag action.

          - `Keypress`

            A collection of keypresses the model would like to perform.

          - `Move`

            A mouse move action.

          - `Screenshot`

            A screenshot action.

          - `Scroll`

            A scroll action.

          - `Type`

            An action to type in text.

          - `Wait`

            A wait action.

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

      - `ComputerCallOutput`

        The output of a computer tool call.

        - `call_id: string`

          The ID of the computer tool call that produced the output.

        - `output: BetaResponseComputerToolCallOutputScreenshot`

          A computer screenshot image used with the computer use tool.

          - `type: "computer_screenshot"`

            Specifies the event type. For a computer screenshot, this property is
            always set to `computer_screenshot`.

            - `"computer_screenshot"`

          - `file_id?: string`

            The identifier of an uploaded file that contains the screenshot.

          - `image_url?: string`

            The URL of the screenshot image.

        - `type: "computer_call_output"`

          The type of the computer tool call output. Always `computer_call_output`.

          - `"computer_call_output"`

        - `id?: string | null`

          The ID of the computer tool call output.

        - `acknowledged_safety_checks?: Array<AcknowledgedSafetyCheck> | null`

          The safety checks reported by the API that have been acknowledged by the developer.

          - `id: string`

            The ID of the pending safety check.

          - `code?: string | null`

            The type of the pending safety check.

          - `message?: string | null`

            Details about the pending safety check.

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `status?: "in_progress" | "completed" | "incomplete" | null`

          The status of the message input. One of `in_progress`, `completed`, or `incomplete`. Populated when input items are returned via API.

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

      - `BetaResponseFunctionWebSearch`

        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.

        - `id: string`

          The unique ID of the web search tool call.

        - `action: Search | OpenPage | FindInPage`

          An object describing the specific action taken in this web search call.
          Includes details on how the model used the web (search, open_page, find_in_page).

          - `Search`

            Action type "search" - Performs a web search query.

            - `type: "search"`

              The action type.

              - `"search"`

            - `queries?: Array<string>`

              The search queries.

            - `query?: string`

              The search query.

            - `sources?: Array<Source>`

              The sources used in the search.

              - `type: "url"`

                The type of source. Always `url`.

                - `"url"`

              - `url: string`

                The URL of the source.

          - `OpenPage`

            Action type "open_page" - Opens a specific URL from search results.

            - `type: "open_page"`

              The action type.

              - `"open_page"`

            - `url?: string | null`

              The URL opened by the model.

          - `FindInPage`

            Action type "find_in_page": Searches for a pattern within a loaded page.

            - `pattern: string`

              The pattern or text to search for within the page.

            - `type: "find_in_page"`

              The action type.

              - `"find_in_page"`

            - `url: string`

              The URL of the page searched for the pattern.

        - `status: "in_progress" | "searching" | "completed" | "failed"`

          The status of the web search tool call.

          - `"in_progress"`

          - `"searching"`

          - `"completed"`

          - `"failed"`

        - `type: "web_search_call"`

          The type of the web search tool call. Always `web_search_call`.

          - `"web_search_call"`

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

      - `BetaResponseFunctionToolCall`

        A tool call to run a function. See the
        [function calling guide](https://platform.openai.com/docs/guides/function-calling) for more information.

        - `arguments: string`

          A JSON string of the arguments to pass to the function.

        - `call_id: string`

          The unique ID of the function tool call generated by the model.

        - `name: string`

          The name of the function to run.

        - `type: "function_call"`

          The type of the function tool call. Always `function_call`.

          - `"function_call"`

        - `id?: string`

          The unique ID of the function tool call.

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `caller?: Direct | Program | null`

          The execution context that produced this tool call.

          - `Direct`

            - `type: "direct"`

              - `"direct"`

          - `Program`

            - `caller_id: string`

              The call ID of the program item that produced this tool call.

            - `type: "program"`

              - `"program"`

        - `namespace?: string`

          The namespace of the function to run.

        - `status?: "in_progress" | "completed" | "incomplete"`

          The status of the item. One of `in_progress`, `completed`, or
          `incomplete`. Populated when items are returned via API.

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

      - `FunctionCallOutput`

        The output of a function tool call.

        - `call_id: string`

          The unique ID of the function tool call generated by the model.

        - `output: string | BetaResponseFunctionCallOutputItemList`

          Text, image, or file output of the function tool call.

          - `string`

          - `BetaResponseFunctionCallOutputItemList = Array<BetaResponseFunctionCallOutputItem>`

            An array of content outputs (text, image, file) for the function tool call.

            - `BetaResponseInputTextContent`

              A text input to the model.

              - `text: string`

                The text input to the model.

              - `type: "input_text"`

                The type of the input item. Always `input_text`.

                - `"input_text"`

              - `prompt_cache_breakpoint?: PromptCacheBreakpoint | null`

                Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.

                - `mode: "explicit"`

                  The breakpoint mode. Always `explicit`.

                  - `"explicit"`

            - `BetaResponseInputImageContent`

              An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision)

              - `type: "input_image"`

                The type of the input item. Always `input_image`.

                - `"input_image"`

              - `detail?: BetaImageDetail | null`

                The detail level of the image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`.

              - `file_id?: string | null`

                The ID of the file to be sent to the model.

              - `image_url?: string | null`

                The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.

              - `prompt_cache_breakpoint?: PromptCacheBreakpoint | null`

                Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.

                - `mode: "explicit"`

                  The breakpoint mode. Always `explicit`.

                  - `"explicit"`

            - `BetaResponseInputFileContent`

              A file input to the model.

              - `type: "input_file"`

                The type of the input item. Always `input_file`.

                - `"input_file"`

              - `detail?: "auto" | "low" | "high"`

                The detail level of the file to be sent to the model. Use `auto` to let the system select the detail level; for GPT-5.6 and later models, `auto` uses high-quality rendering, which may increase input token usage. Use `low` for lower-cost rendering, or `high` to render the file at higher quality. Defaults to `auto`.

                - `"auto"`

                - `"low"`

                - `"high"`

              - `file_data?: string | null`

                The base64-encoded data of the file to be sent to the model.

              - `file_id?: string | null`

                The ID of the file to be sent to the model.

              - `file_url?: string | null`

                The URL of the file to be sent to the model.

              - `filename?: string | null`

                The name of the file to be sent to the model.

              - `prompt_cache_breakpoint?: PromptCacheBreakpoint | null`

                Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.

                - `mode: "explicit"`

                  The breakpoint mode. Always `explicit`.

                  - `"explicit"`

        - `type: "function_call_output"`

          The type of the function tool call output. Always `function_call_output`.

          - `"function_call_output"`

        - `id?: string | null`

          The unique ID of the function tool call output. Populated when this item is returned via API.

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `caller?: Direct | Program | null`

          The execution context that produced this tool call.

          - `Direct`

            - `type: "direct"`

              The caller type. Always `direct`.

              - `"direct"`

          - `Program`

            - `caller_id: string`

              The call ID of the program item that produced this tool call.

            - `type: "program"`

              The caller type. Always `program`.

              - `"program"`

        - `name?: string | null`

          The name of the tool that produced the output.

        - `namespace?: string | null`

          The namespace of the tool that produced the output.

        - `status?: "in_progress" | "completed" | "incomplete" | null`

          The status of the item. One of `in_progress`, `completed`, or `incomplete`. Populated when items are returned via API.

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

      - `AgentMessage`

        A message routed between agents.

        - `author: string`

          The sending agent identity.

        - `content: Array<BetaResponseInputTextContent | BetaResponseInputImageContent | EncryptedContent>`

          Plaintext, image, or encrypted content sent between agents.

          - `BetaResponseInputTextContent`

            A text input to the model.

          - `BetaResponseInputImageContent`

            An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision)

          - `EncryptedContent`

            Opaque encrypted content that Responses API decrypts inside trusted model execution.

            - `encrypted_content: string`

              Opaque encrypted content.

            - `type: "encrypted_content"`

              The type of the input item. Always `encrypted_content`.

              - `"encrypted_content"`

        - `recipient: string`

          The destination agent identity.

        - `type: "agent_message"`

          The item type. Always `agent_message`.

          - `"agent_message"`

        - `id?: string | null`

          The unique ID of this agent message item.

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

      - `MultiAgentCall`

        - `action: "spawn_agent" | "interrupt_agent" | "list_agents" | 3 more`

          The multi-agent action that was executed.

          - `"spawn_agent"`

          - `"interrupt_agent"`

          - `"list_agents"`

          - `"send_message"`

          - `"followup_task"`

          - `"wait_agent"`

        - `arguments: string`

          The action arguments as a JSON string.

        - `call_id: string`

          The unique ID linking this call to its output.

        - `type: "multi_agent_call"`

          The item type. Always `multi_agent_call`.

          - `"multi_agent_call"`

        - `id?: string | null`

          The unique ID of this multi-agent call.

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

      - `MultiAgentCallOutput`

        - `action: "spawn_agent" | "interrupt_agent" | "list_agents" | 3 more`

          The multi-agent action that produced this result.

          - `"spawn_agent"`

          - `"interrupt_agent"`

          - `"list_agents"`

          - `"send_message"`

          - `"followup_task"`

          - `"wait_agent"`

        - `call_id: string`

          The unique ID of the multi-agent call.

        - `output: Array<Output>`

          Text output returned by the multi-agent action.

          - `text: string`

            The text content.

          - `type: "output_text"`

            The content type. Always `output_text`.

            - `"output_text"`

          - `annotations?: Array<FileCitation | URLCitation | ContainerFileCitation>`

            Citations associated with the text content.

            - `FileCitation`

              - `file_id: string`

                The ID of the file.

              - `filename: string`

                The filename of the file cited.

              - `index: number`

                The index of the file in the list of files.

              - `type: "file_citation"`

                The citation type. Always `file_citation`.

                - `"file_citation"`

            - `URLCitation`

              - `end_index: number`

                The index of the last character of the citation in the message.

              - `start_index: number`

                The index of the first character of the citation in the message.

              - `title: string`

                The title of the cited resource.

              - `type: "url_citation"`

                The citation type. Always `url_citation`.

                - `"url_citation"`

              - `url: string`

                The URL of the cited resource.

            - `ContainerFileCitation`

              - `container_id: string`

                The ID of the container.

              - `end_index: number`

                The index of the last character of the citation in the message.

              - `file_id: string`

                The ID of the container file.

              - `filename: string`

                The filename of the container file cited.

              - `start_index: number`

                The index of the first character of the citation in the message.

              - `type: "container_file_citation"`

                The citation type. Always `container_file_citation`.

                - `"container_file_citation"`

        - `type: "multi_agent_call_output"`

          The item type. Always `multi_agent_call_output`.

          - `"multi_agent_call_output"`

        - `id?: string | null`

          The unique ID of this multi-agent call output.

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

      - `ToolSearchCall`

        - `arguments: unknown`

          The arguments supplied to the tool search call.

        - `type: "tool_search_call"`

          The item type. Always `tool_search_call`.

          - `"tool_search_call"`

        - `id?: string | null`

          The unique ID of this tool search call.

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `call_id?: string | null`

          The unique ID of the tool search call generated by the model.

        - `execution?: "server" | "client"`

          Whether tool search was executed by the server or by the client.

          - `"server"`

          - `"client"`

        - `status?: "in_progress" | "completed" | "incomplete" | null`

          The status of the tool search call.

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

      - `BetaResponseToolSearchOutputItemParam`

        - `tools: Array<BetaTool>`

          The loaded tool definitions returned by the tool search output.

          - `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).

            - `name: string`

              The name of the function to call.

            - `parameters: Record<string, unknown> | null`

              A JSON schema object describing the parameters of the function.

            - `strict: boolean | null`

              Whether strict parameter validation is enforced for this function tool.

            - `type: "function"`

              The type of the function tool. Always `function`.

              - `"function"`

            - `allowed_callers?: Array<"direct" | "programmatic"> | null`

              The tool invocation context(s).

              - `"direct"`

              - `"programmatic"`

            - `defer_loading?: boolean`

              Whether this function is deferred and loaded via tool search.

            - `description?: string | null`

              A description of the function. Used by the model to determine whether or not to call the function.

            - `output_schema?: Record<string, unknown> | null`

              A JSON schema object describing the JSON value encoded in string outputs for this function.

          - `BetaFileSearchTool`

            A tool that searches for relevant content from uploaded files. Learn more about the [file search tool](https://platform.openai.com/docs/guides/tools-file-search).

            - `type: "file_search"`

              The type of the file search tool. Always `file_search`.

              - `"file_search"`

            - `vector_store_ids: Array<string>`

              The IDs of the vector stores to search.

            - `filters?: ComparisonFilter | CompoundFilter | null`

              A filter to apply.

              - `ComparisonFilter`

                A filter used to compare a specified attribute key to a given value using a defined comparison operation.

                - `key: string`

                  The key to compare against the value.

                - `type: "eq" | "ne" | "gt" | 5 more`

                  Specifies the comparison operator: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`, `in`, `nin`.

                  - `eq`: equals
                  - `ne`: not equal
                  - `gt`: greater than
                  - `gte`: greater than or equal
                  - `lt`: less than
                  - `lte`: less than or equal
                  - `in`: in
                  - `nin`: not in

                  - `"eq"`

                  - `"ne"`

                  - `"gt"`

                  - `"gte"`

                  - `"lt"`

                  - `"lte"`

                  - `"in"`

                  - `"nin"`

                - `value: string | number | boolean | Array<string | number>`

                  The value to compare against the attribute key; supports string, number, or boolean types.

                  - `string`

                  - `number`

                  - `boolean`

                  - `Array<string | number>`

                    - `string`

                    - `number`

              - `CompoundFilter`

                Combine multiple filters using `and` or `or`.

                - `filters: Array<ComparisonFilter | unknown>`

                  Array of filters to combine. Items can be `ComparisonFilter` or `CompoundFilter`.

                  - `ComparisonFilter`

                    A filter used to compare a specified attribute key to a given value using a defined comparison operation.

                    - `key: string`

                      The key to compare against the value.

                    - `type: "eq" | "ne" | "gt" | 5 more`

                      Specifies the comparison operator: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`, `in`, `nin`.

                      - `eq`: equals
                      - `ne`: not equal
                      - `gt`: greater than
                      - `gte`: greater than or equal
                      - `lt`: less than
                      - `lte`: less than or equal
                      - `in`: in
                      - `nin`: not in

                      - `"eq"`

                      - `"ne"`

                      - `"gt"`

                      - `"gte"`

                      - `"lt"`

                      - `"lte"`

                      - `"in"`

                      - `"nin"`

                    - `value: string | number | boolean | Array<string | number>`

                      The value to compare against the attribute key; supports string, number, or boolean types.

                      - `string`

                      - `number`

                      - `boolean`

                      - `Array<string | number>`

                        - `string`

                        - `number`

                  - `unknown`

                - `type: "and" | "or"`

                  Type of operation: `and` or `or`.

                  - `"and"`

                  - `"or"`

            - `max_num_results?: number`

              The maximum number of results to return. This number should be between 1 and 50 inclusive.

            - `ranking_options?: RankingOptions`

              Ranking options for search.

              - `hybrid_search?: HybridSearch`

                Weights that control how reciprocal rank fusion balances semantic embedding matches versus sparse keyword matches when hybrid search is enabled.

                - `embedding_weight: number`

                  The weight of the embedding in the reciprocal ranking fusion.

                - `text_weight: number`

                  The weight of the text in the reciprocal ranking fusion.

              - `ranker?: "auto" | "default-2024-11-15"`

                The ranker to use for the file search.

                - `"auto"`

                - `"default-2024-11-15"`

              - `score_threshold?: number`

                The score threshold for the file search, a number between 0 and 1. Numbers closer to 1 will attempt to return only the most relevant results, but may return fewer results.

          - `BetaComputerTool`

            A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use).

            - `type: "computer"`

              The type of the computer tool. Always `computer`.

              - `"computer"`

          - `BetaComputerUsePreviewTool`

            A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use).

            - `display_height: number`

              The height of the computer display.

            - `display_width: number`

              The width of the computer display.

            - `environment: "windows" | "mac" | "linux" | 2 more`

              The type of computer environment to control.

              - `"windows"`

              - `"mac"`

              - `"linux"`

              - `"ubuntu"`

              - `"browser"`

            - `type: "computer_use_preview"`

              The type of the computer use tool. Always `computer_use_preview`.

              - `"computer_use_preview"`

          - `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"`

              The type of the web search tool. One of `web_search` or `web_search_2025_08_26`.

              - `"web_search"`

              - `"web_search_2025_08_26"`

            - `external_web_access?: boolean`

              Allow live internet access for web search. Defaults to true when omitted. When false, the web search tool runs in offline/cache-only mode and will not fetch new external content.

            - `filters?: Filters | null`

              Filters for the search.

              - `allowed_domains?: Array<string> | null`

                Allowed domains for the search. If not provided, all domains are allowed.
                Subdomains of the provided domains are allowed as well.

                Example: `["pubmed.ncbi.nlm.nih.gov"]`

            - `search_context_size?: "low" | "medium" | "high"`

              High level guidance for the amount of context window space to use for the search. One of `low`, `medium`, or `high`. `medium` is the default.

              - `"low"`

              - `"medium"`

              - `"high"`

            - `user_location?: UserLocation | null`

              The approximate location of the user.

              - `city?: string | null`

                Free text input for the city of the user, e.g. `San Francisco`.

              - `country?: string | null`

                The two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of the user, e.g. `US`.

              - `region?: string | null`

                Free text input for the region of the user, e.g. `California`.

              - `timezone?: string | null`

                The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of the user, e.g. `America/Los_Angeles`.

              - `type?: "approximate"`

                The type of location approximation. Always `approximate`.

                - `"approximate"`

          - `Mcp`

            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).

            - `server_label: string`

              A label for this MCP server, used to identify it in tool calls.

            - `type: "mcp"`

              The type of the MCP tool. Always `mcp`.

              - `"mcp"`

            - `allowed_callers?: Array<"direct" | "programmatic"> | null`

              The tool invocation context(s).

              - `"direct"`

              - `"programmatic"`

            - `allowed_tools?: Array<string> | McpToolFilter | null`

              List of allowed tool names or a filter object.

              - `Array<string>`

              - `McpToolFilter`

                A filter object to specify which tools are allowed.

                - `read_only?: boolean`

                  Indicates whether or not a tool modifies data or is read-only. If an
                  MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint),
                  it will match this filter.

                - `tool_names?: Array<string>`

                  List of allowed tool names.

            - `authorization?: string`

              An OAuth access token that can be used with a remote MCP server, either
              with a custom MCP server URL or a service connector. Your application
              must handle the OAuth authorization flow and provide the token here.

            - `connector_id?: "connector_dropbox" | "connector_gmail" | "connector_googlecalendar" | 5 more`

              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`

              - `"connector_dropbox"`

              - `"connector_gmail"`

              - `"connector_googlecalendar"`

              - `"connector_googledrive"`

              - `"connector_microsoftteams"`

              - `"connector_outlookcalendar"`

              - `"connector_outlookemail"`

              - `"connector_sharepoint"`

            - `defer_loading?: boolean`

              Whether this MCP tool is deferred and discovered via tool search.

            - `headers?: Record<string, string> | null`

              Optional HTTP headers to send to the MCP server. Use for authentication
              or other purposes.

            - `require_approval?: McpToolApprovalFilter | "always" | "never" | null`

              Specify which of the MCP server's tools require approval.

              - `McpToolApprovalFilter`

                Specify which of the MCP server's tools require approval. Can be
                `always`, `never`, or a filter object associated with tools
                that require approval.

                - `always?: Always`

                  A filter object to specify which tools are allowed.

                  - `read_only?: boolean`

                    Indicates whether or not a tool modifies data or is read-only. If an
                    MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint),
                    it will match this filter.

                  - `tool_names?: Array<string>`

                    List of allowed tool names.

                - `never?: Never`

                  A filter object to specify which tools are allowed.

                  - `read_only?: boolean`

                    Indicates whether or not a tool modifies data or is read-only. If an
                    MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint),
                    it will match this filter.

                  - `tool_names?: Array<string>`

                    List of allowed tool names.

              - `"always" | "never"`

                - `"always"`

                - `"never"`

            - `server_description?: string`

              Optional description of the MCP server, used to provide more context.

            - `server_url?: string`

              The URL for the MCP server. One of `server_url`, `connector_id`, or
              `tunnel_id` must be provided.

            - `tunnel_id?: string`

              The Secure MCP Tunnel ID to use instead of a direct server URL. One of
              `server_url`, `connector_id`, or `tunnel_id` must be provided.

          - `CodeInterpreter`

            A tool that runs Python code to help generate a response to a prompt.

            - `container: string | CodeInterpreterToolAuto`

              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`

              - `CodeInterpreterToolAuto`

                Configuration for a code interpreter container. Optionally specify the IDs of the files to run the code on.

                - `type: "auto"`

                  Always `auto`.

                  - `"auto"`

                - `file_ids?: Array<string>`

                  An optional list of uploaded files to make available to your code.

                - `memory_limit?: "1g" | "4g" | "16g" | "64g" | null`

                  The memory limit for the code interpreter container.

                  - `"1g"`

                  - `"4g"`

                  - `"16g"`

                  - `"64g"`

                - `network_policy?: BetaContainerNetworkPolicyDisabled | BetaContainerNetworkPolicyAllowlist`

                  Network access policy for the container.

                  - `BetaContainerNetworkPolicyDisabled`

                    - `type: "disabled"`

                      Disable outbound network access. Always `disabled`.

                      - `"disabled"`

                  - `BetaContainerNetworkPolicyAllowlist`

                    - `allowed_domains: Array<string>`

                      A list of allowed domains when type is `allowlist`.

                    - `type: "allowlist"`

                      Allow outbound network access only to specified domains. Always `allowlist`.

                      - `"allowlist"`

                    - `domain_secrets?: Array<BetaContainerNetworkPolicyDomainSecret>`

                      Optional domain-scoped secrets for allowlisted domains.

                      - `domain: string`

                        The domain associated with the secret.

                      - `name: string`

                        The name of the secret to inject for the domain.

                      - `value: string`

                        The secret value to inject for the domain.

            - `type: "code_interpreter"`

              The type of the code interpreter tool. Always `code_interpreter`.

              - `"code_interpreter"`

            - `allowed_callers?: Array<"direct" | "programmatic"> | null`

              The tool invocation context(s).

              - `"direct"`

              - `"programmatic"`

          - `ProgrammaticToolCalling`

            - `type: "programmatic_tool_calling"`

              The type of the tool. Always `programmatic_tool_calling`.

              - `"programmatic_tool_calling"`

          - `ImageGeneration`

            A tool that generates images using the GPT image models.

            - `type: "image_generation"`

              The type of the image generation tool. Always `image_generation`.

              - `"image_generation"`

            - `action?: "generate" | "edit" | "auto"`

              Whether to generate a new image or edit an existing image. Default: `auto`.

              - `"generate"`

              - `"edit"`

              - `"auto"`

            - `background?: "transparent" | "opaque" | "auto"`

              Allows to set transparency for the background of the generated image(s).
              Must be one of `transparent`, `opaque`, or `auto` (default value). When
              `auto` is used, the model will automatically determine the best
              background for the image.

              Transparent backgrounds are available for supported GPT Image models.
              For `gpt-image-2` and `gpt-image-2-2026-04-21`, this support is in
              preview. When using `transparent`, set the output format to `png` or
              `webp`.

              - `"transparent"`

              - `"opaque"`

              - `"auto"`

            - `input_fidelity?: "high" | "low" | null`

              Control how much effort the model will exert to match the style and features, especially facial features, of input images. This parameter is only supported for `gpt-image-1` and `gpt-image-1.5` and later models, unsupported for `gpt-image-1-mini`. Supports `high` and `low`. Defaults to `low`.

              - `"high"`

              - `"low"`

            - `input_image_mask?: InputImageMask`

              Optional mask for inpainting. Contains `image_url`
              (string, optional) and `file_id` (string, optional).

              - `file_id?: string`

                File ID for the mask image.

              - `image_url?: string`

                Base64-encoded mask image.

            - `model?: (string & {}) | "gpt-image-1" | "gpt-image-1-mini" | "gpt-image-2" | 3 more`

              The image generation model to use. One of `gpt-image-1`,
              `gpt-image-1-mini`, `gpt-image-1.5`, `gpt-image-2`,
              `gpt-image-2-2026-04-21`, or `chatgpt-image-latest`. Default:
              `gpt-image-1`.

              - `(string & {})`

              - `"gpt-image-1" | "gpt-image-1-mini" | "gpt-image-2" | 3 more`

                - `"gpt-image-1"`

                - `"gpt-image-1-mini"`

                - `"gpt-image-2"`

                - `"gpt-image-2-2026-04-21"`

                - `"gpt-image-1.5"`

                - `"chatgpt-image-latest"`

            - `moderation?: "auto" | "low"`

              Moderation level for the generated image. Default: `auto`.

              - `"auto"`

              - `"low"`

            - `output_compression?: number`

              Compression level for the output image. Default: 100.

            - `output_format?: "png" | "webp" | "jpeg"`

              The output format of the generated image. One of `png`, `webp`, or
              `jpeg`. Default: `png`.

              - `"png"`

              - `"webp"`

              - `"jpeg"`

            - `partial_images?: number`

              Number of partial images to generate in streaming mode, from 0 (default value) to 3.

            - `quality?: "low" | "medium" | "high" | "auto"`

              The quality of the generated image. One of `low`, `medium`, `high`,
              or `auto`. Default: `auto`.

              - `"low"`

              - `"medium"`

              - `"high"`

              - `"auto"`

            - `size?: (string & {}) | "1024x1024" | "1024x1536" | "1536x1024" | "auto"`

              The size of the generated images. For `gpt-image-2` and `gpt-image-2-2026-04-21`, arbitrary resolutions are supported as `WIDTHxHEIGHT` strings, for example `1536x864`. Width and height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above `2560x1440` are experimental, and the maximum supported resolution is `3840x2160`. The requested size must also satisfy the model's current pixel and edge limits. The standard sizes `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models; `auto` is supported for models that allow automatic sizing. For `dall-e-2`, use one of `256x256`, `512x512`, or `1024x1024`. For `dall-e-3`, use one of `1024x1024`, `1792x1024`, or `1024x1792`.

              - `(string & {})`

              - `"1024x1024" | "1024x1536" | "1536x1024" | "auto"`

                - `"1024x1024"`

                - `"1024x1536"`

                - `"1536x1024"`

                - `"auto"`

          - `LocalShell`

            A tool that allows the model to execute shell commands in a local environment.

            - `type: "local_shell"`

              The type of the local shell tool. Always `local_shell`.

              - `"local_shell"`

          - `BetaFunctionShellTool`

            A tool that allows the model to execute shell commands.

            - `type: "shell"`

              The type of the shell tool. Always `shell`.

              - `"shell"`

            - `allowed_callers?: Array<"direct" | "programmatic"> | null`

              The tool invocation context(s).

              - `"direct"`

              - `"programmatic"`

            - `environment?: BetaContainerAuto | BetaLocalEnvironment | BetaContainerReference | null`

              - `BetaContainerAuto`

                - `type: "container_auto"`

                  Automatically creates a container for this request

                  - `"container_auto"`

                - `file_ids?: Array<string>`

                  An optional list of uploaded files to make available to your code.

                - `memory_limit?: "1g" | "4g" | "16g" | "64g" | null`

                  The memory limit for the container.

                  - `"1g"`

                  - `"4g"`

                  - `"16g"`

                  - `"64g"`

                - `network_policy?: BetaContainerNetworkPolicyDisabled | BetaContainerNetworkPolicyAllowlist`

                  Network access policy for the container.

                  - `BetaContainerNetworkPolicyDisabled`

                  - `BetaContainerNetworkPolicyAllowlist`

                - `skills?: Array<BetaSkillReference | BetaInlineSkill>`

                  An optional list of skills referenced by id or inline data.

                  - `BetaSkillReference`

                    - `skill_id: string`

                      The ID of the referenced skill.

                    - `type: "skill_reference"`

                      References a skill created with the /v1/skills endpoint.

                      - `"skill_reference"`

                    - `version?: string`

                      Optional skill version. Use a positive integer or 'latest'. Omit for default.

                  - `BetaInlineSkill`

                    - `description: string`

                      The description of the skill.

                    - `name: string`

                      The name of the skill.

                    - `source: BetaInlineSkillSource`

                      Inline skill payload

                      - `data: string`

                        Base64-encoded skill zip bundle.

                      - `media_type: "application/zip"`

                        The media type of the inline skill payload. Must be `application/zip`.

                        - `"application/zip"`

                      - `type: "base64"`

                        The type of the inline skill source. Must be `base64`.

                        - `"base64"`

                    - `type: "inline"`

                      Defines an inline skill for this request.

                      - `"inline"`

              - `BetaLocalEnvironment`

                - `type: "local"`

                  Use a local computer environment.

                  - `"local"`

                - `skills?: Array<BetaLocalSkill>`

                  An optional list of skills.

                  - `description: string`

                    The description of the skill.

                  - `name: string`

                    The name of the skill.

                  - `path: string`

                    The path to the directory containing the skill.

              - `BetaContainerReference`

                - `container_id: string`

                  The ID of the referenced container.

                - `type: "container_reference"`

                  References a container created with the /v1/containers endpoint

                  - `"container_reference"`

          - `BetaCustomTool`

            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)

            - `name: string`

              The name of the custom tool, used to identify it in tool calls.

            - `type: "custom"`

              The type of the custom tool. Always `custom`.

              - `"custom"`

            - `allowed_callers?: Array<"direct" | "programmatic"> | null`

              The tool invocation context(s).

              - `"direct"`

              - `"programmatic"`

            - `defer_loading?: boolean`

              Whether this tool should be deferred and discovered via tool search.

            - `description?: string`

              Optional description of the custom tool, used to provide more context.

            - `format?: Text | Grammar`

              The input format for the custom tool. Default is unconstrained text.

              - `Text`

                Unconstrained free-form text.

                - `type: "text"`

                  Unconstrained text format. Always `text`.

                  - `"text"`

              - `Grammar`

                A grammar defined by the user.

                - `definition: string`

                  The grammar definition.

                - `syntax: "lark" | "regex"`

                  The syntax of the grammar definition. One of `lark` or `regex`.

                  - `"lark"`

                  - `"regex"`

                - `type: "grammar"`

                  Grammar format. Always `grammar`.

                  - `"grammar"`

          - `BetaNamespaceTool`

            Groups function/custom tools under a shared namespace.

            - `description: string`

              A description of the namespace shown to the model.

            - `name: string`

              The namespace name used in tool calls (for example, `crm`).

            - `tools: Array<Function | BetaCustomTool>`

              The function/custom tools available inside this namespace.

              - `Function`

                - `name: string`

                - `type: "function"`

                  - `"function"`

                - `allowed_callers?: Array<"direct" | "programmatic"> | null`

                  The tool invocation context(s).

                  - `"direct"`

                  - `"programmatic"`

                - `defer_loading?: boolean`

                  Whether this function should be deferred and discovered via tool search.

                - `description?: string | null`

                - `output_schema?: Record<string, unknown> | null`

                  A JSON Schema describing the JSON value encoded in string outputs for this function tool. This does not describe content-array outputs.

                - `parameters?: unknown`

                - `strict?: boolean | null`

                  Whether to enforce strict parameter validation. If omitted, Responses attempts to use strict validation when the schema is compatible, and falls back to non-strict validation otherwise.

              - `BetaCustomTool`

                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: "namespace"`

              The type of the tool. Always `namespace`.

              - `"namespace"`

          - `BetaToolSearchTool`

            Hosted or BYOT tool search configuration for deferred tools.

            - `type: "tool_search"`

              The type of the tool. Always `tool_search`.

              - `"tool_search"`

            - `description?: string | null`

              Description shown to the model for a client-executed tool search tool.

            - `execution?: "server" | "client"`

              Whether tool search is executed by the server or by the client.

              - `"server"`

              - `"client"`

            - `parameters?: unknown`

              Parameter schema for a client-executed tool search tool.

          - `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"`

              The type of the web search tool. One of `web_search_preview` or `web_search_preview_2025_03_11`.

              - `"web_search_preview"`

              - `"web_search_preview_2025_03_11"`

            - `search_content_types?: Array<"text" | "image">`

              - `"text"`

              - `"image"`

            - `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.

              - `"low"`

              - `"medium"`

              - `"high"`

            - `user_location?: UserLocation | null`

              The user's location.

              - `type: "approximate"`

                The type of location approximation. Always `approximate`.

                - `"approximate"`

              - `city?: string | null`

                Free text input for the city of the user, e.g. `San Francisco`.

              - `country?: string | null`

                The two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of the user, e.g. `US`.

              - `region?: string | null`

                Free text input for the region of the user, e.g. `California`.

              - `timezone?: string | null`

                The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of the user, e.g. `America/Los_Angeles`.

          - `BetaApplyPatchTool`

            Allows the assistant to create, delete, or update files using unified diffs.

            - `type: "apply_patch"`

              The type of the tool. Always `apply_patch`.

              - `"apply_patch"`

            - `allowed_callers?: Array<"direct" | "programmatic"> | null`

              The tool invocation context(s).

              - `"direct"`

              - `"programmatic"`

        - `type: "tool_search_output"`

          The item type. Always `tool_search_output`.

          - `"tool_search_output"`

        - `id?: string | null`

          The unique ID of this tool search output.

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `call_id?: string | null`

          The unique ID of the tool search call generated by the model.

        - `execution?: "server" | "client"`

          Whether tool search was executed by the server or by the client.

          - `"server"`

          - `"client"`

        - `status?: "in_progress" | "completed" | "incomplete" | null`

          The status of the tool search output.

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

      - `AdditionalTools`

        - `role: "developer"`

          The role that provided the additional tools. Only `developer` is supported.

          - `"developer"`

        - `tools: Array<BetaTool>`

          A list of additional tools made available at this item.

          - `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).

          - `Mcp`

            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).

          - `CodeInterpreter`

            A tool that runs Python code to help generate a response to a prompt.

          - `ProgrammaticToolCalling`

          - `ImageGeneration`

            A tool that generates images using the GPT image models.

          - `LocalShell`

            A tool that allows the model to execute shell commands in a local environment.

          - `BetaFunctionShellTool`

            A tool that allows the model to execute shell commands.

          - `BetaCustomTool`

            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)

          - `BetaNamespaceTool`

            Groups function/custom tools under a shared namespace.

          - `BetaToolSearchTool`

            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).

          - `BetaApplyPatchTool`

            Allows the assistant to create, delete, or update files using unified diffs.

        - `type: "additional_tools"`

          The item type. Always `additional_tools`.

          - `"additional_tools"`

        - `id?: string | null`

          The unique ID of this additional tools item.

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

      - `BetaResponseReasoningItem`

        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).

        - `id: string`

          The unique identifier of the reasoning content.

        - `summary: Array<Summary>`

          Reasoning summary content.

          - `text: string`

            A summary of the reasoning output from the model so far.

          - `type: "summary_text"`

            The type of the object. Always `summary_text`.

            - `"summary_text"`

        - `type: "reasoning"`

          The type of the object. Always `reasoning`.

          - `"reasoning"`

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `content?: Array<Content>`

          Reasoning text content.

          - `text: string`

            The reasoning text from the model.

          - `type: "reasoning_text"`

            The type of the reasoning text. Always `reasoning_text`.

            - `"reasoning_text"`

        - `encrypted_content?: string | null`

          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.

          When streaming, use the completed reasoning item and its
          `encrypted_content` from the `response.output_item.done` event in
          subsequent requests. The `encrypted_content` in
          `response.output_item.added` may be incomplete. This is especially
          important when `store` is `false` or when using Zero Data Retention.

        - `status?: "in_progress" | "completed" | "incomplete"`

          The status of the item. One of `in_progress`, `completed`, or
          `incomplete`. Populated when items are returned via API.

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

      - `BetaResponseCompactionItemParam`

        A compaction item generated by the [`v1/responses/compact` API](https://platform.openai.com/docs/api-reference/responses/compact).

        - `encrypted_content: string`

          The encrypted content of the compaction summary.

        - `type: "compaction"`

          The type of the item. Always `compaction`.

          - `"compaction"`

        - `id?: string | null`

          The ID of the compaction item.

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

      - `ImageGenerationCall`

        An image generation request made by the model.

        - `id: string`

          The unique ID of the image generation call.

        - `result: string | null`

          The generated image encoded in base64.

        - `status: "in_progress" | "completed" | "generating" | "failed"`

          The status of the image generation call.

          - `"in_progress"`

          - `"completed"`

          - `"generating"`

          - `"failed"`

        - `type: "image_generation_call"`

          The type of the image generation call. Always `image_generation_call`.

          - `"image_generation_call"`

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

      - `BetaResponseCodeInterpreterToolCall`

        A tool call to run code.

        - `id: string`

          The unique ID of the code interpreter tool call.

        - `code: string | null`

          The code to run, or null if not available.

        - `container_id: string`

          The ID of the container used to run the code.

        - `outputs: Array<Logs | Image> | null`

          The outputs generated by the code interpreter, such as logs or images.
          Can be null if no outputs are available.

          - `Logs`

            The logs output from the code interpreter.

            - `logs: string`

              The logs output from the code interpreter.

            - `type: "logs"`

              The type of the output. Always `logs`.

              - `"logs"`

          - `Image`

            The image output from the code interpreter.

            - `type: "image"`

              The type of the output. Always `image`.

              - `"image"`

            - `url: string`

              The URL of the image output from the code interpreter.

        - `status: "in_progress" | "completed" | "incomplete" | 2 more`

          The status of the code interpreter tool call. Valid values are `in_progress`, `completed`, `incomplete`, `interpreting`, and `failed`.

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

          - `"interpreting"`

          - `"failed"`

        - `type: "code_interpreter_call"`

          The type of the code interpreter tool call. Always `code_interpreter_call`.

          - `"code_interpreter_call"`

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

      - `LocalShellCall`

        A tool call to run a command on the local shell.

        - `id: string`

          The unique ID of the local shell call.

        - `action: Action`

          Execute a shell command on the server.

          - `command: Array<string>`

            The command to run.

          - `env: Record<string, string>`

            Environment variables to set for the command.

          - `type: "exec"`

            The type of the local shell action. Always `exec`.

            - `"exec"`

          - `timeout_ms?: number | null`

            Optional timeout in milliseconds for the command.

          - `user?: string | null`

            Optional user to run the command as.

          - `working_directory?: string | null`

            Optional working directory to run the command in.

        - `call_id: string`

          The unique ID of the local shell tool call generated by the model.

        - `status: "in_progress" | "completed" | "incomplete"`

          The status of the local shell call.

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

        - `type: "local_shell_call"`

          The type of the local shell call. Always `local_shell_call`.

          - `"local_shell_call"`

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

      - `LocalShellCallOutput`

        The output of a local shell tool call.

        - `id: string`

          The unique ID of the local shell tool call generated by the model.

        - `output: string`

          A JSON string of the output of the local shell tool call.

        - `type: "local_shell_call_output"`

          The type of the local shell tool call output. Always `local_shell_call_output`.

          - `"local_shell_call_output"`

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `status?: "in_progress" | "completed" | "incomplete" | null`

          The status of the item. One of `in_progress`, `completed`, or `incomplete`.

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

      - `ShellCall`

        A tool representing a request to execute one or more shell commands.

        - `action: Action`

          The shell commands and limits that describe how to run the tool call.

          - `commands: Array<string>`

            Ordered shell commands for the execution environment to run.

          - `max_output_length?: number | null`

            Maximum number of UTF-8 characters to capture from combined stdout and stderr output.

          - `timeout_ms?: number | null`

            Maximum wall-clock time in milliseconds to allow the shell commands to run.

        - `call_id: string`

          The unique ID of the shell tool call generated by the model.

        - `type: "shell_call"`

          The type of the item. Always `shell_call`.

          - `"shell_call"`

        - `id?: string | null`

          The unique ID of the shell tool call. Populated when this item is returned via API.

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `caller?: Direct | Program | null`

          The execution context that produced this tool call.

          - `Direct`

            - `type: "direct"`

              The caller type. Always `direct`.

              - `"direct"`

          - `Program`

            - `caller_id: string`

              The call ID of the program item that produced this tool call.

            - `type: "program"`

              The caller type. Always `program`.

              - `"program"`

        - `environment?: BetaLocalEnvironment | BetaContainerReference | null`

          The environment to execute the shell commands in.

          - `BetaLocalEnvironment`

          - `BetaContainerReference`

        - `status?: "in_progress" | "completed" | "incomplete" | null`

          The status of the shell call. One of `in_progress`, `completed`, or `incomplete`.

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

      - `ShellCallOutput`

        The streamed output items emitted by a shell tool call.

        - `call_id: string`

          The unique ID of the shell tool call generated by the model.

        - `output: Array<BetaResponseFunctionShellCallOutputContent>`

          Captured chunks of stdout and stderr output, along with their associated outcomes.

          - `outcome: Timeout | Exit`

            The exit or timeout outcome associated with this shell call.

            - `Timeout`

              Indicates that the shell call exceeded its configured time limit.

              - `type: "timeout"`

                The outcome type. Always `timeout`.

                - `"timeout"`

            - `Exit`

              Indicates that the shell commands finished and returned an exit code.

              - `exit_code: number`

                The exit code returned by the shell process.

              - `type: "exit"`

                The outcome type. Always `exit`.

                - `"exit"`

          - `stderr: string`

            Captured stderr output for the shell call.

          - `stdout: string`

            Captured stdout output for the shell call.

        - `type: "shell_call_output"`

          The type of the item. Always `shell_call_output`.

          - `"shell_call_output"`

        - `id?: string | null`

          The unique ID of the shell tool call output. Populated when this item is returned via API.

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `caller?: Direct | Program | null`

          The execution context that produced this tool call.

          - `Direct`

            - `type: "direct"`

              The caller type. Always `direct`.

              - `"direct"`

          - `Program`

            - `caller_id: string`

              The call ID of the program item that produced this tool call.

            - `type: "program"`

              The caller type. Always `program`.

              - `"program"`

        - `max_output_length?: number | null`

          The maximum number of UTF-8 characters captured for this shell call's combined output.

        - `status?: "in_progress" | "completed" | "incomplete" | null`

          The status of the shell call output.

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

      - `ApplyPatchCall`

        A tool call representing a request to create, delete, or update files using diff patches.

        - `call_id: string`

          The unique ID of the apply patch tool call generated by the model.

        - `operation: CreateFile | DeleteFile | UpdateFile`

          The specific create, delete, or update instruction for the apply_patch tool call.

          - `CreateFile`

            Instruction for creating a new file via the apply_patch tool.

            - `diff: string`

              Unified diff content to apply when creating the file.

            - `path: string`

              Path of the file to create relative to the workspace root.

            - `type: "create_file"`

              The operation type. Always `create_file`.

              - `"create_file"`

          - `DeleteFile`

            Instruction for deleting an existing file via the apply_patch tool.

            - `path: string`

              Path of the file to delete relative to the workspace root.

            - `type: "delete_file"`

              The operation type. Always `delete_file`.

              - `"delete_file"`

          - `UpdateFile`

            Instruction for updating an existing file via the apply_patch tool.

            - `diff: string`

              Unified diff content to apply to the existing file.

            - `path: string`

              Path of the file to update relative to the workspace root.

            - `type: "update_file"`

              The operation type. Always `update_file`.

              - `"update_file"`

        - `status: "in_progress" | "completed"`

          The status of the apply patch tool call. One of `in_progress` or `completed`.

          - `"in_progress"`

          - `"completed"`

        - `type: "apply_patch_call"`

          The type of the item. Always `apply_patch_call`.

          - `"apply_patch_call"`

        - `id?: string | null`

          The unique ID of the apply patch tool call. Populated when this item is returned via API.

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `caller?: Direct | Program | null`

          The execution context that produced this tool call.

          - `Direct`

            - `type: "direct"`

              The caller type. Always `direct`.

              - `"direct"`

          - `Program`

            - `caller_id: string`

              The call ID of the program item that produced this tool call.

            - `type: "program"`

              The caller type. Always `program`.

              - `"program"`

      - `ApplyPatchCallOutput`

        The streamed output emitted by an apply patch tool call.

        - `call_id: string`

          The unique ID of the apply patch tool call generated by the model.

        - `status: "completed" | "failed"`

          The status of the apply patch tool call output. One of `completed` or `failed`.

          - `"completed"`

          - `"failed"`

        - `type: "apply_patch_call_output"`

          The type of the item. Always `apply_patch_call_output`.

          - `"apply_patch_call_output"`

        - `id?: string | null`

          The unique ID of the apply patch tool call output. Populated when this item is returned via API.

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `caller?: Direct | Program | null`

          The execution context that produced this tool call.

          - `Direct`

            - `type: "direct"`

              The caller type. Always `direct`.

              - `"direct"`

          - `Program`

            - `caller_id: string`

              The call ID of the program item that produced this tool call.

            - `type: "program"`

              The caller type. Always `program`.

              - `"program"`

        - `output?: string | null`

          Optional human-readable log text from the apply patch tool (e.g., patch results or errors).

      - `McpListTools`

        A list of tools available on an MCP server.

        - `id: string`

          The unique ID of the list.

        - `server_label: string`

          The label of the MCP server.

        - `tools: Array<Tool>`

          The tools available on the server.

          - `input_schema: unknown`

            The JSON schema describing the tool's input.

          - `name: string`

            The name of the tool.

          - `annotations?: unknown`

            Additional annotations about the tool.

          - `description?: string | null`

            The description of the tool.

        - `type: "mcp_list_tools"`

          The type of the item. Always `mcp_list_tools`.

          - `"mcp_list_tools"`

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `error?: string | null`

          Error message if the server could not list tools.

      - `McpApprovalRequest`

        A request for human approval of a tool invocation.

        - `id: string`

          The unique ID of the approval request.

        - `arguments: string`

          A JSON string of arguments for the tool.

        - `name: string`

          The name of the tool to run.

        - `server_label: string`

          The label of the MCP server making the request.

        - `type: "mcp_approval_request"`

          The type of the item. Always `mcp_approval_request`.

          - `"mcp_approval_request"`

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

      - `McpApprovalResponse`

        A response to an MCP approval request.

        - `approval_request_id: string`

          The ID of the approval request being answered.

        - `approve: boolean`

          Whether the request was approved.

        - `type: "mcp_approval_response"`

          The type of the item. Always `mcp_approval_response`.

          - `"mcp_approval_response"`

        - `id?: string | null`

          The unique ID of the approval response

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `reason?: string | null`

          Optional reason for the decision.

      - `McpCall`

        An invocation of a tool on an MCP server.

        - `id: string`

          The unique ID of the tool call.

        - `arguments: string`

          A JSON string of the arguments passed to the tool.

        - `name: string`

          The name of the tool that was run.

        - `server_label: string`

          The label of the MCP server running the tool.

        - `type: "mcp_call"`

          The type of the item. Always `mcp_call`.

          - `"mcp_call"`

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `approval_request_id?: string | null`

          Unique identifier for the MCP tool call approval request.
          Include this value in a subsequent `mcp_approval_response` input to approve or reject the corresponding tool call.

        - `error?: BetaMcpToolCallError | null`

          The error from the tool call, if any.

          - `McpProtocolError`

            - `code: number`

            - `message: string`

            - `type: "mcp_protocol_error"`

              - `"mcp_protocol_error"`

          - `McpToolExecutionError`

            - `content: unknown`

            - `type: "mcp_tool_execution_error"`

              - `"mcp_tool_execution_error"`

          - `HTTPError`

            - `code: number`

            - `message: string`

            - `type: "http_error"`

              - `"http_error"`

        - `output?: string | null`

          The output from the tool call.

        - `status?: "in_progress" | "completed" | "incomplete" | 2 more`

          The status of the tool call. One of `in_progress`, `completed`, `incomplete`, `calling`, or `failed`.

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

          - `"calling"`

          - `"failed"`

      - `BetaResponseCustomToolCallOutput`

        The output of a custom tool call from your code, being sent back to the model.

        - `call_id: string`

          The call ID, used to map this custom tool call output to a custom tool call.

        - `output: string | Array<BetaResponseInputText | BetaResponseInputImage | BetaResponseInputFile>`

          The output from the custom tool call generated by your code.
          Can be a string or an list of output content.

          - `string`

          - `Array<BetaResponseInputText | BetaResponseInputImage | BetaResponseInputFile>`

            - `BetaResponseInputText`

              A text input to the model.

            - `BetaResponseInputImage`

              An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision).

            - `BetaResponseInputFile`

              A file input to the model.

        - `type: "custom_tool_call_output"`

          The type of the custom tool call output. Always `custom_tool_call_output`.

          - `"custom_tool_call_output"`

        - `id?: string`

          The unique ID of the custom tool call output in the OpenAI platform.

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `caller?: Direct | Program | null`

          The execution context that produced this tool call.

          - `Direct`

            - `type: "direct"`

              The caller type. Always `direct`.

              - `"direct"`

          - `Program`

            - `caller_id: string`

              The call ID of the program item that produced this tool call.

            - `type: "program"`

              The caller type. Always `program`.

              - `"program"`

      - `BetaResponseCustomToolCall`

        A call to a custom tool created by the model.

        - `call_id: string`

          An identifier used to map this custom tool call to a tool call output.

        - `input: string`

          The input for the custom tool call generated by the model.

        - `name: string`

          The name of the custom tool being called.

        - `type: "custom_tool_call"`

          The type of the custom tool call. Always `custom_tool_call`.

          - `"custom_tool_call"`

        - `id?: string`

          The unique ID of the custom tool call in the OpenAI platform.

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `caller?: Direct | Program | null`

          The execution context that produced this tool call.

          - `Direct`

            - `type: "direct"`

              - `"direct"`

          - `Program`

            - `caller_id: string`

              The call ID of the program item that produced this tool call.

            - `type: "program"`

              - `"program"`

        - `namespace?: string`

          The namespace of the custom tool being called.

      - `CompactionTrigger`

        Compacts the current context. Must be the final input item.

        - `type: "compaction_trigger"`

          The type of the item. Always `compaction_trigger`.

          - `"compaction_trigger"`

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

      - `ItemReference`

        An internal identifier for an item to reference.

        - `id: string`

          The ID of the item to reference.

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `type?: "item_reference" | null`

          The type of item to reference. Always `item_reference`.

          - `"item_reference"`

      - `Program`

        - `id: string`

          The unique ID of this program item.

        - `call_id: string`

          The stable call ID of the program item.

        - `code: string`

          The JavaScript source executed by programmatic tool calling.

        - `fingerprint: string`

          Opaque program replay fingerprint that must be round-tripped.

        - `type: "program"`

          The item type. Always `program`.

          - `"program"`

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

      - `ProgramOutput`

        - `id: string`

          The unique ID of this program output item.

        - `call_id: string`

          The call ID of the program item.

        - `result: string`

          The result produced by the program item.

        - `status: "completed" | "incomplete"`

          The terminal status of the program output.

          - `"completed"`

          - `"incomplete"`

        - `type: "program_output"`

          The item type. Always `program_output`.

          - `"program_output"`

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

    - `response_id: string`

      The ID of the response that rejected the input.

    - `sequence_number: number`

      The sequence number for this event.

    - `type: "response.inject.failed"`

      The event discriminator. Always `response.inject.failed`.

      - `"response.inject.failed"`

    - `stream_id?: string`

      The multiplexed WebSocket stream that emitted the event. This field is
      present only when WebSocket multiplexing is enabled separately.

### Beta Service Tier

- `BetaServiceTier = "auto" | "default" | "flex" | 4 more | null`

  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.
  - If set to 'ultrafast', then the request will be processed with the access-controlled Ultrafast Processing service tier. This tier is currently available for `gpt-5.6-sol`; a response served through it will show `service_tier=ultrafast`.
  - When not set, the default behavior is 'auto'.

  When the `service_tier` parameter is set, the response body will include the `service_tier` value based on the processing mode actually used to serve the request. This response value may be different from the value set in the parameter.

  - `"auto"`

  - `"default"`

  - `"flex"`

  - `"scale"`

  - `"priority"`

  - `"fast"`

  - `"ultrafast"`

### Beta Skill Reference

- `BetaSkillReference`

  - `skill_id: string`

    The ID of the referenced skill.

  - `type: "skill_reference"`

    References a skill created with the /v1/skills endpoint.

    - `"skill_reference"`

  - `version?: string`

    Optional skill version. Use a positive integer or 'latest'. Omit for default.

### Beta Tool

- `BetaTool = BetaFunctionTool | BetaFileSearchTool | BetaComputerTool | 13 more`

  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).

    - `name: string`

      The name of the function to call.

    - `parameters: Record<string, unknown> | null`

      A JSON schema object describing the parameters of the function.

    - `strict: boolean | null`

      Whether strict parameter validation is enforced for this function tool.

    - `type: "function"`

      The type of the function tool. Always `function`.

      - `"function"`

    - `allowed_callers?: Array<"direct" | "programmatic"> | null`

      The tool invocation context(s).

      - `"direct"`

      - `"programmatic"`

    - `defer_loading?: boolean`

      Whether this function is deferred and loaded via tool search.

    - `description?: string | null`

      A description of the function. Used by the model to determine whether or not to call the function.

    - `output_schema?: Record<string, unknown> | null`

      A JSON schema object describing the JSON value encoded in string outputs for this function.

  - `BetaFileSearchTool`

    A tool that searches for relevant content from uploaded files. Learn more about the [file search tool](https://platform.openai.com/docs/guides/tools-file-search).

    - `type: "file_search"`

      The type of the file search tool. Always `file_search`.

      - `"file_search"`

    - `vector_store_ids: Array<string>`

      The IDs of the vector stores to search.

    - `filters?: ComparisonFilter | CompoundFilter | null`

      A filter to apply.

      - `ComparisonFilter`

        A filter used to compare a specified attribute key to a given value using a defined comparison operation.

        - `key: string`

          The key to compare against the value.

        - `type: "eq" | "ne" | "gt" | 5 more`

          Specifies the comparison operator: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`, `in`, `nin`.

          - `eq`: equals
          - `ne`: not equal
          - `gt`: greater than
          - `gte`: greater than or equal
          - `lt`: less than
          - `lte`: less than or equal
          - `in`: in
          - `nin`: not in

          - `"eq"`

          - `"ne"`

          - `"gt"`

          - `"gte"`

          - `"lt"`

          - `"lte"`

          - `"in"`

          - `"nin"`

        - `value: string | number | boolean | Array<string | number>`

          The value to compare against the attribute key; supports string, number, or boolean types.

          - `string`

          - `number`

          - `boolean`

          - `Array<string | number>`

            - `string`

            - `number`

      - `CompoundFilter`

        Combine multiple filters using `and` or `or`.

        - `filters: Array<ComparisonFilter | unknown>`

          Array of filters to combine. Items can be `ComparisonFilter` or `CompoundFilter`.

          - `ComparisonFilter`

            A filter used to compare a specified attribute key to a given value using a defined comparison operation.

            - `key: string`

              The key to compare against the value.

            - `type: "eq" | "ne" | "gt" | 5 more`

              Specifies the comparison operator: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`, `in`, `nin`.

              - `eq`: equals
              - `ne`: not equal
              - `gt`: greater than
              - `gte`: greater than or equal
              - `lt`: less than
              - `lte`: less than or equal
              - `in`: in
              - `nin`: not in

              - `"eq"`

              - `"ne"`

              - `"gt"`

              - `"gte"`

              - `"lt"`

              - `"lte"`

              - `"in"`

              - `"nin"`

            - `value: string | number | boolean | Array<string | number>`

              The value to compare against the attribute key; supports string, number, or boolean types.

              - `string`

              - `number`

              - `boolean`

              - `Array<string | number>`

                - `string`

                - `number`

          - `unknown`

        - `type: "and" | "or"`

          Type of operation: `and` or `or`.

          - `"and"`

          - `"or"`

    - `max_num_results?: number`

      The maximum number of results to return. This number should be between 1 and 50 inclusive.

    - `ranking_options?: RankingOptions`

      Ranking options for search.

      - `hybrid_search?: HybridSearch`

        Weights that control how reciprocal rank fusion balances semantic embedding matches versus sparse keyword matches when hybrid search is enabled.

        - `embedding_weight: number`

          The weight of the embedding in the reciprocal ranking fusion.

        - `text_weight: number`

          The weight of the text in the reciprocal ranking fusion.

      - `ranker?: "auto" | "default-2024-11-15"`

        The ranker to use for the file search.

        - `"auto"`

        - `"default-2024-11-15"`

      - `score_threshold?: number`

        The score threshold for the file search, a number between 0 and 1. Numbers closer to 1 will attempt to return only the most relevant results, but may return fewer results.

  - `BetaComputerTool`

    A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use).

    - `type: "computer"`

      The type of the computer tool. Always `computer`.

      - `"computer"`

  - `BetaComputerUsePreviewTool`

    A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use).

    - `display_height: number`

      The height of the computer display.

    - `display_width: number`

      The width of the computer display.

    - `environment: "windows" | "mac" | "linux" | 2 more`

      The type of computer environment to control.

      - `"windows"`

      - `"mac"`

      - `"linux"`

      - `"ubuntu"`

      - `"browser"`

    - `type: "computer_use_preview"`

      The type of the computer use tool. Always `computer_use_preview`.

      - `"computer_use_preview"`

  - `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"`

      The type of the web search tool. One of `web_search` or `web_search_2025_08_26`.

      - `"web_search"`

      - `"web_search_2025_08_26"`

    - `external_web_access?: boolean`

      Allow live internet access for web search. Defaults to true when omitted. When false, the web search tool runs in offline/cache-only mode and will not fetch new external content.

    - `filters?: Filters | null`

      Filters for the search.

      - `allowed_domains?: Array<string> | null`

        Allowed domains for the search. If not provided, all domains are allowed.
        Subdomains of the provided domains are allowed as well.

        Example: `["pubmed.ncbi.nlm.nih.gov"]`

    - `search_context_size?: "low" | "medium" | "high"`

      High level guidance for the amount of context window space to use for the search. One of `low`, `medium`, or `high`. `medium` is the default.

      - `"low"`

      - `"medium"`

      - `"high"`

    - `user_location?: UserLocation | null`

      The approximate location of the user.

      - `city?: string | null`

        Free text input for the city of the user, e.g. `San Francisco`.

      - `country?: string | null`

        The two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of the user, e.g. `US`.

      - `region?: string | null`

        Free text input for the region of the user, e.g. `California`.

      - `timezone?: string | null`

        The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of the user, e.g. `America/Los_Angeles`.

      - `type?: "approximate"`

        The type of location approximation. Always `approximate`.

        - `"approximate"`

  - `Mcp`

    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).

    - `server_label: string`

      A label for this MCP server, used to identify it in tool calls.

    - `type: "mcp"`

      The type of the MCP tool. Always `mcp`.

      - `"mcp"`

    - `allowed_callers?: Array<"direct" | "programmatic"> | null`

      The tool invocation context(s).

      - `"direct"`

      - `"programmatic"`

    - `allowed_tools?: Array<string> | McpToolFilter | null`

      List of allowed tool names or a filter object.

      - `Array<string>`

      - `McpToolFilter`

        A filter object to specify which tools are allowed.

        - `read_only?: boolean`

          Indicates whether or not a tool modifies data or is read-only. If an
          MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint),
          it will match this filter.

        - `tool_names?: Array<string>`

          List of allowed tool names.

    - `authorization?: string`

      An OAuth access token that can be used with a remote MCP server, either
      with a custom MCP server URL or a service connector. Your application
      must handle the OAuth authorization flow and provide the token here.

    - `connector_id?: "connector_dropbox" | "connector_gmail" | "connector_googlecalendar" | 5 more`

      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`

      - `"connector_dropbox"`

      - `"connector_gmail"`

      - `"connector_googlecalendar"`

      - `"connector_googledrive"`

      - `"connector_microsoftteams"`

      - `"connector_outlookcalendar"`

      - `"connector_outlookemail"`

      - `"connector_sharepoint"`

    - `defer_loading?: boolean`

      Whether this MCP tool is deferred and discovered via tool search.

    - `headers?: Record<string, string> | null`

      Optional HTTP headers to send to the MCP server. Use for authentication
      or other purposes.

    - `require_approval?: McpToolApprovalFilter | "always" | "never" | null`

      Specify which of the MCP server's tools require approval.

      - `McpToolApprovalFilter`

        Specify which of the MCP server's tools require approval. Can be
        `always`, `never`, or a filter object associated with tools
        that require approval.

        - `always?: Always`

          A filter object to specify which tools are allowed.

          - `read_only?: boolean`

            Indicates whether or not a tool modifies data or is read-only. If an
            MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint),
            it will match this filter.

          - `tool_names?: Array<string>`

            List of allowed tool names.

        - `never?: Never`

          A filter object to specify which tools are allowed.

          - `read_only?: boolean`

            Indicates whether or not a tool modifies data or is read-only. If an
            MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint),
            it will match this filter.

          - `tool_names?: Array<string>`

            List of allowed tool names.

      - `"always" | "never"`

        - `"always"`

        - `"never"`

    - `server_description?: string`

      Optional description of the MCP server, used to provide more context.

    - `server_url?: string`

      The URL for the MCP server. One of `server_url`, `connector_id`, or
      `tunnel_id` must be provided.

    - `tunnel_id?: string`

      The Secure MCP Tunnel ID to use instead of a direct server URL. One of
      `server_url`, `connector_id`, or `tunnel_id` must be provided.

  - `CodeInterpreter`

    A tool that runs Python code to help generate a response to a prompt.

    - `container: string | CodeInterpreterToolAuto`

      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`

      - `CodeInterpreterToolAuto`

        Configuration for a code interpreter container. Optionally specify the IDs of the files to run the code on.

        - `type: "auto"`

          Always `auto`.

          - `"auto"`

        - `file_ids?: Array<string>`

          An optional list of uploaded files to make available to your code.

        - `memory_limit?: "1g" | "4g" | "16g" | "64g" | null`

          The memory limit for the code interpreter container.

          - `"1g"`

          - `"4g"`

          - `"16g"`

          - `"64g"`

        - `network_policy?: BetaContainerNetworkPolicyDisabled | BetaContainerNetworkPolicyAllowlist`

          Network access policy for the container.

          - `BetaContainerNetworkPolicyDisabled`

            - `type: "disabled"`

              Disable outbound network access. Always `disabled`.

              - `"disabled"`

          - `BetaContainerNetworkPolicyAllowlist`

            - `allowed_domains: Array<string>`

              A list of allowed domains when type is `allowlist`.

            - `type: "allowlist"`

              Allow outbound network access only to specified domains. Always `allowlist`.

              - `"allowlist"`

            - `domain_secrets?: Array<BetaContainerNetworkPolicyDomainSecret>`

              Optional domain-scoped secrets for allowlisted domains.

              - `domain: string`

                The domain associated with the secret.

              - `name: string`

                The name of the secret to inject for the domain.

              - `value: string`

                The secret value to inject for the domain.

    - `type: "code_interpreter"`

      The type of the code interpreter tool. Always `code_interpreter`.

      - `"code_interpreter"`

    - `allowed_callers?: Array<"direct" | "programmatic"> | null`

      The tool invocation context(s).

      - `"direct"`

      - `"programmatic"`

  - `ProgrammaticToolCalling`

    - `type: "programmatic_tool_calling"`

      The type of the tool. Always `programmatic_tool_calling`.

      - `"programmatic_tool_calling"`

  - `ImageGeneration`

    A tool that generates images using the GPT image models.

    - `type: "image_generation"`

      The type of the image generation tool. Always `image_generation`.

      - `"image_generation"`

    - `action?: "generate" | "edit" | "auto"`

      Whether to generate a new image or edit an existing image. Default: `auto`.

      - `"generate"`

      - `"edit"`

      - `"auto"`

    - `background?: "transparent" | "opaque" | "auto"`

      Allows to set transparency for the background of the generated image(s).
      Must be one of `transparent`, `opaque`, or `auto` (default value). When
      `auto` is used, the model will automatically determine the best
      background for the image.

      Transparent backgrounds are available for supported GPT Image models.
      For `gpt-image-2` and `gpt-image-2-2026-04-21`, this support is in
      preview. When using `transparent`, set the output format to `png` or
      `webp`.

      - `"transparent"`

      - `"opaque"`

      - `"auto"`

    - `input_fidelity?: "high" | "low" | null`

      Control how much effort the model will exert to match the style and features, especially facial features, of input images. This parameter is only supported for `gpt-image-1` and `gpt-image-1.5` and later models, unsupported for `gpt-image-1-mini`. Supports `high` and `low`. Defaults to `low`.

      - `"high"`

      - `"low"`

    - `input_image_mask?: InputImageMask`

      Optional mask for inpainting. Contains `image_url`
      (string, optional) and `file_id` (string, optional).

      - `file_id?: string`

        File ID for the mask image.

      - `image_url?: string`

        Base64-encoded mask image.

    - `model?: (string & {}) | "gpt-image-1" | "gpt-image-1-mini" | "gpt-image-2" | 3 more`

      The image generation model to use. One of `gpt-image-1`,
      `gpt-image-1-mini`, `gpt-image-1.5`, `gpt-image-2`,
      `gpt-image-2-2026-04-21`, or `chatgpt-image-latest`. Default:
      `gpt-image-1`.

      - `(string & {})`

      - `"gpt-image-1" | "gpt-image-1-mini" | "gpt-image-2" | 3 more`

        - `"gpt-image-1"`

        - `"gpt-image-1-mini"`

        - `"gpt-image-2"`

        - `"gpt-image-2-2026-04-21"`

        - `"gpt-image-1.5"`

        - `"chatgpt-image-latest"`

    - `moderation?: "auto" | "low"`

      Moderation level for the generated image. Default: `auto`.

      - `"auto"`

      - `"low"`

    - `output_compression?: number`

      Compression level for the output image. Default: 100.

    - `output_format?: "png" | "webp" | "jpeg"`

      The output format of the generated image. One of `png`, `webp`, or
      `jpeg`. Default: `png`.

      - `"png"`

      - `"webp"`

      - `"jpeg"`

    - `partial_images?: number`

      Number of partial images to generate in streaming mode, from 0 (default value) to 3.

    - `quality?: "low" | "medium" | "high" | "auto"`

      The quality of the generated image. One of `low`, `medium`, `high`,
      or `auto`. Default: `auto`.

      - `"low"`

      - `"medium"`

      - `"high"`

      - `"auto"`

    - `size?: (string & {}) | "1024x1024" | "1024x1536" | "1536x1024" | "auto"`

      The size of the generated images. For `gpt-image-2` and `gpt-image-2-2026-04-21`, arbitrary resolutions are supported as `WIDTHxHEIGHT` strings, for example `1536x864`. Width and height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above `2560x1440` are experimental, and the maximum supported resolution is `3840x2160`. The requested size must also satisfy the model's current pixel and edge limits. The standard sizes `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models; `auto` is supported for models that allow automatic sizing. For `dall-e-2`, use one of `256x256`, `512x512`, or `1024x1024`. For `dall-e-3`, use one of `1024x1024`, `1792x1024`, or `1024x1792`.

      - `(string & {})`

      - `"1024x1024" | "1024x1536" | "1536x1024" | "auto"`

        - `"1024x1024"`

        - `"1024x1536"`

        - `"1536x1024"`

        - `"auto"`

  - `LocalShell`

    A tool that allows the model to execute shell commands in a local environment.

    - `type: "local_shell"`

      The type of the local shell tool. Always `local_shell`.

      - `"local_shell"`

  - `BetaFunctionShellTool`

    A tool that allows the model to execute shell commands.

    - `type: "shell"`

      The type of the shell tool. Always `shell`.

      - `"shell"`

    - `allowed_callers?: Array<"direct" | "programmatic"> | null`

      The tool invocation context(s).

      - `"direct"`

      - `"programmatic"`

    - `environment?: BetaContainerAuto | BetaLocalEnvironment | BetaContainerReference | null`

      - `BetaContainerAuto`

        - `type: "container_auto"`

          Automatically creates a container for this request

          - `"container_auto"`

        - `file_ids?: Array<string>`

          An optional list of uploaded files to make available to your code.

        - `memory_limit?: "1g" | "4g" | "16g" | "64g" | null`

          The memory limit for the container.

          - `"1g"`

          - `"4g"`

          - `"16g"`

          - `"64g"`

        - `network_policy?: BetaContainerNetworkPolicyDisabled | BetaContainerNetworkPolicyAllowlist`

          Network access policy for the container.

          - `BetaContainerNetworkPolicyDisabled`

          - `BetaContainerNetworkPolicyAllowlist`

        - `skills?: Array<BetaSkillReference | BetaInlineSkill>`

          An optional list of skills referenced by id or inline data.

          - `BetaSkillReference`

            - `skill_id: string`

              The ID of the referenced skill.

            - `type: "skill_reference"`

              References a skill created with the /v1/skills endpoint.

              - `"skill_reference"`

            - `version?: string`

              Optional skill version. Use a positive integer or 'latest'. Omit for default.

          - `BetaInlineSkill`

            - `description: string`

              The description of the skill.

            - `name: string`

              The name of the skill.

            - `source: BetaInlineSkillSource`

              Inline skill payload

              - `data: string`

                Base64-encoded skill zip bundle.

              - `media_type: "application/zip"`

                The media type of the inline skill payload. Must be `application/zip`.

                - `"application/zip"`

              - `type: "base64"`

                The type of the inline skill source. Must be `base64`.

                - `"base64"`

            - `type: "inline"`

              Defines an inline skill for this request.

              - `"inline"`

      - `BetaLocalEnvironment`

        - `type: "local"`

          Use a local computer environment.

          - `"local"`

        - `skills?: Array<BetaLocalSkill>`

          An optional list of skills.

          - `description: string`

            The description of the skill.

          - `name: string`

            The name of the skill.

          - `path: string`

            The path to the directory containing the skill.

      - `BetaContainerReference`

        - `container_id: string`

          The ID of the referenced container.

        - `type: "container_reference"`

          References a container created with the /v1/containers endpoint

          - `"container_reference"`

  - `BetaCustomTool`

    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)

    - `name: string`

      The name of the custom tool, used to identify it in tool calls.

    - `type: "custom"`

      The type of the custom tool. Always `custom`.

      - `"custom"`

    - `allowed_callers?: Array<"direct" | "programmatic"> | null`

      The tool invocation context(s).

      - `"direct"`

      - `"programmatic"`

    - `defer_loading?: boolean`

      Whether this tool should be deferred and discovered via tool search.

    - `description?: string`

      Optional description of the custom tool, used to provide more context.

    - `format?: Text | Grammar`

      The input format for the custom tool. Default is unconstrained text.

      - `Text`

        Unconstrained free-form text.

        - `type: "text"`

          Unconstrained text format. Always `text`.

          - `"text"`

      - `Grammar`

        A grammar defined by the user.

        - `definition: string`

          The grammar definition.

        - `syntax: "lark" | "regex"`

          The syntax of the grammar definition. One of `lark` or `regex`.

          - `"lark"`

          - `"regex"`

        - `type: "grammar"`

          Grammar format. Always `grammar`.

          - `"grammar"`

  - `BetaNamespaceTool`

    Groups function/custom tools under a shared namespace.

    - `description: string`

      A description of the namespace shown to the model.

    - `name: string`

      The namespace name used in tool calls (for example, `crm`).

    - `tools: Array<Function | BetaCustomTool>`

      The function/custom tools available inside this namespace.

      - `Function`

        - `name: string`

        - `type: "function"`

          - `"function"`

        - `allowed_callers?: Array<"direct" | "programmatic"> | null`

          The tool invocation context(s).

          - `"direct"`

          - `"programmatic"`

        - `defer_loading?: boolean`

          Whether this function should be deferred and discovered via tool search.

        - `description?: string | null`

        - `output_schema?: Record<string, unknown> | null`

          A JSON Schema describing the JSON value encoded in string outputs for this function tool. This does not describe content-array outputs.

        - `parameters?: unknown`

        - `strict?: boolean | null`

          Whether to enforce strict parameter validation. If omitted, Responses attempts to use strict validation when the schema is compatible, and falls back to non-strict validation otherwise.

      - `BetaCustomTool`

        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: "namespace"`

      The type of the tool. Always `namespace`.

      - `"namespace"`

  - `BetaToolSearchTool`

    Hosted or BYOT tool search configuration for deferred tools.

    - `type: "tool_search"`

      The type of the tool. Always `tool_search`.

      - `"tool_search"`

    - `description?: string | null`

      Description shown to the model for a client-executed tool search tool.

    - `execution?: "server" | "client"`

      Whether tool search is executed by the server or by the client.

      - `"server"`

      - `"client"`

    - `parameters?: unknown`

      Parameter schema for a client-executed tool search tool.

  - `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"`

      The type of the web search tool. One of `web_search_preview` or `web_search_preview_2025_03_11`.

      - `"web_search_preview"`

      - `"web_search_preview_2025_03_11"`

    - `search_content_types?: Array<"text" | "image">`

      - `"text"`

      - `"image"`

    - `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.

      - `"low"`

      - `"medium"`

      - `"high"`

    - `user_location?: UserLocation | null`

      The user's location.

      - `type: "approximate"`

        The type of location approximation. Always `approximate`.

        - `"approximate"`

      - `city?: string | null`

        Free text input for the city of the user, e.g. `San Francisco`.

      - `country?: string | null`

        The two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of the user, e.g. `US`.

      - `region?: string | null`

        Free text input for the region of the user, e.g. `California`.

      - `timezone?: string | null`

        The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of the user, e.g. `America/Los_Angeles`.

  - `BetaApplyPatchTool`

    Allows the assistant to create, delete, or update files using unified diffs.

    - `type: "apply_patch"`

      The type of the tool. Always `apply_patch`.

      - `"apply_patch"`

    - `allowed_callers?: Array<"direct" | "programmatic"> | null`

      The tool invocation context(s).

      - `"direct"`

      - `"programmatic"`

### Beta Tool Choice Allowed

- `BetaToolChoiceAllowed`

  Constrains the tools available to the model to a pre-defined set.

  - `mode: "auto" | "required"`

    Constrains the tools available to the model to a pre-defined set.

    `auto` allows the model to pick from among the allowed tools and generate a
    message.

    `required` requires the model to call one or more of the allowed tools.

    - `"auto"`

    - `"required"`

  - `tools: Array<Record<string, unknown>>`

    A list of tool definitions that the model should be allowed to call.

    For the Responses API, the list of tool definitions might look like:

    ```json
    [
      { "type": "function", "name": "get_weather" },
      { "type": "mcp", "server_label": "deepwiki" },
      { "type": "image_generation" }
    ]
    ```

  - `type: "allowed_tools"`

    Allowed tool configuration type. Always `allowed_tools`.

    - `"allowed_tools"`

### Beta Tool Choice Apply Patch

- `BetaToolChoiceApplyPatch`

  Forces the model to call the apply_patch tool when executing a tool call.

  - `type: "apply_patch"`

    The tool to call. Always `apply_patch`.

    - `"apply_patch"`

### Beta Tool Choice Custom

- `BetaToolChoiceCustom`

  Use this option to force the model to call a specific custom tool.

  - `name: string`

    The name of the custom tool to call.

  - `type: "custom"`

    For custom tool calling, the type is always `custom`.

    - `"custom"`

### Beta Tool Choice Function

- `BetaToolChoiceFunction`

  Use this option to force the model to call a specific function.

  - `name: string`

    The name of the function to call.

  - `type: "function"`

    For function calling, the type is always `function`.

    - `"function"`

### Beta Tool Choice Mcp

- `BetaToolChoiceMcp`

  Use this option to force the model to call a specific tool on a remote MCP server.

  - `server_label: string`

    The label of the MCP server to use.

  - `type: "mcp"`

    For MCP tools, the type is always `mcp`.

    - `"mcp"`

  - `name?: string | null`

    The name of the tool to call on the server.

### Beta Tool Choice Options

- `BetaToolChoiceOptions = "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.

  - `"none"`

  - `"auto"`

  - `"required"`

### Beta Tool Choice Shell

- `BetaToolChoiceShell`

  Forces the model to call the shell tool when a tool call is required.

  - `type: "shell"`

    The tool to call. Always `shell`.

    - `"shell"`

### Beta Tool Choice Types

- `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" | 5 more`

    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`

    - `"file_search"`

    - `"web_search_preview"`

    - `"computer"`

    - `"computer_use_preview"`

    - `"computer_use"`

    - `"web_search_preview_2025_03_11"`

    - `"image_generation"`

    - `"code_interpreter"`

### Beta Tool Search Tool

- `BetaToolSearchTool`

  Hosted or BYOT tool search configuration for deferred tools.

  - `type: "tool_search"`

    The type of the tool. Always `tool_search`.

    - `"tool_search"`

  - `description?: string | null`

    Description shown to the model for a client-executed tool search tool.

  - `execution?: "server" | "client"`

    Whether tool search is executed by the server or by the client.

    - `"server"`

    - `"client"`

  - `parameters?: unknown`

    Parameter schema for a client-executed tool search tool.

### Beta Web Search Preview Tool

- `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"`

    The type of the web search tool. One of `web_search_preview` or `web_search_preview_2025_03_11`.

    - `"web_search_preview"`

    - `"web_search_preview_2025_03_11"`

  - `search_content_types?: Array<"text" | "image">`

    - `"text"`

    - `"image"`

  - `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.

    - `"low"`

    - `"medium"`

    - `"high"`

  - `user_location?: UserLocation | null`

    The user's location.

    - `type: "approximate"`

      The type of location approximation. Always `approximate`.

      - `"approximate"`

    - `city?: string | null`

      Free text input for the city of the user, e.g. `San Francisco`.

    - `country?: string | null`

      The two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of the user, e.g. `US`.

    - `region?: string | null`

      Free text input for the region of the user, e.g. `California`.

    - `timezone?: string | null`

      The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of the user, e.g. `America/Los_Angeles`.

### Beta Web Search Tool

- `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"`

    The type of the web search tool. One of `web_search` or `web_search_2025_08_26`.

    - `"web_search"`

    - `"web_search_2025_08_26"`

  - `external_web_access?: boolean`

    Allow live internet access for web search. Defaults to true when omitted. When false, the web search tool runs in offline/cache-only mode and will not fetch new external content.

  - `filters?: Filters | null`

    Filters for the search.

    - `allowed_domains?: Array<string> | null`

      Allowed domains for the search. If not provided, all domains are allowed.
      Subdomains of the provided domains are allowed as well.

      Example: `["pubmed.ncbi.nlm.nih.gov"]`

  - `search_context_size?: "low" | "medium" | "high"`

    High level guidance for the amount of context window space to use for the search. One of `low`, `medium`, or `high`. `medium` is the default.

    - `"low"`

    - `"medium"`

    - `"high"`

  - `user_location?: UserLocation | null`

    The approximate location of the user.

    - `city?: string | null`

      Free text input for the city of the user, e.g. `San Francisco`.

    - `country?: string | null`

      The two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of the user, e.g. `US`.

    - `region?: string | null`

      Free text input for the region of the user, e.g. `California`.

    - `timezone?: string | null`

      The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of the user, e.g. `America/Los_Angeles`.

    - `type?: "approximate"`

      The type of location approximation. Always `approximate`.

      - `"approximate"`

# Input Items

## List input items

`client.beta.responses.inputItems.list(stringresponseID, InputItemListParamsparams?, RequestOptionsoptions?): CursorPage<BetaResponseItem>`

**get** `/responses/{response_id}/input_items?beta=true`

Returns a list of input items for a given response.

### Parameters

- `responseID: string`

- `params: InputItemListParams`

  - `after?: string`

    Query param: An item ID to list items after, used in pagination.

  - `include?: Array<BetaResponseIncludable>`

    Query param: Additional fields to include in the response. See the `include`
    parameter for Response creation above for more information.

    - `"file_search_call.results"`

    - `"web_search_call.results"`

    - `"web_search_call.action.sources"`

    - `"message.input_image.image_url"`

    - `"computer_call_output.output.image_url"`

    - `"code_interpreter_call.outputs"`

    - `"reasoning.encrypted_content"`

    - `"message.output_text.logprobs"`

  - `limit?: number`

    Query param: A limit on the number of objects to be returned. Limit can range between
    1 and 100, and the default is 20.

  - `order?: "asc" | "desc"`

    Query param: The order to return the input items in. Default is `desc`.

    - `asc`: Return the input items in ascending order.
    - `desc`: Return the input items in descending order.

    - `"asc"`

    - `"desc"`

  - `betas?: Array<"responses_multi_agent=v1">`

    Header param: Optional beta features to enable for this request.

    - `"responses_multi_agent=v1"`

### Returns

- `BetaResponseItem = BetaResponseInputMessageItem | BetaResponseOutputMessage | BetaResponseFileSearchToolCall | 29 more`

  Content item used to generate a response.

  - `BetaResponseInputMessageItem`

    - `id: string`

      The unique ID of the message input.

    - `content: BetaResponseInputMessageContentList`

      A list of one or many input items to the model, containing different content
      types.

      - `BetaResponseInputText`

        A text input to the model.

        - `text: string`

          The text input to the model.

        - `type: "input_text"`

          The type of the input item. Always `input_text`.

          - `"input_text"`

        - `prompt_cache_breakpoint?: PromptCacheBreakpoint`

          Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.

          - `mode: "explicit"`

            The breakpoint mode. Always `explicit`.

            - `"explicit"`

      - `BetaResponseInputImage`

        An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision).

        - `detail: BetaImageDetail`

          The detail level of the image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`.

          - `"low"`

          - `"high"`

          - `"auto"`

          - `"original"`

        - `type: "input_image"`

          The type of the input item. Always `input_image`.

          - `"input_image"`

        - `file_id?: string | null`

          The ID of the file to be sent to the model.

        - `image_url?: string | null`

          The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.

        - `prompt_cache_breakpoint?: PromptCacheBreakpoint`

          Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.

          - `mode: "explicit"`

            The breakpoint mode. Always `explicit`.

            - `"explicit"`

      - `BetaResponseInputFile`

        A file input to the model.

        - `type: "input_file"`

          The type of the input item. Always `input_file`.

          - `"input_file"`

        - `detail?: "auto" | "low" | "high"`

          The detail level of the file to be sent to the model. Use `auto` to let the system select the detail level; for GPT-5.6 and later models, `auto` uses high-quality rendering, which may increase input token usage. Use `low` for lower-cost rendering, or `high` to render the file at higher quality. Defaults to `auto`.

          - `"auto"`

          - `"low"`

          - `"high"`

        - `file_data?: string`

          The content of the file to be sent to the model.

        - `file_id?: string | null`

          The ID of the file to be sent to the model.

        - `file_url?: string`

          The URL of the file to be sent to the model.

        - `filename?: string`

          The name of the file to be sent to the model.

        - `prompt_cache_breakpoint?: PromptCacheBreakpoint`

          Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.

          - `mode: "explicit"`

            The breakpoint mode. Always `explicit`.

            - `"explicit"`

    - `role: "user" | "system" | "developer"`

      The role of the message input. One of `user`, `system`, or `developer`.

      - `"user"`

      - `"system"`

      - `"developer"`

    - `type: "message"`

      The type of the message input. Always set to `message`.

      - `"message"`

    - `agent?: Agent | null`

      The agent that produced this item.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

    - `status?: "in_progress" | "completed" | "incomplete"`

      The status of item. One of `in_progress`, `completed`, or
      `incomplete`. Populated when items are returned via API.

      - `"in_progress"`

      - `"completed"`

      - `"incomplete"`

  - `BetaResponseOutputMessage`

    An output message from the model.

    - `id: string`

      The unique ID of the output message.

    - `content: Array<BetaResponseOutputText | BetaResponseOutputRefusal>`

      The content of the output message.

      - `BetaResponseOutputText`

        A text output from the model.

        - `annotations: Array<FileCitation | URLCitation | ContainerFileCitation | FilePath>`

          The annotations of the text output.

          - `FileCitation`

            A citation to a file.

            - `file_id: string`

              The ID of the file.

            - `filename: string`

              The filename of the file cited.

            - `index: number`

              The index of the file in the list of files.

            - `type: "file_citation"`

              The type of the file citation. Always `file_citation`.

              - `"file_citation"`

          - `URLCitation`

            A citation for a web resource used to generate a model response.

            - `end_index: number`

              The index of the last character of the URL citation in the message.

            - `start_index: number`

              The index of the first character of the URL citation in the message.

            - `title: string`

              The title of the web resource.

            - `type: "url_citation"`

              The type of the URL citation. Always `url_citation`.

              - `"url_citation"`

            - `url: string`

              The URL of the web resource.

          - `ContainerFileCitation`

            A citation for a container file used to generate a model response.

            - `container_id: string`

              The ID of the container file.

            - `end_index: number`

              The index of the last character of the container file citation in the message.

            - `file_id: string`

              The ID of the file.

            - `filename: string`

              The filename of the container file cited.

            - `start_index: number`

              The index of the first character of the container file citation in the message.

            - `type: "container_file_citation"`

              The type of the container file citation. Always `container_file_citation`.

              - `"container_file_citation"`

          - `FilePath`

            A path to a file.

            - `file_id: string`

              The ID of the file.

            - `index: number`

              The index of the file in the list of files.

            - `type: "file_path"`

              The type of the file path. Always `file_path`.

              - `"file_path"`

        - `text: string`

          The text output from the model.

        - `type: "output_text"`

          The type of the output text. Always `output_text`.

          - `"output_text"`

        - `logprobs?: Array<Logprob>`

          - `token: string`

          - `bytes: Array<number>`

          - `logprob: number`

          - `top_logprobs: Array<TopLogprob>`

            - `token: string`

            - `bytes: Array<number>`

            - `logprob: number`

      - `BetaResponseOutputRefusal`

        A refusal from the model.

        - `refusal: string`

          The refusal explanation from the model.

        - `type: "refusal"`

          The type of the refusal. Always `refusal`.

          - `"refusal"`

    - `role: "assistant"`

      The role of the output message. Always `assistant`.

      - `"assistant"`

    - `status: "in_progress" | "completed" | "incomplete"`

      The status of the message input. One of `in_progress`, `completed`, or
      `incomplete`. Populated when input items are returned via API.

      - `"in_progress"`

      - `"completed"`

      - `"incomplete"`

    - `type: "message"`

      The type of the output message. Always `message`.

      - `"message"`

    - `agent?: Agent | null`

      The agent that produced this item.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

    - `phase?: "commentary" | "final_answer" | null`

      Labels an `assistant` message as intermediate commentary (`commentary`) or the final answer (`final_answer`).
      For models like `gpt-5.3-codex` and beyond, when sending follow-up requests, preserve and resend
      phase on all assistant messages — dropping it can degrade performance. Not used for user messages.

      - `"commentary"`

      - `"final_answer"`

  - `BetaResponseFileSearchToolCall`

    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.

    - `id: string`

      The unique ID of the file search tool call.

    - `queries: Array<string>`

      The queries used to search for files.

    - `status: "in_progress" | "searching" | "completed" | 2 more`

      The status of the file search tool call. One of `in_progress`,
      `searching`, `incomplete` or `failed`,

      - `"in_progress"`

      - `"searching"`

      - `"completed"`

      - `"incomplete"`

      - `"failed"`

    - `type: "file_search_call"`

      The type of the file search tool call. Always `file_search_call`.

      - `"file_search_call"`

    - `agent?: Agent | null`

      The agent that produced this item.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

    - `results?: Array<Result> | null`

      The results of the file search tool call.

      - `attributes?: Record<string, string | number | boolean> | null`

        Set of 16 key-value pairs that can be attached to an object. This can be
        useful for storing additional information about the object in a structured
        format, and querying for objects via API or the dashboard. Keys are strings
        with a maximum length of 64 characters. Values are strings with a maximum
        length of 512 characters, booleans, or numbers.

        - `string`

        - `number`

        - `boolean`

      - `file_id?: string`

        The unique ID of the file.

      - `filename?: string`

        The name of the file.

      - `score?: number`

        The relevance score of the file - a value between 0 and 1.

      - `text?: string`

        The text that was retrieved from the file.

  - `BetaResponseComputerToolCall`

    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.

    - `id: string`

      The unique ID of the computer call.

    - `call_id: string`

      An identifier used when responding to the tool call with output.

    - `pending_safety_checks: Array<PendingSafetyCheck>`

      The pending safety checks for the computer call.

      - `id: string`

        The ID of the pending safety check.

      - `code?: string | null`

        The type of the pending safety check.

      - `message?: string | null`

        Details about the pending safety check.

    - `status: "in_progress" | "completed" | "incomplete"`

      The status of the item. One of `in_progress`, `completed`, or
      `incomplete`. Populated when items are returned via API.

      - `"in_progress"`

      - `"completed"`

      - `"incomplete"`

    - `type: "computer_call"`

      The type of the computer call. Always `computer_call`.

      - `"computer_call"`

    - `action?: BetaComputerAction`

      A click action.

      - `Click`

        A click action.

        - `button: "left" | "right" | "wheel" | 2 more`

          Indicates which mouse button was pressed during the click. One of `left`, `right`, `wheel`, `back`, or `forward`.

          - `"left"`

          - `"right"`

          - `"wheel"`

          - `"back"`

          - `"forward"`

        - `type: "click"`

          Specifies the event type. For a click action, this property is always `click`.

          - `"click"`

        - `x: number`

          The x-coordinate where the click occurred.

        - `y: number`

          The y-coordinate where the click occurred.

        - `keys?: Array<string> | null`

          The keys being held while clicking.

      - `DoubleClick`

        A double click action.

        - `keys: Array<string> | null`

          The keys being held while double-clicking.

        - `type: "double_click"`

          Specifies the event type. For a double click action, this property is always set to `double_click`.

          - `"double_click"`

        - `x: number`

          The x-coordinate where the double click occurred.

        - `y: number`

          The y-coordinate where the double click occurred.

      - `Drag`

        A drag action.

        - `path: Array<Path>`

          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 }
          ]
          ```

          - `x: number`

            The x-coordinate.

          - `y: number`

            The y-coordinate.

        - `type: "drag"`

          Specifies the event type. For a drag action, this property is always set to `drag`.

          - `"drag"`

        - `keys?: Array<string> | null`

          The keys being held while dragging the mouse.

      - `Keypress`

        A collection of keypresses the model would like to perform.

        - `keys: Array<string>`

          The combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key.

        - `type: "keypress"`

          Specifies the event type. For a keypress action, this property is always set to `keypress`.

          - `"keypress"`

      - `Move`

        A mouse move action.

        - `type: "move"`

          Specifies the event type. For a move action, this property is always set to `move`.

          - `"move"`

        - `x: number`

          The x-coordinate to move to.

        - `y: number`

          The y-coordinate to move to.

        - `keys?: Array<string> | null`

          The keys being held while moving the mouse.

      - `Screenshot`

        A screenshot action.

        - `type: "screenshot"`

          Specifies the event type. For a screenshot action, this property is always set to `screenshot`.

          - `"screenshot"`

      - `Scroll`

        A scroll action.

        - `scroll_x: number`

          The horizontal scroll distance.

        - `scroll_y: number`

          The vertical scroll distance.

        - `type: "scroll"`

          Specifies the event type. For a scroll action, this property is always set to `scroll`.

          - `"scroll"`

        - `x: number`

          The x-coordinate where the scroll occurred.

        - `y: number`

          The y-coordinate where the scroll occurred.

        - `keys?: Array<string> | null`

          The keys being held while scrolling.

      - `Type`

        An action to type in text.

        - `text: string`

          The text to type.

        - `type: "type"`

          Specifies the event type. For a type action, this property is always set to `type`.

          - `"type"`

      - `Wait`

        A wait action.

        - `type: "wait"`

          Specifies the event type. For a wait action, this property is always set to `wait`.

          - `"wait"`

    - `actions?: BetaComputerActionList`

      Flattened batched actions for `computer_use`. Each action includes an
      `type` discriminator and action-specific fields.

      - `Click`

        A click action.

      - `DoubleClick`

        A double click action.

      - `Drag`

        A drag action.

      - `Keypress`

        A collection of keypresses the model would like to perform.

      - `Move`

        A mouse move action.

      - `Screenshot`

        A screenshot action.

      - `Scroll`

        A scroll action.

      - `Type`

        An action to type in text.

      - `Wait`

        A wait action.

    - `agent?: Agent | null`

      The agent that produced this item.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

  - `BetaResponseComputerToolCallOutputItem`

    - `id: string`

      The unique ID of the computer call tool output.

    - `call_id: string`

      The ID of the computer tool call that produced the output.

    - `output: BetaResponseComputerToolCallOutputScreenshot`

      A computer screenshot image used with the computer use tool.

      - `type: "computer_screenshot"`

        Specifies the event type. For a computer screenshot, this property is
        always set to `computer_screenshot`.

        - `"computer_screenshot"`

      - `file_id?: string`

        The identifier of an uploaded file that contains the screenshot.

      - `image_url?: string`

        The URL of the screenshot image.

    - `status: "completed" | "incomplete" | "failed" | "in_progress"`

      The status of the message input. One of `in_progress`, `completed`, or
      `incomplete`. Populated when input items are returned via API.

      - `"completed"`

      - `"incomplete"`

      - `"failed"`

      - `"in_progress"`

    - `type: "computer_call_output"`

      The type of the computer tool call output. Always `computer_call_output`.

      - `"computer_call_output"`

    - `acknowledged_safety_checks?: Array<AcknowledgedSafetyCheck>`

      The safety checks reported by the API that have been acknowledged by the
      developer.

      - `id: string`

        The ID of the pending safety check.

      - `code?: string | null`

        The type of the pending safety check.

      - `message?: string | null`

        Details about the pending safety check.

    - `agent?: Agent | null`

      The agent that produced this item.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

    - `created_by?: string`

      The identifier of the actor that created the item.

  - `BetaResponseFunctionWebSearch`

    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.

    - `id: string`

      The unique ID of the web search tool call.

    - `action: Search | OpenPage | FindInPage`

      An object describing the specific action taken in this web search call.
      Includes details on how the model used the web (search, open_page, find_in_page).

      - `Search`

        Action type "search" - Performs a web search query.

        - `type: "search"`

          The action type.

          - `"search"`

        - `queries?: Array<string>`

          The search queries.

        - `query?: string`

          The search query.

        - `sources?: Array<Source>`

          The sources used in the search.

          - `type: "url"`

            The type of source. Always `url`.

            - `"url"`

          - `url: string`

            The URL of the source.

      - `OpenPage`

        Action type "open_page" - Opens a specific URL from search results.

        - `type: "open_page"`

          The action type.

          - `"open_page"`

        - `url?: string | null`

          The URL opened by the model.

      - `FindInPage`

        Action type "find_in_page": Searches for a pattern within a loaded page.

        - `pattern: string`

          The pattern or text to search for within the page.

        - `type: "find_in_page"`

          The action type.

          - `"find_in_page"`

        - `url: string`

          The URL of the page searched for the pattern.

    - `status: "in_progress" | "searching" | "completed" | "failed"`

      The status of the web search tool call.

      - `"in_progress"`

      - `"searching"`

      - `"completed"`

      - `"failed"`

    - `type: "web_search_call"`

      The type of the web search tool call. Always `web_search_call`.

      - `"web_search_call"`

    - `agent?: Agent | null`

      The agent that produced this item.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

  - `BetaResponseFunctionToolCallItem extends BetaResponseFunctionToolCall`

    A tool call to run a function. See the
    [function calling guide](https://platform.openai.com/docs/guides/function-calling) for more information.

    - `id: string`

      The unique ID of the function tool call.

    - `status: "in_progress" | "completed" | "incomplete"`

      The status of the item. One of `in_progress`, `completed`, or
      `incomplete`. Populated when items are returned via API.

      - `"in_progress"`

      - `"completed"`

      - `"incomplete"`

    - `created_by?: string`

      The identifier of the actor that created the item.

  - `BetaResponseFunctionToolCallOutputItem`

    - `id: string`

      The unique ID of the function call tool output.

    - `call_id: string`

      The unique ID of the function tool call generated by the model.

    - `output: string | Array<BetaResponseInputText | BetaResponseInputImage | BetaResponseInputFile>`

      The output from the function call generated by your code.
      Can be a string or an list of output content.

      - `string`

      - `Array<BetaResponseInputText | BetaResponseInputImage | BetaResponseInputFile>`

        - `BetaResponseInputText`

          A text input to the model.

        - `BetaResponseInputImage`

          An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision).

        - `BetaResponseInputFile`

          A file input to 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.

      - `"in_progress"`

      - `"completed"`

      - `"incomplete"`

    - `type: "function_call_output"`

      The type of the function tool call output. Always `function_call_output`.

      - `"function_call_output"`

    - `agent?: Agent | null`

      The agent that produced this item.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

    - `caller?: Direct | Program | null`

      The execution context that produced this tool call.

      - `Direct`

        - `type: "direct"`

          The caller type. Always `direct`.

          - `"direct"`

      - `Program`

        - `caller_id: string`

          The call ID of the program item that produced this tool call.

        - `type: "program"`

          The caller type. Always `program`.

          - `"program"`

    - `created_by?: string`

      The identifier of the actor that created the item.

    - `name?: string`

      The name of the tool that produced the output.

    - `namespace?: string`

      The namespace of the tool that produced the output.

  - `AgentMessage`

    - `id: string`

      The unique ID of the agent message.

    - `author: string`

      The sending agent identity.

    - `content: Array<BetaResponseInputText | BetaResponseOutputText | Text | 7 more>`

      Encrypted content sent between agents.

      - `BetaResponseInputText`

        A text input to the model.

      - `BetaResponseOutputText`

        A text output from the model.

      - `Text`

        A text content.

        - `text: string`

        - `type: "text"`

          - `"text"`

      - `SummaryText`

        A summary text from the model.

        - `text: string`

          A summary of the reasoning output from the model so far.

        - `type: "summary_text"`

          The type of the object. Always `summary_text`.

          - `"summary_text"`

      - `ReasoningText`

        Reasoning text from the model.

        - `text: string`

          The reasoning text from the model.

        - `type: "reasoning_text"`

          The type of the reasoning text. Always `reasoning_text`.

          - `"reasoning_text"`

      - `BetaResponseOutputRefusal`

        A refusal from the model.

      - `BetaResponseInputImage`

        An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision).

      - `ComputerScreenshot`

        A screenshot of a computer.

        - `detail: BetaImageDetail`

          The detail level of the screenshot image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`.

        - `file_id: string | null`

          The identifier of an uploaded file that contains the screenshot.

        - `image_url: string | null`

          The URL of the screenshot image.

        - `type: "computer_screenshot"`

          Specifies the event type. For a computer screenshot, this property is always set to `computer_screenshot`.

          - `"computer_screenshot"`

        - `prompt_cache_breakpoint?: PromptCacheBreakpoint`

          Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.

          - `mode: "explicit"`

            The breakpoint mode. Always `explicit`.

            - `"explicit"`

      - `BetaResponseInputFile`

        A file input to the model.

      - `EncryptedContent`

        Opaque encrypted content that Responses API decrypts inside trusted model execution.

        - `encrypted_content: string`

          Opaque encrypted content.

        - `type: "encrypted_content"`

          The type of the input item. Always `encrypted_content`.

          - `"encrypted_content"`

    - `recipient: string`

      The destination agent identity.

    - `type: "agent_message"`

      The type of the item. Always `agent_message`.

      - `"agent_message"`

    - `agent?: Agent`

      The agent that produced this item.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

  - `MultiAgentCall`

    - `id: string`

      The unique ID of the multi-agent call item.

    - `action: "spawn_agent" | "interrupt_agent" | "list_agents" | 3 more`

      The multi-agent action to execute.

      - `"spawn_agent"`

      - `"interrupt_agent"`

      - `"list_agents"`

      - `"send_message"`

      - `"followup_task"`

      - `"wait_agent"`

    - `arguments: string`

      The JSON string of arguments generated for the action.

    - `call_id: string`

      The unique ID linking this call to its output.

    - `type: "multi_agent_call"`

      The type of the multi-agent call. Always `multi_agent_call`.

      - `"multi_agent_call"`

    - `agent?: Agent`

      The agent that produced this item.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

  - `MultiAgentCallOutput`

    - `id: string`

      The unique ID of the multi-agent call output item.

    - `action: "spawn_agent" | "interrupt_agent" | "list_agents" | 3 more`

      The multi-agent action that produced this result.

      - `"spawn_agent"`

      - `"interrupt_agent"`

      - `"list_agents"`

      - `"send_message"`

      - `"followup_task"`

      - `"wait_agent"`

    - `call_id: string`

      The unique ID of the multi-agent call.

    - `output: Array<BetaResponseOutputText>`

      Text output returned by the multi-agent action.

      - `annotations: Array<FileCitation | URLCitation | ContainerFileCitation | FilePath>`

        The annotations of the text output.

      - `text: string`

        The text output from the model.

      - `type: "output_text"`

        The type of the output text. Always `output_text`.

      - `logprobs?: Array<Logprob>`

    - `type: "multi_agent_call_output"`

      The type of the multi-agent result. Always `multi_agent_call_output`.

      - `"multi_agent_call_output"`

    - `agent?: Agent`

      The agent that produced this item.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

  - `BetaResponseToolSearchCall`

    - `id: string`

      The unique ID of the tool search call item.

    - `arguments: unknown`

      Arguments used for the tool search call.

    - `call_id: string | null`

      The unique ID of the tool search call generated by the model.

    - `execution: "server" | "client"`

      Whether tool search was executed by the server or by the client.

      - `"server"`

      - `"client"`

    - `status: "in_progress" | "completed" | "incomplete"`

      The status of the tool search call item that was recorded.

      - `"in_progress"`

      - `"completed"`

      - `"incomplete"`

    - `type: "tool_search_call"`

      The type of the item. Always `tool_search_call`.

      - `"tool_search_call"`

    - `agent?: Agent`

      The agent that produced this item.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

    - `created_by?: string`

      The identifier of the actor that created the item.

  - `BetaResponseToolSearchOutputItem`

    - `id: string`

      The unique ID of the tool search output item.

    - `call_id: string | null`

      The unique ID of the tool search call generated by the model.

    - `execution: "server" | "client"`

      Whether tool search was executed by the server or by the client.

      - `"server"`

      - `"client"`

    - `status: "in_progress" | "completed" | "incomplete"`

      The status of the tool search output item that was recorded.

      - `"in_progress"`

      - `"completed"`

      - `"incomplete"`

    - `tools: Array<BetaTool>`

      The loaded tool definitions returned by tool search.

      - `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).

        - `name: string`

          The name of the function to call.

        - `parameters: Record<string, unknown> | null`

          A JSON schema object describing the parameters of the function.

        - `strict: boolean | null`

          Whether strict parameter validation is enforced for this function tool.

        - `type: "function"`

          The type of the function tool. Always `function`.

          - `"function"`

        - `allowed_callers?: Array<"direct" | "programmatic"> | null`

          The tool invocation context(s).

          - `"direct"`

          - `"programmatic"`

        - `defer_loading?: boolean`

          Whether this function is deferred and loaded via tool search.

        - `description?: string | null`

          A description of the function. Used by the model to determine whether or not to call the function.

        - `output_schema?: Record<string, unknown> | null`

          A JSON schema object describing the JSON value encoded in string outputs for this function.

      - `BetaFileSearchTool`

        A tool that searches for relevant content from uploaded files. Learn more about the [file search tool](https://platform.openai.com/docs/guides/tools-file-search).

        - `type: "file_search"`

          The type of the file search tool. Always `file_search`.

          - `"file_search"`

        - `vector_store_ids: Array<string>`

          The IDs of the vector stores to search.

        - `filters?: ComparisonFilter | CompoundFilter | null`

          A filter to apply.

          - `ComparisonFilter`

            A filter used to compare a specified attribute key to a given value using a defined comparison operation.

            - `key: string`

              The key to compare against the value.

            - `type: "eq" | "ne" | "gt" | 5 more`

              Specifies the comparison operator: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`, `in`, `nin`.

              - `eq`: equals
              - `ne`: not equal
              - `gt`: greater than
              - `gte`: greater than or equal
              - `lt`: less than
              - `lte`: less than or equal
              - `in`: in
              - `nin`: not in

              - `"eq"`

              - `"ne"`

              - `"gt"`

              - `"gte"`

              - `"lt"`

              - `"lte"`

              - `"in"`

              - `"nin"`

            - `value: string | number | boolean | Array<string | number>`

              The value to compare against the attribute key; supports string, number, or boolean types.

              - `string`

              - `number`

              - `boolean`

              - `Array<string | number>`

                - `string`

                - `number`

          - `CompoundFilter`

            Combine multiple filters using `and` or `or`.

            - `filters: Array<ComparisonFilter | unknown>`

              Array of filters to combine. Items can be `ComparisonFilter` or `CompoundFilter`.

              - `ComparisonFilter`

                A filter used to compare a specified attribute key to a given value using a defined comparison operation.

                - `key: string`

                  The key to compare against the value.

                - `type: "eq" | "ne" | "gt" | 5 more`

                  Specifies the comparison operator: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`, `in`, `nin`.

                  - `eq`: equals
                  - `ne`: not equal
                  - `gt`: greater than
                  - `gte`: greater than or equal
                  - `lt`: less than
                  - `lte`: less than or equal
                  - `in`: in
                  - `nin`: not in

                  - `"eq"`

                  - `"ne"`

                  - `"gt"`

                  - `"gte"`

                  - `"lt"`

                  - `"lte"`

                  - `"in"`

                  - `"nin"`

                - `value: string | number | boolean | Array<string | number>`

                  The value to compare against the attribute key; supports string, number, or boolean types.

                  - `string`

                  - `number`

                  - `boolean`

                  - `Array<string | number>`

                    - `string`

                    - `number`

              - `unknown`

            - `type: "and" | "or"`

              Type of operation: `and` or `or`.

              - `"and"`

              - `"or"`

        - `max_num_results?: number`

          The maximum number of results to return. This number should be between 1 and 50 inclusive.

        - `ranking_options?: RankingOptions`

          Ranking options for search.

          - `hybrid_search?: HybridSearch`

            Weights that control how reciprocal rank fusion balances semantic embedding matches versus sparse keyword matches when hybrid search is enabled.

            - `embedding_weight: number`

              The weight of the embedding in the reciprocal ranking fusion.

            - `text_weight: number`

              The weight of the text in the reciprocal ranking fusion.

          - `ranker?: "auto" | "default-2024-11-15"`

            The ranker to use for the file search.

            - `"auto"`

            - `"default-2024-11-15"`

          - `score_threshold?: number`

            The score threshold for the file search, a number between 0 and 1. Numbers closer to 1 will attempt to return only the most relevant results, but may return fewer results.

      - `BetaComputerTool`

        A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use).

        - `type: "computer"`

          The type of the computer tool. Always `computer`.

          - `"computer"`

      - `BetaComputerUsePreviewTool`

        A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use).

        - `display_height: number`

          The height of the computer display.

        - `display_width: number`

          The width of the computer display.

        - `environment: "windows" | "mac" | "linux" | 2 more`

          The type of computer environment to control.

          - `"windows"`

          - `"mac"`

          - `"linux"`

          - `"ubuntu"`

          - `"browser"`

        - `type: "computer_use_preview"`

          The type of the computer use tool. Always `computer_use_preview`.

          - `"computer_use_preview"`

      - `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"`

          The type of the web search tool. One of `web_search` or `web_search_2025_08_26`.

          - `"web_search"`

          - `"web_search_2025_08_26"`

        - `external_web_access?: boolean`

          Allow live internet access for web search. Defaults to true when omitted. When false, the web search tool runs in offline/cache-only mode and will not fetch new external content.

        - `filters?: Filters | null`

          Filters for the search.

          - `allowed_domains?: Array<string> | null`

            Allowed domains for the search. If not provided, all domains are allowed.
            Subdomains of the provided domains are allowed as well.

            Example: `["pubmed.ncbi.nlm.nih.gov"]`

        - `search_context_size?: "low" | "medium" | "high"`

          High level guidance for the amount of context window space to use for the search. One of `low`, `medium`, or `high`. `medium` is the default.

          - `"low"`

          - `"medium"`

          - `"high"`

        - `user_location?: UserLocation | null`

          The approximate location of the user.

          - `city?: string | null`

            Free text input for the city of the user, e.g. `San Francisco`.

          - `country?: string | null`

            The two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of the user, e.g. `US`.

          - `region?: string | null`

            Free text input for the region of the user, e.g. `California`.

          - `timezone?: string | null`

            The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of the user, e.g. `America/Los_Angeles`.

          - `type?: "approximate"`

            The type of location approximation. Always `approximate`.

            - `"approximate"`

      - `Mcp`

        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).

        - `server_label: string`

          A label for this MCP server, used to identify it in tool calls.

        - `type: "mcp"`

          The type of the MCP tool. Always `mcp`.

          - `"mcp"`

        - `allowed_callers?: Array<"direct" | "programmatic"> | null`

          The tool invocation context(s).

          - `"direct"`

          - `"programmatic"`

        - `allowed_tools?: Array<string> | McpToolFilter | null`

          List of allowed tool names or a filter object.

          - `Array<string>`

          - `McpToolFilter`

            A filter object to specify which tools are allowed.

            - `read_only?: boolean`

              Indicates whether or not a tool modifies data or is read-only. If an
              MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint),
              it will match this filter.

            - `tool_names?: Array<string>`

              List of allowed tool names.

        - `authorization?: string`

          An OAuth access token that can be used with a remote MCP server, either
          with a custom MCP server URL or a service connector. Your application
          must handle the OAuth authorization flow and provide the token here.

        - `connector_id?: "connector_dropbox" | "connector_gmail" | "connector_googlecalendar" | 5 more`

          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`

          - `"connector_dropbox"`

          - `"connector_gmail"`

          - `"connector_googlecalendar"`

          - `"connector_googledrive"`

          - `"connector_microsoftteams"`

          - `"connector_outlookcalendar"`

          - `"connector_outlookemail"`

          - `"connector_sharepoint"`

        - `defer_loading?: boolean`

          Whether this MCP tool is deferred and discovered via tool search.

        - `headers?: Record<string, string> | null`

          Optional HTTP headers to send to the MCP server. Use for authentication
          or other purposes.

        - `require_approval?: McpToolApprovalFilter | "always" | "never" | null`

          Specify which of the MCP server's tools require approval.

          - `McpToolApprovalFilter`

            Specify which of the MCP server's tools require approval. Can be
            `always`, `never`, or a filter object associated with tools
            that require approval.

            - `always?: Always`

              A filter object to specify which tools are allowed.

              - `read_only?: boolean`

                Indicates whether or not a tool modifies data or is read-only. If an
                MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint),
                it will match this filter.

              - `tool_names?: Array<string>`

                List of allowed tool names.

            - `never?: Never`

              A filter object to specify which tools are allowed.

              - `read_only?: boolean`

                Indicates whether or not a tool modifies data or is read-only. If an
                MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint),
                it will match this filter.

              - `tool_names?: Array<string>`

                List of allowed tool names.

          - `"always" | "never"`

            - `"always"`

            - `"never"`

        - `server_description?: string`

          Optional description of the MCP server, used to provide more context.

        - `server_url?: string`

          The URL for the MCP server. One of `server_url`, `connector_id`, or
          `tunnel_id` must be provided.

        - `tunnel_id?: string`

          The Secure MCP Tunnel ID to use instead of a direct server URL. One of
          `server_url`, `connector_id`, or `tunnel_id` must be provided.

      - `CodeInterpreter`

        A tool that runs Python code to help generate a response to a prompt.

        - `container: string | CodeInterpreterToolAuto`

          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`

          - `CodeInterpreterToolAuto`

            Configuration for a code interpreter container. Optionally specify the IDs of the files to run the code on.

            - `type: "auto"`

              Always `auto`.

              - `"auto"`

            - `file_ids?: Array<string>`

              An optional list of uploaded files to make available to your code.

            - `memory_limit?: "1g" | "4g" | "16g" | "64g" | null`

              The memory limit for the code interpreter container.

              - `"1g"`

              - `"4g"`

              - `"16g"`

              - `"64g"`

            - `network_policy?: BetaContainerNetworkPolicyDisabled | BetaContainerNetworkPolicyAllowlist`

              Network access policy for the container.

              - `BetaContainerNetworkPolicyDisabled`

                - `type: "disabled"`

                  Disable outbound network access. Always `disabled`.

                  - `"disabled"`

              - `BetaContainerNetworkPolicyAllowlist`

                - `allowed_domains: Array<string>`

                  A list of allowed domains when type is `allowlist`.

                - `type: "allowlist"`

                  Allow outbound network access only to specified domains. Always `allowlist`.

                  - `"allowlist"`

                - `domain_secrets?: Array<BetaContainerNetworkPolicyDomainSecret>`

                  Optional domain-scoped secrets for allowlisted domains.

                  - `domain: string`

                    The domain associated with the secret.

                  - `name: string`

                    The name of the secret to inject for the domain.

                  - `value: string`

                    The secret value to inject for the domain.

        - `type: "code_interpreter"`

          The type of the code interpreter tool. Always `code_interpreter`.

          - `"code_interpreter"`

        - `allowed_callers?: Array<"direct" | "programmatic"> | null`

          The tool invocation context(s).

          - `"direct"`

          - `"programmatic"`

      - `ProgrammaticToolCalling`

        - `type: "programmatic_tool_calling"`

          The type of the tool. Always `programmatic_tool_calling`.

          - `"programmatic_tool_calling"`

      - `ImageGeneration`

        A tool that generates images using the GPT image models.

        - `type: "image_generation"`

          The type of the image generation tool. Always `image_generation`.

          - `"image_generation"`

        - `action?: "generate" | "edit" | "auto"`

          Whether to generate a new image or edit an existing image. Default: `auto`.

          - `"generate"`

          - `"edit"`

          - `"auto"`

        - `background?: "transparent" | "opaque" | "auto"`

          Allows to set transparency for the background of the generated image(s).
          Must be one of `transparent`, `opaque`, or `auto` (default value). When
          `auto` is used, the model will automatically determine the best
          background for the image.

          Transparent backgrounds are available for supported GPT Image models.
          For `gpt-image-2` and `gpt-image-2-2026-04-21`, this support is in
          preview. When using `transparent`, set the output format to `png` or
          `webp`.

          - `"transparent"`

          - `"opaque"`

          - `"auto"`

        - `input_fidelity?: "high" | "low" | null`

          Control how much effort the model will exert to match the style and features, especially facial features, of input images. This parameter is only supported for `gpt-image-1` and `gpt-image-1.5` and later models, unsupported for `gpt-image-1-mini`. Supports `high` and `low`. Defaults to `low`.

          - `"high"`

          - `"low"`

        - `input_image_mask?: InputImageMask`

          Optional mask for inpainting. Contains `image_url`
          (string, optional) and `file_id` (string, optional).

          - `file_id?: string`

            File ID for the mask image.

          - `image_url?: string`

            Base64-encoded mask image.

        - `model?: (string & {}) | "gpt-image-1" | "gpt-image-1-mini" | "gpt-image-2" | 3 more`

          The image generation model to use. One of `gpt-image-1`,
          `gpt-image-1-mini`, `gpt-image-1.5`, `gpt-image-2`,
          `gpt-image-2-2026-04-21`, or `chatgpt-image-latest`. Default:
          `gpt-image-1`.

          - `(string & {})`

          - `"gpt-image-1" | "gpt-image-1-mini" | "gpt-image-2" | 3 more`

            - `"gpt-image-1"`

            - `"gpt-image-1-mini"`

            - `"gpt-image-2"`

            - `"gpt-image-2-2026-04-21"`

            - `"gpt-image-1.5"`

            - `"chatgpt-image-latest"`

        - `moderation?: "auto" | "low"`

          Moderation level for the generated image. Default: `auto`.

          - `"auto"`

          - `"low"`

        - `output_compression?: number`

          Compression level for the output image. Default: 100.

        - `output_format?: "png" | "webp" | "jpeg"`

          The output format of the generated image. One of `png`, `webp`, or
          `jpeg`. Default: `png`.

          - `"png"`

          - `"webp"`

          - `"jpeg"`

        - `partial_images?: number`

          Number of partial images to generate in streaming mode, from 0 (default value) to 3.

        - `quality?: "low" | "medium" | "high" | "auto"`

          The quality of the generated image. One of `low`, `medium`, `high`,
          or `auto`. Default: `auto`.

          - `"low"`

          - `"medium"`

          - `"high"`

          - `"auto"`

        - `size?: (string & {}) | "1024x1024" | "1024x1536" | "1536x1024" | "auto"`

          The size of the generated images. For `gpt-image-2` and `gpt-image-2-2026-04-21`, arbitrary resolutions are supported as `WIDTHxHEIGHT` strings, for example `1536x864`. Width and height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above `2560x1440` are experimental, and the maximum supported resolution is `3840x2160`. The requested size must also satisfy the model's current pixel and edge limits. The standard sizes `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models; `auto` is supported for models that allow automatic sizing. For `dall-e-2`, use one of `256x256`, `512x512`, or `1024x1024`. For `dall-e-3`, use one of `1024x1024`, `1792x1024`, or `1024x1792`.

          - `(string & {})`

          - `"1024x1024" | "1024x1536" | "1536x1024" | "auto"`

            - `"1024x1024"`

            - `"1024x1536"`

            - `"1536x1024"`

            - `"auto"`

      - `LocalShell`

        A tool that allows the model to execute shell commands in a local environment.

        - `type: "local_shell"`

          The type of the local shell tool. Always `local_shell`.

          - `"local_shell"`

      - `BetaFunctionShellTool`

        A tool that allows the model to execute shell commands.

        - `type: "shell"`

          The type of the shell tool. Always `shell`.

          - `"shell"`

        - `allowed_callers?: Array<"direct" | "programmatic"> | null`

          The tool invocation context(s).

          - `"direct"`

          - `"programmatic"`

        - `environment?: BetaContainerAuto | BetaLocalEnvironment | BetaContainerReference | null`

          - `BetaContainerAuto`

            - `type: "container_auto"`

              Automatically creates a container for this request

              - `"container_auto"`

            - `file_ids?: Array<string>`

              An optional list of uploaded files to make available to your code.

            - `memory_limit?: "1g" | "4g" | "16g" | "64g" | null`

              The memory limit for the container.

              - `"1g"`

              - `"4g"`

              - `"16g"`

              - `"64g"`

            - `network_policy?: BetaContainerNetworkPolicyDisabled | BetaContainerNetworkPolicyAllowlist`

              Network access policy for the container.

              - `BetaContainerNetworkPolicyDisabled`

              - `BetaContainerNetworkPolicyAllowlist`

            - `skills?: Array<BetaSkillReference | BetaInlineSkill>`

              An optional list of skills referenced by id or inline data.

              - `BetaSkillReference`

                - `skill_id: string`

                  The ID of the referenced skill.

                - `type: "skill_reference"`

                  References a skill created with the /v1/skills endpoint.

                  - `"skill_reference"`

                - `version?: string`

                  Optional skill version. Use a positive integer or 'latest'. Omit for default.

              - `BetaInlineSkill`

                - `description: string`

                  The description of the skill.

                - `name: string`

                  The name of the skill.

                - `source: BetaInlineSkillSource`

                  Inline skill payload

                  - `data: string`

                    Base64-encoded skill zip bundle.

                  - `media_type: "application/zip"`

                    The media type of the inline skill payload. Must be `application/zip`.

                    - `"application/zip"`

                  - `type: "base64"`

                    The type of the inline skill source. Must be `base64`.

                    - `"base64"`

                - `type: "inline"`

                  Defines an inline skill for this request.

                  - `"inline"`

          - `BetaLocalEnvironment`

            - `type: "local"`

              Use a local computer environment.

              - `"local"`

            - `skills?: Array<BetaLocalSkill>`

              An optional list of skills.

              - `description: string`

                The description of the skill.

              - `name: string`

                The name of the skill.

              - `path: string`

                The path to the directory containing the skill.

          - `BetaContainerReference`

            - `container_id: string`

              The ID of the referenced container.

            - `type: "container_reference"`

              References a container created with the /v1/containers endpoint

              - `"container_reference"`

      - `BetaCustomTool`

        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)

        - `name: string`

          The name of the custom tool, used to identify it in tool calls.

        - `type: "custom"`

          The type of the custom tool. Always `custom`.

          - `"custom"`

        - `allowed_callers?: Array<"direct" | "programmatic"> | null`

          The tool invocation context(s).

          - `"direct"`

          - `"programmatic"`

        - `defer_loading?: boolean`

          Whether this tool should be deferred and discovered via tool search.

        - `description?: string`

          Optional description of the custom tool, used to provide more context.

        - `format?: Text | Grammar`

          The input format for the custom tool. Default is unconstrained text.

          - `Text`

            Unconstrained free-form text.

            - `type: "text"`

              Unconstrained text format. Always `text`.

              - `"text"`

          - `Grammar`

            A grammar defined by the user.

            - `definition: string`

              The grammar definition.

            - `syntax: "lark" | "regex"`

              The syntax of the grammar definition. One of `lark` or `regex`.

              - `"lark"`

              - `"regex"`

            - `type: "grammar"`

              Grammar format. Always `grammar`.

              - `"grammar"`

      - `BetaNamespaceTool`

        Groups function/custom tools under a shared namespace.

        - `description: string`

          A description of the namespace shown to the model.

        - `name: string`

          The namespace name used in tool calls (for example, `crm`).

        - `tools: Array<Function | BetaCustomTool>`

          The function/custom tools available inside this namespace.

          - `Function`

            - `name: string`

            - `type: "function"`

              - `"function"`

            - `allowed_callers?: Array<"direct" | "programmatic"> | null`

              The tool invocation context(s).

              - `"direct"`

              - `"programmatic"`

            - `defer_loading?: boolean`

              Whether this function should be deferred and discovered via tool search.

            - `description?: string | null`

            - `output_schema?: Record<string, unknown> | null`

              A JSON Schema describing the JSON value encoded in string outputs for this function tool. This does not describe content-array outputs.

            - `parameters?: unknown`

            - `strict?: boolean | null`

              Whether to enforce strict parameter validation. If omitted, Responses attempts to use strict validation when the schema is compatible, and falls back to non-strict validation otherwise.

          - `BetaCustomTool`

            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: "namespace"`

          The type of the tool. Always `namespace`.

          - `"namespace"`

      - `BetaToolSearchTool`

        Hosted or BYOT tool search configuration for deferred tools.

        - `type: "tool_search"`

          The type of the tool. Always `tool_search`.

          - `"tool_search"`

        - `description?: string | null`

          Description shown to the model for a client-executed tool search tool.

        - `execution?: "server" | "client"`

          Whether tool search is executed by the server or by the client.

          - `"server"`

          - `"client"`

        - `parameters?: unknown`

          Parameter schema for a client-executed tool search tool.

      - `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"`

          The type of the web search tool. One of `web_search_preview` or `web_search_preview_2025_03_11`.

          - `"web_search_preview"`

          - `"web_search_preview_2025_03_11"`

        - `search_content_types?: Array<"text" | "image">`

          - `"text"`

          - `"image"`

        - `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.

          - `"low"`

          - `"medium"`

          - `"high"`

        - `user_location?: UserLocation | null`

          The user's location.

          - `type: "approximate"`

            The type of location approximation. Always `approximate`.

            - `"approximate"`

          - `city?: string | null`

            Free text input for the city of the user, e.g. `San Francisco`.

          - `country?: string | null`

            The two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of the user, e.g. `US`.

          - `region?: string | null`

            Free text input for the region of the user, e.g. `California`.

          - `timezone?: string | null`

            The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of the user, e.g. `America/Los_Angeles`.

      - `BetaApplyPatchTool`

        Allows the assistant to create, delete, or update files using unified diffs.

        - `type: "apply_patch"`

          The type of the tool. Always `apply_patch`.

          - `"apply_patch"`

        - `allowed_callers?: Array<"direct" | "programmatic"> | null`

          The tool invocation context(s).

          - `"direct"`

          - `"programmatic"`

    - `type: "tool_search_output"`

      The type of the item. Always `tool_search_output`.

      - `"tool_search_output"`

    - `agent?: Agent`

      The agent that produced this item.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

    - `created_by?: string`

      The identifier of the actor that created the item.

  - `AdditionalTools`

    - `id: string`

      The unique ID of the additional tools item.

    - `role: "unknown" | "user" | "assistant" | 5 more`

      The role that provided the additional tools.

      - `"unknown"`

      - `"user"`

      - `"assistant"`

      - `"system"`

      - `"critic"`

      - `"discriminator"`

      - `"developer"`

      - `"tool"`

    - `tools: Array<BetaTool>`

      The additional tool definitions made available at this item.

      - `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).

      - `Mcp`

        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).

      - `CodeInterpreter`

        A tool that runs Python code to help generate a response to a prompt.

      - `ProgrammaticToolCalling`

      - `ImageGeneration`

        A tool that generates images using the GPT image models.

      - `LocalShell`

        A tool that allows the model to execute shell commands in a local environment.

      - `BetaFunctionShellTool`

        A tool that allows the model to execute shell commands.

      - `BetaCustomTool`

        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)

      - `BetaNamespaceTool`

        Groups function/custom tools under a shared namespace.

      - `BetaToolSearchTool`

        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).

      - `BetaApplyPatchTool`

        Allows the assistant to create, delete, or update files using unified diffs.

    - `type: "additional_tools"`

      The type of the item. Always `additional_tools`.

      - `"additional_tools"`

    - `agent?: Agent`

      The agent that produced this item.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

  - `BetaResponseReasoningItem`

    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).

    - `id: string`

      The unique identifier of the reasoning content.

    - `summary: Array<Summary>`

      Reasoning summary content.

      - `text: string`

        A summary of the reasoning output from the model so far.

      - `type: "summary_text"`

        The type of the object. Always `summary_text`.

        - `"summary_text"`

    - `type: "reasoning"`

      The type of the object. Always `reasoning`.

      - `"reasoning"`

    - `agent?: Agent | null`

      The agent that produced this item.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

    - `content?: Array<Content>`

      Reasoning text content.

      - `text: string`

        The reasoning text from the model.

      - `type: "reasoning_text"`

        The type of the reasoning text. Always `reasoning_text`.

        - `"reasoning_text"`

    - `encrypted_content?: string | null`

      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.

      When streaming, use the completed reasoning item and its
      `encrypted_content` from the `response.output_item.done` event in
      subsequent requests. The `encrypted_content` in
      `response.output_item.added` may be incomplete. This is especially
      important when `store` is `false` or when using Zero Data Retention.

    - `status?: "in_progress" | "completed" | "incomplete"`

      The status of the item. One of `in_progress`, `completed`, or
      `incomplete`. Populated when items are returned via API.

      - `"in_progress"`

      - `"completed"`

      - `"incomplete"`

  - `Program`

    - `id: string`

      The unique ID of the program item.

    - `call_id: string`

      The stable call ID of the program item.

    - `code: string`

      The JavaScript source executed by programmatic tool calling.

    - `fingerprint: string`

      Opaque program replay fingerprint that must be round-tripped.

    - `type: "program"`

      The type of the item. Always `program`.

      - `"program"`

    - `agent?: Agent`

      The agent that produced this item.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

  - `ProgramOutput`

    - `id: string`

      The unique ID of the program output item.

    - `call_id: string`

      The call ID of the program item.

    - `result: string`

      The result produced by the program item.

    - `status: "completed" | "incomplete"`

      The terminal status of the program output item.

      - `"completed"`

      - `"incomplete"`

    - `type: "program_output"`

      The type of the item. Always `program_output`.

      - `"program_output"`

    - `agent?: Agent`

      The agent that produced this item.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

  - `BetaResponseCompactionItem`

    A compaction item generated by the [`v1/responses/compact` API](https://platform.openai.com/docs/api-reference/responses/compact).

    - `id: string`

      The unique ID of the compaction item.

    - `encrypted_content: string`

      The encrypted content that was produced by compaction.

    - `type: "compaction"`

      The type of the item. Always `compaction`.

      - `"compaction"`

    - `agent?: Agent`

      The agent that produced this item.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

    - `created_by?: string`

      The identifier of the actor that created the item.

  - `ImageGenerationCall`

    An image generation request made by the model.

    - `id: string`

      The unique ID of the image generation call.

    - `result: string | null`

      The generated image encoded in base64.

    - `status: "in_progress" | "completed" | "generating" | "failed"`

      The status of the image generation call.

      - `"in_progress"`

      - `"completed"`

      - `"generating"`

      - `"failed"`

    - `type: "image_generation_call"`

      The type of the image generation call. Always `image_generation_call`.

      - `"image_generation_call"`

    - `agent?: Agent | null`

      The agent that produced this item.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

  - `BetaResponseCodeInterpreterToolCall`

    A tool call to run code.

    - `id: string`

      The unique ID of the code interpreter tool call.

    - `code: string | null`

      The code to run, or null if not available.

    - `container_id: string`

      The ID of the container used to run the code.

    - `outputs: Array<Logs | Image> | null`

      The outputs generated by the code interpreter, such as logs or images.
      Can be null if no outputs are available.

      - `Logs`

        The logs output from the code interpreter.

        - `logs: string`

          The logs output from the code interpreter.

        - `type: "logs"`

          The type of the output. Always `logs`.

          - `"logs"`

      - `Image`

        The image output from the code interpreter.

        - `type: "image"`

          The type of the output. Always `image`.

          - `"image"`

        - `url: string`

          The URL of the image output from the code interpreter.

    - `status: "in_progress" | "completed" | "incomplete" | 2 more`

      The status of the code interpreter tool call. Valid values are `in_progress`, `completed`, `incomplete`, `interpreting`, and `failed`.

      - `"in_progress"`

      - `"completed"`

      - `"incomplete"`

      - `"interpreting"`

      - `"failed"`

    - `type: "code_interpreter_call"`

      The type of the code interpreter tool call. Always `code_interpreter_call`.

      - `"code_interpreter_call"`

    - `agent?: Agent | null`

      The agent that produced this item.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

  - `LocalShellCall`

    A tool call to run a command on the local shell.

    - `id: string`

      The unique ID of the local shell call.

    - `action: Action`

      Execute a shell command on the server.

      - `command: Array<string>`

        The command to run.

      - `env: Record<string, string>`

        Environment variables to set for the command.

      - `type: "exec"`

        The type of the local shell action. Always `exec`.

        - `"exec"`

      - `timeout_ms?: number | null`

        Optional timeout in milliseconds for the command.

      - `user?: string | null`

        Optional user to run the command as.

      - `working_directory?: string | null`

        Optional working directory to run the command in.

    - `call_id: string`

      The unique ID of the local shell tool call generated by the model.

    - `status: "in_progress" | "completed" | "incomplete"`

      The status of the local shell call.

      - `"in_progress"`

      - `"completed"`

      - `"incomplete"`

    - `type: "local_shell_call"`

      The type of the local shell call. Always `local_shell_call`.

      - `"local_shell_call"`

    - `agent?: Agent | null`

      The agent that produced this item.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

  - `LocalShellCallOutput`

    The output of a local shell tool call.

    - `id: string`

      The unique ID of the local shell tool call generated by the model.

    - `output: string`

      A JSON string of the output of the local shell tool call.

    - `type: "local_shell_call_output"`

      The type of the local shell tool call output. Always `local_shell_call_output`.

      - `"local_shell_call_output"`

    - `agent?: Agent | null`

      The agent that produced this item.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

    - `status?: "in_progress" | "completed" | "incomplete" | null`

      The status of the item. One of `in_progress`, `completed`, or `incomplete`.

      - `"in_progress"`

      - `"completed"`

      - `"incomplete"`

  - `BetaResponseFunctionShellToolCall`

    A tool call that executes one or more shell commands in a managed environment.

    - `id: string`

      The unique ID of the shell tool call. Populated when this item is returned via API.

    - `action: Action`

      The shell commands and limits that describe how to run the tool call.

      - `commands: Array<string>`

      - `max_output_length: number | null`

        Optional maximum number of characters to return from each command.

      - `timeout_ms: number | null`

        Optional timeout in milliseconds for the commands.

    - `call_id: string`

      The unique ID of the shell tool call generated by the model.

    - `environment: BetaResponseLocalEnvironment | BetaResponseContainerReference | null`

      Represents the use of a local environment to perform shell actions.

      - `BetaResponseLocalEnvironment`

        Represents the use of a local environment to perform shell actions.

        - `type: "local"`

          The environment type. Always `local`.

          - `"local"`

      - `BetaResponseContainerReference`

        Represents a container created with /v1/containers.

        - `container_id: string`

        - `type: "container_reference"`

          The environment type. Always `container_reference`.

          - `"container_reference"`

    - `status: "in_progress" | "completed" | "incomplete"`

      The status of the shell call. One of `in_progress`, `completed`, or `incomplete`.

      - `"in_progress"`

      - `"completed"`

      - `"incomplete"`

    - `type: "shell_call"`

      The type of the item. Always `shell_call`.

      - `"shell_call"`

    - `agent?: Agent`

      The agent that produced this item.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

    - `caller?: Direct | Program | null`

      The execution context that produced this tool call.

      - `Direct`

        - `type: "direct"`

          - `"direct"`

      - `Program`

        - `caller_id: string`

          The call ID of the program item that produced this tool call.

        - `type: "program"`

          - `"program"`

    - `created_by?: string`

      The ID of the entity that created this tool call.

  - `BetaResponseFunctionShellToolCallOutput`

    The output of a shell tool call that was emitted.

    - `id: string`

      The unique ID of the shell call output. Populated when this item is returned via API.

    - `call_id: string`

      The unique ID of the shell tool call generated by the model.

    - `max_output_length: number | null`

      The maximum length of the shell command output. This is generated by the model and should be passed back with the raw output.

    - `output: Array<Output>`

      An array of shell call output contents

      - `outcome: Timeout | Exit`

        Represents either an exit outcome (with an exit code) or a timeout outcome for a shell call output chunk.

        - `Timeout`

          Indicates that the shell call exceeded its configured time limit.

          - `type: "timeout"`

            The outcome type. Always `timeout`.

            - `"timeout"`

        - `Exit`

          Indicates that the shell commands finished and returned an exit code.

          - `exit_code: number`

            Exit code from the shell process.

          - `type: "exit"`

            The outcome type. Always `exit`.

            - `"exit"`

      - `stderr: string`

        The standard error output that was captured.

      - `stdout: string`

        The standard output that was captured.

      - `created_by?: string`

        The identifier of the actor that created the item.

    - `status: "in_progress" | "completed" | "incomplete"`

      The status of the shell call output. One of `in_progress`, `completed`, or `incomplete`.

      - `"in_progress"`

      - `"completed"`

      - `"incomplete"`

    - `type: "shell_call_output"`

      The type of the shell call output. Always `shell_call_output`.

      - `"shell_call_output"`

    - `agent?: Agent`

      The agent that produced this item.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

    - `caller?: Direct | Program | null`

      The execution context that produced this tool call.

      - `Direct`

        - `type: "direct"`

          - `"direct"`

      - `Program`

        - `caller_id: string`

          The call ID of the program item that produced this tool call.

        - `type: "program"`

          - `"program"`

    - `created_by?: string`

      The identifier of the actor that created the item.

  - `BetaResponseApplyPatchToolCall`

    A tool call that applies file diffs by creating, deleting, or updating files.

    - `id: string`

      The unique ID of the apply patch tool call. Populated when this item is returned via API.

    - `call_id: string`

      The unique ID of the apply patch tool call generated by the model.

    - `operation: CreateFile | DeleteFile | UpdateFile`

      One of the create_file, delete_file, or update_file operations applied via apply_patch.

      - `CreateFile`

        Instruction describing how to create a file via the apply_patch tool.

        - `diff: string`

          Diff to apply.

        - `path: string`

          Path of the file to create.

        - `type: "create_file"`

          Create a new file with the provided diff.

          - `"create_file"`

      - `DeleteFile`

        Instruction describing how to delete a file via the apply_patch tool.

        - `path: string`

          Path of the file to delete.

        - `type: "delete_file"`

          Delete the specified file.

          - `"delete_file"`

      - `UpdateFile`

        Instruction describing how to update a file via the apply_patch tool.

        - `diff: string`

          Diff to apply.

        - `path: string`

          Path of the file to update.

        - `type: "update_file"`

          Update an existing file with the provided diff.

          - `"update_file"`

    - `status: "in_progress" | "completed"`

      The status of the apply patch tool call. One of `in_progress` or `completed`.

      - `"in_progress"`

      - `"completed"`

    - `type: "apply_patch_call"`

      The type of the item. Always `apply_patch_call`.

      - `"apply_patch_call"`

    - `agent?: Agent`

      The agent that produced this item.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

    - `caller?: Direct | Program | null`

      The execution context that produced this tool call.

      - `Direct`

        - `type: "direct"`

          - `"direct"`

      - `Program`

        - `caller_id: string`

          The call ID of the program item that produced this tool call.

        - `type: "program"`

          - `"program"`

    - `created_by?: string`

      The ID of the entity that created this tool call.

  - `BetaResponseApplyPatchToolCallOutput`

    The output emitted by an apply patch tool call.

    - `id: string`

      The unique ID of the apply patch tool call output. Populated when this item is returned via API.

    - `call_id: string`

      The unique ID of the apply patch tool call generated by the model.

    - `status: "completed" | "failed"`

      The status of the apply patch tool call output. One of `completed` or `failed`.

      - `"completed"`

      - `"failed"`

    - `type: "apply_patch_call_output"`

      The type of the item. Always `apply_patch_call_output`.

      - `"apply_patch_call_output"`

    - `agent?: Agent`

      The agent that produced this item.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

    - `caller?: Direct | Program | null`

      The execution context that produced this tool call.

      - `Direct`

        - `type: "direct"`

          - `"direct"`

      - `Program`

        - `caller_id: string`

          The call ID of the program item that produced this tool call.

        - `type: "program"`

          - `"program"`

    - `created_by?: string`

      The ID of the entity that created this tool call output.

    - `output?: string | null`

      Optional textual output returned by the apply patch tool.

  - `McpListTools`

    A list of tools available on an MCP server.

    - `id: string`

      The unique ID of the list.

    - `server_label: string`

      The label of the MCP server.

    - `tools: Array<Tool>`

      The tools available on the server.

      - `input_schema: unknown`

        The JSON schema describing the tool's input.

      - `name: string`

        The name of the tool.

      - `annotations?: unknown`

        Additional annotations about the tool.

      - `description?: string | null`

        The description of the tool.

    - `type: "mcp_list_tools"`

      The type of the item. Always `mcp_list_tools`.

      - `"mcp_list_tools"`

    - `agent?: Agent | null`

      The agent that produced this item.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

    - `error?: string | null`

      Error message if the server could not list tools.

  - `McpApprovalRequest`

    A request for human approval of a tool invocation.

    - `id: string`

      The unique ID of the approval request.

    - `arguments: string`

      A JSON string of arguments for the tool.

    - `name: string`

      The name of the tool to run.

    - `server_label: string`

      The label of the MCP server making the request.

    - `type: "mcp_approval_request"`

      The type of the item. Always `mcp_approval_request`.

      - `"mcp_approval_request"`

    - `agent?: Agent | null`

      The agent that produced this item.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

  - `McpApprovalResponse`

    A response to an MCP approval request.

    - `id: string`

      The unique ID of the approval response

    - `approval_request_id: string`

      The ID of the approval request being answered.

    - `approve: boolean`

      Whether the request was approved.

    - `type: "mcp_approval_response"`

      The type of the item. Always `mcp_approval_response`.

      - `"mcp_approval_response"`

    - `agent?: Agent | null`

      The agent that produced this item.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

    - `reason?: string | null`

      Optional reason for the decision.

  - `McpCall`

    An invocation of a tool on an MCP server.

    - `id: string`

      The unique ID of the tool call.

    - `arguments: string`

      A JSON string of the arguments passed to the tool.

    - `name: string`

      The name of the tool that was run.

    - `server_label: string`

      The label of the MCP server running the tool.

    - `type: "mcp_call"`

      The type of the item. Always `mcp_call`.

      - `"mcp_call"`

    - `agent?: Agent | null`

      The agent that produced this item.

      - `agent_name: string`

        The canonical name of the agent that produced this item.

    - `approval_request_id?: string | null`

      Unique identifier for the MCP tool call approval request.
      Include this value in a subsequent `mcp_approval_response` input to approve or reject the corresponding tool call.

    - `error?: BetaMcpToolCallError | null`

      The error from the tool call, if any.

      - `McpProtocolError`

        - `code: number`

        - `message: string`

        - `type: "mcp_protocol_error"`

          - `"mcp_protocol_error"`

      - `McpToolExecutionError`

        - `content: unknown`

        - `type: "mcp_tool_execution_error"`

          - `"mcp_tool_execution_error"`

      - `HTTPError`

        - `code: number`

        - `message: string`

        - `type: "http_error"`

          - `"http_error"`

    - `output?: string | null`

      The output from the tool call.

    - `status?: "in_progress" | "completed" | "incomplete" | 2 more`

      The status of the tool call. One of `in_progress`, `completed`, `incomplete`, `calling`, or `failed`.

      - `"in_progress"`

      - `"completed"`

      - `"incomplete"`

      - `"calling"`

      - `"failed"`

  - `BetaResponseCustomToolCallItem extends BetaResponseCustomToolCall`

    A call to a custom tool created by the model.

    - `id: string`

      The unique ID of the custom tool call item.

    - `status: "in_progress" | "completed" | "incomplete"`

      The status of the item. One of `in_progress`, `completed`, or
      `incomplete`. Populated when items are returned via API.

      - `"in_progress"`

      - `"completed"`

      - `"incomplete"`

    - `created_by?: string`

      The identifier of the actor that created the item.

  - `BetaResponseCustomToolCallOutputItem extends BetaResponseCustomToolCallOutput`

    The output of a custom tool call from your code, being sent back to the model.

    - `id: string`

      The unique ID of the custom tool call output item.

    - `status: "in_progress" | "completed" | "incomplete"`

      The status of the item. One of `in_progress`, `completed`, or
      `incomplete`. Populated when items are returned via API.

      - `"in_progress"`

      - `"completed"`

      - `"incomplete"`

    - `created_by?: string`

      The identifier of the actor that created the item.

### Example

```typescript
import OpenAI from 'openai';

const client = new OpenAI({
  apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
});

// Automatically fetches more pages as needed.
for await (const betaResponseItem of client.beta.responses.inputItems.list('response_id')) {
  console.log(betaResponseItem);
}
```

#### Response

```json
{
  "data": [
    {
      "id": "id",
      "content": [
        {
          "text": "text",
          "type": "input_text",
          "prompt_cache_breakpoint": {
            "mode": "explicit"
          }
        }
      ],
      "role": "user",
      "type": "message",
      "agent": {
        "agent_name": "agent_name"
      },
      "status": "in_progress"
    }
  ],
  "first_id": "first_id",
  "has_more": true,
  "last_id": "last_id",
  "object": "list"
}
```

### Example

```typescript
import OpenAI from "openai";
const client = new OpenAI();

const response = await client.responses.inputItems.list("resp_123");
console.log(response.data);
```

#### Response

```json
{
  "object": "list",
  "data": [
    {
      "id": "msg_abc123",
      "type": "message",
      "role": "user",
      "content": [
        {
          "type": "input_text",
          "text": "Tell me a three sentence bedtime story about a unicorn."
        }
      ]
    }
  ],
  "first_id": "msg_abc123",
  "last_id": "msg_abc123",
  "has_more": false
}
```

## Domain Types

### Beta Response Item List

- `BetaResponseItemList`

  A list of Response items.

  - `data: Array<BetaResponseItem>`

    A list of items used to generate this response.

    - `BetaResponseInputMessageItem`

      - `id: string`

        The unique ID of the message input.

      - `content: BetaResponseInputMessageContentList`

        A list of one or many input items to the model, containing different content
        types.

        - `BetaResponseInputText`

          A text input to the model.

          - `text: string`

            The text input to the model.

          - `type: "input_text"`

            The type of the input item. Always `input_text`.

            - `"input_text"`

          - `prompt_cache_breakpoint?: PromptCacheBreakpoint`

            Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.

            - `mode: "explicit"`

              The breakpoint mode. Always `explicit`.

              - `"explicit"`

        - `BetaResponseInputImage`

          An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision).

          - `detail: BetaImageDetail`

            The detail level of the image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`.

            - `"low"`

            - `"high"`

            - `"auto"`

            - `"original"`

          - `type: "input_image"`

            The type of the input item. Always `input_image`.

            - `"input_image"`

          - `file_id?: string | null`

            The ID of the file to be sent to the model.

          - `image_url?: string | null`

            The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.

          - `prompt_cache_breakpoint?: PromptCacheBreakpoint`

            Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.

            - `mode: "explicit"`

              The breakpoint mode. Always `explicit`.

              - `"explicit"`

        - `BetaResponseInputFile`

          A file input to the model.

          - `type: "input_file"`

            The type of the input item. Always `input_file`.

            - `"input_file"`

          - `detail?: "auto" | "low" | "high"`

            The detail level of the file to be sent to the model. Use `auto` to let the system select the detail level; for GPT-5.6 and later models, `auto` uses high-quality rendering, which may increase input token usage. Use `low` for lower-cost rendering, or `high` to render the file at higher quality. Defaults to `auto`.

            - `"auto"`

            - `"low"`

            - `"high"`

          - `file_data?: string`

            The content of the file to be sent to the model.

          - `file_id?: string | null`

            The ID of the file to be sent to the model.

          - `file_url?: string`

            The URL of the file to be sent to the model.

          - `filename?: string`

            The name of the file to be sent to the model.

          - `prompt_cache_breakpoint?: PromptCacheBreakpoint`

            Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.

            - `mode: "explicit"`

              The breakpoint mode. Always `explicit`.

              - `"explicit"`

      - `role: "user" | "system" | "developer"`

        The role of the message input. One of `user`, `system`, or `developer`.

        - `"user"`

        - `"system"`

        - `"developer"`

      - `type: "message"`

        The type of the message input. Always set to `message`.

        - `"message"`

      - `agent?: Agent | null`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

      - `status?: "in_progress" | "completed" | "incomplete"`

        The status of item. One of `in_progress`, `completed`, or
        `incomplete`. Populated when items are returned via API.

        - `"in_progress"`

        - `"completed"`

        - `"incomplete"`

    - `BetaResponseOutputMessage`

      An output message from the model.

      - `id: string`

        The unique ID of the output message.

      - `content: Array<BetaResponseOutputText | BetaResponseOutputRefusal>`

        The content of the output message.

        - `BetaResponseOutputText`

          A text output from the model.

          - `annotations: Array<FileCitation | URLCitation | ContainerFileCitation | FilePath>`

            The annotations of the text output.

            - `FileCitation`

              A citation to a file.

              - `file_id: string`

                The ID of the file.

              - `filename: string`

                The filename of the file cited.

              - `index: number`

                The index of the file in the list of files.

              - `type: "file_citation"`

                The type of the file citation. Always `file_citation`.

                - `"file_citation"`

            - `URLCitation`

              A citation for a web resource used to generate a model response.

              - `end_index: number`

                The index of the last character of the URL citation in the message.

              - `start_index: number`

                The index of the first character of the URL citation in the message.

              - `title: string`

                The title of the web resource.

              - `type: "url_citation"`

                The type of the URL citation. Always `url_citation`.

                - `"url_citation"`

              - `url: string`

                The URL of the web resource.

            - `ContainerFileCitation`

              A citation for a container file used to generate a model response.

              - `container_id: string`

                The ID of the container file.

              - `end_index: number`

                The index of the last character of the container file citation in the message.

              - `file_id: string`

                The ID of the file.

              - `filename: string`

                The filename of the container file cited.

              - `start_index: number`

                The index of the first character of the container file citation in the message.

              - `type: "container_file_citation"`

                The type of the container file citation. Always `container_file_citation`.

                - `"container_file_citation"`

            - `FilePath`

              A path to a file.

              - `file_id: string`

                The ID of the file.

              - `index: number`

                The index of the file in the list of files.

              - `type: "file_path"`

                The type of the file path. Always `file_path`.

                - `"file_path"`

          - `text: string`

            The text output from the model.

          - `type: "output_text"`

            The type of the output text. Always `output_text`.

            - `"output_text"`

          - `logprobs?: Array<Logprob>`

            - `token: string`

            - `bytes: Array<number>`

            - `logprob: number`

            - `top_logprobs: Array<TopLogprob>`

              - `token: string`

              - `bytes: Array<number>`

              - `logprob: number`

        - `BetaResponseOutputRefusal`

          A refusal from the model.

          - `refusal: string`

            The refusal explanation from the model.

          - `type: "refusal"`

            The type of the refusal. Always `refusal`.

            - `"refusal"`

      - `role: "assistant"`

        The role of the output message. Always `assistant`.

        - `"assistant"`

      - `status: "in_progress" | "completed" | "incomplete"`

        The status of the message input. One of `in_progress`, `completed`, or
        `incomplete`. Populated when input items are returned via API.

        - `"in_progress"`

        - `"completed"`

        - `"incomplete"`

      - `type: "message"`

        The type of the output message. Always `message`.

        - `"message"`

      - `agent?: Agent | null`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

      - `phase?: "commentary" | "final_answer" | null`

        Labels an `assistant` message as intermediate commentary (`commentary`) or the final answer (`final_answer`).
        For models like `gpt-5.3-codex` and beyond, when sending follow-up requests, preserve and resend
        phase on all assistant messages — dropping it can degrade performance. Not used for user messages.

        - `"commentary"`

        - `"final_answer"`

    - `BetaResponseFileSearchToolCall`

      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.

      - `id: string`

        The unique ID of the file search tool call.

      - `queries: Array<string>`

        The queries used to search for files.

      - `status: "in_progress" | "searching" | "completed" | 2 more`

        The status of the file search tool call. One of `in_progress`,
        `searching`, `incomplete` or `failed`,

        - `"in_progress"`

        - `"searching"`

        - `"completed"`

        - `"incomplete"`

        - `"failed"`

      - `type: "file_search_call"`

        The type of the file search tool call. Always `file_search_call`.

        - `"file_search_call"`

      - `agent?: Agent | null`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

      - `results?: Array<Result> | null`

        The results of the file search tool call.

        - `attributes?: Record<string, string | number | boolean> | null`

          Set of 16 key-value pairs that can be attached to an object. This can be
          useful for storing additional information about the object in a structured
          format, and querying for objects via API or the dashboard. Keys are strings
          with a maximum length of 64 characters. Values are strings with a maximum
          length of 512 characters, booleans, or numbers.

          - `string`

          - `number`

          - `boolean`

        - `file_id?: string`

          The unique ID of the file.

        - `filename?: string`

          The name of the file.

        - `score?: number`

          The relevance score of the file - a value between 0 and 1.

        - `text?: string`

          The text that was retrieved from the file.

    - `BetaResponseComputerToolCall`

      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.

      - `id: string`

        The unique ID of the computer call.

      - `call_id: string`

        An identifier used when responding to the tool call with output.

      - `pending_safety_checks: Array<PendingSafetyCheck>`

        The pending safety checks for the computer call.

        - `id: string`

          The ID of the pending safety check.

        - `code?: string | null`

          The type of the pending safety check.

        - `message?: string | null`

          Details about the pending safety check.

      - `status: "in_progress" | "completed" | "incomplete"`

        The status of the item. One of `in_progress`, `completed`, or
        `incomplete`. Populated when items are returned via API.

        - `"in_progress"`

        - `"completed"`

        - `"incomplete"`

      - `type: "computer_call"`

        The type of the computer call. Always `computer_call`.

        - `"computer_call"`

      - `action?: BetaComputerAction`

        A click action.

        - `Click`

          A click action.

          - `button: "left" | "right" | "wheel" | 2 more`

            Indicates which mouse button was pressed during the click. One of `left`, `right`, `wheel`, `back`, or `forward`.

            - `"left"`

            - `"right"`

            - `"wheel"`

            - `"back"`

            - `"forward"`

          - `type: "click"`

            Specifies the event type. For a click action, this property is always `click`.

            - `"click"`

          - `x: number`

            The x-coordinate where the click occurred.

          - `y: number`

            The y-coordinate where the click occurred.

          - `keys?: Array<string> | null`

            The keys being held while clicking.

        - `DoubleClick`

          A double click action.

          - `keys: Array<string> | null`

            The keys being held while double-clicking.

          - `type: "double_click"`

            Specifies the event type. For a double click action, this property is always set to `double_click`.

            - `"double_click"`

          - `x: number`

            The x-coordinate where the double click occurred.

          - `y: number`

            The y-coordinate where the double click occurred.

        - `Drag`

          A drag action.

          - `path: Array<Path>`

            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 }
            ]
            ```

            - `x: number`

              The x-coordinate.

            - `y: number`

              The y-coordinate.

          - `type: "drag"`

            Specifies the event type. For a drag action, this property is always set to `drag`.

            - `"drag"`

          - `keys?: Array<string> | null`

            The keys being held while dragging the mouse.

        - `Keypress`

          A collection of keypresses the model would like to perform.

          - `keys: Array<string>`

            The combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key.

          - `type: "keypress"`

            Specifies the event type. For a keypress action, this property is always set to `keypress`.

            - `"keypress"`

        - `Move`

          A mouse move action.

          - `type: "move"`

            Specifies the event type. For a move action, this property is always set to `move`.

            - `"move"`

          - `x: number`

            The x-coordinate to move to.

          - `y: number`

            The y-coordinate to move to.

          - `keys?: Array<string> | null`

            The keys being held while moving the mouse.

        - `Screenshot`

          A screenshot action.

          - `type: "screenshot"`

            Specifies the event type. For a screenshot action, this property is always set to `screenshot`.

            - `"screenshot"`

        - `Scroll`

          A scroll action.

          - `scroll_x: number`

            The horizontal scroll distance.

          - `scroll_y: number`

            The vertical scroll distance.

          - `type: "scroll"`

            Specifies the event type. For a scroll action, this property is always set to `scroll`.

            - `"scroll"`

          - `x: number`

            The x-coordinate where the scroll occurred.

          - `y: number`

            The y-coordinate where the scroll occurred.

          - `keys?: Array<string> | null`

            The keys being held while scrolling.

        - `Type`

          An action to type in text.

          - `text: string`

            The text to type.

          - `type: "type"`

            Specifies the event type. For a type action, this property is always set to `type`.

            - `"type"`

        - `Wait`

          A wait action.

          - `type: "wait"`

            Specifies the event type. For a wait action, this property is always set to `wait`.

            - `"wait"`

      - `actions?: BetaComputerActionList`

        Flattened batched actions for `computer_use`. Each action includes an
        `type` discriminator and action-specific fields.

        - `Click`

          A click action.

        - `DoubleClick`

          A double click action.

        - `Drag`

          A drag action.

        - `Keypress`

          A collection of keypresses the model would like to perform.

        - `Move`

          A mouse move action.

        - `Screenshot`

          A screenshot action.

        - `Scroll`

          A scroll action.

        - `Type`

          An action to type in text.

        - `Wait`

          A wait action.

      - `agent?: Agent | null`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

    - `BetaResponseComputerToolCallOutputItem`

      - `id: string`

        The unique ID of the computer call tool output.

      - `call_id: string`

        The ID of the computer tool call that produced the output.

      - `output: BetaResponseComputerToolCallOutputScreenshot`

        A computer screenshot image used with the computer use tool.

        - `type: "computer_screenshot"`

          Specifies the event type. For a computer screenshot, this property is
          always set to `computer_screenshot`.

          - `"computer_screenshot"`

        - `file_id?: string`

          The identifier of an uploaded file that contains the screenshot.

        - `image_url?: string`

          The URL of the screenshot image.

      - `status: "completed" | "incomplete" | "failed" | "in_progress"`

        The status of the message input. One of `in_progress`, `completed`, or
        `incomplete`. Populated when input items are returned via API.

        - `"completed"`

        - `"incomplete"`

        - `"failed"`

        - `"in_progress"`

      - `type: "computer_call_output"`

        The type of the computer tool call output. Always `computer_call_output`.

        - `"computer_call_output"`

      - `acknowledged_safety_checks?: Array<AcknowledgedSafetyCheck>`

        The safety checks reported by the API that have been acknowledged by the
        developer.

        - `id: string`

          The ID of the pending safety check.

        - `code?: string | null`

          The type of the pending safety check.

        - `message?: string | null`

          Details about the pending safety check.

      - `agent?: Agent | null`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

      - `created_by?: string`

        The identifier of the actor that created the item.

    - `BetaResponseFunctionWebSearch`

      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.

      - `id: string`

        The unique ID of the web search tool call.

      - `action: Search | OpenPage | FindInPage`

        An object describing the specific action taken in this web search call.
        Includes details on how the model used the web (search, open_page, find_in_page).

        - `Search`

          Action type "search" - Performs a web search query.

          - `type: "search"`

            The action type.

            - `"search"`

          - `queries?: Array<string>`

            The search queries.

          - `query?: string`

            The search query.

          - `sources?: Array<Source>`

            The sources used in the search.

            - `type: "url"`

              The type of source. Always `url`.

              - `"url"`

            - `url: string`

              The URL of the source.

        - `OpenPage`

          Action type "open_page" - Opens a specific URL from search results.

          - `type: "open_page"`

            The action type.

            - `"open_page"`

          - `url?: string | null`

            The URL opened by the model.

        - `FindInPage`

          Action type "find_in_page": Searches for a pattern within a loaded page.

          - `pattern: string`

            The pattern or text to search for within the page.

          - `type: "find_in_page"`

            The action type.

            - `"find_in_page"`

          - `url: string`

            The URL of the page searched for the pattern.

      - `status: "in_progress" | "searching" | "completed" | "failed"`

        The status of the web search tool call.

        - `"in_progress"`

        - `"searching"`

        - `"completed"`

        - `"failed"`

      - `type: "web_search_call"`

        The type of the web search tool call. Always `web_search_call`.

        - `"web_search_call"`

      - `agent?: Agent | null`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

    - `BetaResponseFunctionToolCallItem extends BetaResponseFunctionToolCall`

      A tool call to run a function. See the
      [function calling guide](https://platform.openai.com/docs/guides/function-calling) for more information.

      - `id: string`

        The unique ID of the function tool call.

      - `status: "in_progress" | "completed" | "incomplete"`

        The status of the item. One of `in_progress`, `completed`, or
        `incomplete`. Populated when items are returned via API.

        - `"in_progress"`

        - `"completed"`

        - `"incomplete"`

      - `created_by?: string`

        The identifier of the actor that created the item.

    - `BetaResponseFunctionToolCallOutputItem`

      - `id: string`

        The unique ID of the function call tool output.

      - `call_id: string`

        The unique ID of the function tool call generated by the model.

      - `output: string | Array<BetaResponseInputText | BetaResponseInputImage | BetaResponseInputFile>`

        The output from the function call generated by your code.
        Can be a string or an list of output content.

        - `string`

        - `Array<BetaResponseInputText | BetaResponseInputImage | BetaResponseInputFile>`

          - `BetaResponseInputText`

            A text input to the model.

          - `BetaResponseInputImage`

            An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision).

          - `BetaResponseInputFile`

            A file input to 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.

        - `"in_progress"`

        - `"completed"`

        - `"incomplete"`

      - `type: "function_call_output"`

        The type of the function tool call output. Always `function_call_output`.

        - `"function_call_output"`

      - `agent?: Agent | null`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

      - `caller?: Direct | Program | null`

        The execution context that produced this tool call.

        - `Direct`

          - `type: "direct"`

            The caller type. Always `direct`.

            - `"direct"`

        - `Program`

          - `caller_id: string`

            The call ID of the program item that produced this tool call.

          - `type: "program"`

            The caller type. Always `program`.

            - `"program"`

      - `created_by?: string`

        The identifier of the actor that created the item.

      - `name?: string`

        The name of the tool that produced the output.

      - `namespace?: string`

        The namespace of the tool that produced the output.

    - `AgentMessage`

      - `id: string`

        The unique ID of the agent message.

      - `author: string`

        The sending agent identity.

      - `content: Array<BetaResponseInputText | BetaResponseOutputText | Text | 7 more>`

        Encrypted content sent between agents.

        - `BetaResponseInputText`

          A text input to the model.

        - `BetaResponseOutputText`

          A text output from the model.

        - `Text`

          A text content.

          - `text: string`

          - `type: "text"`

            - `"text"`

        - `SummaryText`

          A summary text from the model.

          - `text: string`

            A summary of the reasoning output from the model so far.

          - `type: "summary_text"`

            The type of the object. Always `summary_text`.

            - `"summary_text"`

        - `ReasoningText`

          Reasoning text from the model.

          - `text: string`

            The reasoning text from the model.

          - `type: "reasoning_text"`

            The type of the reasoning text. Always `reasoning_text`.

            - `"reasoning_text"`

        - `BetaResponseOutputRefusal`

          A refusal from the model.

        - `BetaResponseInputImage`

          An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision).

        - `ComputerScreenshot`

          A screenshot of a computer.

          - `detail: BetaImageDetail`

            The detail level of the screenshot image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`.

          - `file_id: string | null`

            The identifier of an uploaded file that contains the screenshot.

          - `image_url: string | null`

            The URL of the screenshot image.

          - `type: "computer_screenshot"`

            Specifies the event type. For a computer screenshot, this property is always set to `computer_screenshot`.

            - `"computer_screenshot"`

          - `prompt_cache_breakpoint?: PromptCacheBreakpoint`

            Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.

            - `mode: "explicit"`

              The breakpoint mode. Always `explicit`.

              - `"explicit"`

        - `BetaResponseInputFile`

          A file input to the model.

        - `EncryptedContent`

          Opaque encrypted content that Responses API decrypts inside trusted model execution.

          - `encrypted_content: string`

            Opaque encrypted content.

          - `type: "encrypted_content"`

            The type of the input item. Always `encrypted_content`.

            - `"encrypted_content"`

      - `recipient: string`

        The destination agent identity.

      - `type: "agent_message"`

        The type of the item. Always `agent_message`.

        - `"agent_message"`

      - `agent?: Agent`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

    - `MultiAgentCall`

      - `id: string`

        The unique ID of the multi-agent call item.

      - `action: "spawn_agent" | "interrupt_agent" | "list_agents" | 3 more`

        The multi-agent action to execute.

        - `"spawn_agent"`

        - `"interrupt_agent"`

        - `"list_agents"`

        - `"send_message"`

        - `"followup_task"`

        - `"wait_agent"`

      - `arguments: string`

        The JSON string of arguments generated for the action.

      - `call_id: string`

        The unique ID linking this call to its output.

      - `type: "multi_agent_call"`

        The type of the multi-agent call. Always `multi_agent_call`.

        - `"multi_agent_call"`

      - `agent?: Agent`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

    - `MultiAgentCallOutput`

      - `id: string`

        The unique ID of the multi-agent call output item.

      - `action: "spawn_agent" | "interrupt_agent" | "list_agents" | 3 more`

        The multi-agent action that produced this result.

        - `"spawn_agent"`

        - `"interrupt_agent"`

        - `"list_agents"`

        - `"send_message"`

        - `"followup_task"`

        - `"wait_agent"`

      - `call_id: string`

        The unique ID of the multi-agent call.

      - `output: Array<BetaResponseOutputText>`

        Text output returned by the multi-agent action.

        - `annotations: Array<FileCitation | URLCitation | ContainerFileCitation | FilePath>`

          The annotations of the text output.

        - `text: string`

          The text output from the model.

        - `type: "output_text"`

          The type of the output text. Always `output_text`.

        - `logprobs?: Array<Logprob>`

      - `type: "multi_agent_call_output"`

        The type of the multi-agent result. Always `multi_agent_call_output`.

        - `"multi_agent_call_output"`

      - `agent?: Agent`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

    - `BetaResponseToolSearchCall`

      - `id: string`

        The unique ID of the tool search call item.

      - `arguments: unknown`

        Arguments used for the tool search call.

      - `call_id: string | null`

        The unique ID of the tool search call generated by the model.

      - `execution: "server" | "client"`

        Whether tool search was executed by the server or by the client.

        - `"server"`

        - `"client"`

      - `status: "in_progress" | "completed" | "incomplete"`

        The status of the tool search call item that was recorded.

        - `"in_progress"`

        - `"completed"`

        - `"incomplete"`

      - `type: "tool_search_call"`

        The type of the item. Always `tool_search_call`.

        - `"tool_search_call"`

      - `agent?: Agent`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

      - `created_by?: string`

        The identifier of the actor that created the item.

    - `BetaResponseToolSearchOutputItem`

      - `id: string`

        The unique ID of the tool search output item.

      - `call_id: string | null`

        The unique ID of the tool search call generated by the model.

      - `execution: "server" | "client"`

        Whether tool search was executed by the server or by the client.

        - `"server"`

        - `"client"`

      - `status: "in_progress" | "completed" | "incomplete"`

        The status of the tool search output item that was recorded.

        - `"in_progress"`

        - `"completed"`

        - `"incomplete"`

      - `tools: Array<BetaTool>`

        The loaded tool definitions returned by tool search.

        - `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).

          - `name: string`

            The name of the function to call.

          - `parameters: Record<string, unknown> | null`

            A JSON schema object describing the parameters of the function.

          - `strict: boolean | null`

            Whether strict parameter validation is enforced for this function tool.

          - `type: "function"`

            The type of the function tool. Always `function`.

            - `"function"`

          - `allowed_callers?: Array<"direct" | "programmatic"> | null`

            The tool invocation context(s).

            - `"direct"`

            - `"programmatic"`

          - `defer_loading?: boolean`

            Whether this function is deferred and loaded via tool search.

          - `description?: string | null`

            A description of the function. Used by the model to determine whether or not to call the function.

          - `output_schema?: Record<string, unknown> | null`

            A JSON schema object describing the JSON value encoded in string outputs for this function.

        - `BetaFileSearchTool`

          A tool that searches for relevant content from uploaded files. Learn more about the [file search tool](https://platform.openai.com/docs/guides/tools-file-search).

          - `type: "file_search"`

            The type of the file search tool. Always `file_search`.

            - `"file_search"`

          - `vector_store_ids: Array<string>`

            The IDs of the vector stores to search.

          - `filters?: ComparisonFilter | CompoundFilter | null`

            A filter to apply.

            - `ComparisonFilter`

              A filter used to compare a specified attribute key to a given value using a defined comparison operation.

              - `key: string`

                The key to compare against the value.

              - `type: "eq" | "ne" | "gt" | 5 more`

                Specifies the comparison operator: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`, `in`, `nin`.

                - `eq`: equals
                - `ne`: not equal
                - `gt`: greater than
                - `gte`: greater than or equal
                - `lt`: less than
                - `lte`: less than or equal
                - `in`: in
                - `nin`: not in

                - `"eq"`

                - `"ne"`

                - `"gt"`

                - `"gte"`

                - `"lt"`

                - `"lte"`

                - `"in"`

                - `"nin"`

              - `value: string | number | boolean | Array<string | number>`

                The value to compare against the attribute key; supports string, number, or boolean types.

                - `string`

                - `number`

                - `boolean`

                - `Array<string | number>`

                  - `string`

                  - `number`

            - `CompoundFilter`

              Combine multiple filters using `and` or `or`.

              - `filters: Array<ComparisonFilter | unknown>`

                Array of filters to combine. Items can be `ComparisonFilter` or `CompoundFilter`.

                - `ComparisonFilter`

                  A filter used to compare a specified attribute key to a given value using a defined comparison operation.

                  - `key: string`

                    The key to compare against the value.

                  - `type: "eq" | "ne" | "gt" | 5 more`

                    Specifies the comparison operator: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`, `in`, `nin`.

                    - `eq`: equals
                    - `ne`: not equal
                    - `gt`: greater than
                    - `gte`: greater than or equal
                    - `lt`: less than
                    - `lte`: less than or equal
                    - `in`: in
                    - `nin`: not in

                    - `"eq"`

                    - `"ne"`

                    - `"gt"`

                    - `"gte"`

                    - `"lt"`

                    - `"lte"`

                    - `"in"`

                    - `"nin"`

                  - `value: string | number | boolean | Array<string | number>`

                    The value to compare against the attribute key; supports string, number, or boolean types.

                    - `string`

                    - `number`

                    - `boolean`

                    - `Array<string | number>`

                      - `string`

                      - `number`

                - `unknown`

              - `type: "and" | "or"`

                Type of operation: `and` or `or`.

                - `"and"`

                - `"or"`

          - `max_num_results?: number`

            The maximum number of results to return. This number should be between 1 and 50 inclusive.

          - `ranking_options?: RankingOptions`

            Ranking options for search.

            - `hybrid_search?: HybridSearch`

              Weights that control how reciprocal rank fusion balances semantic embedding matches versus sparse keyword matches when hybrid search is enabled.

              - `embedding_weight: number`

                The weight of the embedding in the reciprocal ranking fusion.

              - `text_weight: number`

                The weight of the text in the reciprocal ranking fusion.

            - `ranker?: "auto" | "default-2024-11-15"`

              The ranker to use for the file search.

              - `"auto"`

              - `"default-2024-11-15"`

            - `score_threshold?: number`

              The score threshold for the file search, a number between 0 and 1. Numbers closer to 1 will attempt to return only the most relevant results, but may return fewer results.

        - `BetaComputerTool`

          A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use).

          - `type: "computer"`

            The type of the computer tool. Always `computer`.

            - `"computer"`

        - `BetaComputerUsePreviewTool`

          A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use).

          - `display_height: number`

            The height of the computer display.

          - `display_width: number`

            The width of the computer display.

          - `environment: "windows" | "mac" | "linux" | 2 more`

            The type of computer environment to control.

            - `"windows"`

            - `"mac"`

            - `"linux"`

            - `"ubuntu"`

            - `"browser"`

          - `type: "computer_use_preview"`

            The type of the computer use tool. Always `computer_use_preview`.

            - `"computer_use_preview"`

        - `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"`

            The type of the web search tool. One of `web_search` or `web_search_2025_08_26`.

            - `"web_search"`

            - `"web_search_2025_08_26"`

          - `external_web_access?: boolean`

            Allow live internet access for web search. Defaults to true when omitted. When false, the web search tool runs in offline/cache-only mode and will not fetch new external content.

          - `filters?: Filters | null`

            Filters for the search.

            - `allowed_domains?: Array<string> | null`

              Allowed domains for the search. If not provided, all domains are allowed.
              Subdomains of the provided domains are allowed as well.

              Example: `["pubmed.ncbi.nlm.nih.gov"]`

          - `search_context_size?: "low" | "medium" | "high"`

            High level guidance for the amount of context window space to use for the search. One of `low`, `medium`, or `high`. `medium` is the default.

            - `"low"`

            - `"medium"`

            - `"high"`

          - `user_location?: UserLocation | null`

            The approximate location of the user.

            - `city?: string | null`

              Free text input for the city of the user, e.g. `San Francisco`.

            - `country?: string | null`

              The two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of the user, e.g. `US`.

            - `region?: string | null`

              Free text input for the region of the user, e.g. `California`.

            - `timezone?: string | null`

              The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of the user, e.g. `America/Los_Angeles`.

            - `type?: "approximate"`

              The type of location approximation. Always `approximate`.

              - `"approximate"`

        - `Mcp`

          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).

          - `server_label: string`

            A label for this MCP server, used to identify it in tool calls.

          - `type: "mcp"`

            The type of the MCP tool. Always `mcp`.

            - `"mcp"`

          - `allowed_callers?: Array<"direct" | "programmatic"> | null`

            The tool invocation context(s).

            - `"direct"`

            - `"programmatic"`

          - `allowed_tools?: Array<string> | McpToolFilter | null`

            List of allowed tool names or a filter object.

            - `Array<string>`

            - `McpToolFilter`

              A filter object to specify which tools are allowed.

              - `read_only?: boolean`

                Indicates whether or not a tool modifies data or is read-only. If an
                MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint),
                it will match this filter.

              - `tool_names?: Array<string>`

                List of allowed tool names.

          - `authorization?: string`

            An OAuth access token that can be used with a remote MCP server, either
            with a custom MCP server URL or a service connector. Your application
            must handle the OAuth authorization flow and provide the token here.

          - `connector_id?: "connector_dropbox" | "connector_gmail" | "connector_googlecalendar" | 5 more`

            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`

            - `"connector_dropbox"`

            - `"connector_gmail"`

            - `"connector_googlecalendar"`

            - `"connector_googledrive"`

            - `"connector_microsoftteams"`

            - `"connector_outlookcalendar"`

            - `"connector_outlookemail"`

            - `"connector_sharepoint"`

          - `defer_loading?: boolean`

            Whether this MCP tool is deferred and discovered via tool search.

          - `headers?: Record<string, string> | null`

            Optional HTTP headers to send to the MCP server. Use for authentication
            or other purposes.

          - `require_approval?: McpToolApprovalFilter | "always" | "never" | null`

            Specify which of the MCP server's tools require approval.

            - `McpToolApprovalFilter`

              Specify which of the MCP server's tools require approval. Can be
              `always`, `never`, or a filter object associated with tools
              that require approval.

              - `always?: Always`

                A filter object to specify which tools are allowed.

                - `read_only?: boolean`

                  Indicates whether or not a tool modifies data or is read-only. If an
                  MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint),
                  it will match this filter.

                - `tool_names?: Array<string>`

                  List of allowed tool names.

              - `never?: Never`

                A filter object to specify which tools are allowed.

                - `read_only?: boolean`

                  Indicates whether or not a tool modifies data or is read-only. If an
                  MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint),
                  it will match this filter.

                - `tool_names?: Array<string>`

                  List of allowed tool names.

            - `"always" | "never"`

              - `"always"`

              - `"never"`

          - `server_description?: string`

            Optional description of the MCP server, used to provide more context.

          - `server_url?: string`

            The URL for the MCP server. One of `server_url`, `connector_id`, or
            `tunnel_id` must be provided.

          - `tunnel_id?: string`

            The Secure MCP Tunnel ID to use instead of a direct server URL. One of
            `server_url`, `connector_id`, or `tunnel_id` must be provided.

        - `CodeInterpreter`

          A tool that runs Python code to help generate a response to a prompt.

          - `container: string | CodeInterpreterToolAuto`

            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`

            - `CodeInterpreterToolAuto`

              Configuration for a code interpreter container. Optionally specify the IDs of the files to run the code on.

              - `type: "auto"`

                Always `auto`.

                - `"auto"`

              - `file_ids?: Array<string>`

                An optional list of uploaded files to make available to your code.

              - `memory_limit?: "1g" | "4g" | "16g" | "64g" | null`

                The memory limit for the code interpreter container.

                - `"1g"`

                - `"4g"`

                - `"16g"`

                - `"64g"`

              - `network_policy?: BetaContainerNetworkPolicyDisabled | BetaContainerNetworkPolicyAllowlist`

                Network access policy for the container.

                - `BetaContainerNetworkPolicyDisabled`

                  - `type: "disabled"`

                    Disable outbound network access. Always `disabled`.

                    - `"disabled"`

                - `BetaContainerNetworkPolicyAllowlist`

                  - `allowed_domains: Array<string>`

                    A list of allowed domains when type is `allowlist`.

                  - `type: "allowlist"`

                    Allow outbound network access only to specified domains. Always `allowlist`.

                    - `"allowlist"`

                  - `domain_secrets?: Array<BetaContainerNetworkPolicyDomainSecret>`

                    Optional domain-scoped secrets for allowlisted domains.

                    - `domain: string`

                      The domain associated with the secret.

                    - `name: string`

                      The name of the secret to inject for the domain.

                    - `value: string`

                      The secret value to inject for the domain.

          - `type: "code_interpreter"`

            The type of the code interpreter tool. Always `code_interpreter`.

            - `"code_interpreter"`

          - `allowed_callers?: Array<"direct" | "programmatic"> | null`

            The tool invocation context(s).

            - `"direct"`

            - `"programmatic"`

        - `ProgrammaticToolCalling`

          - `type: "programmatic_tool_calling"`

            The type of the tool. Always `programmatic_tool_calling`.

            - `"programmatic_tool_calling"`

        - `ImageGeneration`

          A tool that generates images using the GPT image models.

          - `type: "image_generation"`

            The type of the image generation tool. Always `image_generation`.

            - `"image_generation"`

          - `action?: "generate" | "edit" | "auto"`

            Whether to generate a new image or edit an existing image. Default: `auto`.

            - `"generate"`

            - `"edit"`

            - `"auto"`

          - `background?: "transparent" | "opaque" | "auto"`

            Allows to set transparency for the background of the generated image(s).
            Must be one of `transparent`, `opaque`, or `auto` (default value). When
            `auto` is used, the model will automatically determine the best
            background for the image.

            Transparent backgrounds are available for supported GPT Image models.
            For `gpt-image-2` and `gpt-image-2-2026-04-21`, this support is in
            preview. When using `transparent`, set the output format to `png` or
            `webp`.

            - `"transparent"`

            - `"opaque"`

            - `"auto"`

          - `input_fidelity?: "high" | "low" | null`

            Control how much effort the model will exert to match the style and features, especially facial features, of input images. This parameter is only supported for `gpt-image-1` and `gpt-image-1.5` and later models, unsupported for `gpt-image-1-mini`. Supports `high` and `low`. Defaults to `low`.

            - `"high"`

            - `"low"`

          - `input_image_mask?: InputImageMask`

            Optional mask for inpainting. Contains `image_url`
            (string, optional) and `file_id` (string, optional).

            - `file_id?: string`

              File ID for the mask image.

            - `image_url?: string`

              Base64-encoded mask image.

          - `model?: (string & {}) | "gpt-image-1" | "gpt-image-1-mini" | "gpt-image-2" | 3 more`

            The image generation model to use. One of `gpt-image-1`,
            `gpt-image-1-mini`, `gpt-image-1.5`, `gpt-image-2`,
            `gpt-image-2-2026-04-21`, or `chatgpt-image-latest`. Default:
            `gpt-image-1`.

            - `(string & {})`

            - `"gpt-image-1" | "gpt-image-1-mini" | "gpt-image-2" | 3 more`

              - `"gpt-image-1"`

              - `"gpt-image-1-mini"`

              - `"gpt-image-2"`

              - `"gpt-image-2-2026-04-21"`

              - `"gpt-image-1.5"`

              - `"chatgpt-image-latest"`

          - `moderation?: "auto" | "low"`

            Moderation level for the generated image. Default: `auto`.

            - `"auto"`

            - `"low"`

          - `output_compression?: number`

            Compression level for the output image. Default: 100.

          - `output_format?: "png" | "webp" | "jpeg"`

            The output format of the generated image. One of `png`, `webp`, or
            `jpeg`. Default: `png`.

            - `"png"`

            - `"webp"`

            - `"jpeg"`

          - `partial_images?: number`

            Number of partial images to generate in streaming mode, from 0 (default value) to 3.

          - `quality?: "low" | "medium" | "high" | "auto"`

            The quality of the generated image. One of `low`, `medium`, `high`,
            or `auto`. Default: `auto`.

            - `"low"`

            - `"medium"`

            - `"high"`

            - `"auto"`

          - `size?: (string & {}) | "1024x1024" | "1024x1536" | "1536x1024" | "auto"`

            The size of the generated images. For `gpt-image-2` and `gpt-image-2-2026-04-21`, arbitrary resolutions are supported as `WIDTHxHEIGHT` strings, for example `1536x864`. Width and height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above `2560x1440` are experimental, and the maximum supported resolution is `3840x2160`. The requested size must also satisfy the model's current pixel and edge limits. The standard sizes `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models; `auto` is supported for models that allow automatic sizing. For `dall-e-2`, use one of `256x256`, `512x512`, or `1024x1024`. For `dall-e-3`, use one of `1024x1024`, `1792x1024`, or `1024x1792`.

            - `(string & {})`

            - `"1024x1024" | "1024x1536" | "1536x1024" | "auto"`

              - `"1024x1024"`

              - `"1024x1536"`

              - `"1536x1024"`

              - `"auto"`

        - `LocalShell`

          A tool that allows the model to execute shell commands in a local environment.

          - `type: "local_shell"`

            The type of the local shell tool. Always `local_shell`.

            - `"local_shell"`

        - `BetaFunctionShellTool`

          A tool that allows the model to execute shell commands.

          - `type: "shell"`

            The type of the shell tool. Always `shell`.

            - `"shell"`

          - `allowed_callers?: Array<"direct" | "programmatic"> | null`

            The tool invocation context(s).

            - `"direct"`

            - `"programmatic"`

          - `environment?: BetaContainerAuto | BetaLocalEnvironment | BetaContainerReference | null`

            - `BetaContainerAuto`

              - `type: "container_auto"`

                Automatically creates a container for this request

                - `"container_auto"`

              - `file_ids?: Array<string>`

                An optional list of uploaded files to make available to your code.

              - `memory_limit?: "1g" | "4g" | "16g" | "64g" | null`

                The memory limit for the container.

                - `"1g"`

                - `"4g"`

                - `"16g"`

                - `"64g"`

              - `network_policy?: BetaContainerNetworkPolicyDisabled | BetaContainerNetworkPolicyAllowlist`

                Network access policy for the container.

                - `BetaContainerNetworkPolicyDisabled`

                - `BetaContainerNetworkPolicyAllowlist`

              - `skills?: Array<BetaSkillReference | BetaInlineSkill>`

                An optional list of skills referenced by id or inline data.

                - `BetaSkillReference`

                  - `skill_id: string`

                    The ID of the referenced skill.

                  - `type: "skill_reference"`

                    References a skill created with the /v1/skills endpoint.

                    - `"skill_reference"`

                  - `version?: string`

                    Optional skill version. Use a positive integer or 'latest'. Omit for default.

                - `BetaInlineSkill`

                  - `description: string`

                    The description of the skill.

                  - `name: string`

                    The name of the skill.

                  - `source: BetaInlineSkillSource`

                    Inline skill payload

                    - `data: string`

                      Base64-encoded skill zip bundle.

                    - `media_type: "application/zip"`

                      The media type of the inline skill payload. Must be `application/zip`.

                      - `"application/zip"`

                    - `type: "base64"`

                      The type of the inline skill source. Must be `base64`.

                      - `"base64"`

                  - `type: "inline"`

                    Defines an inline skill for this request.

                    - `"inline"`

            - `BetaLocalEnvironment`

              - `type: "local"`

                Use a local computer environment.

                - `"local"`

              - `skills?: Array<BetaLocalSkill>`

                An optional list of skills.

                - `description: string`

                  The description of the skill.

                - `name: string`

                  The name of the skill.

                - `path: string`

                  The path to the directory containing the skill.

            - `BetaContainerReference`

              - `container_id: string`

                The ID of the referenced container.

              - `type: "container_reference"`

                References a container created with the /v1/containers endpoint

                - `"container_reference"`

        - `BetaCustomTool`

          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)

          - `name: string`

            The name of the custom tool, used to identify it in tool calls.

          - `type: "custom"`

            The type of the custom tool. Always `custom`.

            - `"custom"`

          - `allowed_callers?: Array<"direct" | "programmatic"> | null`

            The tool invocation context(s).

            - `"direct"`

            - `"programmatic"`

          - `defer_loading?: boolean`

            Whether this tool should be deferred and discovered via tool search.

          - `description?: string`

            Optional description of the custom tool, used to provide more context.

          - `format?: Text | Grammar`

            The input format for the custom tool. Default is unconstrained text.

            - `Text`

              Unconstrained free-form text.

              - `type: "text"`

                Unconstrained text format. Always `text`.

                - `"text"`

            - `Grammar`

              A grammar defined by the user.

              - `definition: string`

                The grammar definition.

              - `syntax: "lark" | "regex"`

                The syntax of the grammar definition. One of `lark` or `regex`.

                - `"lark"`

                - `"regex"`

              - `type: "grammar"`

                Grammar format. Always `grammar`.

                - `"grammar"`

        - `BetaNamespaceTool`

          Groups function/custom tools under a shared namespace.

          - `description: string`

            A description of the namespace shown to the model.

          - `name: string`

            The namespace name used in tool calls (for example, `crm`).

          - `tools: Array<Function | BetaCustomTool>`

            The function/custom tools available inside this namespace.

            - `Function`

              - `name: string`

              - `type: "function"`

                - `"function"`

              - `allowed_callers?: Array<"direct" | "programmatic"> | null`

                The tool invocation context(s).

                - `"direct"`

                - `"programmatic"`

              - `defer_loading?: boolean`

                Whether this function should be deferred and discovered via tool search.

              - `description?: string | null`

              - `output_schema?: Record<string, unknown> | null`

                A JSON Schema describing the JSON value encoded in string outputs for this function tool. This does not describe content-array outputs.

              - `parameters?: unknown`

              - `strict?: boolean | null`

                Whether to enforce strict parameter validation. If omitted, Responses attempts to use strict validation when the schema is compatible, and falls back to non-strict validation otherwise.

            - `BetaCustomTool`

              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: "namespace"`

            The type of the tool. Always `namespace`.

            - `"namespace"`

        - `BetaToolSearchTool`

          Hosted or BYOT tool search configuration for deferred tools.

          - `type: "tool_search"`

            The type of the tool. Always `tool_search`.

            - `"tool_search"`

          - `description?: string | null`

            Description shown to the model for a client-executed tool search tool.

          - `execution?: "server" | "client"`

            Whether tool search is executed by the server or by the client.

            - `"server"`

            - `"client"`

          - `parameters?: unknown`

            Parameter schema for a client-executed tool search tool.

        - `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"`

            The type of the web search tool. One of `web_search_preview` or `web_search_preview_2025_03_11`.

            - `"web_search_preview"`

            - `"web_search_preview_2025_03_11"`

          - `search_content_types?: Array<"text" | "image">`

            - `"text"`

            - `"image"`

          - `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.

            - `"low"`

            - `"medium"`

            - `"high"`

          - `user_location?: UserLocation | null`

            The user's location.

            - `type: "approximate"`

              The type of location approximation. Always `approximate`.

              - `"approximate"`

            - `city?: string | null`

              Free text input for the city of the user, e.g. `San Francisco`.

            - `country?: string | null`

              The two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of the user, e.g. `US`.

            - `region?: string | null`

              Free text input for the region of the user, e.g. `California`.

            - `timezone?: string | null`

              The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of the user, e.g. `America/Los_Angeles`.

        - `BetaApplyPatchTool`

          Allows the assistant to create, delete, or update files using unified diffs.

          - `type: "apply_patch"`

            The type of the tool. Always `apply_patch`.

            - `"apply_patch"`

          - `allowed_callers?: Array<"direct" | "programmatic"> | null`

            The tool invocation context(s).

            - `"direct"`

            - `"programmatic"`

      - `type: "tool_search_output"`

        The type of the item. Always `tool_search_output`.

        - `"tool_search_output"`

      - `agent?: Agent`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

      - `created_by?: string`

        The identifier of the actor that created the item.

    - `AdditionalTools`

      - `id: string`

        The unique ID of the additional tools item.

      - `role: "unknown" | "user" | "assistant" | 5 more`

        The role that provided the additional tools.

        - `"unknown"`

        - `"user"`

        - `"assistant"`

        - `"system"`

        - `"critic"`

        - `"discriminator"`

        - `"developer"`

        - `"tool"`

      - `tools: Array<BetaTool>`

        The additional tool definitions made available at this item.

        - `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).

        - `Mcp`

          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).

        - `CodeInterpreter`

          A tool that runs Python code to help generate a response to a prompt.

        - `ProgrammaticToolCalling`

        - `ImageGeneration`

          A tool that generates images using the GPT image models.

        - `LocalShell`

          A tool that allows the model to execute shell commands in a local environment.

        - `BetaFunctionShellTool`

          A tool that allows the model to execute shell commands.

        - `BetaCustomTool`

          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)

        - `BetaNamespaceTool`

          Groups function/custom tools under a shared namespace.

        - `BetaToolSearchTool`

          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).

        - `BetaApplyPatchTool`

          Allows the assistant to create, delete, or update files using unified diffs.

      - `type: "additional_tools"`

        The type of the item. Always `additional_tools`.

        - `"additional_tools"`

      - `agent?: Agent`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

    - `BetaResponseReasoningItem`

      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).

      - `id: string`

        The unique identifier of the reasoning content.

      - `summary: Array<Summary>`

        Reasoning summary content.

        - `text: string`

          A summary of the reasoning output from the model so far.

        - `type: "summary_text"`

          The type of the object. Always `summary_text`.

          - `"summary_text"`

      - `type: "reasoning"`

        The type of the object. Always `reasoning`.

        - `"reasoning"`

      - `agent?: Agent | null`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

      - `content?: Array<Content>`

        Reasoning text content.

        - `text: string`

          The reasoning text from the model.

        - `type: "reasoning_text"`

          The type of the reasoning text. Always `reasoning_text`.

          - `"reasoning_text"`

      - `encrypted_content?: string | null`

        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.

        When streaming, use the completed reasoning item and its
        `encrypted_content` from the `response.output_item.done` event in
        subsequent requests. The `encrypted_content` in
        `response.output_item.added` may be incomplete. This is especially
        important when `store` is `false` or when using Zero Data Retention.

      - `status?: "in_progress" | "completed" | "incomplete"`

        The status of the item. One of `in_progress`, `completed`, or
        `incomplete`. Populated when items are returned via API.

        - `"in_progress"`

        - `"completed"`

        - `"incomplete"`

    - `Program`

      - `id: string`

        The unique ID of the program item.

      - `call_id: string`

        The stable call ID of the program item.

      - `code: string`

        The JavaScript source executed by programmatic tool calling.

      - `fingerprint: string`

        Opaque program replay fingerprint that must be round-tripped.

      - `type: "program"`

        The type of the item. Always `program`.

        - `"program"`

      - `agent?: Agent`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

    - `ProgramOutput`

      - `id: string`

        The unique ID of the program output item.

      - `call_id: string`

        The call ID of the program item.

      - `result: string`

        The result produced by the program item.

      - `status: "completed" | "incomplete"`

        The terminal status of the program output item.

        - `"completed"`

        - `"incomplete"`

      - `type: "program_output"`

        The type of the item. Always `program_output`.

        - `"program_output"`

      - `agent?: Agent`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

    - `BetaResponseCompactionItem`

      A compaction item generated by the [`v1/responses/compact` API](https://platform.openai.com/docs/api-reference/responses/compact).

      - `id: string`

        The unique ID of the compaction item.

      - `encrypted_content: string`

        The encrypted content that was produced by compaction.

      - `type: "compaction"`

        The type of the item. Always `compaction`.

        - `"compaction"`

      - `agent?: Agent`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

      - `created_by?: string`

        The identifier of the actor that created the item.

    - `ImageGenerationCall`

      An image generation request made by the model.

      - `id: string`

        The unique ID of the image generation call.

      - `result: string | null`

        The generated image encoded in base64.

      - `status: "in_progress" | "completed" | "generating" | "failed"`

        The status of the image generation call.

        - `"in_progress"`

        - `"completed"`

        - `"generating"`

        - `"failed"`

      - `type: "image_generation_call"`

        The type of the image generation call. Always `image_generation_call`.

        - `"image_generation_call"`

      - `agent?: Agent | null`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

    - `BetaResponseCodeInterpreterToolCall`

      A tool call to run code.

      - `id: string`

        The unique ID of the code interpreter tool call.

      - `code: string | null`

        The code to run, or null if not available.

      - `container_id: string`

        The ID of the container used to run the code.

      - `outputs: Array<Logs | Image> | null`

        The outputs generated by the code interpreter, such as logs or images.
        Can be null if no outputs are available.

        - `Logs`

          The logs output from the code interpreter.

          - `logs: string`

            The logs output from the code interpreter.

          - `type: "logs"`

            The type of the output. Always `logs`.

            - `"logs"`

        - `Image`

          The image output from the code interpreter.

          - `type: "image"`

            The type of the output. Always `image`.

            - `"image"`

          - `url: string`

            The URL of the image output from the code interpreter.

      - `status: "in_progress" | "completed" | "incomplete" | 2 more`

        The status of the code interpreter tool call. Valid values are `in_progress`, `completed`, `incomplete`, `interpreting`, and `failed`.

        - `"in_progress"`

        - `"completed"`

        - `"incomplete"`

        - `"interpreting"`

        - `"failed"`

      - `type: "code_interpreter_call"`

        The type of the code interpreter tool call. Always `code_interpreter_call`.

        - `"code_interpreter_call"`

      - `agent?: Agent | null`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

    - `LocalShellCall`

      A tool call to run a command on the local shell.

      - `id: string`

        The unique ID of the local shell call.

      - `action: Action`

        Execute a shell command on the server.

        - `command: Array<string>`

          The command to run.

        - `env: Record<string, string>`

          Environment variables to set for the command.

        - `type: "exec"`

          The type of the local shell action. Always `exec`.

          - `"exec"`

        - `timeout_ms?: number | null`

          Optional timeout in milliseconds for the command.

        - `user?: string | null`

          Optional user to run the command as.

        - `working_directory?: string | null`

          Optional working directory to run the command in.

      - `call_id: string`

        The unique ID of the local shell tool call generated by the model.

      - `status: "in_progress" | "completed" | "incomplete"`

        The status of the local shell call.

        - `"in_progress"`

        - `"completed"`

        - `"incomplete"`

      - `type: "local_shell_call"`

        The type of the local shell call. Always `local_shell_call`.

        - `"local_shell_call"`

      - `agent?: Agent | null`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

    - `LocalShellCallOutput`

      The output of a local shell tool call.

      - `id: string`

        The unique ID of the local shell tool call generated by the model.

      - `output: string`

        A JSON string of the output of the local shell tool call.

      - `type: "local_shell_call_output"`

        The type of the local shell tool call output. Always `local_shell_call_output`.

        - `"local_shell_call_output"`

      - `agent?: Agent | null`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

      - `status?: "in_progress" | "completed" | "incomplete" | null`

        The status of the item. One of `in_progress`, `completed`, or `incomplete`.

        - `"in_progress"`

        - `"completed"`

        - `"incomplete"`

    - `BetaResponseFunctionShellToolCall`

      A tool call that executes one or more shell commands in a managed environment.

      - `id: string`

        The unique ID of the shell tool call. Populated when this item is returned via API.

      - `action: Action`

        The shell commands and limits that describe how to run the tool call.

        - `commands: Array<string>`

        - `max_output_length: number | null`

          Optional maximum number of characters to return from each command.

        - `timeout_ms: number | null`

          Optional timeout in milliseconds for the commands.

      - `call_id: string`

        The unique ID of the shell tool call generated by the model.

      - `environment: BetaResponseLocalEnvironment | BetaResponseContainerReference | null`

        Represents the use of a local environment to perform shell actions.

        - `BetaResponseLocalEnvironment`

          Represents the use of a local environment to perform shell actions.

          - `type: "local"`

            The environment type. Always `local`.

            - `"local"`

        - `BetaResponseContainerReference`

          Represents a container created with /v1/containers.

          - `container_id: string`

          - `type: "container_reference"`

            The environment type. Always `container_reference`.

            - `"container_reference"`

      - `status: "in_progress" | "completed" | "incomplete"`

        The status of the shell call. One of `in_progress`, `completed`, or `incomplete`.

        - `"in_progress"`

        - `"completed"`

        - `"incomplete"`

      - `type: "shell_call"`

        The type of the item. Always `shell_call`.

        - `"shell_call"`

      - `agent?: Agent`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

      - `caller?: Direct | Program | null`

        The execution context that produced this tool call.

        - `Direct`

          - `type: "direct"`

            - `"direct"`

        - `Program`

          - `caller_id: string`

            The call ID of the program item that produced this tool call.

          - `type: "program"`

            - `"program"`

      - `created_by?: string`

        The ID of the entity that created this tool call.

    - `BetaResponseFunctionShellToolCallOutput`

      The output of a shell tool call that was emitted.

      - `id: string`

        The unique ID of the shell call output. Populated when this item is returned via API.

      - `call_id: string`

        The unique ID of the shell tool call generated by the model.

      - `max_output_length: number | null`

        The maximum length of the shell command output. This is generated by the model and should be passed back with the raw output.

      - `output: Array<Output>`

        An array of shell call output contents

        - `outcome: Timeout | Exit`

          Represents either an exit outcome (with an exit code) or a timeout outcome for a shell call output chunk.

          - `Timeout`

            Indicates that the shell call exceeded its configured time limit.

            - `type: "timeout"`

              The outcome type. Always `timeout`.

              - `"timeout"`

          - `Exit`

            Indicates that the shell commands finished and returned an exit code.

            - `exit_code: number`

              Exit code from the shell process.

            - `type: "exit"`

              The outcome type. Always `exit`.

              - `"exit"`

        - `stderr: string`

          The standard error output that was captured.

        - `stdout: string`

          The standard output that was captured.

        - `created_by?: string`

          The identifier of the actor that created the item.

      - `status: "in_progress" | "completed" | "incomplete"`

        The status of the shell call output. One of `in_progress`, `completed`, or `incomplete`.

        - `"in_progress"`

        - `"completed"`

        - `"incomplete"`

      - `type: "shell_call_output"`

        The type of the shell call output. Always `shell_call_output`.

        - `"shell_call_output"`

      - `agent?: Agent`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

      - `caller?: Direct | Program | null`

        The execution context that produced this tool call.

        - `Direct`

          - `type: "direct"`

            - `"direct"`

        - `Program`

          - `caller_id: string`

            The call ID of the program item that produced this tool call.

          - `type: "program"`

            - `"program"`

      - `created_by?: string`

        The identifier of the actor that created the item.

    - `BetaResponseApplyPatchToolCall`

      A tool call that applies file diffs by creating, deleting, or updating files.

      - `id: string`

        The unique ID of the apply patch tool call. Populated when this item is returned via API.

      - `call_id: string`

        The unique ID of the apply patch tool call generated by the model.

      - `operation: CreateFile | DeleteFile | UpdateFile`

        One of the create_file, delete_file, or update_file operations applied via apply_patch.

        - `CreateFile`

          Instruction describing how to create a file via the apply_patch tool.

          - `diff: string`

            Diff to apply.

          - `path: string`

            Path of the file to create.

          - `type: "create_file"`

            Create a new file with the provided diff.

            - `"create_file"`

        - `DeleteFile`

          Instruction describing how to delete a file via the apply_patch tool.

          - `path: string`

            Path of the file to delete.

          - `type: "delete_file"`

            Delete the specified file.

            - `"delete_file"`

        - `UpdateFile`

          Instruction describing how to update a file via the apply_patch tool.

          - `diff: string`

            Diff to apply.

          - `path: string`

            Path of the file to update.

          - `type: "update_file"`

            Update an existing file with the provided diff.

            - `"update_file"`

      - `status: "in_progress" | "completed"`

        The status of the apply patch tool call. One of `in_progress` or `completed`.

        - `"in_progress"`

        - `"completed"`

      - `type: "apply_patch_call"`

        The type of the item. Always `apply_patch_call`.

        - `"apply_patch_call"`

      - `agent?: Agent`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

      - `caller?: Direct | Program | null`

        The execution context that produced this tool call.

        - `Direct`

          - `type: "direct"`

            - `"direct"`

        - `Program`

          - `caller_id: string`

            The call ID of the program item that produced this tool call.

          - `type: "program"`

            - `"program"`

      - `created_by?: string`

        The ID of the entity that created this tool call.

    - `BetaResponseApplyPatchToolCallOutput`

      The output emitted by an apply patch tool call.

      - `id: string`

        The unique ID of the apply patch tool call output. Populated when this item is returned via API.

      - `call_id: string`

        The unique ID of the apply patch tool call generated by the model.

      - `status: "completed" | "failed"`

        The status of the apply patch tool call output. One of `completed` or `failed`.

        - `"completed"`

        - `"failed"`

      - `type: "apply_patch_call_output"`

        The type of the item. Always `apply_patch_call_output`.

        - `"apply_patch_call_output"`

      - `agent?: Agent`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

      - `caller?: Direct | Program | null`

        The execution context that produced this tool call.

        - `Direct`

          - `type: "direct"`

            - `"direct"`

        - `Program`

          - `caller_id: string`

            The call ID of the program item that produced this tool call.

          - `type: "program"`

            - `"program"`

      - `created_by?: string`

        The ID of the entity that created this tool call output.

      - `output?: string | null`

        Optional textual output returned by the apply patch tool.

    - `McpListTools`

      A list of tools available on an MCP server.

      - `id: string`

        The unique ID of the list.

      - `server_label: string`

        The label of the MCP server.

      - `tools: Array<Tool>`

        The tools available on the server.

        - `input_schema: unknown`

          The JSON schema describing the tool's input.

        - `name: string`

          The name of the tool.

        - `annotations?: unknown`

          Additional annotations about the tool.

        - `description?: string | null`

          The description of the tool.

      - `type: "mcp_list_tools"`

        The type of the item. Always `mcp_list_tools`.

        - `"mcp_list_tools"`

      - `agent?: Agent | null`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

      - `error?: string | null`

        Error message if the server could not list tools.

    - `McpApprovalRequest`

      A request for human approval of a tool invocation.

      - `id: string`

        The unique ID of the approval request.

      - `arguments: string`

        A JSON string of arguments for the tool.

      - `name: string`

        The name of the tool to run.

      - `server_label: string`

        The label of the MCP server making the request.

      - `type: "mcp_approval_request"`

        The type of the item. Always `mcp_approval_request`.

        - `"mcp_approval_request"`

      - `agent?: Agent | null`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

    - `McpApprovalResponse`

      A response to an MCP approval request.

      - `id: string`

        The unique ID of the approval response

      - `approval_request_id: string`

        The ID of the approval request being answered.

      - `approve: boolean`

        Whether the request was approved.

      - `type: "mcp_approval_response"`

        The type of the item. Always `mcp_approval_response`.

        - `"mcp_approval_response"`

      - `agent?: Agent | null`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

      - `reason?: string | null`

        Optional reason for the decision.

    - `McpCall`

      An invocation of a tool on an MCP server.

      - `id: string`

        The unique ID of the tool call.

      - `arguments: string`

        A JSON string of the arguments passed to the tool.

      - `name: string`

        The name of the tool that was run.

      - `server_label: string`

        The label of the MCP server running the tool.

      - `type: "mcp_call"`

        The type of the item. Always `mcp_call`.

        - `"mcp_call"`

      - `agent?: Agent | null`

        The agent that produced this item.

        - `agent_name: string`

          The canonical name of the agent that produced this item.

      - `approval_request_id?: string | null`

        Unique identifier for the MCP tool call approval request.
        Include this value in a subsequent `mcp_approval_response` input to approve or reject the corresponding tool call.

      - `error?: BetaMcpToolCallError | null`

        The error from the tool call, if any.

        - `McpProtocolError`

          - `code: number`

          - `message: string`

          - `type: "mcp_protocol_error"`

            - `"mcp_protocol_error"`

        - `McpToolExecutionError`

          - `content: unknown`

          - `type: "mcp_tool_execution_error"`

            - `"mcp_tool_execution_error"`

        - `HTTPError`

          - `code: number`

          - `message: string`

          - `type: "http_error"`

            - `"http_error"`

      - `output?: string | null`

        The output from the tool call.

      - `status?: "in_progress" | "completed" | "incomplete" | 2 more`

        The status of the tool call. One of `in_progress`, `completed`, `incomplete`, `calling`, or `failed`.

        - `"in_progress"`

        - `"completed"`

        - `"incomplete"`

        - `"calling"`

        - `"failed"`

    - `BetaResponseCustomToolCallItem extends BetaResponseCustomToolCall`

      A call to a custom tool created by the model.

      - `id: string`

        The unique ID of the custom tool call item.

      - `status: "in_progress" | "completed" | "incomplete"`

        The status of the item. One of `in_progress`, `completed`, or
        `incomplete`. Populated when items are returned via API.

        - `"in_progress"`

        - `"completed"`

        - `"incomplete"`

      - `created_by?: string`

        The identifier of the actor that created the item.

    - `BetaResponseCustomToolCallOutputItem extends BetaResponseCustomToolCallOutput`

      The output of a custom tool call from your code, being sent back to the model.

      - `id: string`

        The unique ID of the custom tool call output item.

      - `status: "in_progress" | "completed" | "incomplete"`

        The status of the item. One of `in_progress`, `completed`, or
        `incomplete`. Populated when items are returned via API.

        - `"in_progress"`

        - `"completed"`

        - `"incomplete"`

      - `created_by?: string`

        The identifier of the actor that created the item.

  - `first_id: string`

    The ID of the first item in the list.

  - `has_more: boolean`

    Whether there are more items available.

  - `last_id: string`

    The ID of the last item in the list.

  - `object: "list"`

    The type of object returned, must be `list`.

    - `"list"`

# Input Tokens

## Get input token counts

`client.beta.responses.inputTokens.count(InputTokenCountParamsparams?, RequestOptionsoptions?): InputTokenCountResponse`

**post** `/responses/input_tokens?beta=true`

Returns input token counts of the request.

Returns an object with `object` set to `response.input_tokens` and an `input_tokens` count.

### Parameters

- `params: InputTokenCountParams`

  - `conversation?: string | BetaResponseConversationParam | null`

    Body param: The conversation that this response belongs to. Items from this conversation are prepended to `input_items` for this response request.
    Input items and output items from this response are automatically added to this conversation after this response completes.

    - `string`

    - `BetaResponseConversationParam`

      The conversation that this response belongs to.

      - `id: string`

        The unique ID of the conversation.

  - `input?: string | Array<BetaResponseInputItem> | null`

    Body param: Text, image, or file inputs to the model, used to generate a response

    - `string`

    - `Array<BetaResponseInputItem>`

      - `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.

        - `content: string | BetaResponseInputMessageContentList`

          Text, image, or audio input to the model, used to generate a response.
          Can also contain previous assistant responses.

          - `string`

          - `BetaResponseInputMessageContentList = Array<BetaResponseInputContent>`

            A list of one or many input items to the model, containing different content
            types.

            - `BetaResponseInputText`

              A text input to the model.

              - `text: string`

                The text input to the model.

              - `type: "input_text"`

                The type of the input item. Always `input_text`.

                - `"input_text"`

              - `prompt_cache_breakpoint?: PromptCacheBreakpoint`

                Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.

                - `mode: "explicit"`

                  The breakpoint mode. Always `explicit`.

                  - `"explicit"`

            - `BetaResponseInputImage`

              An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision).

              - `detail: BetaImageDetail`

                The detail level of the image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`.

                - `"low"`

                - `"high"`

                - `"auto"`

                - `"original"`

              - `type: "input_image"`

                The type of the input item. Always `input_image`.

                - `"input_image"`

              - `file_id?: string | null`

                The ID of the file to be sent to the model.

              - `image_url?: string | null`

                The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.

              - `prompt_cache_breakpoint?: PromptCacheBreakpoint`

                Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.

                - `mode: "explicit"`

                  The breakpoint mode. Always `explicit`.

                  - `"explicit"`

            - `BetaResponseInputFile`

              A file input to the model.

              - `type: "input_file"`

                The type of the input item. Always `input_file`.

                - `"input_file"`

              - `detail?: "auto" | "low" | "high"`

                The detail level of the file to be sent to the model. Use `auto` to let the system select the detail level; for GPT-5.6 and later models, `auto` uses high-quality rendering, which may increase input token usage. Use `low` for lower-cost rendering, or `high` to render the file at higher quality. Defaults to `auto`.

                - `"auto"`

                - `"low"`

                - `"high"`

              - `file_data?: string`

                The content of the file to be sent to the model.

              - `file_id?: string | null`

                The ID of the file to be sent to the model.

              - `file_url?: string`

                The URL of the file to be sent to the model.

              - `filename?: string`

                The name of the file to be sent to the model.

              - `prompt_cache_breakpoint?: PromptCacheBreakpoint`

                Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.

                - `mode: "explicit"`

                  The breakpoint mode. Always `explicit`.

                  - `"explicit"`

        - `role: "user" | "assistant" | "system" | "developer"`

          The role of the message input. One of `user`, `assistant`, `system`, or
          `developer`.

          - `"user"`

          - `"assistant"`

          - `"system"`

          - `"developer"`

        - `phase?: "commentary" | "final_answer" | null`

          Labels an `assistant` message as intermediate commentary (`commentary`) or the final answer (`final_answer`).
          For models like `gpt-5.3-codex` and beyond, when sending follow-up requests, preserve and resend
          phase on all assistant messages — dropping it can degrade performance. Not used for user messages.

          - `"commentary"`

          - `"final_answer"`

        - `type?: "message"`

          The type of the message input. Always `message`.

          - `"message"`

      - `Message`

        A message input to the model with a role indicating instruction following
        hierarchy. Instructions given with the `developer` or `system` role take
        precedence over instructions given with the `user` role.

        - `content: BetaResponseInputMessageContentList`

          A list of one or many input items to the model, containing different content
          types.

        - `role: "user" | "system" | "developer"`

          The role of the message input. One of `user`, `system`, or `developer`.

          - `"user"`

          - `"system"`

          - `"developer"`

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `status?: "in_progress" | "completed" | "incomplete"`

          The status of item. One of `in_progress`, `completed`, or
          `incomplete`. Populated when items are returned via API.

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

        - `type?: "message"`

          The type of the message input. Always set to `message`.

          - `"message"`

      - `BetaResponseOutputMessage`

        An output message from the model.

        - `id: string`

          The unique ID of the output message.

        - `content: Array<BetaResponseOutputText | BetaResponseOutputRefusal>`

          The content of the output message.

          - `BetaResponseOutputText`

            A text output from the model.

            - `annotations: Array<FileCitation | URLCitation | ContainerFileCitation | FilePath>`

              The annotations of the text output.

              - `FileCitation`

                A citation to a file.

                - `file_id: string`

                  The ID of the file.

                - `filename: string`

                  The filename of the file cited.

                - `index: number`

                  The index of the file in the list of files.

                - `type: "file_citation"`

                  The type of the file citation. Always `file_citation`.

                  - `"file_citation"`

              - `URLCitation`

                A citation for a web resource used to generate a model response.

                - `end_index: number`

                  The index of the last character of the URL citation in the message.

                - `start_index: number`

                  The index of the first character of the URL citation in the message.

                - `title: string`

                  The title of the web resource.

                - `type: "url_citation"`

                  The type of the URL citation. Always `url_citation`.

                  - `"url_citation"`

                - `url: string`

                  The URL of the web resource.

              - `ContainerFileCitation`

                A citation for a container file used to generate a model response.

                - `container_id: string`

                  The ID of the container file.

                - `end_index: number`

                  The index of the last character of the container file citation in the message.

                - `file_id: string`

                  The ID of the file.

                - `filename: string`

                  The filename of the container file cited.

                - `start_index: number`

                  The index of the first character of the container file citation in the message.

                - `type: "container_file_citation"`

                  The type of the container file citation. Always `container_file_citation`.

                  - `"container_file_citation"`

              - `FilePath`

                A path to a file.

                - `file_id: string`

                  The ID of the file.

                - `index: number`

                  The index of the file in the list of files.

                - `type: "file_path"`

                  The type of the file path. Always `file_path`.

                  - `"file_path"`

            - `text: string`

              The text output from the model.

            - `type: "output_text"`

              The type of the output text. Always `output_text`.

              - `"output_text"`

            - `logprobs?: Array<Logprob>`

              - `token: string`

              - `bytes: Array<number>`

              - `logprob: number`

              - `top_logprobs: Array<TopLogprob>`

                - `token: string`

                - `bytes: Array<number>`

                - `logprob: number`

          - `BetaResponseOutputRefusal`

            A refusal from the model.

            - `refusal: string`

              The refusal explanation from the model.

            - `type: "refusal"`

              The type of the refusal. Always `refusal`.

              - `"refusal"`

        - `role: "assistant"`

          The role of the output message. Always `assistant`.

          - `"assistant"`

        - `status: "in_progress" | "completed" | "incomplete"`

          The status of the message input. One of `in_progress`, `completed`, or
          `incomplete`. Populated when input items are returned via API.

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

        - `type: "message"`

          The type of the output message. Always `message`.

          - `"message"`

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `phase?: "commentary" | "final_answer" | null`

          Labels an `assistant` message as intermediate commentary (`commentary`) or the final answer (`final_answer`).
          For models like `gpt-5.3-codex` and beyond, when sending follow-up requests, preserve and resend
          phase on all assistant messages — dropping it can degrade performance. Not used for user messages.

          - `"commentary"`

          - `"final_answer"`

      - `BetaResponseFileSearchToolCall`

        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.

        - `id: string`

          The unique ID of the file search tool call.

        - `queries: Array<string>`

          The queries used to search for files.

        - `status: "in_progress" | "searching" | "completed" | 2 more`

          The status of the file search tool call. One of `in_progress`,
          `searching`, `incomplete` or `failed`,

          - `"in_progress"`

          - `"searching"`

          - `"completed"`

          - `"incomplete"`

          - `"failed"`

        - `type: "file_search_call"`

          The type of the file search tool call. Always `file_search_call`.

          - `"file_search_call"`

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `results?: Array<Result> | null`

          The results of the file search tool call.

          - `attributes?: Record<string, string | number | boolean> | null`

            Set of 16 key-value pairs that can be attached to an object. This can be
            useful for storing additional information about the object in a structured
            format, and querying for objects via API or the dashboard. Keys are strings
            with a maximum length of 64 characters. Values are strings with a maximum
            length of 512 characters, booleans, or numbers.

            - `string`

            - `number`

            - `boolean`

          - `file_id?: string`

            The unique ID of the file.

          - `filename?: string`

            The name of the file.

          - `score?: number`

            The relevance score of the file - a value between 0 and 1.

          - `text?: string`

            The text that was retrieved from the file.

      - `BetaResponseComputerToolCall`

        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.

        - `id: string`

          The unique ID of the computer call.

        - `call_id: string`

          An identifier used when responding to the tool call with output.

        - `pending_safety_checks: Array<PendingSafetyCheck>`

          The pending safety checks for the computer call.

          - `id: string`

            The ID of the pending safety check.

          - `code?: string | null`

            The type of the pending safety check.

          - `message?: string | null`

            Details about the pending safety check.

        - `status: "in_progress" | "completed" | "incomplete"`

          The status of the item. One of `in_progress`, `completed`, or
          `incomplete`. Populated when items are returned via API.

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

        - `type: "computer_call"`

          The type of the computer call. Always `computer_call`.

          - `"computer_call"`

        - `action?: BetaComputerAction`

          A click action.

          - `Click`

            A click action.

            - `button: "left" | "right" | "wheel" | 2 more`

              Indicates which mouse button was pressed during the click. One of `left`, `right`, `wheel`, `back`, or `forward`.

              - `"left"`

              - `"right"`

              - `"wheel"`

              - `"back"`

              - `"forward"`

            - `type: "click"`

              Specifies the event type. For a click action, this property is always `click`.

              - `"click"`

            - `x: number`

              The x-coordinate where the click occurred.

            - `y: number`

              The y-coordinate where the click occurred.

            - `keys?: Array<string> | null`

              The keys being held while clicking.

          - `DoubleClick`

            A double click action.

            - `keys: Array<string> | null`

              The keys being held while double-clicking.

            - `type: "double_click"`

              Specifies the event type. For a double click action, this property is always set to `double_click`.

              - `"double_click"`

            - `x: number`

              The x-coordinate where the double click occurred.

            - `y: number`

              The y-coordinate where the double click occurred.

          - `Drag`

            A drag action.

            - `path: Array<Path>`

              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 }
              ]
              ```

              - `x: number`

                The x-coordinate.

              - `y: number`

                The y-coordinate.

            - `type: "drag"`

              Specifies the event type. For a drag action, this property is always set to `drag`.

              - `"drag"`

            - `keys?: Array<string> | null`

              The keys being held while dragging the mouse.

          - `Keypress`

            A collection of keypresses the model would like to perform.

            - `keys: Array<string>`

              The combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key.

            - `type: "keypress"`

              Specifies the event type. For a keypress action, this property is always set to `keypress`.

              - `"keypress"`

          - `Move`

            A mouse move action.

            - `type: "move"`

              Specifies the event type. For a move action, this property is always set to `move`.

              - `"move"`

            - `x: number`

              The x-coordinate to move to.

            - `y: number`

              The y-coordinate to move to.

            - `keys?: Array<string> | null`

              The keys being held while moving the mouse.

          - `Screenshot`

            A screenshot action.

            - `type: "screenshot"`

              Specifies the event type. For a screenshot action, this property is always set to `screenshot`.

              - `"screenshot"`

          - `Scroll`

            A scroll action.

            - `scroll_x: number`

              The horizontal scroll distance.

            - `scroll_y: number`

              The vertical scroll distance.

            - `type: "scroll"`

              Specifies the event type. For a scroll action, this property is always set to `scroll`.

              - `"scroll"`

            - `x: number`

              The x-coordinate where the scroll occurred.

            - `y: number`

              The y-coordinate where the scroll occurred.

            - `keys?: Array<string> | null`

              The keys being held while scrolling.

          - `Type`

            An action to type in text.

            - `text: string`

              The text to type.

            - `type: "type"`

              Specifies the event type. For a type action, this property is always set to `type`.

              - `"type"`

          - `Wait`

            A wait action.

            - `type: "wait"`

              Specifies the event type. For a wait action, this property is always set to `wait`.

              - `"wait"`

        - `actions?: BetaComputerActionList`

          Flattened batched actions for `computer_use`. Each action includes an
          `type` discriminator and action-specific fields.

          - `Click`

            A click action.

          - `DoubleClick`

            A double click action.

          - `Drag`

            A drag action.

          - `Keypress`

            A collection of keypresses the model would like to perform.

          - `Move`

            A mouse move action.

          - `Screenshot`

            A screenshot action.

          - `Scroll`

            A scroll action.

          - `Type`

            An action to type in text.

          - `Wait`

            A wait action.

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

      - `ComputerCallOutput`

        The output of a computer tool call.

        - `call_id: string`

          The ID of the computer tool call that produced the output.

        - `output: BetaResponseComputerToolCallOutputScreenshot`

          A computer screenshot image used with the computer use tool.

          - `type: "computer_screenshot"`

            Specifies the event type. For a computer screenshot, this property is
            always set to `computer_screenshot`.

            - `"computer_screenshot"`

          - `file_id?: string`

            The identifier of an uploaded file that contains the screenshot.

          - `image_url?: string`

            The URL of the screenshot image.

        - `type: "computer_call_output"`

          The type of the computer tool call output. Always `computer_call_output`.

          - `"computer_call_output"`

        - `id?: string | null`

          The ID of the computer tool call output.

        - `acknowledged_safety_checks?: Array<AcknowledgedSafetyCheck> | null`

          The safety checks reported by the API that have been acknowledged by the developer.

          - `id: string`

            The ID of the pending safety check.

          - `code?: string | null`

            The type of the pending safety check.

          - `message?: string | null`

            Details about the pending safety check.

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `status?: "in_progress" | "completed" | "incomplete" | null`

          The status of the message input. One of `in_progress`, `completed`, or `incomplete`. Populated when input items are returned via API.

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

      - `BetaResponseFunctionWebSearch`

        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.

        - `id: string`

          The unique ID of the web search tool call.

        - `action: Search | OpenPage | FindInPage`

          An object describing the specific action taken in this web search call.
          Includes details on how the model used the web (search, open_page, find_in_page).

          - `Search`

            Action type "search" - Performs a web search query.

            - `type: "search"`

              The action type.

              - `"search"`

            - `queries?: Array<string>`

              The search queries.

            - `query?: string`

              The search query.

            - `sources?: Array<Source>`

              The sources used in the search.

              - `type: "url"`

                The type of source. Always `url`.

                - `"url"`

              - `url: string`

                The URL of the source.

          - `OpenPage`

            Action type "open_page" - Opens a specific URL from search results.

            - `type: "open_page"`

              The action type.

              - `"open_page"`

            - `url?: string | null`

              The URL opened by the model.

          - `FindInPage`

            Action type "find_in_page": Searches for a pattern within a loaded page.

            - `pattern: string`

              The pattern or text to search for within the page.

            - `type: "find_in_page"`

              The action type.

              - `"find_in_page"`

            - `url: string`

              The URL of the page searched for the pattern.

        - `status: "in_progress" | "searching" | "completed" | "failed"`

          The status of the web search tool call.

          - `"in_progress"`

          - `"searching"`

          - `"completed"`

          - `"failed"`

        - `type: "web_search_call"`

          The type of the web search tool call. Always `web_search_call`.

          - `"web_search_call"`

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

      - `BetaResponseFunctionToolCall`

        A tool call to run a function. See the
        [function calling guide](https://platform.openai.com/docs/guides/function-calling) for more information.

        - `arguments: string`

          A JSON string of the arguments to pass to the function.

        - `call_id: string`

          The unique ID of the function tool call generated by the model.

        - `name: string`

          The name of the function to run.

        - `type: "function_call"`

          The type of the function tool call. Always `function_call`.

          - `"function_call"`

        - `id?: string`

          The unique ID of the function tool call.

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `caller?: Direct | Program | null`

          The execution context that produced this tool call.

          - `Direct`

            - `type: "direct"`

              - `"direct"`

          - `Program`

            - `caller_id: string`

              The call ID of the program item that produced this tool call.

            - `type: "program"`

              - `"program"`

        - `namespace?: string`

          The namespace of the function to run.

        - `status?: "in_progress" | "completed" | "incomplete"`

          The status of the item. One of `in_progress`, `completed`, or
          `incomplete`. Populated when items are returned via API.

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

      - `FunctionCallOutput`

        The output of a function tool call.

        - `call_id: string`

          The unique ID of the function tool call generated by the model.

        - `output: string | BetaResponseFunctionCallOutputItemList`

          Text, image, or file output of the function tool call.

          - `string`

          - `BetaResponseFunctionCallOutputItemList = Array<BetaResponseFunctionCallOutputItem>`

            An array of content outputs (text, image, file) for the function tool call.

            - `BetaResponseInputTextContent`

              A text input to the model.

              - `text: string`

                The text input to the model.

              - `type: "input_text"`

                The type of the input item. Always `input_text`.

                - `"input_text"`

              - `prompt_cache_breakpoint?: PromptCacheBreakpoint | null`

                Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.

                - `mode: "explicit"`

                  The breakpoint mode. Always `explicit`.

                  - `"explicit"`

            - `BetaResponseInputImageContent`

              An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision)

              - `type: "input_image"`

                The type of the input item. Always `input_image`.

                - `"input_image"`

              - `detail?: BetaImageDetail | null`

                The detail level of the image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`.

              - `file_id?: string | null`

                The ID of the file to be sent to the model.

              - `image_url?: string | null`

                The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.

              - `prompt_cache_breakpoint?: PromptCacheBreakpoint | null`

                Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.

                - `mode: "explicit"`

                  The breakpoint mode. Always `explicit`.

                  - `"explicit"`

            - `BetaResponseInputFileContent`

              A file input to the model.

              - `type: "input_file"`

                The type of the input item. Always `input_file`.

                - `"input_file"`

              - `detail?: "auto" | "low" | "high"`

                The detail level of the file to be sent to the model. Use `auto` to let the system select the detail level; for GPT-5.6 and later models, `auto` uses high-quality rendering, which may increase input token usage. Use `low` for lower-cost rendering, or `high` to render the file at higher quality. Defaults to `auto`.

                - `"auto"`

                - `"low"`

                - `"high"`

              - `file_data?: string | null`

                The base64-encoded data of the file to be sent to the model.

              - `file_id?: string | null`

                The ID of the file to be sent to the model.

              - `file_url?: string | null`

                The URL of the file to be sent to the model.

              - `filename?: string | null`

                The name of the file to be sent to the model.

              - `prompt_cache_breakpoint?: PromptCacheBreakpoint | null`

                Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.

                - `mode: "explicit"`

                  The breakpoint mode. Always `explicit`.

                  - `"explicit"`

        - `type: "function_call_output"`

          The type of the function tool call output. Always `function_call_output`.

          - `"function_call_output"`

        - `id?: string | null`

          The unique ID of the function tool call output. Populated when this item is returned via API.

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `caller?: Direct | Program | null`

          The execution context that produced this tool call.

          - `Direct`

            - `type: "direct"`

              The caller type. Always `direct`.

              - `"direct"`

          - `Program`

            - `caller_id: string`

              The call ID of the program item that produced this tool call.

            - `type: "program"`

              The caller type. Always `program`.

              - `"program"`

        - `name?: string | null`

          The name of the tool that produced the output.

        - `namespace?: string | null`

          The namespace of the tool that produced the output.

        - `status?: "in_progress" | "completed" | "incomplete" | null`

          The status of the item. One of `in_progress`, `completed`, or `incomplete`. Populated when items are returned via API.

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

      - `AgentMessage`

        A message routed between agents.

        - `author: string`

          The sending agent identity.

        - `content: Array<BetaResponseInputTextContent | BetaResponseInputImageContent | EncryptedContent>`

          Plaintext, image, or encrypted content sent between agents.

          - `BetaResponseInputTextContent`

            A text input to the model.

          - `BetaResponseInputImageContent`

            An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision)

          - `EncryptedContent`

            Opaque encrypted content that Responses API decrypts inside trusted model execution.

            - `encrypted_content: string`

              Opaque encrypted content.

            - `type: "encrypted_content"`

              The type of the input item. Always `encrypted_content`.

              - `"encrypted_content"`

        - `recipient: string`

          The destination agent identity.

        - `type: "agent_message"`

          The item type. Always `agent_message`.

          - `"agent_message"`

        - `id?: string | null`

          The unique ID of this agent message item.

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

      - `MultiAgentCall`

        - `action: "spawn_agent" | "interrupt_agent" | "list_agents" | 3 more`

          The multi-agent action that was executed.

          - `"spawn_agent"`

          - `"interrupt_agent"`

          - `"list_agents"`

          - `"send_message"`

          - `"followup_task"`

          - `"wait_agent"`

        - `arguments: string`

          The action arguments as a JSON string.

        - `call_id: string`

          The unique ID linking this call to its output.

        - `type: "multi_agent_call"`

          The item type. Always `multi_agent_call`.

          - `"multi_agent_call"`

        - `id?: string | null`

          The unique ID of this multi-agent call.

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

      - `MultiAgentCallOutput`

        - `action: "spawn_agent" | "interrupt_agent" | "list_agents" | 3 more`

          The multi-agent action that produced this result.

          - `"spawn_agent"`

          - `"interrupt_agent"`

          - `"list_agents"`

          - `"send_message"`

          - `"followup_task"`

          - `"wait_agent"`

        - `call_id: string`

          The unique ID of the multi-agent call.

        - `output: Array<Output>`

          Text output returned by the multi-agent action.

          - `text: string`

            The text content.

          - `type: "output_text"`

            The content type. Always `output_text`.

            - `"output_text"`

          - `annotations?: Array<FileCitation | URLCitation | ContainerFileCitation>`

            Citations associated with the text content.

            - `FileCitation`

              - `file_id: string`

                The ID of the file.

              - `filename: string`

                The filename of the file cited.

              - `index: number`

                The index of the file in the list of files.

              - `type: "file_citation"`

                The citation type. Always `file_citation`.

                - `"file_citation"`

            - `URLCitation`

              - `end_index: number`

                The index of the last character of the citation in the message.

              - `start_index: number`

                The index of the first character of the citation in the message.

              - `title: string`

                The title of the cited resource.

              - `type: "url_citation"`

                The citation type. Always `url_citation`.

                - `"url_citation"`

              - `url: string`

                The URL of the cited resource.

            - `ContainerFileCitation`

              - `container_id: string`

                The ID of the container.

              - `end_index: number`

                The index of the last character of the citation in the message.

              - `file_id: string`

                The ID of the container file.

              - `filename: string`

                The filename of the container file cited.

              - `start_index: number`

                The index of the first character of the citation in the message.

              - `type: "container_file_citation"`

                The citation type. Always `container_file_citation`.

                - `"container_file_citation"`

        - `type: "multi_agent_call_output"`

          The item type. Always `multi_agent_call_output`.

          - `"multi_agent_call_output"`

        - `id?: string | null`

          The unique ID of this multi-agent call output.

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

      - `ToolSearchCall`

        - `arguments: unknown`

          The arguments supplied to the tool search call.

        - `type: "tool_search_call"`

          The item type. Always `tool_search_call`.

          - `"tool_search_call"`

        - `id?: string | null`

          The unique ID of this tool search call.

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `call_id?: string | null`

          The unique ID of the tool search call generated by the model.

        - `execution?: "server" | "client"`

          Whether tool search was executed by the server or by the client.

          - `"server"`

          - `"client"`

        - `status?: "in_progress" | "completed" | "incomplete" | null`

          The status of the tool search call.

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

      - `BetaResponseToolSearchOutputItemParam`

        - `tools: Array<BetaTool>`

          The loaded tool definitions returned by the tool search output.

          - `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).

            - `name: string`

              The name of the function to call.

            - `parameters: Record<string, unknown> | null`

              A JSON schema object describing the parameters of the function.

            - `strict: boolean | null`

              Whether strict parameter validation is enforced for this function tool.

            - `type: "function"`

              The type of the function tool. Always `function`.

              - `"function"`

            - `allowed_callers?: Array<"direct" | "programmatic"> | null`

              The tool invocation context(s).

              - `"direct"`

              - `"programmatic"`

            - `defer_loading?: boolean`

              Whether this function is deferred and loaded via tool search.

            - `description?: string | null`

              A description of the function. Used by the model to determine whether or not to call the function.

            - `output_schema?: Record<string, unknown> | null`

              A JSON schema object describing the JSON value encoded in string outputs for this function.

          - `BetaFileSearchTool`

            A tool that searches for relevant content from uploaded files. Learn more about the [file search tool](https://platform.openai.com/docs/guides/tools-file-search).

            - `type: "file_search"`

              The type of the file search tool. Always `file_search`.

              - `"file_search"`

            - `vector_store_ids: Array<string>`

              The IDs of the vector stores to search.

            - `filters?: ComparisonFilter | CompoundFilter | null`

              A filter to apply.

              - `ComparisonFilter`

                A filter used to compare a specified attribute key to a given value using a defined comparison operation.

                - `key: string`

                  The key to compare against the value.

                - `type: "eq" | "ne" | "gt" | 5 more`

                  Specifies the comparison operator: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`, `in`, `nin`.

                  - `eq`: equals
                  - `ne`: not equal
                  - `gt`: greater than
                  - `gte`: greater than or equal
                  - `lt`: less than
                  - `lte`: less than or equal
                  - `in`: in
                  - `nin`: not in

                  - `"eq"`

                  - `"ne"`

                  - `"gt"`

                  - `"gte"`

                  - `"lt"`

                  - `"lte"`

                  - `"in"`

                  - `"nin"`

                - `value: string | number | boolean | Array<string | number>`

                  The value to compare against the attribute key; supports string, number, or boolean types.

                  - `string`

                  - `number`

                  - `boolean`

                  - `Array<string | number>`

                    - `string`

                    - `number`

              - `CompoundFilter`

                Combine multiple filters using `and` or `or`.

                - `filters: Array<ComparisonFilter | unknown>`

                  Array of filters to combine. Items can be `ComparisonFilter` or `CompoundFilter`.

                  - `ComparisonFilter`

                    A filter used to compare a specified attribute key to a given value using a defined comparison operation.

                    - `key: string`

                      The key to compare against the value.

                    - `type: "eq" | "ne" | "gt" | 5 more`

                      Specifies the comparison operator: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`, `in`, `nin`.

                      - `eq`: equals
                      - `ne`: not equal
                      - `gt`: greater than
                      - `gte`: greater than or equal
                      - `lt`: less than
                      - `lte`: less than or equal
                      - `in`: in
                      - `nin`: not in

                      - `"eq"`

                      - `"ne"`

                      - `"gt"`

                      - `"gte"`

                      - `"lt"`

                      - `"lte"`

                      - `"in"`

                      - `"nin"`

                    - `value: string | number | boolean | Array<string | number>`

                      The value to compare against the attribute key; supports string, number, or boolean types.

                      - `string`

                      - `number`

                      - `boolean`

                      - `Array<string | number>`

                        - `string`

                        - `number`

                  - `unknown`

                - `type: "and" | "or"`

                  Type of operation: `and` or `or`.

                  - `"and"`

                  - `"or"`

            - `max_num_results?: number`

              The maximum number of results to return. This number should be between 1 and 50 inclusive.

            - `ranking_options?: RankingOptions`

              Ranking options for search.

              - `hybrid_search?: HybridSearch`

                Weights that control how reciprocal rank fusion balances semantic embedding matches versus sparse keyword matches when hybrid search is enabled.

                - `embedding_weight: number`

                  The weight of the embedding in the reciprocal ranking fusion.

                - `text_weight: number`

                  The weight of the text in the reciprocal ranking fusion.

              - `ranker?: "auto" | "default-2024-11-15"`

                The ranker to use for the file search.

                - `"auto"`

                - `"default-2024-11-15"`

              - `score_threshold?: number`

                The score threshold for the file search, a number between 0 and 1. Numbers closer to 1 will attempt to return only the most relevant results, but may return fewer results.

          - `BetaComputerTool`

            A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use).

            - `type: "computer"`

              The type of the computer tool. Always `computer`.

              - `"computer"`

          - `BetaComputerUsePreviewTool`

            A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use).

            - `display_height: number`

              The height of the computer display.

            - `display_width: number`

              The width of the computer display.

            - `environment: "windows" | "mac" | "linux" | 2 more`

              The type of computer environment to control.

              - `"windows"`

              - `"mac"`

              - `"linux"`

              - `"ubuntu"`

              - `"browser"`

            - `type: "computer_use_preview"`

              The type of the computer use tool. Always `computer_use_preview`.

              - `"computer_use_preview"`

          - `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"`

              The type of the web search tool. One of `web_search` or `web_search_2025_08_26`.

              - `"web_search"`

              - `"web_search_2025_08_26"`

            - `external_web_access?: boolean`

              Allow live internet access for web search. Defaults to true when omitted. When false, the web search tool runs in offline/cache-only mode and will not fetch new external content.

            - `filters?: Filters | null`

              Filters for the search.

              - `allowed_domains?: Array<string> | null`

                Allowed domains for the search. If not provided, all domains are allowed.
                Subdomains of the provided domains are allowed as well.

                Example: `["pubmed.ncbi.nlm.nih.gov"]`

            - `search_context_size?: "low" | "medium" | "high"`

              High level guidance for the amount of context window space to use for the search. One of `low`, `medium`, or `high`. `medium` is the default.

              - `"low"`

              - `"medium"`

              - `"high"`

            - `user_location?: UserLocation | null`

              The approximate location of the user.

              - `city?: string | null`

                Free text input for the city of the user, e.g. `San Francisco`.

              - `country?: string | null`

                The two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of the user, e.g. `US`.

              - `region?: string | null`

                Free text input for the region of the user, e.g. `California`.

              - `timezone?: string | null`

                The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of the user, e.g. `America/Los_Angeles`.

              - `type?: "approximate"`

                The type of location approximation. Always `approximate`.

                - `"approximate"`

          - `Mcp`

            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).

            - `server_label: string`

              A label for this MCP server, used to identify it in tool calls.

            - `type: "mcp"`

              The type of the MCP tool. Always `mcp`.

              - `"mcp"`

            - `allowed_callers?: Array<"direct" | "programmatic"> | null`

              The tool invocation context(s).

              - `"direct"`

              - `"programmatic"`

            - `allowed_tools?: Array<string> | McpToolFilter | null`

              List of allowed tool names or a filter object.

              - `Array<string>`

              - `McpToolFilter`

                A filter object to specify which tools are allowed.

                - `read_only?: boolean`

                  Indicates whether or not a tool modifies data or is read-only. If an
                  MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint),
                  it will match this filter.

                - `tool_names?: Array<string>`

                  List of allowed tool names.

            - `authorization?: string`

              An OAuth access token that can be used with a remote MCP server, either
              with a custom MCP server URL or a service connector. Your application
              must handle the OAuth authorization flow and provide the token here.

            - `connector_id?: "connector_dropbox" | "connector_gmail" | "connector_googlecalendar" | 5 more`

              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`

              - `"connector_dropbox"`

              - `"connector_gmail"`

              - `"connector_googlecalendar"`

              - `"connector_googledrive"`

              - `"connector_microsoftteams"`

              - `"connector_outlookcalendar"`

              - `"connector_outlookemail"`

              - `"connector_sharepoint"`

            - `defer_loading?: boolean`

              Whether this MCP tool is deferred and discovered via tool search.

            - `headers?: Record<string, string> | null`

              Optional HTTP headers to send to the MCP server. Use for authentication
              or other purposes.

            - `require_approval?: McpToolApprovalFilter | "always" | "never" | null`

              Specify which of the MCP server's tools require approval.

              - `McpToolApprovalFilter`

                Specify which of the MCP server's tools require approval. Can be
                `always`, `never`, or a filter object associated with tools
                that require approval.

                - `always?: Always`

                  A filter object to specify which tools are allowed.

                  - `read_only?: boolean`

                    Indicates whether or not a tool modifies data or is read-only. If an
                    MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint),
                    it will match this filter.

                  - `tool_names?: Array<string>`

                    List of allowed tool names.

                - `never?: Never`

                  A filter object to specify which tools are allowed.

                  - `read_only?: boolean`

                    Indicates whether or not a tool modifies data or is read-only. If an
                    MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint),
                    it will match this filter.

                  - `tool_names?: Array<string>`

                    List of allowed tool names.

              - `"always" | "never"`

                - `"always"`

                - `"never"`

            - `server_description?: string`

              Optional description of the MCP server, used to provide more context.

            - `server_url?: string`

              The URL for the MCP server. One of `server_url`, `connector_id`, or
              `tunnel_id` must be provided.

            - `tunnel_id?: string`

              The Secure MCP Tunnel ID to use instead of a direct server URL. One of
              `server_url`, `connector_id`, or `tunnel_id` must be provided.

          - `CodeInterpreter`

            A tool that runs Python code to help generate a response to a prompt.

            - `container: string | CodeInterpreterToolAuto`

              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`

              - `CodeInterpreterToolAuto`

                Configuration for a code interpreter container. Optionally specify the IDs of the files to run the code on.

                - `type: "auto"`

                  Always `auto`.

                  - `"auto"`

                - `file_ids?: Array<string>`

                  An optional list of uploaded files to make available to your code.

                - `memory_limit?: "1g" | "4g" | "16g" | "64g" | null`

                  The memory limit for the code interpreter container.

                  - `"1g"`

                  - `"4g"`

                  - `"16g"`

                  - `"64g"`

                - `network_policy?: BetaContainerNetworkPolicyDisabled | BetaContainerNetworkPolicyAllowlist`

                  Network access policy for the container.

                  - `BetaContainerNetworkPolicyDisabled`

                    - `type: "disabled"`

                      Disable outbound network access. Always `disabled`.

                      - `"disabled"`

                  - `BetaContainerNetworkPolicyAllowlist`

                    - `allowed_domains: Array<string>`

                      A list of allowed domains when type is `allowlist`.

                    - `type: "allowlist"`

                      Allow outbound network access only to specified domains. Always `allowlist`.

                      - `"allowlist"`

                    - `domain_secrets?: Array<BetaContainerNetworkPolicyDomainSecret>`

                      Optional domain-scoped secrets for allowlisted domains.

                      - `domain: string`

                        The domain associated with the secret.

                      - `name: string`

                        The name of the secret to inject for the domain.

                      - `value: string`

                        The secret value to inject for the domain.

            - `type: "code_interpreter"`

              The type of the code interpreter tool. Always `code_interpreter`.

              - `"code_interpreter"`

            - `allowed_callers?: Array<"direct" | "programmatic"> | null`

              The tool invocation context(s).

              - `"direct"`

              - `"programmatic"`

          - `ProgrammaticToolCalling`

            - `type: "programmatic_tool_calling"`

              The type of the tool. Always `programmatic_tool_calling`.

              - `"programmatic_tool_calling"`

          - `ImageGeneration`

            A tool that generates images using the GPT image models.

            - `type: "image_generation"`

              The type of the image generation tool. Always `image_generation`.

              - `"image_generation"`

            - `action?: "generate" | "edit" | "auto"`

              Whether to generate a new image or edit an existing image. Default: `auto`.

              - `"generate"`

              - `"edit"`

              - `"auto"`

            - `background?: "transparent" | "opaque" | "auto"`

              Allows to set transparency for the background of the generated image(s).
              Must be one of `transparent`, `opaque`, or `auto` (default value). When
              `auto` is used, the model will automatically determine the best
              background for the image.

              Transparent backgrounds are available for supported GPT Image models.
              For `gpt-image-2` and `gpt-image-2-2026-04-21`, this support is in
              preview. When using `transparent`, set the output format to `png` or
              `webp`.

              - `"transparent"`

              - `"opaque"`

              - `"auto"`

            - `input_fidelity?: "high" | "low" | null`

              Control how much effort the model will exert to match the style and features, especially facial features, of input images. This parameter is only supported for `gpt-image-1` and `gpt-image-1.5` and later models, unsupported for `gpt-image-1-mini`. Supports `high` and `low`. Defaults to `low`.

              - `"high"`

              - `"low"`

            - `input_image_mask?: InputImageMask`

              Optional mask for inpainting. Contains `image_url`
              (string, optional) and `file_id` (string, optional).

              - `file_id?: string`

                File ID for the mask image.

              - `image_url?: string`

                Base64-encoded mask image.

            - `model?: (string & {}) | "gpt-image-1" | "gpt-image-1-mini" | "gpt-image-2" | 3 more`

              The image generation model to use. One of `gpt-image-1`,
              `gpt-image-1-mini`, `gpt-image-1.5`, `gpt-image-2`,
              `gpt-image-2-2026-04-21`, or `chatgpt-image-latest`. Default:
              `gpt-image-1`.

              - `(string & {})`

              - `"gpt-image-1" | "gpt-image-1-mini" | "gpt-image-2" | 3 more`

                - `"gpt-image-1"`

                - `"gpt-image-1-mini"`

                - `"gpt-image-2"`

                - `"gpt-image-2-2026-04-21"`

                - `"gpt-image-1.5"`

                - `"chatgpt-image-latest"`

            - `moderation?: "auto" | "low"`

              Moderation level for the generated image. Default: `auto`.

              - `"auto"`

              - `"low"`

            - `output_compression?: number`

              Compression level for the output image. Default: 100.

            - `output_format?: "png" | "webp" | "jpeg"`

              The output format of the generated image. One of `png`, `webp`, or
              `jpeg`. Default: `png`.

              - `"png"`

              - `"webp"`

              - `"jpeg"`

            - `partial_images?: number`

              Number of partial images to generate in streaming mode, from 0 (default value) to 3.

            - `quality?: "low" | "medium" | "high" | "auto"`

              The quality of the generated image. One of `low`, `medium`, `high`,
              or `auto`. Default: `auto`.

              - `"low"`

              - `"medium"`

              - `"high"`

              - `"auto"`

            - `size?: (string & {}) | "1024x1024" | "1024x1536" | "1536x1024" | "auto"`

              The size of the generated images. For `gpt-image-2` and `gpt-image-2-2026-04-21`, arbitrary resolutions are supported as `WIDTHxHEIGHT` strings, for example `1536x864`. Width and height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above `2560x1440` are experimental, and the maximum supported resolution is `3840x2160`. The requested size must also satisfy the model's current pixel and edge limits. The standard sizes `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models; `auto` is supported for models that allow automatic sizing. For `dall-e-2`, use one of `256x256`, `512x512`, or `1024x1024`. For `dall-e-3`, use one of `1024x1024`, `1792x1024`, or `1024x1792`.

              - `(string & {})`

              - `"1024x1024" | "1024x1536" | "1536x1024" | "auto"`

                - `"1024x1024"`

                - `"1024x1536"`

                - `"1536x1024"`

                - `"auto"`

          - `LocalShell`

            A tool that allows the model to execute shell commands in a local environment.

            - `type: "local_shell"`

              The type of the local shell tool. Always `local_shell`.

              - `"local_shell"`

          - `BetaFunctionShellTool`

            A tool that allows the model to execute shell commands.

            - `type: "shell"`

              The type of the shell tool. Always `shell`.

              - `"shell"`

            - `allowed_callers?: Array<"direct" | "programmatic"> | null`

              The tool invocation context(s).

              - `"direct"`

              - `"programmatic"`

            - `environment?: BetaContainerAuto | BetaLocalEnvironment | BetaContainerReference | null`

              - `BetaContainerAuto`

                - `type: "container_auto"`

                  Automatically creates a container for this request

                  - `"container_auto"`

                - `file_ids?: Array<string>`

                  An optional list of uploaded files to make available to your code.

                - `memory_limit?: "1g" | "4g" | "16g" | "64g" | null`

                  The memory limit for the container.

                  - `"1g"`

                  - `"4g"`

                  - `"16g"`

                  - `"64g"`

                - `network_policy?: BetaContainerNetworkPolicyDisabled | BetaContainerNetworkPolicyAllowlist`

                  Network access policy for the container.

                  - `BetaContainerNetworkPolicyDisabled`

                  - `BetaContainerNetworkPolicyAllowlist`

                - `skills?: Array<BetaSkillReference | BetaInlineSkill>`

                  An optional list of skills referenced by id or inline data.

                  - `BetaSkillReference`

                    - `skill_id: string`

                      The ID of the referenced skill.

                    - `type: "skill_reference"`

                      References a skill created with the /v1/skills endpoint.

                      - `"skill_reference"`

                    - `version?: string`

                      Optional skill version. Use a positive integer or 'latest'. Omit for default.

                  - `BetaInlineSkill`

                    - `description: string`

                      The description of the skill.

                    - `name: string`

                      The name of the skill.

                    - `source: BetaInlineSkillSource`

                      Inline skill payload

                      - `data: string`

                        Base64-encoded skill zip bundle.

                      - `media_type: "application/zip"`

                        The media type of the inline skill payload. Must be `application/zip`.

                        - `"application/zip"`

                      - `type: "base64"`

                        The type of the inline skill source. Must be `base64`.

                        - `"base64"`

                    - `type: "inline"`

                      Defines an inline skill for this request.

                      - `"inline"`

              - `BetaLocalEnvironment`

                - `type: "local"`

                  Use a local computer environment.

                  - `"local"`

                - `skills?: Array<BetaLocalSkill>`

                  An optional list of skills.

                  - `description: string`

                    The description of the skill.

                  - `name: string`

                    The name of the skill.

                  - `path: string`

                    The path to the directory containing the skill.

              - `BetaContainerReference`

                - `container_id: string`

                  The ID of the referenced container.

                - `type: "container_reference"`

                  References a container created with the /v1/containers endpoint

                  - `"container_reference"`

          - `BetaCustomTool`

            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)

            - `name: string`

              The name of the custom tool, used to identify it in tool calls.

            - `type: "custom"`

              The type of the custom tool. Always `custom`.

              - `"custom"`

            - `allowed_callers?: Array<"direct" | "programmatic"> | null`

              The tool invocation context(s).

              - `"direct"`

              - `"programmatic"`

            - `defer_loading?: boolean`

              Whether this tool should be deferred and discovered via tool search.

            - `description?: string`

              Optional description of the custom tool, used to provide more context.

            - `format?: Text | Grammar`

              The input format for the custom tool. Default is unconstrained text.

              - `Text`

                Unconstrained free-form text.

                - `type: "text"`

                  Unconstrained text format. Always `text`.

                  - `"text"`

              - `Grammar`

                A grammar defined by the user.

                - `definition: string`

                  The grammar definition.

                - `syntax: "lark" | "regex"`

                  The syntax of the grammar definition. One of `lark` or `regex`.

                  - `"lark"`

                  - `"regex"`

                - `type: "grammar"`

                  Grammar format. Always `grammar`.

                  - `"grammar"`

          - `BetaNamespaceTool`

            Groups function/custom tools under a shared namespace.

            - `description: string`

              A description of the namespace shown to the model.

            - `name: string`

              The namespace name used in tool calls (for example, `crm`).

            - `tools: Array<Function | BetaCustomTool>`

              The function/custom tools available inside this namespace.

              - `Function`

                - `name: string`

                - `type: "function"`

                  - `"function"`

                - `allowed_callers?: Array<"direct" | "programmatic"> | null`

                  The tool invocation context(s).

                  - `"direct"`

                  - `"programmatic"`

                - `defer_loading?: boolean`

                  Whether this function should be deferred and discovered via tool search.

                - `description?: string | null`

                - `output_schema?: Record<string, unknown> | null`

                  A JSON Schema describing the JSON value encoded in string outputs for this function tool. This does not describe content-array outputs.

                - `parameters?: unknown`

                - `strict?: boolean | null`

                  Whether to enforce strict parameter validation. If omitted, Responses attempts to use strict validation when the schema is compatible, and falls back to non-strict validation otherwise.

              - `BetaCustomTool`

                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: "namespace"`

              The type of the tool. Always `namespace`.

              - `"namespace"`

          - `BetaToolSearchTool`

            Hosted or BYOT tool search configuration for deferred tools.

            - `type: "tool_search"`

              The type of the tool. Always `tool_search`.

              - `"tool_search"`

            - `description?: string | null`

              Description shown to the model for a client-executed tool search tool.

            - `execution?: "server" | "client"`

              Whether tool search is executed by the server or by the client.

              - `"server"`

              - `"client"`

            - `parameters?: unknown`

              Parameter schema for a client-executed tool search tool.

          - `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"`

              The type of the web search tool. One of `web_search_preview` or `web_search_preview_2025_03_11`.

              - `"web_search_preview"`

              - `"web_search_preview_2025_03_11"`

            - `search_content_types?: Array<"text" | "image">`

              - `"text"`

              - `"image"`

            - `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.

              - `"low"`

              - `"medium"`

              - `"high"`

            - `user_location?: UserLocation | null`

              The user's location.

              - `type: "approximate"`

                The type of location approximation. Always `approximate`.

                - `"approximate"`

              - `city?: string | null`

                Free text input for the city of the user, e.g. `San Francisco`.

              - `country?: string | null`

                The two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of the user, e.g. `US`.

              - `region?: string | null`

                Free text input for the region of the user, e.g. `California`.

              - `timezone?: string | null`

                The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of the user, e.g. `America/Los_Angeles`.

          - `BetaApplyPatchTool`

            Allows the assistant to create, delete, or update files using unified diffs.

            - `type: "apply_patch"`

              The type of the tool. Always `apply_patch`.

              - `"apply_patch"`

            - `allowed_callers?: Array<"direct" | "programmatic"> | null`

              The tool invocation context(s).

              - `"direct"`

              - `"programmatic"`

        - `type: "tool_search_output"`

          The item type. Always `tool_search_output`.

          - `"tool_search_output"`

        - `id?: string | null`

          The unique ID of this tool search output.

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `call_id?: string | null`

          The unique ID of the tool search call generated by the model.

        - `execution?: "server" | "client"`

          Whether tool search was executed by the server or by the client.

          - `"server"`

          - `"client"`

        - `status?: "in_progress" | "completed" | "incomplete" | null`

          The status of the tool search output.

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

      - `AdditionalTools`

        - `role: "developer"`

          The role that provided the additional tools. Only `developer` is supported.

          - `"developer"`

        - `tools: Array<BetaTool>`

          A list of additional tools made available at this item.

          - `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).

          - `Mcp`

            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).

          - `CodeInterpreter`

            A tool that runs Python code to help generate a response to a prompt.

          - `ProgrammaticToolCalling`

          - `ImageGeneration`

            A tool that generates images using the GPT image models.

          - `LocalShell`

            A tool that allows the model to execute shell commands in a local environment.

          - `BetaFunctionShellTool`

            A tool that allows the model to execute shell commands.

          - `BetaCustomTool`

            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)

          - `BetaNamespaceTool`

            Groups function/custom tools under a shared namespace.

          - `BetaToolSearchTool`

            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).

          - `BetaApplyPatchTool`

            Allows the assistant to create, delete, or update files using unified diffs.

        - `type: "additional_tools"`

          The item type. Always `additional_tools`.

          - `"additional_tools"`

        - `id?: string | null`

          The unique ID of this additional tools item.

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

      - `BetaResponseReasoningItem`

        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).

        - `id: string`

          The unique identifier of the reasoning content.

        - `summary: Array<Summary>`

          Reasoning summary content.

          - `text: string`

            A summary of the reasoning output from the model so far.

          - `type: "summary_text"`

            The type of the object. Always `summary_text`.

            - `"summary_text"`

        - `type: "reasoning"`

          The type of the object. Always `reasoning`.

          - `"reasoning"`

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `content?: Array<Content>`

          Reasoning text content.

          - `text: string`

            The reasoning text from the model.

          - `type: "reasoning_text"`

            The type of the reasoning text. Always `reasoning_text`.

            - `"reasoning_text"`

        - `encrypted_content?: string | null`

          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.

          When streaming, use the completed reasoning item and its
          `encrypted_content` from the `response.output_item.done` event in
          subsequent requests. The `encrypted_content` in
          `response.output_item.added` may be incomplete. This is especially
          important when `store` is `false` or when using Zero Data Retention.

        - `status?: "in_progress" | "completed" | "incomplete"`

          The status of the item. One of `in_progress`, `completed`, or
          `incomplete`. Populated when items are returned via API.

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

      - `BetaResponseCompactionItemParam`

        A compaction item generated by the [`v1/responses/compact` API](https://platform.openai.com/docs/api-reference/responses/compact).

        - `encrypted_content: string`

          The encrypted content of the compaction summary.

        - `type: "compaction"`

          The type of the item. Always `compaction`.

          - `"compaction"`

        - `id?: string | null`

          The ID of the compaction item.

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

      - `ImageGenerationCall`

        An image generation request made by the model.

        - `id: string`

          The unique ID of the image generation call.

        - `result: string | null`

          The generated image encoded in base64.

        - `status: "in_progress" | "completed" | "generating" | "failed"`

          The status of the image generation call.

          - `"in_progress"`

          - `"completed"`

          - `"generating"`

          - `"failed"`

        - `type: "image_generation_call"`

          The type of the image generation call. Always `image_generation_call`.

          - `"image_generation_call"`

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

      - `BetaResponseCodeInterpreterToolCall`

        A tool call to run code.

        - `id: string`

          The unique ID of the code interpreter tool call.

        - `code: string | null`

          The code to run, or null if not available.

        - `container_id: string`

          The ID of the container used to run the code.

        - `outputs: Array<Logs | Image> | null`

          The outputs generated by the code interpreter, such as logs or images.
          Can be null if no outputs are available.

          - `Logs`

            The logs output from the code interpreter.

            - `logs: string`

              The logs output from the code interpreter.

            - `type: "logs"`

              The type of the output. Always `logs`.

              - `"logs"`

          - `Image`

            The image output from the code interpreter.

            - `type: "image"`

              The type of the output. Always `image`.

              - `"image"`

            - `url: string`

              The URL of the image output from the code interpreter.

        - `status: "in_progress" | "completed" | "incomplete" | 2 more`

          The status of the code interpreter tool call. Valid values are `in_progress`, `completed`, `incomplete`, `interpreting`, and `failed`.

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

          - `"interpreting"`

          - `"failed"`

        - `type: "code_interpreter_call"`

          The type of the code interpreter tool call. Always `code_interpreter_call`.

          - `"code_interpreter_call"`

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

      - `LocalShellCall`

        A tool call to run a command on the local shell.

        - `id: string`

          The unique ID of the local shell call.

        - `action: Action`

          Execute a shell command on the server.

          - `command: Array<string>`

            The command to run.

          - `env: Record<string, string>`

            Environment variables to set for the command.

          - `type: "exec"`

            The type of the local shell action. Always `exec`.

            - `"exec"`

          - `timeout_ms?: number | null`

            Optional timeout in milliseconds for the command.

          - `user?: string | null`

            Optional user to run the command as.

          - `working_directory?: string | null`

            Optional working directory to run the command in.

        - `call_id: string`

          The unique ID of the local shell tool call generated by the model.

        - `status: "in_progress" | "completed" | "incomplete"`

          The status of the local shell call.

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

        - `type: "local_shell_call"`

          The type of the local shell call. Always `local_shell_call`.

          - `"local_shell_call"`

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

      - `LocalShellCallOutput`

        The output of a local shell tool call.

        - `id: string`

          The unique ID of the local shell tool call generated by the model.

        - `output: string`

          A JSON string of the output of the local shell tool call.

        - `type: "local_shell_call_output"`

          The type of the local shell tool call output. Always `local_shell_call_output`.

          - `"local_shell_call_output"`

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `status?: "in_progress" | "completed" | "incomplete" | null`

          The status of the item. One of `in_progress`, `completed`, or `incomplete`.

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

      - `ShellCall`

        A tool representing a request to execute one or more shell commands.

        - `action: Action`

          The shell commands and limits that describe how to run the tool call.

          - `commands: Array<string>`

            Ordered shell commands for the execution environment to run.

          - `max_output_length?: number | null`

            Maximum number of UTF-8 characters to capture from combined stdout and stderr output.

          - `timeout_ms?: number | null`

            Maximum wall-clock time in milliseconds to allow the shell commands to run.

        - `call_id: string`

          The unique ID of the shell tool call generated by the model.

        - `type: "shell_call"`

          The type of the item. Always `shell_call`.

          - `"shell_call"`

        - `id?: string | null`

          The unique ID of the shell tool call. Populated when this item is returned via API.

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `caller?: Direct | Program | null`

          The execution context that produced this tool call.

          - `Direct`

            - `type: "direct"`

              The caller type. Always `direct`.

              - `"direct"`

          - `Program`

            - `caller_id: string`

              The call ID of the program item that produced this tool call.

            - `type: "program"`

              The caller type. Always `program`.

              - `"program"`

        - `environment?: BetaLocalEnvironment | BetaContainerReference | null`

          The environment to execute the shell commands in.

          - `BetaLocalEnvironment`

          - `BetaContainerReference`

        - `status?: "in_progress" | "completed" | "incomplete" | null`

          The status of the shell call. One of `in_progress`, `completed`, or `incomplete`.

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

      - `ShellCallOutput`

        The streamed output items emitted by a shell tool call.

        - `call_id: string`

          The unique ID of the shell tool call generated by the model.

        - `output: Array<BetaResponseFunctionShellCallOutputContent>`

          Captured chunks of stdout and stderr output, along with their associated outcomes.

          - `outcome: Timeout | Exit`

            The exit or timeout outcome associated with this shell call.

            - `Timeout`

              Indicates that the shell call exceeded its configured time limit.

              - `type: "timeout"`

                The outcome type. Always `timeout`.

                - `"timeout"`

            - `Exit`

              Indicates that the shell commands finished and returned an exit code.

              - `exit_code: number`

                The exit code returned by the shell process.

              - `type: "exit"`

                The outcome type. Always `exit`.

                - `"exit"`

          - `stderr: string`

            Captured stderr output for the shell call.

          - `stdout: string`

            Captured stdout output for the shell call.

        - `type: "shell_call_output"`

          The type of the item. Always `shell_call_output`.

          - `"shell_call_output"`

        - `id?: string | null`

          The unique ID of the shell tool call output. Populated when this item is returned via API.

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `caller?: Direct | Program | null`

          The execution context that produced this tool call.

          - `Direct`

            - `type: "direct"`

              The caller type. Always `direct`.

              - `"direct"`

          - `Program`

            - `caller_id: string`

              The call ID of the program item that produced this tool call.

            - `type: "program"`

              The caller type. Always `program`.

              - `"program"`

        - `max_output_length?: number | null`

          The maximum number of UTF-8 characters captured for this shell call's combined output.

        - `status?: "in_progress" | "completed" | "incomplete" | null`

          The status of the shell call output.

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

      - `ApplyPatchCall`

        A tool call representing a request to create, delete, or update files using diff patches.

        - `call_id: string`

          The unique ID of the apply patch tool call generated by the model.

        - `operation: CreateFile | DeleteFile | UpdateFile`

          The specific create, delete, or update instruction for the apply_patch tool call.

          - `CreateFile`

            Instruction for creating a new file via the apply_patch tool.

            - `diff: string`

              Unified diff content to apply when creating the file.

            - `path: string`

              Path of the file to create relative to the workspace root.

            - `type: "create_file"`

              The operation type. Always `create_file`.

              - `"create_file"`

          - `DeleteFile`

            Instruction for deleting an existing file via the apply_patch tool.

            - `path: string`

              Path of the file to delete relative to the workspace root.

            - `type: "delete_file"`

              The operation type. Always `delete_file`.

              - `"delete_file"`

          - `UpdateFile`

            Instruction for updating an existing file via the apply_patch tool.

            - `diff: string`

              Unified diff content to apply to the existing file.

            - `path: string`

              Path of the file to update relative to the workspace root.

            - `type: "update_file"`

              The operation type. Always `update_file`.

              - `"update_file"`

        - `status: "in_progress" | "completed"`

          The status of the apply patch tool call. One of `in_progress` or `completed`.

          - `"in_progress"`

          - `"completed"`

        - `type: "apply_patch_call"`

          The type of the item. Always `apply_patch_call`.

          - `"apply_patch_call"`

        - `id?: string | null`

          The unique ID of the apply patch tool call. Populated when this item is returned via API.

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `caller?: Direct | Program | null`

          The execution context that produced this tool call.

          - `Direct`

            - `type: "direct"`

              The caller type. Always `direct`.

              - `"direct"`

          - `Program`

            - `caller_id: string`

              The call ID of the program item that produced this tool call.

            - `type: "program"`

              The caller type. Always `program`.

              - `"program"`

      - `ApplyPatchCallOutput`

        The streamed output emitted by an apply patch tool call.

        - `call_id: string`

          The unique ID of the apply patch tool call generated by the model.

        - `status: "completed" | "failed"`

          The status of the apply patch tool call output. One of `completed` or `failed`.

          - `"completed"`

          - `"failed"`

        - `type: "apply_patch_call_output"`

          The type of the item. Always `apply_patch_call_output`.

          - `"apply_patch_call_output"`

        - `id?: string | null`

          The unique ID of the apply patch tool call output. Populated when this item is returned via API.

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `caller?: Direct | Program | null`

          The execution context that produced this tool call.

          - `Direct`

            - `type: "direct"`

              The caller type. Always `direct`.

              - `"direct"`

          - `Program`

            - `caller_id: string`

              The call ID of the program item that produced this tool call.

            - `type: "program"`

              The caller type. Always `program`.

              - `"program"`

        - `output?: string | null`

          Optional human-readable log text from the apply patch tool (e.g., patch results or errors).

      - `McpListTools`

        A list of tools available on an MCP server.

        - `id: string`

          The unique ID of the list.

        - `server_label: string`

          The label of the MCP server.

        - `tools: Array<Tool>`

          The tools available on the server.

          - `input_schema: unknown`

            The JSON schema describing the tool's input.

          - `name: string`

            The name of the tool.

          - `annotations?: unknown`

            Additional annotations about the tool.

          - `description?: string | null`

            The description of the tool.

        - `type: "mcp_list_tools"`

          The type of the item. Always `mcp_list_tools`.

          - `"mcp_list_tools"`

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `error?: string | null`

          Error message if the server could not list tools.

      - `McpApprovalRequest`

        A request for human approval of a tool invocation.

        - `id: string`

          The unique ID of the approval request.

        - `arguments: string`

          A JSON string of arguments for the tool.

        - `name: string`

          The name of the tool to run.

        - `server_label: string`

          The label of the MCP server making the request.

        - `type: "mcp_approval_request"`

          The type of the item. Always `mcp_approval_request`.

          - `"mcp_approval_request"`

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

      - `McpApprovalResponse`

        A response to an MCP approval request.

        - `approval_request_id: string`

          The ID of the approval request being answered.

        - `approve: boolean`

          Whether the request was approved.

        - `type: "mcp_approval_response"`

          The type of the item. Always `mcp_approval_response`.

          - `"mcp_approval_response"`

        - `id?: string | null`

          The unique ID of the approval response

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `reason?: string | null`

          Optional reason for the decision.

      - `McpCall`

        An invocation of a tool on an MCP server.

        - `id: string`

          The unique ID of the tool call.

        - `arguments: string`

          A JSON string of the arguments passed to the tool.

        - `name: string`

          The name of the tool that was run.

        - `server_label: string`

          The label of the MCP server running the tool.

        - `type: "mcp_call"`

          The type of the item. Always `mcp_call`.

          - `"mcp_call"`

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `approval_request_id?: string | null`

          Unique identifier for the MCP tool call approval request.
          Include this value in a subsequent `mcp_approval_response` input to approve or reject the corresponding tool call.

        - `error?: BetaMcpToolCallError | null`

          The error from the tool call, if any.

          - `McpProtocolError`

            - `code: number`

            - `message: string`

            - `type: "mcp_protocol_error"`

              - `"mcp_protocol_error"`

          - `McpToolExecutionError`

            - `content: unknown`

            - `type: "mcp_tool_execution_error"`

              - `"mcp_tool_execution_error"`

          - `HTTPError`

            - `code: number`

            - `message: string`

            - `type: "http_error"`

              - `"http_error"`

        - `output?: string | null`

          The output from the tool call.

        - `status?: "in_progress" | "completed" | "incomplete" | 2 more`

          The status of the tool call. One of `in_progress`, `completed`, `incomplete`, `calling`, or `failed`.

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

          - `"calling"`

          - `"failed"`

      - `BetaResponseCustomToolCallOutput`

        The output of a custom tool call from your code, being sent back to the model.

        - `call_id: string`

          The call ID, used to map this custom tool call output to a custom tool call.

        - `output: string | Array<BetaResponseInputText | BetaResponseInputImage | BetaResponseInputFile>`

          The output from the custom tool call generated by your code.
          Can be a string or an list of output content.

          - `string`

          - `Array<BetaResponseInputText | BetaResponseInputImage | BetaResponseInputFile>`

            - `BetaResponseInputText`

              A text input to the model.

            - `BetaResponseInputImage`

              An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision).

            - `BetaResponseInputFile`

              A file input to the model.

        - `type: "custom_tool_call_output"`

          The type of the custom tool call output. Always `custom_tool_call_output`.

          - `"custom_tool_call_output"`

        - `id?: string`

          The unique ID of the custom tool call output in the OpenAI platform.

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `caller?: Direct | Program | null`

          The execution context that produced this tool call.

          - `Direct`

            - `type: "direct"`

              The caller type. Always `direct`.

              - `"direct"`

          - `Program`

            - `caller_id: string`

              The call ID of the program item that produced this tool call.

            - `type: "program"`

              The caller type. Always `program`.

              - `"program"`

      - `BetaResponseCustomToolCall`

        A call to a custom tool created by the model.

        - `call_id: string`

          An identifier used to map this custom tool call to a tool call output.

        - `input: string`

          The input for the custom tool call generated by the model.

        - `name: string`

          The name of the custom tool being called.

        - `type: "custom_tool_call"`

          The type of the custom tool call. Always `custom_tool_call`.

          - `"custom_tool_call"`

        - `id?: string`

          The unique ID of the custom tool call in the OpenAI platform.

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `caller?: Direct | Program | null`

          The execution context that produced this tool call.

          - `Direct`

            - `type: "direct"`

              - `"direct"`

          - `Program`

            - `caller_id: string`

              The call ID of the program item that produced this tool call.

            - `type: "program"`

              - `"program"`

        - `namespace?: string`

          The namespace of the custom tool being called.

      - `CompactionTrigger`

        Compacts the current context. Must be the final input item.

        - `type: "compaction_trigger"`

          The type of the item. Always `compaction_trigger`.

          - `"compaction_trigger"`

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

      - `ItemReference`

        An internal identifier for an item to reference.

        - `id: string`

          The ID of the item to reference.

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

        - `type?: "item_reference" | null`

          The type of item to reference. Always `item_reference`.

          - `"item_reference"`

      - `Program`

        - `id: string`

          The unique ID of this program item.

        - `call_id: string`

          The stable call ID of the program item.

        - `code: string`

          The JavaScript source executed by programmatic tool calling.

        - `fingerprint: string`

          Opaque program replay fingerprint that must be round-tripped.

        - `type: "program"`

          The item type. Always `program`.

          - `"program"`

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

      - `ProgramOutput`

        - `id: string`

          The unique ID of this program output item.

        - `call_id: string`

          The call ID of the program item.

        - `result: string`

          The result produced by the program item.

        - `status: "completed" | "incomplete"`

          The terminal status of the program output.

          - `"completed"`

          - `"incomplete"`

        - `type: "program_output"`

          The item type. Always `program_output`.

          - `"program_output"`

        - `agent?: Agent | null`

          The agent that produced this item.

          - `agent_name: string`

            The canonical name of the agent that produced this item.

  - `instructions?: string | null`

    Body param: A system (or developer) message inserted into the model's context.
    When used along with `previous_response_id`, the instructions from a previous response will not be carried over to the next response. This makes it simple to swap out system (or developer) messages in new responses.

  - `model?: string | null`

    Body param: Model ID used to generate the response, like `gpt-4o` or `o3`. OpenAI offers a wide range of models with different capabilities, performance characteristics, and price points. Refer to the [model guide](https://platform.openai.com/docs/models) to browse and compare available models.

  - `parallel_tool_calls?: boolean | null`

    Body param: Whether to allow the model to run tool calls in parallel.

  - `personality?: (string & {}) | "friendly" | "pragmatic"`

    Body param: A model-owned style preset to apply to this request. Omit this parameter to use the model's default style. Supported values may expand over time. Values must be at most 64 characters.

    - `(string & {})`

    - `"friendly" | "pragmatic"`

      - `"friendly"`

      - `"pragmatic"`

  - `previous_response_id?: string | null`

    Body param: 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`.

  - `reasoning?: Reasoning | null`

    Body param: **gpt-5 and o-series models only** Configuration options for [reasoning models](https://platform.openai.com/docs/guides/reasoning).

    - `context?: "auto" | "current_turn" | "all_turns" | null`

      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.

      - `"auto"`

      - `"current_turn"`

      - `"all_turns"`

    - `effort?: "none" | "minimal" | "low" | 4 more | null`

      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.

      - `"none"`

      - `"minimal"`

      - `"low"`

      - `"medium"`

      - `"high"`

      - `"xhigh"`

      - `"max"`

    - `generate_summary?: "auto" | "concise" | "detailed" | null`

      **Deprecated:** use `summary` instead.

      A summary of the reasoning performed by the model. This can be
      useful for debugging and understanding the model's reasoning process.
      One of `auto`, `concise`, or `detailed`.

      - `"auto"`

      - `"concise"`

      - `"detailed"`

    - `mode?: (string & {}) | "standard" | "pro"`

      Controls the reasoning execution mode for the request.

      When returned on a response, this is the effective execution mode.

      - `(string & {})`

      - `"standard" | "pro"`

        - `"standard"`

        - `"pro"`

    - `summary?: "auto" | "concise" | "detailed" | null`

      A summary of the reasoning performed by the model. This can be
      useful for debugging and understanding the model's reasoning process.
      One of `auto`, `concise`, or `detailed`.

      `concise` is supported for `computer-use-preview` models and all reasoning models after `gpt-5`.

      - `"auto"`

      - `"concise"`

      - `"detailed"`

  - `text?: Text | null`

    Body param: 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?: BetaResponseFormatTextConfig`

      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.

      - `Text`

        Default response format. Used to generate text responses.

        - `type: "text"`

          The type of response format being defined. Always `text`.

          - `"text"`

      - `BetaResponseFormatTextJSONSchemaConfig`

        JSON Schema response format. Used to generate structured JSON responses.
        Learn more about [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs).

        - `name: string`

          The name of the response format. Must be a-z, A-Z, 0-9, or contain
          underscores and dashes, with a maximum length of 64.

        - `schema: Record<string, unknown>`

          The schema for the response format, described as a JSON Schema object.
          Learn how to build JSON schemas [here](https://json-schema.org/).

        - `type: "json_schema"`

          The type of response format being defined. Always `json_schema`.

          - `"json_schema"`

        - `description?: string`

          A description of what the response format is for, used by the model to
          determine how to respond in the format.

        - `strict?: boolean | null`

          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).

      - `JSONObject`

        JSON object response format. An older method of generating JSON responses.
        Using `json_schema` is recommended for models that support it. Note that the
        model will not generate JSON without a system or user message instructing it
        to do so.

        - `type: "json_object"`

          The type of response format being defined. Always `json_object`.

          - `"json_object"`

    - `verbosity?: "low" | "medium" | "high" | null`

      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`.

      - `"low"`

      - `"medium"`

      - `"high"`

  - `tool_choice?: BetaToolChoiceOptions | BetaToolChoiceAllowed | BetaToolChoiceTypes | 6 more | null`

    Body param: Controls which tool the model should use, if any.

    - `BetaToolChoiceOptions = "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.

      - `"none"`

      - `"auto"`

      - `"required"`

    - `BetaToolChoiceAllowed`

      Constrains the tools available to the model to a pre-defined set.

      - `mode: "auto" | "required"`

        Constrains the tools available to the model to a pre-defined set.

        `auto` allows the model to pick from among the allowed tools and generate a
        message.

        `required` requires the model to call one or more of the allowed tools.

        - `"auto"`

        - `"required"`

      - `tools: Array<Record<string, unknown>>`

        A list of tool definitions that the model should be allowed to call.

        For the Responses API, the list of tool definitions might look like:

        ```json
        [
          { "type": "function", "name": "get_weather" },
          { "type": "mcp", "server_label": "deepwiki" },
          { "type": "image_generation" }
        ]
        ```

      - `type: "allowed_tools"`

        Allowed tool configuration type. Always `allowed_tools`.

        - `"allowed_tools"`

    - `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" | 5 more`

        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`

        - `"file_search"`

        - `"web_search_preview"`

        - `"computer"`

        - `"computer_use_preview"`

        - `"computer_use"`

        - `"web_search_preview_2025_03_11"`

        - `"image_generation"`

        - `"code_interpreter"`

    - `BetaToolChoiceFunction`

      Use this option to force the model to call a specific function.

      - `name: string`

        The name of the function to call.

      - `type: "function"`

        For function calling, the type is always `function`.

        - `"function"`

    - `BetaToolChoiceMcp`

      Use this option to force the model to call a specific tool on a remote MCP server.

      - `server_label: string`

        The label of the MCP server to use.

      - `type: "mcp"`

        For MCP tools, the type is always `mcp`.

        - `"mcp"`

      - `name?: string | null`

        The name of the tool to call on the server.

    - `BetaToolChoiceCustom`

      Use this option to force the model to call a specific custom tool.

      - `name: string`

        The name of the custom tool to call.

      - `type: "custom"`

        For custom tool calling, the type is always `custom`.

        - `"custom"`

    - `BetaSpecificProgrammaticToolCallingParam`

      - `type: "programmatic_tool_calling"`

        The tool to call. Always `programmatic_tool_calling`.

        - `"programmatic_tool_calling"`

    - `BetaToolChoiceApplyPatch`

      Forces the model to call the apply_patch tool when executing a tool call.

      - `type: "apply_patch"`

        The tool to call. Always `apply_patch`.

        - `"apply_patch"`

    - `BetaToolChoiceShell`

      Forces the model to call the shell tool when a tool call is required.

      - `type: "shell"`

        The tool to call. Always `shell`.

        - `"shell"`

  - `tools?: Array<BetaTool> | null`

    Body param: 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.

    - `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).

    - `Mcp`

      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).

    - `CodeInterpreter`

      A tool that runs Python code to help generate a response to a prompt.

    - `ProgrammaticToolCalling`

    - `ImageGeneration`

      A tool that generates images using the GPT image models.

    - `LocalShell`

      A tool that allows the model to execute shell commands in a local environment.

    - `BetaFunctionShellTool`

      A tool that allows the model to execute shell commands.

    - `BetaCustomTool`

      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)

    - `BetaNamespaceTool`

      Groups function/custom tools under a shared namespace.

    - `BetaToolSearchTool`

      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).

    - `BetaApplyPatchTool`

      Allows the assistant to create, delete, or update files using unified diffs.

  - `truncation?: "auto" | "disabled"`

    Body param: The truncation strategy to use for the model response. - `auto`: If the input to this Response exceeds the model's context window size, the model will truncate the response to fit the context window by dropping items from the beginning of the conversation. - `disabled` (default): If the input size will exceed the context window size for a model, the request will fail with a 400 error.

    - `"auto"`

    - `"disabled"`

  - `betas?: Array<"responses_multi_agent=v1">`

    Header param: Optional beta features to enable for this request.

    - `"responses_multi_agent=v1"`

### Returns

- `InputTokenCountResponse`

  - `input_tokens: number`

  - `object: "response.input_tokens"`

    - `"response.input_tokens"`

### Example

```typescript
import OpenAI from 'openai';

const client = new OpenAI({
  apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
});

const response = await client.beta.responses.inputTokens.count();

console.log(response.input_tokens);
```

#### Response

```json
{
  "input_tokens": 123,
  "object": "response.input_tokens"
}
```

### Example

```typescript
import OpenAI from "openai";

const client = new OpenAI();

const response = await client.responses.inputTokens.count({
  model: "gpt-5",
  input: "Tell me a joke.",
});

console.log(response.input_tokens);
```

#### Response

```json
{
  "object": "response.input_tokens",
  "input_tokens": 11
}
```

## Domain Types

### Input Token Count Response

- `InputTokenCountResponse`

  - `input_tokens: number`

  - `object: "response.input_tokens"`

    - `"response.input_tokens"`
