# Responses

## Run OpenAI Responses API (OpenAI only)

`client.responses.create(ResponseCreateParamsbody, RequestOptionsoptions?): ResponseCreateResponse`

**post** `/v5/responses`

Runs inference using the OpenAI Responses API contract, taking an `input` rather than a chat `messages` array.

This endpoint is restricted to OpenAI-vendor models: requests whose `model` (`vendor/name`) resolves
to any other vendor are rejected with an unsupported-vendor error, unlike /v5/chat/completions and
/v5/inference which support many vendors. Use it when you specifically need Responses API features
such as `previous_response_id` chaining, `instructions`, or `store`; use /v5/chat/completions for the
standard messages-based chat contract. When `stream` is set the response streams as server-sent
events; otherwise a single `response` object is returned.

### Parameters

- `body: ResponseCreateParams`

  - `input: string | Array<EasyInputMessageParam | OpenAITypesResponsesResponseInputParamMessage | ResponseOutputMessageParam | 23 more>`

    - `string`

    - `Array<EasyInputMessageParam | OpenAITypesResponsesResponseInputParamMessage | ResponseOutputMessageParam | 23 more>`

      - `EasyInputMessageParam`

        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 | Array<OpenAIResponseInputTextParam | OpenAIResponseInputImageParam | OpenAIResponseInputFileParam>`

          - `string`

          - `Array<OpenAIResponseInputTextParam | OpenAIResponseInputImageParam | OpenAIResponseInputFileParam>`

            - `OpenAIResponseInputTextParam`

              A text input to the model.

              - `text: string`

              - `type: "input_text"`

                - `"input_text"`

            - `OpenAIResponseInputImageParam`

              An image input to the model.

              Learn about [image inputs](https://platform.openai.com/docs/guides/vision).

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

                - `"low"`

                - `"high"`

                - `"auto"`

              - `type: "input_image"`

                - `"input_image"`

              - `file_id?: string`

              - `image_url?: string`

            - `OpenAIResponseInputFileParam`

              A file input to the model.

              - `type: "input_file"`

                - `"input_file"`

              - `file_data?: string`

              - `file_id?: string`

              - `file_url?: string`

              - `filename?: string`

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

          - `"user"`

          - `"assistant"`

          - `"system"`

          - `"developer"`

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

          - `"commentary"`

          - `"final_answer"`

        - `type?: "message"`

          - `"message"`

      - `OpenAITypesResponsesResponseInputParamMessage`

        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: Array<OpenAIResponseInputTextParam | OpenAIResponseInputImageParam | OpenAIResponseInputFileParam>`

          - `OpenAIResponseInputTextParam`

            A text input to the model.

          - `OpenAIResponseInputImageParam`

            An image input to the model.

            Learn about [image inputs](https://platform.openai.com/docs/guides/vision).

          - `OpenAIResponseInputFileParam`

            A file input to the model.

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

          - `"user"`

          - `"system"`

          - `"developer"`

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

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

        - `type?: "message"`

          - `"message"`

      - `ResponseOutputMessageParam`

        An output message from the model.

        - `id: string`

        - `content: Array<ResponseOutputTextParam | ResponseOutputRefusalParam>`

          - `ResponseOutputTextParam`

            A text output from the model.

            - `annotations: Array<AnnotationFileCitation | OpenAITypesResponsesResponseOutputTextParamAnnotationURLCitation | AnnotationContainerFileCitation | AnnotationFilePath>`

              - `AnnotationFileCitation`

                A citation to a file.

                - `file_id: string`

                - `filename: string`

                - `index: number`

                - `type: "file_citation"`

                  - `"file_citation"`

              - `OpenAITypesResponsesResponseOutputTextParamAnnotationURLCitation`

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

                - `end_index: number`

                - `start_index: number`

                - `title: string`

                - `type: "url_citation"`

                  - `"url_citation"`

                - `url: string`

              - `AnnotationContainerFileCitation`

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

                - `container_id: string`

                - `end_index: number`

                - `file_id: string`

                - `filename: string`

                - `start_index: number`

                - `type: "container_file_citation"`

                  - `"container_file_citation"`

              - `AnnotationFilePath`

                A path to a file.

                - `file_id: string`

                - `index: number`

                - `type: "file_path"`

                  - `"file_path"`

            - `text: string`

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

          - `ResponseOutputRefusalParam`

            A refusal from the model.

            - `refusal: string`

            - `type: "refusal"`

              - `"refusal"`

        - `role: "assistant"`

          - `"assistant"`

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

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

        - `type: "message"`

          - `"message"`

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

          - `"commentary"`

          - `"final_answer"`

      - `ResponseFileSearchToolCallParam`

        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`

        - `queries: Array<string>`

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

          - `"in_progress"`

          - `"searching"`

          - `"completed"`

          - `"incomplete"`

          - `"failed"`

        - `type: "file_search_call"`

          - `"file_search_call"`

        - `results?: Array<Result>`

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

            - `string`

            - `number`

            - `boolean`

          - `file_id?: string`

          - `filename?: string`

          - `score?: number`

          - `text?: string`

      - `ResponseComputerToolCallParam`

        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`

        - `action: ActionClick | ActionDoubleClick | ActionDrag | 6 more`

          A click action.

          - `ActionClick`

            A click action.

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

              - `"left"`

              - `"right"`

              - `"wheel"`

              - `"back"`

              - `"forward"`

            - `type: "click"`

              - `"click"`

            - `x: number`

            - `y: number`

          - `ActionDoubleClick`

            A double click action.

            - `type: "double_click"`

              - `"double_click"`

            - `x: number`

            - `y: number`

          - `ActionDrag`

            A drag action.

            - `path: Array<Path>`

              - `x: number`

              - `y: number`

            - `type: "drag"`

              - `"drag"`

          - `ActionKeypress`

            A collection of keypresses the model would like to perform.

            - `keys: Array<string>`

            - `type: "keypress"`

              - `"keypress"`

          - `ActionMove`

            A mouse move action.

            - `type: "move"`

              - `"move"`

            - `x: number`

            - `y: number`

          - `ActionScreenshot`

            A screenshot action.

            - `type: "screenshot"`

              - `"screenshot"`

          - `ActionScroll`

            A scroll action.

            - `scroll_x: number`

            - `scroll_y: number`

            - `type: "scroll"`

              - `"scroll"`

            - `x: number`

            - `y: number`

          - `ActionType`

            An action to type in text.

            - `text: string`

            - `type: "type"`

              - `"type"`

          - `ActionWait`

            A wait action.

            - `type: "wait"`

              - `"wait"`

        - `call_id: string`

        - `pending_safety_checks: Array<PendingSafetyCheck>`

          - `id: string`

          - `code?: string`

          - `message?: string`

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

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

        - `type: "computer_call"`

          - `"computer_call"`

      - `OpenAITypesResponsesResponseInputParamComputerCallOutput`

        The output of a computer tool call.

        - `call_id: string`

        - `output: Output`

          A computer screenshot image used with the computer use tool.

          - `type: "computer_screenshot"`

            - `"computer_screenshot"`

          - `file_id?: string`

          - `image_url?: string`

        - `type: "computer_call_output"`

          - `"computer_call_output"`

        - `id?: string`

        - `acknowledged_safety_checks?: Array<AcknowledgedSafetyCheck>`

          - `id: string`

          - `code?: string`

          - `message?: string`

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

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

      - `ResponseFunctionWebSearchParam`

        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`

        - `action: OpenAITypesResponsesResponseFunctionWebSearchParamActionSearch | OpenAITypesResponsesResponseFunctionWebSearchParamActionOpenPage | ActionFind`

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

          - `OpenAITypesResponsesResponseFunctionWebSearchParamActionSearch`

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

            - `query: string`

            - `type: "search"`

              - `"search"`

            - `queries?: Array<string>`

            - `sources?: Array<Source>`

              - `type: "url"`

                - `"url"`

              - `url: string`

          - `OpenAITypesResponsesResponseFunctionWebSearchParamActionOpenPage`

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

            - `type: "open_page"`

              - `"open_page"`

            - `url?: string`

          - `ActionFind`

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

            - `pattern: string`

            - `type: "find_in_page"`

              - `"find_in_page"`

            - `url: string`

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

          - `"in_progress"`

          - `"searching"`

          - `"completed"`

          - `"failed"`

        - `type: "web_search_call"`

          - `"web_search_call"`

      - `ResponseFunctionToolCallParam`

        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`

        - `call_id: string`

        - `name: string`

        - `type: "function_call"`

          - `"function_call"`

        - `id?: string`

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

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

      - `OpenAITypesResponsesResponseInputParamFunctionCallOutput`

        The output of a function tool call.

        - `call_id: string`

        - `output: string | Array<ResponseInputTextContentParam | ResponseInputImageContentParam | ResponseInputFileContentParam>`

          - `string`

          - `Array<ResponseInputTextContentParam | ResponseInputImageContentParam | ResponseInputFileContentParam>`

            - `ResponseInputTextContentParam`

              A text input to the model.

              - `text: string`

              - `type: "input_text"`

                - `"input_text"`

            - `ResponseInputImageContentParam`

              An image input to the model.

              Learn about [image inputs](https://platform.openai.com/docs/guides/vision)

              - `type: "input_image"`

                - `"input_image"`

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

                - `"low"`

                - `"high"`

                - `"auto"`

              - `file_id?: string`

              - `image_url?: string`

            - `ResponseInputFileContentParam`

              A file input to the model.

              - `type: "input_file"`

                - `"input_file"`

              - `file_data?: string`

              - `file_id?: string`

              - `file_url?: string`

              - `filename?: string`

        - `type: "function_call_output"`

          - `"function_call_output"`

        - `id?: string`

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

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

      - `ResponseReasoningItemParam`

        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`

        - `summary: Array<Summary>`

          - `text: string`

          - `type: "summary_text"`

            - `"summary_text"`

        - `type: "reasoning"`

          - `"reasoning"`

        - `content?: Array<Content>`

          - `text: string`

          - `type: "reasoning_text"`

            - `"reasoning_text"`

        - `encrypted_content?: string`

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

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

      - `ResponseCompactionItemParamParam`

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

        - `encrypted_content: string`

        - `type: "compaction"`

          - `"compaction"`

        - `id?: string`

      - `OpenAITypesResponsesResponseInputParamImageGenerationCall`

        An image generation request made by the model.

        - `id: string`

        - `result: string | null`

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

          - `"in_progress"`

          - `"completed"`

          - `"generating"`

          - `"failed"`

        - `type: "image_generation_call"`

          - `"image_generation_call"`

      - `ResponseCodeInterpreterToolCallParam`

        A tool call to run code.

        - `id: string`

        - `code: string | null`

        - `container_id: string`

        - `outputs: Array<OutputLogs | OutputImage> | null`

          - `OutputLogs`

            The logs output from the code interpreter.

            - `logs: string`

            - `type: "logs"`

              - `"logs"`

          - `OutputImage`

            The image output from the code interpreter.

            - `type: "image"`

              - `"image"`

            - `url: string`

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

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

          - `"interpreting"`

          - `"failed"`

        - `type: "code_interpreter_call"`

          - `"code_interpreter_call"`

      - `OpenAITypesResponsesResponseInputParamLocalShellCall`

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

        - `id: string`

        - `action: Action`

          Execute a shell command on the server.

          - `command: Array<string>`

          - `env: Record<string, string>`

          - `type: "exec"`

            - `"exec"`

          - `timeout_ms?: number`

          - `user?: string`

          - `working_directory?: string`

        - `call_id: string`

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

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

        - `type: "local_shell_call"`

          - `"local_shell_call"`

      - `OpenAITypesResponsesResponseInputParamLocalShellCallOutput`

        The output of a local shell tool call.

        - `id: string`

        - `output: string`

        - `type: "local_shell_call_output"`

          - `"local_shell_call_output"`

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

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

      - `OpenAITypesResponsesResponseInputParamShellCall`

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

          - `max_output_length?: number`

          - `timeout_ms?: number`

        - `call_id: string`

        - `type: "shell_call"`

          - `"shell_call"`

        - `id?: string`

        - `environment?: LocalEnvironmentParam | ContainerReferenceParam`

          - `LocalEnvironmentParam`

            - `type: "local"`

              - `"local"`

            - `skills?: Array<Skill>`

              - `description: string`

              - `name: string`

              - `path: string`

          - `ContainerReferenceParam`

            - `container_id: string`

            - `type: "container_reference"`

              - `"container_reference"`

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

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

      - `OpenAITypesResponsesResponseInputParamShellCallOutput`

        The streamed output items emitted by a shell tool call.

        - `call_id: string`

        - `output: Array<Output>`

          - `outcome: OutcomeTimeout | OutcomeExit`

            Indicates that the shell call exceeded its configured time limit.

            - `OutcomeTimeout`

              Indicates that the shell call exceeded its configured time limit.

              - `type: "timeout"`

                - `"timeout"`

            - `OutcomeExit`

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

              - `exit_code: number`

              - `type: "exit"`

                - `"exit"`

          - `stderr: string`

          - `stdout: string`

        - `type: "shell_call_output"`

          - `"shell_call_output"`

        - `id?: string`

        - `max_output_length?: number`

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

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

      - `OpenAITypesResponsesResponseInputParamApplyPatchCall`

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

        - `call_id: string`

        - `operation: ApplyPatchCallOperationCreateFile | ApplyPatchCallOperationDeleteFile | ApplyPatchCallOperationUpdateFile`

          Instruction for creating a new file via the apply_patch tool.

          - `ApplyPatchCallOperationCreateFile`

            Instruction for creating a new file via the apply_patch tool.

            - `diff: string`

            - `path: string`

            - `type: "create_file"`

              - `"create_file"`

          - `ApplyPatchCallOperationDeleteFile`

            Instruction for deleting an existing file via the apply_patch tool.

            - `path: string`

            - `type: "delete_file"`

              - `"delete_file"`

          - `ApplyPatchCallOperationUpdateFile`

            Instruction for updating an existing file via the apply_patch tool.

            - `diff: string`

            - `path: string`

            - `type: "update_file"`

              - `"update_file"`

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

          - `"in_progress"`

          - `"completed"`

        - `type: "apply_patch_call"`

          - `"apply_patch_call"`

        - `id?: string`

      - `OpenAITypesResponsesResponseInputParamApplyPatchCallOutput`

        The streamed output emitted by an apply patch tool call.

        - `call_id: string`

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

          - `"completed"`

          - `"failed"`

        - `type: "apply_patch_call_output"`

          - `"apply_patch_call_output"`

        - `id?: string`

        - `output?: string`

      - `OpenAITypesResponsesResponseInputParamMcpListTools`

        A list of tools available on an MCP server.

        - `id: string`

        - `server_label: string`

        - `tools: Array<Tool>`

          - `input_schema: unknown`

          - `name: string`

          - `annotations?: unknown`

          - `description?: string`

        - `type: "mcp_list_tools"`

          - `"mcp_list_tools"`

        - `error?: string`

      - `McpApprovalRequest`

        A request for human approval of a tool invocation.

        - `id: string`

        - `arguments: string`

        - `name: string`

        - `server_label: string`

        - `type: "mcp_approval_request"`

          - `"mcp_approval_request"`

      - `OpenAITypesResponsesResponseInputParamMcpApprovalResponse`

        A response to an MCP approval request.

        - `approval_request_id: string`

        - `approve: boolean`

        - `type: "mcp_approval_response"`

          - `"mcp_approval_response"`

        - `id?: string`

        - `reason?: string`

      - `OpenAITypesResponsesResponseInputParamMcpCall`

        An invocation of a tool on an MCP server.

        - `id: string`

        - `arguments: string`

        - `name: string`

        - `server_label: string`

        - `type: "mcp_call"`

          - `"mcp_call"`

        - `approval_request_id?: string`

        - `error?: string`

        - `output?: string`

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

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

          - `"calling"`

          - `"failed"`

      - `ResponseCustomToolCallOutputParam`

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

        - `call_id: string`

        - `output: string | Array<OpenAIResponseInputTextParam | OpenAIResponseInputImageParam | OpenAIResponseInputFileParam>`

          - `string`

          - `Array<OpenAIResponseInputTextParam | OpenAIResponseInputImageParam | OpenAIResponseInputFileParam>`

            - `OpenAIResponseInputTextParam`

              A text input to the model.

            - `OpenAIResponseInputImageParam`

              An image input to the model.

              Learn about [image inputs](https://platform.openai.com/docs/guides/vision).

            - `OpenAIResponseInputFileParam`

              A file input to the model.

        - `type: "custom_tool_call_output"`

          - `"custom_tool_call_output"`

        - `id?: string`

      - `ResponseCustomToolCallParam`

        A call to a custom tool created by the model.

        - `call_id: string`

        - `input: string`

        - `name: string`

        - `type: "custom_tool_call"`

          - `"custom_tool_call"`

        - `id?: string`

      - `OpenAITypesResponsesResponseInputParamItemReference`

        An internal identifier for an item to reference.

        - `id: string`

        - `type?: "item_reference"`

          - `"item_reference"`

  - `model: string`

    model specified as `model_vendor/model`, for example `openai/gpt-4o`

  - `include?: Array<string>`

    Which fields to include in the response

  - `instructions?: string`

    Instructions for the response generation

  - `max_output_tokens?: number`

    Maximum number of output tokens

  - `metadata?: Record<string, unknown>`

    Metadata for the response

  - `parallel_tool_calls?: boolean`

    Whether to enable parallel tool calls

  - `previous_response_id?: string`

    ID of the previous response for chaining

  - `reasoning?: Record<string, unknown>`

    Reasoning configuration for the response

  - `store?: boolean`

    Whether to store the response

  - `stream?: boolean`

    Whether to stream the response

  - `temperature?: number`

    Sampling temperature for randomness control

  - `text?: Record<string, unknown>`

    Text configuration parameters

  - `tool_choice?: string | Record<string, unknown>`

    Tool choice configuration

    - `string`

    - `Record<string, unknown>`

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

    Tools available for the response

  - `top_p?: number`

    Top-p sampling parameter

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

    Truncation configuration

    - `"auto"`

    - `"disabled"`

### Returns

- `ResponseCreateResponse = OpenAIResponse | ResponseAudioDeltaEvent | ResponseAudioDoneEvent | 52 more`

  Emitted when there is a partial audio response.

  - `OpenAIResponse`

    - `id: string`

    - `created_at: number`

    - `model: "gpt-5.2" | "gpt-5.2-2025-12-11" | "gpt-5.2-chat-latest" | 83 more | (string & {})`

      - `"gpt-5.2" | "gpt-5.2-2025-12-11" | "gpt-5.2-chat-latest" | 83 more`

        - `"gpt-5.2"`

        - `"gpt-5.2-2025-12-11"`

        - `"gpt-5.2-chat-latest"`

        - `"gpt-5.2-pro"`

        - `"gpt-5.2-pro-2025-12-11"`

        - `"gpt-5.1"`

        - `"gpt-5.1-2025-11-13"`

        - `"gpt-5.1-codex"`

        - `"gpt-5.1-mini"`

        - `"gpt-5.1-chat-latest"`

        - `"gpt-5"`

        - `"gpt-5-mini"`

        - `"gpt-5-nano"`

        - `"gpt-5-2025-08-07"`

        - `"gpt-5-mini-2025-08-07"`

        - `"gpt-5-nano-2025-08-07"`

        - `"gpt-5-chat-latest"`

        - `"gpt-4.1"`

        - `"gpt-4.1-mini"`

        - `"gpt-4.1-nano"`

        - `"gpt-4.1-2025-04-14"`

        - `"gpt-4.1-mini-2025-04-14"`

        - `"gpt-4.1-nano-2025-04-14"`

        - `"o4-mini"`

        - `"o4-mini-2025-04-16"`

        - `"o3"`

        - `"o3-2025-04-16"`

        - `"o3-mini"`

        - `"o3-mini-2025-01-31"`

        - `"o1"`

        - `"o1-2024-12-17"`

        - `"o1-preview"`

        - `"o1-preview-2024-09-12"`

        - `"o1-mini"`

        - `"o1-mini-2024-09-12"`

        - `"gpt-4o"`

        - `"gpt-4o-2024-11-20"`

        - `"gpt-4o-2024-08-06"`

        - `"gpt-4o-2024-05-13"`

        - `"gpt-4o-audio-preview"`

        - `"gpt-4o-audio-preview-2024-10-01"`

        - `"gpt-4o-audio-preview-2024-12-17"`

        - `"gpt-4o-audio-preview-2025-06-03"`

        - `"gpt-4o-mini-audio-preview"`

        - `"gpt-4o-mini-audio-preview-2024-12-17"`

        - `"gpt-4o-search-preview"`

        - `"gpt-4o-mini-search-preview"`

        - `"gpt-4o-search-preview-2025-03-11"`

        - `"gpt-4o-mini-search-preview-2025-03-11"`

        - `"chatgpt-4o-latest"`

        - `"codex-mini-latest"`

        - `"gpt-4o-mini"`

        - `"gpt-4o-mini-2024-07-18"`

        - `"gpt-4-turbo"`

        - `"gpt-4-turbo-2024-04-09"`

        - `"gpt-4-0125-preview"`

        - `"gpt-4-turbo-preview"`

        - `"gpt-4-1106-preview"`

        - `"gpt-4-vision-preview"`

        - `"gpt-4"`

        - `"gpt-4-0314"`

        - `"gpt-4-0613"`

        - `"gpt-4-32k"`

        - `"gpt-4-32k-0314"`

        - `"gpt-4-32k-0613"`

        - `"gpt-3.5-turbo"`

        - `"gpt-3.5-turbo-16k"`

        - `"gpt-3.5-turbo-0301"`

        - `"gpt-3.5-turbo-0613"`

        - `"gpt-3.5-turbo-1106"`

        - `"gpt-3.5-turbo-0125"`

        - `"gpt-3.5-turbo-16k-0613"`

        - `"o1-pro"`

        - `"o1-pro-2025-03-19"`

        - `"o3-pro"`

        - `"o3-pro-2025-06-10"`

        - `"o3-deep-research"`

        - `"o3-deep-research-2025-06-26"`

        - `"o4-mini-deep-research"`

        - `"o4-mini-deep-research-2025-06-26"`

        - `"computer-use-preview"`

        - `"computer-use-preview-2025-03-11"`

        - `"gpt-5-codex"`

        - `"gpt-5-pro"`

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

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

      - `(string & {})`

    - `object: "response"`

      - `"response"`

    - `output: Array<OpenAIResponseOutputMessage | OpenAIResponseFileSearchToolCall | OpenAIResponseFunctionToolCall | 15 more>`

      - `OpenAIResponseOutputMessage`

        An output message from the model.

        - `id: string`

        - `content: Array<OpenAIResponseOutputText | OpenAIResponseOutputRefusal>`

          - `OpenAIResponseOutputText`

            A text output from the model.

            - `annotations: Array<AnnotationFileCitation | OpenAITypesResponsesResponseOutputTextAnnotationURLCitation | AnnotationContainerFileCitation | AnnotationFilePath>`

              - `AnnotationFileCitation`

                A citation to a file.

                - `file_id: string`

                - `filename: string`

                - `index: number`

                - `type: "file_citation"`

                  - `"file_citation"`

              - `OpenAITypesResponsesResponseOutputTextAnnotationURLCitation`

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

                - `end_index: number`

                - `start_index: number`

                - `title: string`

                - `type: "url_citation"`

                  - `"url_citation"`

                - `url: string`

              - `AnnotationContainerFileCitation`

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

                - `container_id: string`

                - `end_index: number`

                - `file_id: string`

                - `filename: string`

                - `start_index: number`

                - `type: "container_file_citation"`

                  - `"container_file_citation"`

              - `AnnotationFilePath`

                A path to a file.

                - `file_id: string`

                - `index: number`

                - `type: "file_path"`

                  - `"file_path"`

            - `text: string`

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

          - `OpenAIResponseOutputRefusal`

            A refusal from the model.

            - `refusal: string`

            - `type: "refusal"`

              - `"refusal"`

        - `role: "assistant"`

          - `"assistant"`

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

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

        - `type: "message"`

          - `"message"`

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

          - `"commentary"`

          - `"final_answer"`

      - `OpenAIResponseFileSearchToolCall`

        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`

        - `queries: Array<string>`

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

          - `"in_progress"`

          - `"searching"`

          - `"completed"`

          - `"incomplete"`

          - `"failed"`

        - `type: "file_search_call"`

          - `"file_search_call"`

        - `results?: Array<Result>`

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

            - `string`

            - `number`

            - `boolean`

          - `file_id?: string`

          - `filename?: string`

          - `score?: number`

          - `text?: string`

      - `OpenAIResponseFunctionToolCall`

        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`

        - `call_id: string`

        - `name: string`

        - `type: "function_call"`

          - `"function_call"`

        - `id?: string`

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

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

      - `OpenAIResponseFunctionWebSearch`

        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`

        - `action: OpenAITypesResponsesResponseFunctionWebSearchActionSearch | OpenAITypesResponsesResponseFunctionWebSearchActionOpenPage | ActionFind`

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

          - `OpenAITypesResponsesResponseFunctionWebSearchActionSearch`

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

            - `query: string`

            - `type: "search"`

              - `"search"`

            - `queries?: Array<string>`

            - `sources?: Array<Source>`

              - `type: "url"`

                - `"url"`

              - `url: string`

          - `OpenAITypesResponsesResponseFunctionWebSearchActionOpenPage`

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

            - `type: "open_page"`

              - `"open_page"`

            - `url?: string`

          - `ActionFind`

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

            - `pattern: string`

            - `type: "find_in_page"`

              - `"find_in_page"`

            - `url: string`

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

          - `"in_progress"`

          - `"searching"`

          - `"completed"`

          - `"failed"`

        - `type: "web_search_call"`

          - `"web_search_call"`

      - `OpenAIResponseComputerToolCall`

        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`

        - `action: ActionClick | ActionDoubleClick | ActionDrag | 6 more`

          A click action.

          - `ActionClick`

            A click action.

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

              - `"left"`

              - `"right"`

              - `"wheel"`

              - `"back"`

              - `"forward"`

            - `type: "click"`

              - `"click"`

            - `x: number`

            - `y: number`

          - `ActionDoubleClick`

            A double click action.

            - `type: "double_click"`

              - `"double_click"`

            - `x: number`

            - `y: number`

          - `ActionDrag`

            A drag action.

            - `path: Array<Path>`

              - `x: number`

              - `y: number`

            - `type: "drag"`

              - `"drag"`

          - `ActionKeypress`

            A collection of keypresses the model would like to perform.

            - `keys: Array<string>`

            - `type: "keypress"`

              - `"keypress"`

          - `ActionMove`

            A mouse move action.

            - `type: "move"`

              - `"move"`

            - `x: number`

            - `y: number`

          - `ActionScreenshot`

            A screenshot action.

            - `type: "screenshot"`

              - `"screenshot"`

          - `ActionScroll`

            A scroll action.

            - `scroll_x: number`

            - `scroll_y: number`

            - `type: "scroll"`

              - `"scroll"`

            - `x: number`

            - `y: number`

          - `ActionType`

            An action to type in text.

            - `text: string`

            - `type: "type"`

              - `"type"`

          - `ActionWait`

            A wait action.

            - `type: "wait"`

              - `"wait"`

        - `call_id: string`

        - `pending_safety_checks: Array<PendingSafetyCheck>`

          - `id: string`

          - `code?: string`

          - `message?: string`

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

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

        - `type: "computer_call"`

          - `"computer_call"`

      - `OpenAIResponseReasoningItem`

        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`

        - `summary: Array<Summary>`

          - `text: string`

          - `type: "summary_text"`

            - `"summary_text"`

        - `type: "reasoning"`

          - `"reasoning"`

        - `content?: Array<Content>`

          - `text: string`

          - `type: "reasoning_text"`

            - `"reasoning_text"`

        - `encrypted_content?: string`

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

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

      - `ResponseCompactionItem`

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

        - `id: string`

        - `encrypted_content: string`

        - `type: "compaction"`

          - `"compaction"`

        - `created_by?: string`

      - `OpenAITypesResponsesResponseOutputItemImageGenerationCall`

        An image generation request made by the model.

        - `id: string`

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

          - `"in_progress"`

          - `"completed"`

          - `"generating"`

          - `"failed"`

        - `type: "image_generation_call"`

          - `"image_generation_call"`

        - `result?: string`

      - `OpenAIResponseCodeInterpreterToolCall`

        A tool call to run code.

        - `id: string`

        - `container_id: string`

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

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

          - `"interpreting"`

          - `"failed"`

        - `type: "code_interpreter_call"`

          - `"code_interpreter_call"`

        - `code?: string`

        - `outputs?: Array<OutputLogs | OutputImage>`

          - `OutputLogs`

            The logs output from the code interpreter.

            - `logs: string`

            - `type: "logs"`

              - `"logs"`

          - `OutputImage`

            The image output from the code interpreter.

            - `type: "image"`

              - `"image"`

            - `url: string`

      - `OpenAITypesResponsesResponseOutputItemLocalShellCall`

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

        - `id: string`

        - `action: Action`

          Execute a shell command on the server.

          - `command: Array<string>`

          - `env: Record<string, string>`

          - `type: "exec"`

            - `"exec"`

          - `timeout_ms?: number`

          - `user?: string`

          - `working_directory?: string`

        - `call_id: string`

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

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

        - `type: "local_shell_call"`

          - `"local_shell_call"`

      - `ResponseFunctionShellToolCall`

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

        - `id: string`

        - `action: Action`

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

          - `commands: Array<string>`

          - `max_output_length?: number`

          - `timeout_ms?: number`

        - `call_id: string`

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

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

        - `type: "shell_call"`

          - `"shell_call"`

        - `created_by?: string`

        - `environment?: ResponseLocalEnvironment | ResponseContainerReference`

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

          - `ResponseLocalEnvironment`

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

            - `type: "local"`

              - `"local"`

          - `ResponseContainerReference`

            Represents a container created with /v1/containers.

            - `container_id: string`

            - `type: "container_reference"`

              - `"container_reference"`

      - `ResponseFunctionShellToolCallOutput`

        The output of a shell tool call that was emitted.

        - `id: string`

        - `call_id: string`

        - `output: Array<Output>`

          - `outcome: OutputOutcomeTimeout | OutputOutcomeExit`

            Indicates that the shell call exceeded its configured time limit.

            - `OutputOutcomeTimeout`

              Indicates that the shell call exceeded its configured time limit.

              - `type: "timeout"`

                - `"timeout"`

            - `OutputOutcomeExit`

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

              - `exit_code: number`

              - `type: "exit"`

                - `"exit"`

          - `stderr: string`

          - `stdout: string`

          - `created_by?: string`

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

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

        - `type: "shell_call_output"`

          - `"shell_call_output"`

        - `created_by?: string`

        - `max_output_length?: number`

      - `ResponseApplyPatchToolCall`

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

        - `id: string`

        - `call_id: string`

        - `operation: OperationCreateFile | OperationDeleteFile | OperationUpdateFile`

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

          - `OperationCreateFile`

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

            - `diff: string`

            - `path: string`

            - `type: "create_file"`

              - `"create_file"`

          - `OperationDeleteFile`

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

            - `path: string`

            - `type: "delete_file"`

              - `"delete_file"`

          - `OperationUpdateFile`

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

            - `diff: string`

            - `path: string`

            - `type: "update_file"`

              - `"update_file"`

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

          - `"in_progress"`

          - `"completed"`

        - `type: "apply_patch_call"`

          - `"apply_patch_call"`

        - `created_by?: string`

      - `ResponseApplyPatchToolCallOutput`

        The output emitted by an apply patch tool call.

        - `id: string`

        - `call_id: string`

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

          - `"completed"`

          - `"failed"`

        - `type: "apply_patch_call_output"`

          - `"apply_patch_call_output"`

        - `created_by?: string`

        - `output?: string`

      - `OpenAITypesResponsesResponseOutputItemMcpCall`

        An invocation of a tool on an MCP server.

        - `id: string`

        - `arguments: string`

        - `name: string`

        - `server_label: string`

        - `type: "mcp_call"`

          - `"mcp_call"`

        - `approval_request_id?: string`

        - `error?: string`

        - `output?: string`

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

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

          - `"calling"`

          - `"failed"`

      - `OpenAITypesResponsesResponseOutputItemMcpListTools`

        A list of tools available on an MCP server.

        - `id: string`

        - `server_label: string`

        - `tools: Array<Tool>`

          - `input_schema: unknown`

          - `name: string`

          - `annotations?: unknown`

          - `description?: string`

        - `type: "mcp_list_tools"`

          - `"mcp_list_tools"`

        - `error?: string`

      - `McpApprovalRequest`

        A request for human approval of a tool invocation.

        - `id: string`

        - `arguments: string`

        - `name: string`

        - `server_label: string`

        - `type: "mcp_approval_request"`

          - `"mcp_approval_request"`

      - `OpenAIResponseCustomToolCall`

        A call to a custom tool created by the model.

        - `call_id: string`

        - `input: string`

        - `name: string`

        - `type: "custom_tool_call"`

          - `"custom_tool_call"`

        - `id?: string`

    - `parallel_tool_calls: boolean`

    - `tool_choice: "none" | "auto" | "required" | ToolChoiceAllowed | ToolChoiceTypes | 5 more`

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

      - `"none" | "auto" | "required"`

        - `"none"`

        - `"auto"`

        - `"required"`

      - `ToolChoiceAllowed`

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

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

          - `"auto"`

          - `"required"`

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

        - `type: "allowed_tools"`

          - `"allowed_tools"`

      - `ToolChoiceTypes`

        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_use_preview" | 3 more`

          - `"file_search"`

          - `"web_search_preview"`

          - `"computer_use_preview"`

          - `"web_search_preview_2025_03_11"`

          - `"image_generation"`

          - `"code_interpreter"`

      - `ToolChoiceFunction`

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

        - `name: string`

        - `type: "function"`

          - `"function"`

      - `ToolChoiceMcp`

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

        - `server_label: string`

        - `type: "mcp"`

          - `"mcp"`

        - `name?: string`

      - `ToolChoiceCustom`

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

        - `name: string`

        - `type: "custom"`

          - `"custom"`

      - `ToolChoiceApplyPatch`

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

        - `type: "apply_patch"`

          - `"apply_patch"`

      - `ToolChoiceShell`

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

        - `type: "shell"`

          - `"shell"`

    - `tools: Array<FunctionTool | FileSearchTool | ComputerTool | 9 more>`

      - `FunctionTool`

        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`

        - `type: "function"`

          - `"function"`

        - `description?: string`

        - `parameters?: Record<string, unknown>`

        - `strict?: boolean`

      - `FileSearchTool`

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

          - `"file_search"`

        - `vector_store_ids: Array<string>`

        - `filters?: ComparisonFilter | CompoundFilter`

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

          - `ComparisonFilter`

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

            - `key: string`

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

              - `"eq"`

              - `"ne"`

              - `"gt"`

              - `"gte"`

              - `"lt"`

              - `"lte"`

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

              - `string`

              - `number`

              - `boolean`

              - `Array<string | number>`

                - `string`

                - `number`

          - `CompoundFilter`

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

            - `filters: Array<ComparisonFilter | unknown>`

              - `ComparisonFilter`

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

                - `key: string`

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

                  - `"eq"`

                  - `"ne"`

                  - `"gt"`

                  - `"gte"`

                  - `"lt"`

                  - `"lte"`

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

                  - `string`

                  - `number`

                  - `boolean`

                  - `Array<string | number>`

                    - `string`

                    - `number`

              - `unknown`

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

              - `"and"`

              - `"or"`

        - `max_num_results?: number`

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

            - `text_weight: number`

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

            - `"auto"`

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

          - `score_threshold?: number`

      - `ComputerTool`

        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`

        - `display_width: number`

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

          - `"windows"`

          - `"mac"`

          - `"linux"`

          - `"ubuntu"`

          - `"browser"`

        - `type: "computer_use_preview"`

          - `"computer_use_preview"`

      - `WebSearchTool`

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

          - `"web_search"`

          - `"web_search_2025_08_26"`

        - `filters?: Filters`

          Filters for the search.

          - `allowed_domains?: Array<string>`

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

          - `"low"`

          - `"medium"`

          - `"high"`

        - `user_location?: UserLocation`

          The approximate location of the user.

          - `city?: string`

          - `country?: string`

          - `region?: string`

          - `timezone?: string`

          - `type?: "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`

        - `type: "mcp"`

          - `"mcp"`

        - `allowed_tools?: Array<string> | McpAllowedToolsMcpToolFilter`

          A filter object to specify which tools are allowed.

          - `Array<string>`

          - `McpAllowedToolsMcpToolFilter`

            A filter object to specify which tools are allowed.

            - `read_only?: boolean`

            - `tool_names?: Array<string>`

        - `authorization?: string`

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

          - `"connector_dropbox"`

          - `"connector_gmail"`

          - `"connector_googlecalendar"`

          - `"connector_googledrive"`

          - `"connector_microsoftteams"`

          - `"connector_outlookcalendar"`

          - `"connector_outlookemail"`

          - `"connector_sharepoint"`

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

        - `require_approval?: McpRequireApprovalMcpToolApprovalFilter | "always" | "never"`

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

          Can be
          `always`, `never`, or a filter object associated with tools
          that require approval.

          - `McpRequireApprovalMcpToolApprovalFilter`

            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`

              - `tool_names?: Array<string>`

            - `never?: Never`

              A filter object to specify which tools are allowed.

              - `read_only?: boolean`

              - `tool_names?: Array<string>`

          - `"always" | "never"`

            - `"always"`

            - `"never"`

        - `server_description?: string`

        - `server_url?: string`

      - `CodeInterpreter`

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

        - `container: string | CodeInterpreterContainerCodeInterpreterToolAuto`

          Configuration for a code interpreter container.

          Optionally specify the IDs of the files to run the code on.

          - `string`

          - `CodeInterpreterContainerCodeInterpreterToolAuto`

            Configuration for a code interpreter container.

            Optionally specify the IDs of the files to run the code on.

            - `type: "auto"`

              - `"auto"`

            - `file_ids?: Array<string>`

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

              - `"1g"`

              - `"4g"`

              - `"16g"`

              - `"64g"`

            - `network_policy?: ContainerNetworkPolicyDisabled | ContainerNetworkPolicyAllowlist`

              - `ContainerNetworkPolicyDisabled`

                - `type: "disabled"`

                  - `"disabled"`

              - `ContainerNetworkPolicyAllowlist`

                - `allowed_domains: Array<string>`

                - `type: "allowlist"`

                  - `"allowlist"`

                - `domain_secrets?: Array<DomainSecret>`

                  - `domain: string`

                  - `name: string`

                  - `value: string`

        - `type: "code_interpreter"`

          - `"code_interpreter"`

      - `ImageGeneration`

        A tool that generates images using the GPT image models.

        - `type: "image_generation"`

          - `"image_generation"`

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

          - `"generate"`

          - `"edit"`

          - `"auto"`

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

          - `"transparent"`

          - `"opaque"`

          - `"auto"`

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

          - `"high"`

          - `"low"`

        - `input_image_mask?: InputImageMask`

          Optional mask for inpainting.

          Contains `image_url`
          (string, optional) and `file_id` (string, optional).

          - `file_id?: string`

          - `image_url?: string`

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

          - `(string & {})`

          - `"gpt-image-1" | "gpt-image-1-mini" | "gpt-image-1.5"`

            - `"gpt-image-1"`

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

            - `"gpt-image-1.5"`

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

          - `"auto"`

          - `"low"`

        - `output_compression?: number`

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

          - `"png"`

          - `"webp"`

          - `"jpeg"`

        - `partial_images?: number`

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

          - `"low"`

          - `"medium"`

          - `"high"`

          - `"auto"`

        - `size?: "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"`

          - `"local_shell"`

      - `FunctionShellTool`

        A tool that allows the model to execute shell commands.

        - `type: "shell"`

          - `"shell"`

        - `environment?: ContainerAuto | LocalEnvironment | ContainerReference`

          - `ContainerAuto`

            - `type: "container_auto"`

              - `"container_auto"`

            - `file_ids?: Array<string>`

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

              - `"1g"`

              - `"4g"`

              - `"16g"`

              - `"64g"`

            - `network_policy?: ContainerNetworkPolicyDisabled | ContainerNetworkPolicyAllowlist`

              - `ContainerNetworkPolicyDisabled`

              - `ContainerNetworkPolicyAllowlist`

            - `skills?: Array<SkillReference | InlineSkill>`

              - `SkillReference`

                - `skill_id: string`

                - `type: "skill_reference"`

                  - `"skill_reference"`

                - `version?: string`

              - `InlineSkill`

                - `description: string`

                - `name: string`

                - `source: Source`

                  Inline skill payload

                  - `data: string`

                  - `media_type: "application/zip"`

                    - `"application/zip"`

                  - `type: "base64"`

                    - `"base64"`

                - `type: "inline"`

                  - `"inline"`

          - `LocalEnvironment`

            - `type: "local"`

              - `"local"`

            - `skills?: Array<Skill>`

              - `description: string`

              - `name: string`

              - `path: string`

          - `ContainerReference`

            - `container_id: string`

            - `type: "container_reference"`

              - `"container_reference"`

      - `CustomTool`

        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`

        - `type: "custom"`

          - `"custom"`

        - `description?: string`

        - `format?: Text | Grammar`

          Unconstrained free-form text.

          - `Text`

            Unconstrained free-form text.

            - `type: "text"`

              - `"text"`

          - `Grammar`

            A grammar defined by the user.

            - `definition: string`

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

              - `"lark"`

              - `"regex"`

            - `type: "grammar"`

              - `"grammar"`

      - `WebSearchPreviewTool`

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

          - `"web_search_preview"`

          - `"web_search_preview_2025_03_11"`

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

          - `"low"`

          - `"medium"`

          - `"high"`

        - `user_location?: UserLocation`

          The user's location.

          - `type: "approximate"`

            - `"approximate"`

          - `city?: string`

          - `country?: string`

          - `region?: string`

          - `timezone?: string`

      - `ApplyPatchTool`

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

        - `type: "apply_patch"`

          - `"apply_patch"`

    - `background?: boolean`

    - `completed_at?: number`

    - `conversation?: Conversation`

      The conversation that this response belonged to.

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

      - `id: string`

    - `error?: OpenAIResponseError`

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

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

        - `"server_error"`

        - `"rate_limit_exceeded"`

        - `"invalid_prompt"`

        - `"vector_store_timeout"`

        - `"invalid_image"`

        - `"invalid_image_format"`

        - `"invalid_base64_image"`

        - `"invalid_image_url"`

        - `"image_too_large"`

        - `"image_too_small"`

        - `"image_parse_error"`

        - `"image_content_policy_violation"`

        - `"invalid_image_mode"`

        - `"image_file_too_large"`

        - `"unsupported_image_media_type"`

        - `"empty_image_file"`

        - `"failed_to_download_image"`

        - `"image_file_not_found"`

      - `message: string`

    - `incomplete_details?: IncompleteDetails`

      Details about why the response is incomplete.

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

        - `"max_output_tokens"`

        - `"content_filter"`

    - `instructions?: string | Array<EasyInputMessage | OpenAITypesResponsesResponseInputItemMessage | OpenAIResponseOutputMessage | 23 more>`

      - `string`

      - `Array<EasyInputMessage | OpenAITypesResponsesResponseInputItemMessage | OpenAIResponseOutputMessage | 23 more>`

        - `EasyInputMessage`

          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 | Array<OpenAIResponseInputText | OpenAIResponseInputImage | OpenAIResponseInputFile>`

            - `string`

            - `Array<OpenAIResponseInputText | OpenAIResponseInputImage | OpenAIResponseInputFile>`

              - `OpenAIResponseInputText`

                A text input to the model.

                - `text: string`

                - `type: "input_text"`

                  - `"input_text"`

              - `OpenAIResponseInputImage`

                An image input to the model.

                Learn about [image inputs](https://platform.openai.com/docs/guides/vision).

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

                  - `"low"`

                  - `"high"`

                  - `"auto"`

                - `type: "input_image"`

                  - `"input_image"`

                - `file_id?: string`

                - `image_url?: string`

              - `OpenAIResponseInputFile`

                A file input to the model.

                - `type: "input_file"`

                  - `"input_file"`

                - `file_data?: string`

                - `file_id?: string`

                - `file_url?: string`

                - `filename?: string`

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

            - `"user"`

            - `"assistant"`

            - `"system"`

            - `"developer"`

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

            - `"commentary"`

            - `"final_answer"`

          - `type?: "message"`

            - `"message"`

        - `OpenAITypesResponsesResponseInputItemMessage`

          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: Array<OpenAIResponseInputText | OpenAIResponseInputImage | OpenAIResponseInputFile>`

            - `OpenAIResponseInputText`

              A text input to the model.

            - `OpenAIResponseInputImage`

              An image input to the model.

              Learn about [image inputs](https://platform.openai.com/docs/guides/vision).

            - `OpenAIResponseInputFile`

              A file input to the model.

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

            - `"user"`

            - `"system"`

            - `"developer"`

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

            - `"in_progress"`

            - `"completed"`

            - `"incomplete"`

          - `type?: "message"`

            - `"message"`

        - `OpenAIResponseOutputMessage`

          An output message from the model.

        - `OpenAIResponseFileSearchToolCall`

          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.

        - `OpenAIResponseComputerToolCall`

          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.

        - `OpenAITypesResponsesResponseInputItemComputerCallOutput`

          The output of a computer tool call.

          - `call_id: string`

          - `output: ResponseComputerToolCallOutputScreenshot`

            A computer screenshot image used with the computer use tool.

            - `type: "computer_screenshot"`

              - `"computer_screenshot"`

            - `file_id?: string`

            - `image_url?: string`

          - `type: "computer_call_output"`

            - `"computer_call_output"`

          - `id?: string`

          - `acknowledged_safety_checks?: Array<AcknowledgedSafetyCheck>`

            - `id: string`

            - `code?: string`

            - `message?: string`

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

            - `"in_progress"`

            - `"completed"`

            - `"incomplete"`

        - `OpenAIResponseFunctionWebSearch`

          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.

        - `OpenAIResponseFunctionToolCall`

          A tool call to run a function.

          See the
          [function calling guide](https://platform.openai.com/docs/guides/function-calling) for more information.

        - `OpenAITypesResponsesResponseInputItemFunctionCallOutput`

          The output of a function tool call.

          - `call_id: string`

          - `output: string | Array<ResponseInputTextContent | ResponseInputImageContent | ResponseInputFileContent>`

            - `string`

            - `Array<ResponseInputTextContent | ResponseInputImageContent | ResponseInputFileContent>`

              - `ResponseInputTextContent`

                A text input to the model.

                - `text: string`

                - `type: "input_text"`

                  - `"input_text"`

              - `ResponseInputImageContent`

                An image input to the model.

                Learn about [image inputs](https://platform.openai.com/docs/guides/vision)

                - `type: "input_image"`

                  - `"input_image"`

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

                  - `"low"`

                  - `"high"`

                  - `"auto"`

                - `file_id?: string`

                - `image_url?: string`

              - `ResponseInputFileContent`

                A file input to the model.

                - `type: "input_file"`

                  - `"input_file"`

                - `file_data?: string`

                - `file_id?: string`

                - `file_url?: string`

                - `filename?: string`

          - `type: "function_call_output"`

            - `"function_call_output"`

          - `id?: string`

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

            - `"in_progress"`

            - `"completed"`

            - `"incomplete"`

        - `OpenAIResponseReasoningItem`

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

        - `ResponseCompactionItemParam`

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

          - `encrypted_content: string`

          - `type: "compaction"`

            - `"compaction"`

          - `id?: string`

        - `OpenAITypesResponsesResponseInputItemImageGenerationCall`

          An image generation request made by the model.

          - `id: string`

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

            - `"in_progress"`

            - `"completed"`

            - `"generating"`

            - `"failed"`

          - `type: "image_generation_call"`

            - `"image_generation_call"`

          - `result?: string`

        - `OpenAIResponseCodeInterpreterToolCall`

          A tool call to run code.

        - `OpenAITypesResponsesResponseInputItemLocalShellCall`

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

          - `id: string`

          - `action: Action`

            Execute a shell command on the server.

            - `command: Array<string>`

            - `env: Record<string, string>`

            - `type: "exec"`

              - `"exec"`

            - `timeout_ms?: number`

            - `user?: string`

            - `working_directory?: string`

          - `call_id: string`

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

            - `"in_progress"`

            - `"completed"`

            - `"incomplete"`

          - `type: "local_shell_call"`

            - `"local_shell_call"`

        - `OpenAITypesResponsesResponseInputItemLocalShellCallOutput`

          The output of a local shell tool call.

          - `id: string`

          - `output: string`

          - `type: "local_shell_call_output"`

            - `"local_shell_call_output"`

          - `status?: "in_progress" | "completed" | "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>`

            - `max_output_length?: number`

            - `timeout_ms?: number`

          - `call_id: string`

          - `type: "shell_call"`

            - `"shell_call"`

          - `id?: string`

          - `environment?: LocalEnvironment | ContainerReference`

            - `LocalEnvironment`

            - `ContainerReference`

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

            - `"in_progress"`

            - `"completed"`

            - `"incomplete"`

        - `ShellCallOutput`

          The streamed output items emitted by a shell tool call.

          - `call_id: string`

          - `output: Array<Output>`

            - `outcome: OutcomeTimeout | OutcomeExit`

              Indicates that the shell call exceeded its configured time limit.

              - `OutcomeTimeout`

                Indicates that the shell call exceeded its configured time limit.

                - `type: "timeout"`

                  - `"timeout"`

              - `OutcomeExit`

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

                - `exit_code: number`

                - `type: "exit"`

                  - `"exit"`

            - `stderr: string`

            - `stdout: string`

          - `type: "shell_call_output"`

            - `"shell_call_output"`

          - `id?: string`

          - `max_output_length?: number`

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

            - `"in_progress"`

            - `"completed"`

            - `"incomplete"`

        - `ApplyPatchCall`

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

          - `call_id: string`

          - `operation: ApplyPatchCallOperationCreateFile | ApplyPatchCallOperationDeleteFile | ApplyPatchCallOperationUpdateFile`

            Instruction for creating a new file via the apply_patch tool.

            - `ApplyPatchCallOperationCreateFile`

              Instruction for creating a new file via the apply_patch tool.

              - `diff: string`

              - `path: string`

              - `type: "create_file"`

                - `"create_file"`

            - `ApplyPatchCallOperationDeleteFile`

              Instruction for deleting an existing file via the apply_patch tool.

              - `path: string`

              - `type: "delete_file"`

                - `"delete_file"`

            - `ApplyPatchCallOperationUpdateFile`

              Instruction for updating an existing file via the apply_patch tool.

              - `diff: string`

              - `path: string`

              - `type: "update_file"`

                - `"update_file"`

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

            - `"in_progress"`

            - `"completed"`

          - `type: "apply_patch_call"`

            - `"apply_patch_call"`

          - `id?: string`

        - `ApplyPatchCallOutput`

          The streamed output emitted by an apply patch tool call.

          - `call_id: string`

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

            - `"completed"`

            - `"failed"`

          - `type: "apply_patch_call_output"`

            - `"apply_patch_call_output"`

          - `id?: string`

          - `output?: string`

        - `OpenAITypesResponsesResponseInputItemMcpListTools`

          A list of tools available on an MCP server.

          - `id: string`

          - `server_label: string`

          - `tools: Array<Tool>`

            - `input_schema: unknown`

            - `name: string`

            - `annotations?: unknown`

            - `description?: string`

          - `type: "mcp_list_tools"`

            - `"mcp_list_tools"`

          - `error?: string`

        - `McpApprovalRequest`

          A request for human approval of a tool invocation.

        - `OpenAITypesResponsesResponseInputItemMcpApprovalResponse`

          A response to an MCP approval request.

          - `approval_request_id: string`

          - `approve: boolean`

          - `type: "mcp_approval_response"`

            - `"mcp_approval_response"`

          - `id?: string`

          - `reason?: string`

        - `OpenAITypesResponsesResponseInputItemMcpCall`

          An invocation of a tool on an MCP server.

          - `id: string`

          - `arguments: string`

          - `name: string`

          - `server_label: string`

          - `type: "mcp_call"`

            - `"mcp_call"`

          - `approval_request_id?: string`

          - `error?: string`

          - `output?: string`

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

            - `"in_progress"`

            - `"completed"`

            - `"incomplete"`

            - `"calling"`

            - `"failed"`

        - `OpenAIResponseCustomToolCallOutput`

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

          - `call_id: string`

          - `output: string | Array<OpenAIResponseInputText | OpenAIResponseInputImage | OpenAIResponseInputFile>`

            - `string`

            - `Array<OpenAIResponseInputText | OpenAIResponseInputImage | OpenAIResponseInputFile>`

              - `OpenAIResponseInputText`

                A text input to the model.

              - `OpenAIResponseInputImage`

                An image input to the model.

                Learn about [image inputs](https://platform.openai.com/docs/guides/vision).

              - `OpenAIResponseInputFile`

                A file input to the model.

          - `type: "custom_tool_call_output"`

            - `"custom_tool_call_output"`

          - `id?: string`

        - `OpenAIResponseCustomToolCall`

          A call to a custom tool created by the model.

        - `OpenAITypesResponsesResponseInputItemItemReference`

          An internal identifier for an item to reference.

          - `id: string`

          - `type?: "item_reference"`

            - `"item_reference"`

    - `max_output_tokens?: number`

    - `max_tool_calls?: number`

    - `metadata?: Record<string, string>`

    - `previous_response_id?: string`

    - `prompt?: OpenAIResponsePrompt`

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

      - `id: string`

      - `variables?: Record<string, string | OpenAIResponseInputText | OpenAIResponseInputImage | OpenAIResponseInputFile>`

        - `string`

        - `OpenAIResponseInputText`

          A text input to the model.

        - `OpenAIResponseInputImage`

          An image input to the model.

          Learn about [image inputs](https://platform.openai.com/docs/guides/vision).

        - `OpenAIResponseInputFile`

          A file input to the model.

      - `version?: string`

    - `prompt_cache_key?: string`

    - `prompt_cache_retention?: "in-memory" | "24h"`

      - `"in-memory"`

      - `"24h"`

    - `reasoning?: Reasoning`

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

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

      - `effort?: "none" | "minimal" | "low" | 3 more`

        - `"none"`

        - `"minimal"`

        - `"low"`

        - `"medium"`

        - `"high"`

        - `"xhigh"`

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

        - `"auto"`

        - `"concise"`

        - `"detailed"`

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

        - `"auto"`

        - `"concise"`

        - `"detailed"`

    - `safety_identifier?: string`

    - `service_tier?: "auto" | "default" | "flex" | 2 more`

      - `"auto"`

      - `"default"`

      - `"flex"`

      - `"scale"`

      - `"priority"`

    - `status?: "completed" | "failed" | "in_progress" | 3 more`

      - `"completed"`

      - `"failed"`

      - `"in_progress"`

      - `"cancelled"`

      - `"queued"`

      - `"incomplete"`

    - `temperature?: number`

    - `text?: OpenAIResponseTextConfig`

      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?: ResponseFormatText | ResponseFormatTextJsonSchemaConfig | ResponseFormatJsonObject`

        Default response format. Used to generate text responses.

        - `ResponseFormatText`

          Default response format. Used to generate text responses.

          - `type: "text"`

            - `"text"`

        - `ResponseFormatTextJsonSchemaConfig`

          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`

          - `schema: Record<string, unknown>`

          - `type: "json_schema"`

            - `"json_schema"`

          - `description?: string`

          - `strict?: boolean`

        - `ResponseFormatJsonObject`

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

            - `"json_object"`

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

        - `"low"`

        - `"medium"`

        - `"high"`

    - `top_logprobs?: number`

    - `top_p?: number`

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

      - `"auto"`

      - `"disabled"`

    - `usage?: OpenAIResponseUsage`

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

      - `input_tokens: number`

      - `input_tokens_details: InputTokensDetails`

        A detailed breakdown of the input tokens.

        - `cached_tokens: number`

      - `output_tokens: number`

      - `output_tokens_details: OutputTokensDetails`

        A detailed breakdown of the output tokens.

        - `reasoning_tokens: number`

      - `total_tokens: number`

    - `user?: string`

  - `ResponseAudioDeltaEvent`

    Emitted when there is a partial audio response.

    - `delta: string`

    - `sequence_number: number`

    - `type: "response.audio.delta"`

      - `"response.audio.delta"`

  - `ResponseAudioDoneEvent`

    Emitted when the audio response is complete.

    - `sequence_number: number`

    - `type: "response.audio.done"`

      - `"response.audio.done"`

  - `ResponseAudioTranscriptDeltaEvent`

    Emitted when there is a partial transcript of audio.

    - `delta: string`

    - `sequence_number: number`

    - `type: "response.audio.transcript.delta"`

      - `"response.audio.transcript.delta"`

  - `ResponseAudioTranscriptDoneEvent`

    Emitted when the full audio transcript is completed.

    - `sequence_number: number`

    - `type: "response.audio.transcript.done"`

      - `"response.audio.transcript.done"`

  - `ResponseCodeInterpreterCallCodeDeltaEvent`

    Emitted when a partial code snippet is streamed by the code interpreter.

    - `delta: string`

    - `item_id: string`

    - `output_index: number`

    - `sequence_number: number`

    - `type: "response.code_interpreter_call_code.delta"`

      - `"response.code_interpreter_call_code.delta"`

  - `ResponseCodeInterpreterCallCodeDoneEvent`

    Emitted when the code snippet is finalized by the code interpreter.

    - `code: string`

    - `item_id: string`

    - `output_index: number`

    - `sequence_number: number`

    - `type: "response.code_interpreter_call_code.done"`

      - `"response.code_interpreter_call_code.done"`

  - `ResponseCodeInterpreterCallCompletedEvent`

    Emitted when the code interpreter call is completed.

    - `item_id: string`

    - `output_index: number`

    - `sequence_number: number`

    - `type: "response.code_interpreter_call.completed"`

      - `"response.code_interpreter_call.completed"`

  - `ResponseCodeInterpreterCallInProgressEvent`

    Emitted when a code interpreter call is in progress.

    - `item_id: string`

    - `output_index: number`

    - `sequence_number: number`

    - `type: "response.code_interpreter_call.in_progress"`

      - `"response.code_interpreter_call.in_progress"`

  - `ResponseCodeInterpreterCallInterpretingEvent`

    Emitted when the code interpreter is actively interpreting the code snippet.

    - `item_id: string`

    - `output_index: number`

    - `sequence_number: number`

    - `type: "response.code_interpreter_call.interpreting"`

      - `"response.code_interpreter_call.interpreting"`

  - `ResponseCompletedEvent`

    Emitted when the model response is complete.

    - `response: OpenAIResponse`

    - `sequence_number: number`

    - `type: "response.completed"`

      - `"response.completed"`

  - `ResponseContentPartAddedEvent`

    Emitted when a new content part is added.

    - `content_index: number`

    - `item_id: string`

    - `output_index: number`

    - `part: OpenAIResponseOutputText | OpenAIResponseOutputRefusal | PartReasoningText`

      A text output from the model.

      - `OpenAIResponseOutputText`

        A text output from the model.

      - `OpenAIResponseOutputRefusal`

        A refusal from the model.

      - `PartReasoningText`

        Reasoning text from the model.

        - `text: string`

        - `type: "reasoning_text"`

          - `"reasoning_text"`

    - `sequence_number: number`

    - `type: "response.content_part.added"`

      - `"response.content_part.added"`

  - `ResponseContentPartDoneEvent`

    Emitted when a content part is done.

    - `content_index: number`

    - `item_id: string`

    - `output_index: number`

    - `part: OpenAIResponseOutputText | OpenAIResponseOutputRefusal | PartReasoningText`

      A text output from the model.

      - `OpenAIResponseOutputText`

        A text output from the model.

      - `OpenAIResponseOutputRefusal`

        A refusal from the model.

      - `PartReasoningText`

        Reasoning text from the model.

    - `sequence_number: number`

    - `type: "response.content_part.done"`

      - `"response.content_part.done"`

  - `ResponseCreatedEvent`

    An event that is emitted when a response is created.

    - `response: OpenAIResponse`

    - `sequence_number: number`

    - `type: "response.created"`

      - `"response.created"`

  - `ResponseErrorEvent`

    Emitted when an error occurs.

    - `message: string`

    - `sequence_number: number`

    - `type: "error"`

      - `"error"`

    - `code?: string`

    - `param?: string`

  - `ResponseFileSearchCallCompletedEvent`

    Emitted when a file search call is completed (results found).

    - `item_id: string`

    - `output_index: number`

    - `sequence_number: number`

    - `type: "response.file_search_call.completed"`

      - `"response.file_search_call.completed"`

  - `ResponseFileSearchCallInProgressEvent`

    Emitted when a file search call is initiated.

    - `item_id: string`

    - `output_index: number`

    - `sequence_number: number`

    - `type: "response.file_search_call.in_progress"`

      - `"response.file_search_call.in_progress"`

  - `ResponseFileSearchCallSearchingEvent`

    Emitted when a file search is currently searching.

    - `item_id: string`

    - `output_index: number`

    - `sequence_number: number`

    - `type: "response.file_search_call.searching"`

      - `"response.file_search_call.searching"`

  - `ResponseFunctionCallArgumentsDeltaEvent`

    Emitted when there is a partial function-call arguments delta.

    - `delta: string`

    - `item_id: string`

    - `output_index: number`

    - `sequence_number: number`

    - `type: "response.function_call_arguments.delta"`

      - `"response.function_call_arguments.delta"`

  - `ResponseFunctionCallArgumentsDoneEvent`

    Emitted when function-call arguments are finalized.

    - `arguments: string`

    - `item_id: string`

    - `name: string`

    - `output_index: number`

    - `sequence_number: number`

    - `type: "response.function_call_arguments.done"`

      - `"response.function_call_arguments.done"`

  - `ResponseInProgressEvent`

    Emitted when the response is in progress.

    - `response: OpenAIResponse`

    - `sequence_number: number`

    - `type: "response.in_progress"`

      - `"response.in_progress"`

  - `ResponseFailedEvent`

    An event that is emitted when a response fails.

    - `response: OpenAIResponse`

    - `sequence_number: number`

    - `type: "response.failed"`

      - `"response.failed"`

  - `ResponseIncompleteEvent`

    An event that is emitted when a response finishes as incomplete.

    - `response: OpenAIResponse`

    - `sequence_number: number`

    - `type: "response.incomplete"`

      - `"response.incomplete"`

  - `ResponseOutputItemAddedEvent`

    Emitted when a new output item is added.

    - `item: OpenAIResponseOutputMessage | OpenAIResponseFileSearchToolCall | OpenAIResponseFunctionToolCall | 15 more`

      An output message from the model.

      - `OpenAIResponseOutputMessage`

        An output message from the model.

      - `OpenAIResponseFileSearchToolCall`

        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.

      - `OpenAIResponseFunctionToolCall`

        A tool call to run a function.

        See the
        [function calling guide](https://platform.openai.com/docs/guides/function-calling) for more information.

      - `OpenAIResponseFunctionWebSearch`

        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.

      - `OpenAIResponseComputerToolCall`

        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.

      - `OpenAIResponseReasoningItem`

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

      - `ResponseCompactionItem`

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

      - `OpenAITypesResponsesResponseOutputItemImageGenerationCall`

        An image generation request made by the model.

      - `OpenAIResponseCodeInterpreterToolCall`

        A tool call to run code.

      - `OpenAITypesResponsesResponseOutputItemLocalShellCall`

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

      - `ResponseFunctionShellToolCall`

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

      - `ResponseFunctionShellToolCallOutput`

        The output of a shell tool call that was emitted.

      - `ResponseApplyPatchToolCall`

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

      - `ResponseApplyPatchToolCallOutput`

        The output emitted by an apply patch tool call.

      - `OpenAITypesResponsesResponseOutputItemMcpCall`

        An invocation of a tool on an MCP server.

      - `OpenAITypesResponsesResponseOutputItemMcpListTools`

        A list of tools available on an MCP server.

      - `McpApprovalRequest`

        A request for human approval of a tool invocation.

      - `OpenAIResponseCustomToolCall`

        A call to a custom tool created by the model.

    - `output_index: number`

    - `sequence_number: number`

    - `type: "response.output_item.added"`

      - `"response.output_item.added"`

  - `ResponseOutputItemDoneEvent`

    Emitted when an output item is marked done.

    - `item: OpenAIResponseOutputMessage | OpenAIResponseFileSearchToolCall | OpenAIResponseFunctionToolCall | 15 more`

      An output message from the model.

      - `OpenAIResponseOutputMessage`

        An output message from the model.

      - `OpenAIResponseFileSearchToolCall`

        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.

      - `OpenAIResponseFunctionToolCall`

        A tool call to run a function.

        See the
        [function calling guide](https://platform.openai.com/docs/guides/function-calling) for more information.

      - `OpenAIResponseFunctionWebSearch`

        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.

      - `OpenAIResponseComputerToolCall`

        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.

      - `OpenAIResponseReasoningItem`

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

      - `ResponseCompactionItem`

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

      - `OpenAITypesResponsesResponseOutputItemImageGenerationCall`

        An image generation request made by the model.

      - `OpenAIResponseCodeInterpreterToolCall`

        A tool call to run code.

      - `OpenAITypesResponsesResponseOutputItemLocalShellCall`

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

      - `ResponseFunctionShellToolCall`

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

      - `ResponseFunctionShellToolCallOutput`

        The output of a shell tool call that was emitted.

      - `ResponseApplyPatchToolCall`

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

      - `ResponseApplyPatchToolCallOutput`

        The output emitted by an apply patch tool call.

      - `OpenAITypesResponsesResponseOutputItemMcpCall`

        An invocation of a tool on an MCP server.

      - `OpenAITypesResponsesResponseOutputItemMcpListTools`

        A list of tools available on an MCP server.

      - `McpApprovalRequest`

        A request for human approval of a tool invocation.

      - `OpenAIResponseCustomToolCall`

        A call to a custom tool created by the model.

    - `output_index: number`

    - `sequence_number: number`

    - `type: "response.output_item.done"`

      - `"response.output_item.done"`

  - `ResponseReasoningSummaryPartAddedEvent`

    Emitted when a new reasoning summary part is added.

    - `item_id: string`

    - `output_index: number`

    - `part: Part`

      The summary part that was added.

      - `text: string`

      - `type: "summary_text"`

        - `"summary_text"`

    - `sequence_number: number`

    - `summary_index: number`

    - `type: "response.reasoning_summary_part.added"`

      - `"response.reasoning_summary_part.added"`

  - `ResponseReasoningSummaryPartDoneEvent`

    Emitted when a reasoning summary part is completed.

    - `item_id: string`

    - `output_index: number`

    - `part: Part`

      The completed summary part.

      - `text: string`

      - `type: "summary_text"`

        - `"summary_text"`

    - `sequence_number: number`

    - `summary_index: number`

    - `type: "response.reasoning_summary_part.done"`

      - `"response.reasoning_summary_part.done"`

  - `ResponseReasoningSummaryTextDeltaEvent`

    Emitted when a delta is added to a reasoning summary text.

    - `delta: string`

    - `item_id: string`

    - `output_index: number`

    - `sequence_number: number`

    - `summary_index: number`

    - `type: "response.reasoning_summary_text.delta"`

      - `"response.reasoning_summary_text.delta"`

  - `ResponseReasoningSummaryTextDoneEvent`

    Emitted when a reasoning summary text is completed.

    - `item_id: string`

    - `output_index: number`

    - `sequence_number: number`

    - `summary_index: number`

    - `text: string`

    - `type: "response.reasoning_summary_text.done"`

      - `"response.reasoning_summary_text.done"`

  - `ResponseReasoningTextDeltaEvent`

    Emitted when a delta is added to a reasoning text.

    - `content_index: number`

    - `delta: string`

    - `item_id: string`

    - `output_index: number`

    - `sequence_number: number`

    - `type: "response.reasoning_text.delta"`

      - `"response.reasoning_text.delta"`

  - `ResponseReasoningTextDoneEvent`

    Emitted when a reasoning text is completed.

    - `content_index: number`

    - `item_id: string`

    - `output_index: number`

    - `sequence_number: number`

    - `text: string`

    - `type: "response.reasoning_text.done"`

      - `"response.reasoning_text.done"`

  - `ResponseRefusalDeltaEvent`

    Emitted when there is a partial refusal text.

    - `content_index: number`

    - `delta: string`

    - `item_id: string`

    - `output_index: number`

    - `sequence_number: number`

    - `type: "response.refusal.delta"`

      - `"response.refusal.delta"`

  - `ResponseRefusalDoneEvent`

    Emitted when refusal text is finalized.

    - `content_index: number`

    - `item_id: string`

    - `output_index: number`

    - `refusal: string`

    - `sequence_number: number`

    - `type: "response.refusal.done"`

      - `"response.refusal.done"`

  - `ResponseTextDeltaEvent`

    Emitted when there is an additional text delta.

    - `content_index: number`

    - `delta: string`

    - `item_id: string`

    - `logprobs: Array<Logprob>`

      - `token: string`

      - `logprob: number`

      - `top_logprobs?: Array<TopLogprob>`

        - `token?: string`

        - `logprob?: number`

    - `output_index: number`

    - `sequence_number: number`

    - `type: "response.output_text.delta"`

      - `"response.output_text.delta"`

  - `ResponseTextDoneEvent`

    Emitted when text content is finalized.

    - `content_index: number`

    - `item_id: string`

    - `logprobs: Array<Logprob>`

      - `token: string`

      - `logprob: number`

      - `top_logprobs?: Array<TopLogprob>`

        - `token?: string`

        - `logprob?: number`

    - `output_index: number`

    - `sequence_number: number`

    - `text: string`

    - `type: "response.output_text.done"`

      - `"response.output_text.done"`

  - `ResponseWebSearchCallCompletedEvent`

    Emitted when a web search call is completed.

    - `item_id: string`

    - `output_index: number`

    - `sequence_number: number`

    - `type: "response.web_search_call.completed"`

      - `"response.web_search_call.completed"`

  - `ResponseWebSearchCallInProgressEvent`

    Emitted when a web search call is initiated.

    - `item_id: string`

    - `output_index: number`

    - `sequence_number: number`

    - `type: "response.web_search_call.in_progress"`

      - `"response.web_search_call.in_progress"`

  - `ResponseWebSearchCallSearchingEvent`

    Emitted when a web search call is executing.

    - `item_id: string`

    - `output_index: number`

    - `sequence_number: number`

    - `type: "response.web_search_call.searching"`

      - `"response.web_search_call.searching"`

  - `ResponseImageGenCallCompletedEvent`

    Emitted when an image generation tool call has completed and the final image is available.

    - `item_id: string`

    - `output_index: number`

    - `sequence_number: number`

    - `type: "response.image_generation_call.completed"`

      - `"response.image_generation_call.completed"`

  - `ResponseImageGenCallGeneratingEvent`

    Emitted when an image generation tool call is actively generating an image (intermediate state).

    - `item_id: string`

    - `output_index: number`

    - `sequence_number: number`

    - `type: "response.image_generation_call.generating"`

      - `"response.image_generation_call.generating"`

  - `ResponseImageGenCallInProgressEvent`

    Emitted when an image generation tool call is in progress.

    - `item_id: string`

    - `output_index: number`

    - `sequence_number: number`

    - `type: "response.image_generation_call.in_progress"`

      - `"response.image_generation_call.in_progress"`

  - `ResponseImageGenCallPartialImageEvent`

    Emitted when a partial image is available during image generation streaming.

    - `item_id: string`

    - `output_index: number`

    - `partial_image_b64: string`

    - `partial_image_index: number`

    - `sequence_number: number`

    - `type: "response.image_generation_call.partial_image"`

      - `"response.image_generation_call.partial_image"`

  - `ResponseMcpCallArgumentsDeltaEvent`

    Emitted when there is a delta (partial update) to the arguments of an MCP tool call.

    - `delta: string`

    - `item_id: string`

    - `output_index: number`

    - `sequence_number: number`

    - `type: "response.mcp_call_arguments.delta"`

      - `"response.mcp_call_arguments.delta"`

  - `ResponseMcpCallArgumentsDoneEvent`

    Emitted when the arguments for an MCP tool call are finalized.

    - `arguments: string`

    - `item_id: string`

    - `output_index: number`

    - `sequence_number: number`

    - `type: "response.mcp_call_arguments.done"`

      - `"response.mcp_call_arguments.done"`

  - `ResponseMcpCallCompletedEvent`

    Emitted when an MCP  tool call has completed successfully.

    - `item_id: string`

    - `output_index: number`

    - `sequence_number: number`

    - `type: "response.mcp_call.completed"`

      - `"response.mcp_call.completed"`

  - `ResponseMcpCallFailedEvent`

    Emitted when an MCP  tool call has failed.

    - `item_id: string`

    - `output_index: number`

    - `sequence_number: number`

    - `type: "response.mcp_call.failed"`

      - `"response.mcp_call.failed"`

  - `ResponseMcpCallInProgressEvent`

    Emitted when an MCP  tool call is in progress.

    - `item_id: string`

    - `output_index: number`

    - `sequence_number: number`

    - `type: "response.mcp_call.in_progress"`

      - `"response.mcp_call.in_progress"`

  - `ResponseMcpListToolsCompletedEvent`

    Emitted when the list of available MCP tools has been successfully retrieved.

    - `item_id: string`

    - `output_index: number`

    - `sequence_number: number`

    - `type: "response.mcp_list_tools.completed"`

      - `"response.mcp_list_tools.completed"`

  - `ResponseMcpListToolsFailedEvent`

    Emitted when the attempt to list available MCP tools has failed.

    - `item_id: string`

    - `output_index: number`

    - `sequence_number: number`

    - `type: "response.mcp_list_tools.failed"`

      - `"response.mcp_list_tools.failed"`

  - `ResponseMcpListToolsInProgressEvent`

    Emitted when the system is in the process of retrieving the list of available MCP tools.

    - `item_id: string`

    - `output_index: number`

    - `sequence_number: number`

    - `type: "response.mcp_list_tools.in_progress"`

      - `"response.mcp_list_tools.in_progress"`

  - `ResponseOutputTextAnnotationAddedEvent`

    Emitted when an annotation is added to output text content.

    - `annotation: unknown`

    - `annotation_index: number`

    - `content_index: number`

    - `item_id: string`

    - `output_index: number`

    - `sequence_number: number`

    - `type: "response.output_text.annotation.added"`

      - `"response.output_text.annotation.added"`

  - `ResponseQueuedEvent`

    Emitted when a response is queued and waiting to be processed.

    - `response: OpenAIResponse`

    - `sequence_number: number`

    - `type: "response.queued"`

      - `"response.queued"`

  - `ResponseCustomToolCallInputDeltaEvent`

    Event representing a delta (partial update) to the input of a custom tool call.

    - `delta: string`

    - `item_id: string`

    - `output_index: number`

    - `sequence_number: number`

    - `type: "response.custom_tool_call_input.delta"`

      - `"response.custom_tool_call_input.delta"`

  - `ResponseCustomToolCallInputDoneEvent`

    Event indicating that input for a custom tool call is complete.

    - `input: string`

    - `item_id: string`

    - `output_index: number`

    - `sequence_number: number`

    - `type: "response.custom_tool_call_input.done"`

      - `"response.custom_tool_call_input.done"`

  - `GenericResponseEvent`

    - `type: string`

### Example

```typescript
import SGPClient from 'scale-gp';

const client = new SGPClient({
  accountID: 'My Account ID',
  apiKey: process.env['SGP_API_KEY'], // This is the default and can be omitted
});

const response = await client.responses.create({ input: 'string', model: 'model' });

console.log(response);
```

#### Response

```json
{
  "id": "id",
  "created_at": 0,
  "model": "gpt-5.2",
  "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",
      "phase": "commentary"
    }
  ],
  "parallel_tool_calls": true,
  "tool_choice": "none",
  "tools": [
    {
      "name": "name",
      "type": "function",
      "description": "description",
      "parameters": {
        "foo": "bar"
      },
      "strict": true
    }
  ],
  "background": true,
  "completed_at": 0,
  "conversation": {
    "id": "id"
  },
  "error": {
    "code": "server_error",
    "message": "message"
  },
  "incomplete_details": {
    "reason": "max_output_tokens"
  },
  "instructions": "string",
  "max_output_tokens": 0,
  "max_tool_calls": 0,
  "metadata": {
    "foo": "string"
  },
  "previous_response_id": "previous_response_id",
  "prompt": {
    "id": "id",
    "variables": {
      "foo": "string"
    },
    "version": "version"
  },
  "prompt_cache_key": "prompt_cache_key",
  "prompt_cache_retention": "in-memory",
  "reasoning": {
    "effort": "none",
    "generate_summary": "auto",
    "summary": "auto"
  },
  "safety_identifier": "safety_identifier",
  "service_tier": "auto",
  "status": "completed",
  "temperature": 0,
  "text": {
    "format": {
      "type": "text"
    },
    "verbosity": "low"
  },
  "top_logprobs": 0,
  "top_p": 0,
  "truncation": "auto",
  "usage": {
    "input_tokens": 0,
    "input_tokens_details": {
      "cached_tokens": 0
    },
    "output_tokens": 0,
    "output_tokens_details": {
      "reasoning_tokens": 0
    },
    "total_tokens": 0
  },
  "user": "user"
}
```

## Domain Types

### Apply Patch Call

- `ApplyPatchCall`

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

  - `call_id: string`

  - `operation: ApplyPatchCallOperationCreateFile | ApplyPatchCallOperationDeleteFile | ApplyPatchCallOperationUpdateFile`

    Instruction for creating a new file via the apply_patch tool.

    - `ApplyPatchCallOperationCreateFile`

      Instruction for creating a new file via the apply_patch tool.

      - `diff: string`

      - `path: string`

      - `type: "create_file"`

        - `"create_file"`

    - `ApplyPatchCallOperationDeleteFile`

      Instruction for deleting an existing file via the apply_patch tool.

      - `path: string`

      - `type: "delete_file"`

        - `"delete_file"`

    - `ApplyPatchCallOperationUpdateFile`

      Instruction for updating an existing file via the apply_patch tool.

      - `diff: string`

      - `path: string`

      - `type: "update_file"`

        - `"update_file"`

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

    - `"in_progress"`

    - `"completed"`

  - `type: "apply_patch_call"`

    - `"apply_patch_call"`

  - `id?: string`

### Apply Patch Call Output

- `ApplyPatchCallOutput`

  The streamed output emitted by an apply patch tool call.

  - `call_id: string`

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

    - `"completed"`

    - `"failed"`

  - `type: "apply_patch_call_output"`

    - `"apply_patch_call_output"`

  - `id?: string`

  - `output?: string`

### Apply Patch Tool

- `ApplyPatchTool`

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

  - `type: "apply_patch"`

    - `"apply_patch"`

### Computer Tool

- `ComputerTool`

  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`

  - `display_width: number`

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

    - `"windows"`

    - `"mac"`

    - `"linux"`

    - `"ubuntu"`

    - `"browser"`

  - `type: "computer_use_preview"`

    - `"computer_use_preview"`

### Container Network Policy Allowlist

- `ContainerNetworkPolicyAllowlist`

  - `allowed_domains: Array<string>`

  - `type: "allowlist"`

    - `"allowlist"`

  - `domain_secrets?: Array<DomainSecret>`

    - `domain: string`

    - `name: string`

    - `value: string`

### Container Network Policy Disabled

- `ContainerNetworkPolicyDisabled`

  - `type: "disabled"`

    - `"disabled"`

### Container Reference

- `ContainerReference`

  - `container_id: string`

  - `type: "container_reference"`

    - `"container_reference"`

### Container Reference Param

- `ContainerReferenceParam`

  - `container_id: string`

  - `type: "container_reference"`

    - `"container_reference"`

### Conversation

- `Conversation`

  The conversation that this response belonged to.

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

  - `id: string`

### Custom Tool

- `CustomTool`

  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`

  - `type: "custom"`

    - `"custom"`

  - `description?: string`

  - `format?: Text | Grammar`

    Unconstrained free-form text.

    - `Text`

      Unconstrained free-form text.

      - `type: "text"`

        - `"text"`

    - `Grammar`

      A grammar defined by the user.

      - `definition: string`

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

        - `"lark"`

        - `"regex"`

      - `type: "grammar"`

        - `"grammar"`

### Easy Input Message

- `EasyInputMessage`

  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 | Array<OpenAIResponseInputText | OpenAIResponseInputImage | OpenAIResponseInputFile>`

    - `string`

    - `Array<OpenAIResponseInputText | OpenAIResponseInputImage | OpenAIResponseInputFile>`

      - `OpenAIResponseInputText`

        A text input to the model.

        - `text: string`

        - `type: "input_text"`

          - `"input_text"`

      - `OpenAIResponseInputImage`

        An image input to the model.

        Learn about [image inputs](https://platform.openai.com/docs/guides/vision).

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

          - `"low"`

          - `"high"`

          - `"auto"`

        - `type: "input_image"`

          - `"input_image"`

        - `file_id?: string`

        - `image_url?: string`

      - `OpenAIResponseInputFile`

        A file input to the model.

        - `type: "input_file"`

          - `"input_file"`

        - `file_data?: string`

        - `file_id?: string`

        - `file_url?: string`

        - `filename?: string`

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

    - `"user"`

    - `"assistant"`

    - `"system"`

    - `"developer"`

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

    - `"commentary"`

    - `"final_answer"`

  - `type?: "message"`

    - `"message"`

### File Search Tool

- `FileSearchTool`

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

    - `"file_search"`

  - `vector_store_ids: Array<string>`

  - `filters?: ComparisonFilter | CompoundFilter`

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

    - `ComparisonFilter`

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

      - `key: string`

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

        - `"eq"`

        - `"ne"`

        - `"gt"`

        - `"gte"`

        - `"lt"`

        - `"lte"`

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

        - `string`

        - `number`

        - `boolean`

        - `Array<string | number>`

          - `string`

          - `number`

    - `CompoundFilter`

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

      - `filters: Array<ComparisonFilter | unknown>`

        - `ComparisonFilter`

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

          - `key: string`

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

            - `"eq"`

            - `"ne"`

            - `"gt"`

            - `"gte"`

            - `"lt"`

            - `"lte"`

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

            - `string`

            - `number`

            - `boolean`

            - `Array<string | number>`

              - `string`

              - `number`

        - `unknown`

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

        - `"and"`

        - `"or"`

  - `max_num_results?: number`

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

      - `text_weight: number`

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

      - `"auto"`

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

    - `score_threshold?: number`

### Function Shell Tool

- `FunctionShellTool`

  A tool that allows the model to execute shell commands.

  - `type: "shell"`

    - `"shell"`

  - `environment?: ContainerAuto | LocalEnvironment | ContainerReference`

    - `ContainerAuto`

      - `type: "container_auto"`

        - `"container_auto"`

      - `file_ids?: Array<string>`

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

        - `"1g"`

        - `"4g"`

        - `"16g"`

        - `"64g"`

      - `network_policy?: ContainerNetworkPolicyDisabled | ContainerNetworkPolicyAllowlist`

        - `ContainerNetworkPolicyDisabled`

          - `type: "disabled"`

            - `"disabled"`

        - `ContainerNetworkPolicyAllowlist`

          - `allowed_domains: Array<string>`

          - `type: "allowlist"`

            - `"allowlist"`

          - `domain_secrets?: Array<DomainSecret>`

            - `domain: string`

            - `name: string`

            - `value: string`

      - `skills?: Array<SkillReference | InlineSkill>`

        - `SkillReference`

          - `skill_id: string`

          - `type: "skill_reference"`

            - `"skill_reference"`

          - `version?: string`

        - `InlineSkill`

          - `description: string`

          - `name: string`

          - `source: Source`

            Inline skill payload

            - `data: string`

            - `media_type: "application/zip"`

              - `"application/zip"`

            - `type: "base64"`

              - `"base64"`

          - `type: "inline"`

            - `"inline"`

    - `LocalEnvironment`

      - `type: "local"`

        - `"local"`

      - `skills?: Array<Skill>`

        - `description: string`

        - `name: string`

        - `path: string`

    - `ContainerReference`

      - `container_id: string`

      - `type: "container_reference"`

        - `"container_reference"`

### Function Tool

- `FunctionTool`

  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`

  - `type: "function"`

    - `"function"`

  - `description?: string`

  - `parameters?: Record<string, unknown>`

  - `strict?: boolean`

### Incomplete Details

- `IncompleteDetails`

  Details about why the response is incomplete.

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

    - `"max_output_tokens"`

    - `"content_filter"`

### Local Environment

- `LocalEnvironment`

  - `type: "local"`

    - `"local"`

  - `skills?: Array<Skill>`

    - `description: string`

    - `name: string`

    - `path: string`

### Local Environment Param

- `LocalEnvironmentParam`

  - `type: "local"`

    - `"local"`

  - `skills?: Array<Skill>`

    - `description: string`

    - `name: string`

    - `path: string`

### Mcp Approval Request

- `McpApprovalRequest`

  A request for human approval of a tool invocation.

  - `id: string`

  - `arguments: string`

  - `name: string`

  - `server_label: string`

  - `type: "mcp_approval_request"`

    - `"mcp_approval_request"`

### OpenAI Response

- `OpenAIResponse`

  - `id: string`

  - `created_at: number`

  - `model: "gpt-5.2" | "gpt-5.2-2025-12-11" | "gpt-5.2-chat-latest" | 83 more | (string & {})`

    - `"gpt-5.2" | "gpt-5.2-2025-12-11" | "gpt-5.2-chat-latest" | 83 more`

      - `"gpt-5.2"`

      - `"gpt-5.2-2025-12-11"`

      - `"gpt-5.2-chat-latest"`

      - `"gpt-5.2-pro"`

      - `"gpt-5.2-pro-2025-12-11"`

      - `"gpt-5.1"`

      - `"gpt-5.1-2025-11-13"`

      - `"gpt-5.1-codex"`

      - `"gpt-5.1-mini"`

      - `"gpt-5.1-chat-latest"`

      - `"gpt-5"`

      - `"gpt-5-mini"`

      - `"gpt-5-nano"`

      - `"gpt-5-2025-08-07"`

      - `"gpt-5-mini-2025-08-07"`

      - `"gpt-5-nano-2025-08-07"`

      - `"gpt-5-chat-latest"`

      - `"gpt-4.1"`

      - `"gpt-4.1-mini"`

      - `"gpt-4.1-nano"`

      - `"gpt-4.1-2025-04-14"`

      - `"gpt-4.1-mini-2025-04-14"`

      - `"gpt-4.1-nano-2025-04-14"`

      - `"o4-mini"`

      - `"o4-mini-2025-04-16"`

      - `"o3"`

      - `"o3-2025-04-16"`

      - `"o3-mini"`

      - `"o3-mini-2025-01-31"`

      - `"o1"`

      - `"o1-2024-12-17"`

      - `"o1-preview"`

      - `"o1-preview-2024-09-12"`

      - `"o1-mini"`

      - `"o1-mini-2024-09-12"`

      - `"gpt-4o"`

      - `"gpt-4o-2024-11-20"`

      - `"gpt-4o-2024-08-06"`

      - `"gpt-4o-2024-05-13"`

      - `"gpt-4o-audio-preview"`

      - `"gpt-4o-audio-preview-2024-10-01"`

      - `"gpt-4o-audio-preview-2024-12-17"`

      - `"gpt-4o-audio-preview-2025-06-03"`

      - `"gpt-4o-mini-audio-preview"`

      - `"gpt-4o-mini-audio-preview-2024-12-17"`

      - `"gpt-4o-search-preview"`

      - `"gpt-4o-mini-search-preview"`

      - `"gpt-4o-search-preview-2025-03-11"`

      - `"gpt-4o-mini-search-preview-2025-03-11"`

      - `"chatgpt-4o-latest"`

      - `"codex-mini-latest"`

      - `"gpt-4o-mini"`

      - `"gpt-4o-mini-2024-07-18"`

      - `"gpt-4-turbo"`

      - `"gpt-4-turbo-2024-04-09"`

      - `"gpt-4-0125-preview"`

      - `"gpt-4-turbo-preview"`

      - `"gpt-4-1106-preview"`

      - `"gpt-4-vision-preview"`

      - `"gpt-4"`

      - `"gpt-4-0314"`

      - `"gpt-4-0613"`

      - `"gpt-4-32k"`

      - `"gpt-4-32k-0314"`

      - `"gpt-4-32k-0613"`

      - `"gpt-3.5-turbo"`

      - `"gpt-3.5-turbo-16k"`

      - `"gpt-3.5-turbo-0301"`

      - `"gpt-3.5-turbo-0613"`

      - `"gpt-3.5-turbo-1106"`

      - `"gpt-3.5-turbo-0125"`

      - `"gpt-3.5-turbo-16k-0613"`

      - `"o1-pro"`

      - `"o1-pro-2025-03-19"`

      - `"o3-pro"`

      - `"o3-pro-2025-06-10"`

      - `"o3-deep-research"`

      - `"o3-deep-research-2025-06-26"`

      - `"o4-mini-deep-research"`

      - `"o4-mini-deep-research-2025-06-26"`

      - `"computer-use-preview"`

      - `"computer-use-preview-2025-03-11"`

      - `"gpt-5-codex"`

      - `"gpt-5-pro"`

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

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

    - `(string & {})`

  - `object: "response"`

    - `"response"`

  - `output: Array<OpenAIResponseOutputMessage | OpenAIResponseFileSearchToolCall | OpenAIResponseFunctionToolCall | 15 more>`

    - `OpenAIResponseOutputMessage`

      An output message from the model.

      - `id: string`

      - `content: Array<OpenAIResponseOutputText | OpenAIResponseOutputRefusal>`

        - `OpenAIResponseOutputText`

          A text output from the model.

          - `annotations: Array<AnnotationFileCitation | OpenAITypesResponsesResponseOutputTextAnnotationURLCitation | AnnotationContainerFileCitation | AnnotationFilePath>`

            - `AnnotationFileCitation`

              A citation to a file.

              - `file_id: string`

              - `filename: string`

              - `index: number`

              - `type: "file_citation"`

                - `"file_citation"`

            - `OpenAITypesResponsesResponseOutputTextAnnotationURLCitation`

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

              - `end_index: number`

              - `start_index: number`

              - `title: string`

              - `type: "url_citation"`

                - `"url_citation"`

              - `url: string`

            - `AnnotationContainerFileCitation`

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

              - `container_id: string`

              - `end_index: number`

              - `file_id: string`

              - `filename: string`

              - `start_index: number`

              - `type: "container_file_citation"`

                - `"container_file_citation"`

            - `AnnotationFilePath`

              A path to a file.

              - `file_id: string`

              - `index: number`

              - `type: "file_path"`

                - `"file_path"`

          - `text: string`

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

        - `OpenAIResponseOutputRefusal`

          A refusal from the model.

          - `refusal: string`

          - `type: "refusal"`

            - `"refusal"`

      - `role: "assistant"`

        - `"assistant"`

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

        - `"in_progress"`

        - `"completed"`

        - `"incomplete"`

      - `type: "message"`

        - `"message"`

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

        - `"commentary"`

        - `"final_answer"`

    - `OpenAIResponseFileSearchToolCall`

      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`

      - `queries: Array<string>`

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

        - `"in_progress"`

        - `"searching"`

        - `"completed"`

        - `"incomplete"`

        - `"failed"`

      - `type: "file_search_call"`

        - `"file_search_call"`

      - `results?: Array<Result>`

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

          - `string`

          - `number`

          - `boolean`

        - `file_id?: string`

        - `filename?: string`

        - `score?: number`

        - `text?: string`

    - `OpenAIResponseFunctionToolCall`

      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`

      - `call_id: string`

      - `name: string`

      - `type: "function_call"`

        - `"function_call"`

      - `id?: string`

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

        - `"in_progress"`

        - `"completed"`

        - `"incomplete"`

    - `OpenAIResponseFunctionWebSearch`

      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`

      - `action: OpenAITypesResponsesResponseFunctionWebSearchActionSearch | OpenAITypesResponsesResponseFunctionWebSearchActionOpenPage | ActionFind`

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

        - `OpenAITypesResponsesResponseFunctionWebSearchActionSearch`

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

          - `query: string`

          - `type: "search"`

            - `"search"`

          - `queries?: Array<string>`

          - `sources?: Array<Source>`

            - `type: "url"`

              - `"url"`

            - `url: string`

        - `OpenAITypesResponsesResponseFunctionWebSearchActionOpenPage`

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

          - `type: "open_page"`

            - `"open_page"`

          - `url?: string`

        - `ActionFind`

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

          - `pattern: string`

          - `type: "find_in_page"`

            - `"find_in_page"`

          - `url: string`

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

        - `"in_progress"`

        - `"searching"`

        - `"completed"`

        - `"failed"`

      - `type: "web_search_call"`

        - `"web_search_call"`

    - `OpenAIResponseComputerToolCall`

      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`

      - `action: ActionClick | ActionDoubleClick | ActionDrag | 6 more`

        A click action.

        - `ActionClick`

          A click action.

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

            - `"left"`

            - `"right"`

            - `"wheel"`

            - `"back"`

            - `"forward"`

          - `type: "click"`

            - `"click"`

          - `x: number`

          - `y: number`

        - `ActionDoubleClick`

          A double click action.

          - `type: "double_click"`

            - `"double_click"`

          - `x: number`

          - `y: number`

        - `ActionDrag`

          A drag action.

          - `path: Array<Path>`

            - `x: number`

            - `y: number`

          - `type: "drag"`

            - `"drag"`

        - `ActionKeypress`

          A collection of keypresses the model would like to perform.

          - `keys: Array<string>`

          - `type: "keypress"`

            - `"keypress"`

        - `ActionMove`

          A mouse move action.

          - `type: "move"`

            - `"move"`

          - `x: number`

          - `y: number`

        - `ActionScreenshot`

          A screenshot action.

          - `type: "screenshot"`

            - `"screenshot"`

        - `ActionScroll`

          A scroll action.

          - `scroll_x: number`

          - `scroll_y: number`

          - `type: "scroll"`

            - `"scroll"`

          - `x: number`

          - `y: number`

        - `ActionType`

          An action to type in text.

          - `text: string`

          - `type: "type"`

            - `"type"`

        - `ActionWait`

          A wait action.

          - `type: "wait"`

            - `"wait"`

      - `call_id: string`

      - `pending_safety_checks: Array<PendingSafetyCheck>`

        - `id: string`

        - `code?: string`

        - `message?: string`

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

        - `"in_progress"`

        - `"completed"`

        - `"incomplete"`

      - `type: "computer_call"`

        - `"computer_call"`

    - `OpenAIResponseReasoningItem`

      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`

      - `summary: Array<Summary>`

        - `text: string`

        - `type: "summary_text"`

          - `"summary_text"`

      - `type: "reasoning"`

        - `"reasoning"`

      - `content?: Array<Content>`

        - `text: string`

        - `type: "reasoning_text"`

          - `"reasoning_text"`

      - `encrypted_content?: string`

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

        - `"in_progress"`

        - `"completed"`

        - `"incomplete"`

    - `ResponseCompactionItem`

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

      - `id: string`

      - `encrypted_content: string`

      - `type: "compaction"`

        - `"compaction"`

      - `created_by?: string`

    - `OpenAITypesResponsesResponseOutputItemImageGenerationCall`

      An image generation request made by the model.

      - `id: string`

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

        - `"in_progress"`

        - `"completed"`

        - `"generating"`

        - `"failed"`

      - `type: "image_generation_call"`

        - `"image_generation_call"`

      - `result?: string`

    - `OpenAIResponseCodeInterpreterToolCall`

      A tool call to run code.

      - `id: string`

      - `container_id: string`

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

        - `"in_progress"`

        - `"completed"`

        - `"incomplete"`

        - `"interpreting"`

        - `"failed"`

      - `type: "code_interpreter_call"`

        - `"code_interpreter_call"`

      - `code?: string`

      - `outputs?: Array<OutputLogs | OutputImage>`

        - `OutputLogs`

          The logs output from the code interpreter.

          - `logs: string`

          - `type: "logs"`

            - `"logs"`

        - `OutputImage`

          The image output from the code interpreter.

          - `type: "image"`

            - `"image"`

          - `url: string`

    - `OpenAITypesResponsesResponseOutputItemLocalShellCall`

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

      - `id: string`

      - `action: Action`

        Execute a shell command on the server.

        - `command: Array<string>`

        - `env: Record<string, string>`

        - `type: "exec"`

          - `"exec"`

        - `timeout_ms?: number`

        - `user?: string`

        - `working_directory?: string`

      - `call_id: string`

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

        - `"in_progress"`

        - `"completed"`

        - `"incomplete"`

      - `type: "local_shell_call"`

        - `"local_shell_call"`

    - `ResponseFunctionShellToolCall`

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

      - `id: string`

      - `action: Action`

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

        - `commands: Array<string>`

        - `max_output_length?: number`

        - `timeout_ms?: number`

      - `call_id: string`

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

        - `"in_progress"`

        - `"completed"`

        - `"incomplete"`

      - `type: "shell_call"`

        - `"shell_call"`

      - `created_by?: string`

      - `environment?: ResponseLocalEnvironment | ResponseContainerReference`

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

        - `ResponseLocalEnvironment`

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

          - `type: "local"`

            - `"local"`

        - `ResponseContainerReference`

          Represents a container created with /v1/containers.

          - `container_id: string`

          - `type: "container_reference"`

            - `"container_reference"`

    - `ResponseFunctionShellToolCallOutput`

      The output of a shell tool call that was emitted.

      - `id: string`

      - `call_id: string`

      - `output: Array<Output>`

        - `outcome: OutputOutcomeTimeout | OutputOutcomeExit`

          Indicates that the shell call exceeded its configured time limit.

          - `OutputOutcomeTimeout`

            Indicates that the shell call exceeded its configured time limit.

            - `type: "timeout"`

              - `"timeout"`

          - `OutputOutcomeExit`

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

            - `exit_code: number`

            - `type: "exit"`

              - `"exit"`

        - `stderr: string`

        - `stdout: string`

        - `created_by?: string`

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

        - `"in_progress"`

        - `"completed"`

        - `"incomplete"`

      - `type: "shell_call_output"`

        - `"shell_call_output"`

      - `created_by?: string`

      - `max_output_length?: number`

    - `ResponseApplyPatchToolCall`

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

      - `id: string`

      - `call_id: string`

      - `operation: OperationCreateFile | OperationDeleteFile | OperationUpdateFile`

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

        - `OperationCreateFile`

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

          - `diff: string`

          - `path: string`

          - `type: "create_file"`

            - `"create_file"`

        - `OperationDeleteFile`

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

          - `path: string`

          - `type: "delete_file"`

            - `"delete_file"`

        - `OperationUpdateFile`

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

          - `diff: string`

          - `path: string`

          - `type: "update_file"`

            - `"update_file"`

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

        - `"in_progress"`

        - `"completed"`

      - `type: "apply_patch_call"`

        - `"apply_patch_call"`

      - `created_by?: string`

    - `ResponseApplyPatchToolCallOutput`

      The output emitted by an apply patch tool call.

      - `id: string`

      - `call_id: string`

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

        - `"completed"`

        - `"failed"`

      - `type: "apply_patch_call_output"`

        - `"apply_patch_call_output"`

      - `created_by?: string`

      - `output?: string`

    - `OpenAITypesResponsesResponseOutputItemMcpCall`

      An invocation of a tool on an MCP server.

      - `id: string`

      - `arguments: string`

      - `name: string`

      - `server_label: string`

      - `type: "mcp_call"`

        - `"mcp_call"`

      - `approval_request_id?: string`

      - `error?: string`

      - `output?: string`

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

        - `"in_progress"`

        - `"completed"`

        - `"incomplete"`

        - `"calling"`

        - `"failed"`

    - `OpenAITypesResponsesResponseOutputItemMcpListTools`

      A list of tools available on an MCP server.

      - `id: string`

      - `server_label: string`

      - `tools: Array<Tool>`

        - `input_schema: unknown`

        - `name: string`

        - `annotations?: unknown`

        - `description?: string`

      - `type: "mcp_list_tools"`

        - `"mcp_list_tools"`

      - `error?: string`

    - `McpApprovalRequest`

      A request for human approval of a tool invocation.

      - `id: string`

      - `arguments: string`

      - `name: string`

      - `server_label: string`

      - `type: "mcp_approval_request"`

        - `"mcp_approval_request"`

    - `OpenAIResponseCustomToolCall`

      A call to a custom tool created by the model.

      - `call_id: string`

      - `input: string`

      - `name: string`

      - `type: "custom_tool_call"`

        - `"custom_tool_call"`

      - `id?: string`

  - `parallel_tool_calls: boolean`

  - `tool_choice: "none" | "auto" | "required" | ToolChoiceAllowed | ToolChoiceTypes | 5 more`

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

    - `"none" | "auto" | "required"`

      - `"none"`

      - `"auto"`

      - `"required"`

    - `ToolChoiceAllowed`

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

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

        - `"auto"`

        - `"required"`

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

      - `type: "allowed_tools"`

        - `"allowed_tools"`

    - `ToolChoiceTypes`

      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_use_preview" | 3 more`

        - `"file_search"`

        - `"web_search_preview"`

        - `"computer_use_preview"`

        - `"web_search_preview_2025_03_11"`

        - `"image_generation"`

        - `"code_interpreter"`

    - `ToolChoiceFunction`

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

      - `name: string`

      - `type: "function"`

        - `"function"`

    - `ToolChoiceMcp`

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

      - `server_label: string`

      - `type: "mcp"`

        - `"mcp"`

      - `name?: string`

    - `ToolChoiceCustom`

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

      - `name: string`

      - `type: "custom"`

        - `"custom"`

    - `ToolChoiceApplyPatch`

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

      - `type: "apply_patch"`

        - `"apply_patch"`

    - `ToolChoiceShell`

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

      - `type: "shell"`

        - `"shell"`

  - `tools: Array<FunctionTool | FileSearchTool | ComputerTool | 9 more>`

    - `FunctionTool`

      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`

      - `type: "function"`

        - `"function"`

      - `description?: string`

      - `parameters?: Record<string, unknown>`

      - `strict?: boolean`

    - `FileSearchTool`

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

        - `"file_search"`

      - `vector_store_ids: Array<string>`

      - `filters?: ComparisonFilter | CompoundFilter`

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

        - `ComparisonFilter`

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

          - `key: string`

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

            - `"eq"`

            - `"ne"`

            - `"gt"`

            - `"gte"`

            - `"lt"`

            - `"lte"`

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

            - `string`

            - `number`

            - `boolean`

            - `Array<string | number>`

              - `string`

              - `number`

        - `CompoundFilter`

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

          - `filters: Array<ComparisonFilter | unknown>`

            - `ComparisonFilter`

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

              - `key: string`

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

                - `"eq"`

                - `"ne"`

                - `"gt"`

                - `"gte"`

                - `"lt"`

                - `"lte"`

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

                - `string`

                - `number`

                - `boolean`

                - `Array<string | number>`

                  - `string`

                  - `number`

            - `unknown`

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

            - `"and"`

            - `"or"`

      - `max_num_results?: number`

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

          - `text_weight: number`

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

          - `"auto"`

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

        - `score_threshold?: number`

    - `ComputerTool`

      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`

      - `display_width: number`

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

        - `"windows"`

        - `"mac"`

        - `"linux"`

        - `"ubuntu"`

        - `"browser"`

      - `type: "computer_use_preview"`

        - `"computer_use_preview"`

    - `WebSearchTool`

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

        - `"web_search"`

        - `"web_search_2025_08_26"`

      - `filters?: Filters`

        Filters for the search.

        - `allowed_domains?: Array<string>`

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

        - `"low"`

        - `"medium"`

        - `"high"`

      - `user_location?: UserLocation`

        The approximate location of the user.

        - `city?: string`

        - `country?: string`

        - `region?: string`

        - `timezone?: string`

        - `type?: "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`

      - `type: "mcp"`

        - `"mcp"`

      - `allowed_tools?: Array<string> | McpAllowedToolsMcpToolFilter`

        A filter object to specify which tools are allowed.

        - `Array<string>`

        - `McpAllowedToolsMcpToolFilter`

          A filter object to specify which tools are allowed.

          - `read_only?: boolean`

          - `tool_names?: Array<string>`

      - `authorization?: string`

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

        - `"connector_dropbox"`

        - `"connector_gmail"`

        - `"connector_googlecalendar"`

        - `"connector_googledrive"`

        - `"connector_microsoftteams"`

        - `"connector_outlookcalendar"`

        - `"connector_outlookemail"`

        - `"connector_sharepoint"`

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

      - `require_approval?: McpRequireApprovalMcpToolApprovalFilter | "always" | "never"`

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

        Can be
        `always`, `never`, or a filter object associated with tools
        that require approval.

        - `McpRequireApprovalMcpToolApprovalFilter`

          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`

            - `tool_names?: Array<string>`

          - `never?: Never`

            A filter object to specify which tools are allowed.

            - `read_only?: boolean`

            - `tool_names?: Array<string>`

        - `"always" | "never"`

          - `"always"`

          - `"never"`

      - `server_description?: string`

      - `server_url?: string`

    - `CodeInterpreter`

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

      - `container: string | CodeInterpreterContainerCodeInterpreterToolAuto`

        Configuration for a code interpreter container.

        Optionally specify the IDs of the files to run the code on.

        - `string`

        - `CodeInterpreterContainerCodeInterpreterToolAuto`

          Configuration for a code interpreter container.

          Optionally specify the IDs of the files to run the code on.

          - `type: "auto"`

            - `"auto"`

          - `file_ids?: Array<string>`

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

            - `"1g"`

            - `"4g"`

            - `"16g"`

            - `"64g"`

          - `network_policy?: ContainerNetworkPolicyDisabled | ContainerNetworkPolicyAllowlist`

            - `ContainerNetworkPolicyDisabled`

              - `type: "disabled"`

                - `"disabled"`

            - `ContainerNetworkPolicyAllowlist`

              - `allowed_domains: Array<string>`

              - `type: "allowlist"`

                - `"allowlist"`

              - `domain_secrets?: Array<DomainSecret>`

                - `domain: string`

                - `name: string`

                - `value: string`

      - `type: "code_interpreter"`

        - `"code_interpreter"`

    - `ImageGeneration`

      A tool that generates images using the GPT image models.

      - `type: "image_generation"`

        - `"image_generation"`

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

        - `"generate"`

        - `"edit"`

        - `"auto"`

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

        - `"transparent"`

        - `"opaque"`

        - `"auto"`

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

        - `"high"`

        - `"low"`

      - `input_image_mask?: InputImageMask`

        Optional mask for inpainting.

        Contains `image_url`
        (string, optional) and `file_id` (string, optional).

        - `file_id?: string`

        - `image_url?: string`

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

        - `(string & {})`

        - `"gpt-image-1" | "gpt-image-1-mini" | "gpt-image-1.5"`

          - `"gpt-image-1"`

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

          - `"gpt-image-1.5"`

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

        - `"auto"`

        - `"low"`

      - `output_compression?: number`

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

        - `"png"`

        - `"webp"`

        - `"jpeg"`

      - `partial_images?: number`

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

        - `"low"`

        - `"medium"`

        - `"high"`

        - `"auto"`

      - `size?: "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"`

        - `"local_shell"`

    - `FunctionShellTool`

      A tool that allows the model to execute shell commands.

      - `type: "shell"`

        - `"shell"`

      - `environment?: ContainerAuto | LocalEnvironment | ContainerReference`

        - `ContainerAuto`

          - `type: "container_auto"`

            - `"container_auto"`

          - `file_ids?: Array<string>`

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

            - `"1g"`

            - `"4g"`

            - `"16g"`

            - `"64g"`

          - `network_policy?: ContainerNetworkPolicyDisabled | ContainerNetworkPolicyAllowlist`

            - `ContainerNetworkPolicyDisabled`

            - `ContainerNetworkPolicyAllowlist`

          - `skills?: Array<SkillReference | InlineSkill>`

            - `SkillReference`

              - `skill_id: string`

              - `type: "skill_reference"`

                - `"skill_reference"`

              - `version?: string`

            - `InlineSkill`

              - `description: string`

              - `name: string`

              - `source: Source`

                Inline skill payload

                - `data: string`

                - `media_type: "application/zip"`

                  - `"application/zip"`

                - `type: "base64"`

                  - `"base64"`

              - `type: "inline"`

                - `"inline"`

        - `LocalEnvironment`

          - `type: "local"`

            - `"local"`

          - `skills?: Array<Skill>`

            - `description: string`

            - `name: string`

            - `path: string`

        - `ContainerReference`

          - `container_id: string`

          - `type: "container_reference"`

            - `"container_reference"`

    - `CustomTool`

      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`

      - `type: "custom"`

        - `"custom"`

      - `description?: string`

      - `format?: Text | Grammar`

        Unconstrained free-form text.

        - `Text`

          Unconstrained free-form text.

          - `type: "text"`

            - `"text"`

        - `Grammar`

          A grammar defined by the user.

          - `definition: string`

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

            - `"lark"`

            - `"regex"`

          - `type: "grammar"`

            - `"grammar"`

    - `WebSearchPreviewTool`

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

        - `"web_search_preview"`

        - `"web_search_preview_2025_03_11"`

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

        - `"low"`

        - `"medium"`

        - `"high"`

      - `user_location?: UserLocation`

        The user's location.

        - `type: "approximate"`

          - `"approximate"`

        - `city?: string`

        - `country?: string`

        - `region?: string`

        - `timezone?: string`

    - `ApplyPatchTool`

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

      - `type: "apply_patch"`

        - `"apply_patch"`

  - `background?: boolean`

  - `completed_at?: number`

  - `conversation?: Conversation`

    The conversation that this response belonged to.

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

    - `id: string`

  - `error?: OpenAIResponseError`

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

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

      - `"server_error"`

      - `"rate_limit_exceeded"`

      - `"invalid_prompt"`

      - `"vector_store_timeout"`

      - `"invalid_image"`

      - `"invalid_image_format"`

      - `"invalid_base64_image"`

      - `"invalid_image_url"`

      - `"image_too_large"`

      - `"image_too_small"`

      - `"image_parse_error"`

      - `"image_content_policy_violation"`

      - `"invalid_image_mode"`

      - `"image_file_too_large"`

      - `"unsupported_image_media_type"`

      - `"empty_image_file"`

      - `"failed_to_download_image"`

      - `"image_file_not_found"`

    - `message: string`

  - `incomplete_details?: IncompleteDetails`

    Details about why the response is incomplete.

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

      - `"max_output_tokens"`

      - `"content_filter"`

  - `instructions?: string | Array<EasyInputMessage | OpenAITypesResponsesResponseInputItemMessage | OpenAIResponseOutputMessage | 23 more>`

    - `string`

    - `Array<EasyInputMessage | OpenAITypesResponsesResponseInputItemMessage | OpenAIResponseOutputMessage | 23 more>`

      - `EasyInputMessage`

        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 | Array<OpenAIResponseInputText | OpenAIResponseInputImage | OpenAIResponseInputFile>`

          - `string`

          - `Array<OpenAIResponseInputText | OpenAIResponseInputImage | OpenAIResponseInputFile>`

            - `OpenAIResponseInputText`

              A text input to the model.

              - `text: string`

              - `type: "input_text"`

                - `"input_text"`

            - `OpenAIResponseInputImage`

              An image input to the model.

              Learn about [image inputs](https://platform.openai.com/docs/guides/vision).

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

                - `"low"`

                - `"high"`

                - `"auto"`

              - `type: "input_image"`

                - `"input_image"`

              - `file_id?: string`

              - `image_url?: string`

            - `OpenAIResponseInputFile`

              A file input to the model.

              - `type: "input_file"`

                - `"input_file"`

              - `file_data?: string`

              - `file_id?: string`

              - `file_url?: string`

              - `filename?: string`

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

          - `"user"`

          - `"assistant"`

          - `"system"`

          - `"developer"`

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

          - `"commentary"`

          - `"final_answer"`

        - `type?: "message"`

          - `"message"`

      - `OpenAITypesResponsesResponseInputItemMessage`

        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: Array<OpenAIResponseInputText | OpenAIResponseInputImage | OpenAIResponseInputFile>`

          - `OpenAIResponseInputText`

            A text input to the model.

          - `OpenAIResponseInputImage`

            An image input to the model.

            Learn about [image inputs](https://platform.openai.com/docs/guides/vision).

          - `OpenAIResponseInputFile`

            A file input to the model.

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

          - `"user"`

          - `"system"`

          - `"developer"`

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

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

        - `type?: "message"`

          - `"message"`

      - `OpenAIResponseOutputMessage`

        An output message from the model.

      - `OpenAIResponseFileSearchToolCall`

        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.

      - `OpenAIResponseComputerToolCall`

        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.

      - `OpenAITypesResponsesResponseInputItemComputerCallOutput`

        The output of a computer tool call.

        - `call_id: string`

        - `output: ResponseComputerToolCallOutputScreenshot`

          A computer screenshot image used with the computer use tool.

          - `type: "computer_screenshot"`

            - `"computer_screenshot"`

          - `file_id?: string`

          - `image_url?: string`

        - `type: "computer_call_output"`

          - `"computer_call_output"`

        - `id?: string`

        - `acknowledged_safety_checks?: Array<AcknowledgedSafetyCheck>`

          - `id: string`

          - `code?: string`

          - `message?: string`

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

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

      - `OpenAIResponseFunctionWebSearch`

        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.

      - `OpenAIResponseFunctionToolCall`

        A tool call to run a function.

        See the
        [function calling guide](https://platform.openai.com/docs/guides/function-calling) for more information.

      - `OpenAITypesResponsesResponseInputItemFunctionCallOutput`

        The output of a function tool call.

        - `call_id: string`

        - `output: string | Array<ResponseInputTextContent | ResponseInputImageContent | ResponseInputFileContent>`

          - `string`

          - `Array<ResponseInputTextContent | ResponseInputImageContent | ResponseInputFileContent>`

            - `ResponseInputTextContent`

              A text input to the model.

              - `text: string`

              - `type: "input_text"`

                - `"input_text"`

            - `ResponseInputImageContent`

              An image input to the model.

              Learn about [image inputs](https://platform.openai.com/docs/guides/vision)

              - `type: "input_image"`

                - `"input_image"`

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

                - `"low"`

                - `"high"`

                - `"auto"`

              - `file_id?: string`

              - `image_url?: string`

            - `ResponseInputFileContent`

              A file input to the model.

              - `type: "input_file"`

                - `"input_file"`

              - `file_data?: string`

              - `file_id?: string`

              - `file_url?: string`

              - `filename?: string`

        - `type: "function_call_output"`

          - `"function_call_output"`

        - `id?: string`

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

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

      - `OpenAIResponseReasoningItem`

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

      - `ResponseCompactionItemParam`

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

        - `encrypted_content: string`

        - `type: "compaction"`

          - `"compaction"`

        - `id?: string`

      - `OpenAITypesResponsesResponseInputItemImageGenerationCall`

        An image generation request made by the model.

        - `id: string`

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

          - `"in_progress"`

          - `"completed"`

          - `"generating"`

          - `"failed"`

        - `type: "image_generation_call"`

          - `"image_generation_call"`

        - `result?: string`

      - `OpenAIResponseCodeInterpreterToolCall`

        A tool call to run code.

      - `OpenAITypesResponsesResponseInputItemLocalShellCall`

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

        - `id: string`

        - `action: Action`

          Execute a shell command on the server.

          - `command: Array<string>`

          - `env: Record<string, string>`

          - `type: "exec"`

            - `"exec"`

          - `timeout_ms?: number`

          - `user?: string`

          - `working_directory?: string`

        - `call_id: string`

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

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

        - `type: "local_shell_call"`

          - `"local_shell_call"`

      - `OpenAITypesResponsesResponseInputItemLocalShellCallOutput`

        The output of a local shell tool call.

        - `id: string`

        - `output: string`

        - `type: "local_shell_call_output"`

          - `"local_shell_call_output"`

        - `status?: "in_progress" | "completed" | "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>`

          - `max_output_length?: number`

          - `timeout_ms?: number`

        - `call_id: string`

        - `type: "shell_call"`

          - `"shell_call"`

        - `id?: string`

        - `environment?: LocalEnvironment | ContainerReference`

          - `LocalEnvironment`

          - `ContainerReference`

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

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

      - `ShellCallOutput`

        The streamed output items emitted by a shell tool call.

        - `call_id: string`

        - `output: Array<Output>`

          - `outcome: OutcomeTimeout | OutcomeExit`

            Indicates that the shell call exceeded its configured time limit.

            - `OutcomeTimeout`

              Indicates that the shell call exceeded its configured time limit.

              - `type: "timeout"`

                - `"timeout"`

            - `OutcomeExit`

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

              - `exit_code: number`

              - `type: "exit"`

                - `"exit"`

          - `stderr: string`

          - `stdout: string`

        - `type: "shell_call_output"`

          - `"shell_call_output"`

        - `id?: string`

        - `max_output_length?: number`

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

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

      - `ApplyPatchCall`

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

        - `call_id: string`

        - `operation: ApplyPatchCallOperationCreateFile | ApplyPatchCallOperationDeleteFile | ApplyPatchCallOperationUpdateFile`

          Instruction for creating a new file via the apply_patch tool.

          - `ApplyPatchCallOperationCreateFile`

            Instruction for creating a new file via the apply_patch tool.

            - `diff: string`

            - `path: string`

            - `type: "create_file"`

              - `"create_file"`

          - `ApplyPatchCallOperationDeleteFile`

            Instruction for deleting an existing file via the apply_patch tool.

            - `path: string`

            - `type: "delete_file"`

              - `"delete_file"`

          - `ApplyPatchCallOperationUpdateFile`

            Instruction for updating an existing file via the apply_patch tool.

            - `diff: string`

            - `path: string`

            - `type: "update_file"`

              - `"update_file"`

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

          - `"in_progress"`

          - `"completed"`

        - `type: "apply_patch_call"`

          - `"apply_patch_call"`

        - `id?: string`

      - `ApplyPatchCallOutput`

        The streamed output emitted by an apply patch tool call.

        - `call_id: string`

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

          - `"completed"`

          - `"failed"`

        - `type: "apply_patch_call_output"`

          - `"apply_patch_call_output"`

        - `id?: string`

        - `output?: string`

      - `OpenAITypesResponsesResponseInputItemMcpListTools`

        A list of tools available on an MCP server.

        - `id: string`

        - `server_label: string`

        - `tools: Array<Tool>`

          - `input_schema: unknown`

          - `name: string`

          - `annotations?: unknown`

          - `description?: string`

        - `type: "mcp_list_tools"`

          - `"mcp_list_tools"`

        - `error?: string`

      - `McpApprovalRequest`

        A request for human approval of a tool invocation.

      - `OpenAITypesResponsesResponseInputItemMcpApprovalResponse`

        A response to an MCP approval request.

        - `approval_request_id: string`

        - `approve: boolean`

        - `type: "mcp_approval_response"`

          - `"mcp_approval_response"`

        - `id?: string`

        - `reason?: string`

      - `OpenAITypesResponsesResponseInputItemMcpCall`

        An invocation of a tool on an MCP server.

        - `id: string`

        - `arguments: string`

        - `name: string`

        - `server_label: string`

        - `type: "mcp_call"`

          - `"mcp_call"`

        - `approval_request_id?: string`

        - `error?: string`

        - `output?: string`

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

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

          - `"calling"`

          - `"failed"`

      - `OpenAIResponseCustomToolCallOutput`

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

        - `call_id: string`

        - `output: string | Array<OpenAIResponseInputText | OpenAIResponseInputImage | OpenAIResponseInputFile>`

          - `string`

          - `Array<OpenAIResponseInputText | OpenAIResponseInputImage | OpenAIResponseInputFile>`

            - `OpenAIResponseInputText`

              A text input to the model.

            - `OpenAIResponseInputImage`

              An image input to the model.

              Learn about [image inputs](https://platform.openai.com/docs/guides/vision).

            - `OpenAIResponseInputFile`

              A file input to the model.

        - `type: "custom_tool_call_output"`

          - `"custom_tool_call_output"`

        - `id?: string`

      - `OpenAIResponseCustomToolCall`

        A call to a custom tool created by the model.

      - `OpenAITypesResponsesResponseInputItemItemReference`

        An internal identifier for an item to reference.

        - `id: string`

        - `type?: "item_reference"`

          - `"item_reference"`

  - `max_output_tokens?: number`

  - `max_tool_calls?: number`

  - `metadata?: Record<string, string>`

  - `previous_response_id?: string`

  - `prompt?: OpenAIResponsePrompt`

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

    - `id: string`

    - `variables?: Record<string, string | OpenAIResponseInputText | OpenAIResponseInputImage | OpenAIResponseInputFile>`

      - `string`

      - `OpenAIResponseInputText`

        A text input to the model.

      - `OpenAIResponseInputImage`

        An image input to the model.

        Learn about [image inputs](https://platform.openai.com/docs/guides/vision).

      - `OpenAIResponseInputFile`

        A file input to the model.

    - `version?: string`

  - `prompt_cache_key?: string`

  - `prompt_cache_retention?: "in-memory" | "24h"`

    - `"in-memory"`

    - `"24h"`

  - `reasoning?: Reasoning`

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

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

    - `effort?: "none" | "minimal" | "low" | 3 more`

      - `"none"`

      - `"minimal"`

      - `"low"`

      - `"medium"`

      - `"high"`

      - `"xhigh"`

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

      - `"auto"`

      - `"concise"`

      - `"detailed"`

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

      - `"auto"`

      - `"concise"`

      - `"detailed"`

  - `safety_identifier?: string`

  - `service_tier?: "auto" | "default" | "flex" | 2 more`

    - `"auto"`

    - `"default"`

    - `"flex"`

    - `"scale"`

    - `"priority"`

  - `status?: "completed" | "failed" | "in_progress" | 3 more`

    - `"completed"`

    - `"failed"`

    - `"in_progress"`

    - `"cancelled"`

    - `"queued"`

    - `"incomplete"`

  - `temperature?: number`

  - `text?: OpenAIResponseTextConfig`

    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?: ResponseFormatText | ResponseFormatTextJsonSchemaConfig | ResponseFormatJsonObject`

      Default response format. Used to generate text responses.

      - `ResponseFormatText`

        Default response format. Used to generate text responses.

        - `type: "text"`

          - `"text"`

      - `ResponseFormatTextJsonSchemaConfig`

        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`

        - `schema: Record<string, unknown>`

        - `type: "json_schema"`

          - `"json_schema"`

        - `description?: string`

        - `strict?: boolean`

      - `ResponseFormatJsonObject`

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

          - `"json_object"`

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

      - `"low"`

      - `"medium"`

      - `"high"`

  - `top_logprobs?: number`

  - `top_p?: number`

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

    - `"auto"`

    - `"disabled"`

  - `usage?: OpenAIResponseUsage`

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

    - `input_tokens: number`

    - `input_tokens_details: InputTokensDetails`

      A detailed breakdown of the input tokens.

      - `cached_tokens: number`

    - `output_tokens: number`

    - `output_tokens_details: OutputTokensDetails`

      A detailed breakdown of the output tokens.

      - `reasoning_tokens: number`

    - `total_tokens: number`

  - `user?: string`

### OpenAI Response Code Interpreter Tool Call

- `OpenAIResponseCodeInterpreterToolCall`

  A tool call to run code.

  - `id: string`

  - `container_id: string`

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

    - `"in_progress"`

    - `"completed"`

    - `"incomplete"`

    - `"interpreting"`

    - `"failed"`

  - `type: "code_interpreter_call"`

    - `"code_interpreter_call"`

  - `code?: string`

  - `outputs?: Array<OutputLogs | OutputImage>`

    - `OutputLogs`

      The logs output from the code interpreter.

      - `logs: string`

      - `type: "logs"`

        - `"logs"`

    - `OutputImage`

      The image output from the code interpreter.

      - `type: "image"`

        - `"image"`

      - `url: string`

### OpenAI Response Computer Tool Call

- `OpenAIResponseComputerToolCall`

  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`

  - `action: ActionClick | ActionDoubleClick | ActionDrag | 6 more`

    A click action.

    - `ActionClick`

      A click action.

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

        - `"left"`

        - `"right"`

        - `"wheel"`

        - `"back"`

        - `"forward"`

      - `type: "click"`

        - `"click"`

      - `x: number`

      - `y: number`

    - `ActionDoubleClick`

      A double click action.

      - `type: "double_click"`

        - `"double_click"`

      - `x: number`

      - `y: number`

    - `ActionDrag`

      A drag action.

      - `path: Array<Path>`

        - `x: number`

        - `y: number`

      - `type: "drag"`

        - `"drag"`

    - `ActionKeypress`

      A collection of keypresses the model would like to perform.

      - `keys: Array<string>`

      - `type: "keypress"`

        - `"keypress"`

    - `ActionMove`

      A mouse move action.

      - `type: "move"`

        - `"move"`

      - `x: number`

      - `y: number`

    - `ActionScreenshot`

      A screenshot action.

      - `type: "screenshot"`

        - `"screenshot"`

    - `ActionScroll`

      A scroll action.

      - `scroll_x: number`

      - `scroll_y: number`

      - `type: "scroll"`

        - `"scroll"`

      - `x: number`

      - `y: number`

    - `ActionType`

      An action to type in text.

      - `text: string`

      - `type: "type"`

        - `"type"`

    - `ActionWait`

      A wait action.

      - `type: "wait"`

        - `"wait"`

  - `call_id: string`

  - `pending_safety_checks: Array<PendingSafetyCheck>`

    - `id: string`

    - `code?: string`

    - `message?: string`

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

    - `"in_progress"`

    - `"completed"`

    - `"incomplete"`

  - `type: "computer_call"`

    - `"computer_call"`

### OpenAI Response Custom Tool Call

- `OpenAIResponseCustomToolCall`

  A call to a custom tool created by the model.

  - `call_id: string`

  - `input: string`

  - `name: string`

  - `type: "custom_tool_call"`

    - `"custom_tool_call"`

  - `id?: string`

### OpenAI Response Custom Tool Call Output

- `OpenAIResponseCustomToolCallOutput`

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

  - `call_id: string`

  - `output: string | Array<OpenAIResponseInputText | OpenAIResponseInputImage | OpenAIResponseInputFile>`

    - `string`

    - `Array<OpenAIResponseInputText | OpenAIResponseInputImage | OpenAIResponseInputFile>`

      - `OpenAIResponseInputText`

        A text input to the model.

        - `text: string`

        - `type: "input_text"`

          - `"input_text"`

      - `OpenAIResponseInputImage`

        An image input to the model.

        Learn about [image inputs](https://platform.openai.com/docs/guides/vision).

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

          - `"low"`

          - `"high"`

          - `"auto"`

        - `type: "input_image"`

          - `"input_image"`

        - `file_id?: string`

        - `image_url?: string`

      - `OpenAIResponseInputFile`

        A file input to the model.

        - `type: "input_file"`

          - `"input_file"`

        - `file_data?: string`

        - `file_id?: string`

        - `file_url?: string`

        - `filename?: string`

  - `type: "custom_tool_call_output"`

    - `"custom_tool_call_output"`

  - `id?: string`

### OpenAI Response Error

- `OpenAIResponseError`

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

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

    - `"server_error"`

    - `"rate_limit_exceeded"`

    - `"invalid_prompt"`

    - `"vector_store_timeout"`

    - `"invalid_image"`

    - `"invalid_image_format"`

    - `"invalid_base64_image"`

    - `"invalid_image_url"`

    - `"image_too_large"`

    - `"image_too_small"`

    - `"image_parse_error"`

    - `"image_content_policy_violation"`

    - `"invalid_image_mode"`

    - `"image_file_too_large"`

    - `"unsupported_image_media_type"`

    - `"empty_image_file"`

    - `"failed_to_download_image"`

    - `"image_file_not_found"`

  - `message: string`

### OpenAI Response File Search Tool Call

- `OpenAIResponseFileSearchToolCall`

  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`

  - `queries: Array<string>`

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

    - `"in_progress"`

    - `"searching"`

    - `"completed"`

    - `"incomplete"`

    - `"failed"`

  - `type: "file_search_call"`

    - `"file_search_call"`

  - `results?: Array<Result>`

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

      - `string`

      - `number`

      - `boolean`

    - `file_id?: string`

    - `filename?: string`

    - `score?: number`

    - `text?: string`

### OpenAI Response Function Tool Call

- `OpenAIResponseFunctionToolCall`

  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`

  - `call_id: string`

  - `name: string`

  - `type: "function_call"`

    - `"function_call"`

  - `id?: string`

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

    - `"in_progress"`

    - `"completed"`

    - `"incomplete"`

### OpenAI Response Function Web Search

- `OpenAIResponseFunctionWebSearch`

  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`

  - `action: OpenAITypesResponsesResponseFunctionWebSearchActionSearch | OpenAITypesResponsesResponseFunctionWebSearchActionOpenPage | ActionFind`

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

    - `OpenAITypesResponsesResponseFunctionWebSearchActionSearch`

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

      - `query: string`

      - `type: "search"`

        - `"search"`

      - `queries?: Array<string>`

      - `sources?: Array<Source>`

        - `type: "url"`

          - `"url"`

        - `url: string`

    - `OpenAITypesResponsesResponseFunctionWebSearchActionOpenPage`

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

      - `type: "open_page"`

        - `"open_page"`

      - `url?: string`

    - `ActionFind`

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

      - `pattern: string`

      - `type: "find_in_page"`

        - `"find_in_page"`

      - `url: string`

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

    - `"in_progress"`

    - `"searching"`

    - `"completed"`

    - `"failed"`

  - `type: "web_search_call"`

    - `"web_search_call"`

### OpenAI Response Input File

- `OpenAIResponseInputFile`

  A file input to the model.

  - `type: "input_file"`

    - `"input_file"`

  - `file_data?: string`

  - `file_id?: string`

  - `file_url?: string`

  - `filename?: string`

### OpenAI Response Input File Param

- `OpenAIResponseInputFileParam`

  A file input to the model.

  - `type: "input_file"`

    - `"input_file"`

  - `file_data?: string`

  - `file_id?: string`

  - `file_url?: string`

  - `filename?: string`

### OpenAI Response Input Image

- `OpenAIResponseInputImage`

  An image input to the model.

  Learn about [image inputs](https://platform.openai.com/docs/guides/vision).

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

    - `"low"`

    - `"high"`

    - `"auto"`

  - `type: "input_image"`

    - `"input_image"`

  - `file_id?: string`

  - `image_url?: string`

### OpenAI Response Input Image Param

- `OpenAIResponseInputImageParam`

  An image input to the model.

  Learn about [image inputs](https://platform.openai.com/docs/guides/vision).

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

    - `"low"`

    - `"high"`

    - `"auto"`

  - `type: "input_image"`

    - `"input_image"`

  - `file_id?: string`

  - `image_url?: string`

### OpenAI Response Input Text

- `OpenAIResponseInputText`

  A text input to the model.

  - `text: string`

  - `type: "input_text"`

    - `"input_text"`

### OpenAI Response Input Text Param

- `OpenAIResponseInputTextParam`

  A text input to the model.

  - `text: string`

  - `type: "input_text"`

    - `"input_text"`

### OpenAI Response Output Message

- `OpenAIResponseOutputMessage`

  An output message from the model.

  - `id: string`

  - `content: Array<OpenAIResponseOutputText | OpenAIResponseOutputRefusal>`

    - `OpenAIResponseOutputText`

      A text output from the model.

      - `annotations: Array<AnnotationFileCitation | OpenAITypesResponsesResponseOutputTextAnnotationURLCitation | AnnotationContainerFileCitation | AnnotationFilePath>`

        - `AnnotationFileCitation`

          A citation to a file.

          - `file_id: string`

          - `filename: string`

          - `index: number`

          - `type: "file_citation"`

            - `"file_citation"`

        - `OpenAITypesResponsesResponseOutputTextAnnotationURLCitation`

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

          - `end_index: number`

          - `start_index: number`

          - `title: string`

          - `type: "url_citation"`

            - `"url_citation"`

          - `url: string`

        - `AnnotationContainerFileCitation`

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

          - `container_id: string`

          - `end_index: number`

          - `file_id: string`

          - `filename: string`

          - `start_index: number`

          - `type: "container_file_citation"`

            - `"container_file_citation"`

        - `AnnotationFilePath`

          A path to a file.

          - `file_id: string`

          - `index: number`

          - `type: "file_path"`

            - `"file_path"`

      - `text: string`

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

    - `OpenAIResponseOutputRefusal`

      A refusal from the model.

      - `refusal: string`

      - `type: "refusal"`

        - `"refusal"`

  - `role: "assistant"`

    - `"assistant"`

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

    - `"in_progress"`

    - `"completed"`

    - `"incomplete"`

  - `type: "message"`

    - `"message"`

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

    - `"commentary"`

    - `"final_answer"`

### OpenAI Response Output Refusal

- `OpenAIResponseOutputRefusal`

  A refusal from the model.

  - `refusal: string`

  - `type: "refusal"`

    - `"refusal"`

### OpenAI Response Output Text

- `OpenAIResponseOutputText`

  A text output from the model.

  - `annotations: Array<AnnotationFileCitation | OpenAITypesResponsesResponseOutputTextAnnotationURLCitation | AnnotationContainerFileCitation | AnnotationFilePath>`

    - `AnnotationFileCitation`

      A citation to a file.

      - `file_id: string`

      - `filename: string`

      - `index: number`

      - `type: "file_citation"`

        - `"file_citation"`

    - `OpenAITypesResponsesResponseOutputTextAnnotationURLCitation`

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

      - `end_index: number`

      - `start_index: number`

      - `title: string`

      - `type: "url_citation"`

        - `"url_citation"`

      - `url: string`

    - `AnnotationContainerFileCitation`

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

      - `container_id: string`

      - `end_index: number`

      - `file_id: string`

      - `filename: string`

      - `start_index: number`

      - `type: "container_file_citation"`

        - `"container_file_citation"`

    - `AnnotationFilePath`

      A path to a file.

      - `file_id: string`

      - `index: number`

      - `type: "file_path"`

        - `"file_path"`

  - `text: string`

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

### OpenAI Response Prompt

- `OpenAIResponsePrompt`

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

  - `id: string`

  - `variables?: Record<string, string | OpenAIResponseInputText | OpenAIResponseInputImage | OpenAIResponseInputFile>`

    - `string`

    - `OpenAIResponseInputText`

      A text input to the model.

      - `text: string`

      - `type: "input_text"`

        - `"input_text"`

    - `OpenAIResponseInputImage`

      An image input to the model.

      Learn about [image inputs](https://platform.openai.com/docs/guides/vision).

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

        - `"low"`

        - `"high"`

        - `"auto"`

      - `type: "input_image"`

        - `"input_image"`

      - `file_id?: string`

      - `image_url?: string`

    - `OpenAIResponseInputFile`

      A file input to the model.

      - `type: "input_file"`

        - `"input_file"`

      - `file_data?: string`

      - `file_id?: string`

      - `file_url?: string`

      - `filename?: string`

  - `version?: string`

### OpenAI Response Reasoning Item

- `OpenAIResponseReasoningItem`

  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`

  - `summary: Array<Summary>`

    - `text: string`

    - `type: "summary_text"`

      - `"summary_text"`

  - `type: "reasoning"`

    - `"reasoning"`

  - `content?: Array<Content>`

    - `text: string`

    - `type: "reasoning_text"`

      - `"reasoning_text"`

  - `encrypted_content?: string`

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

    - `"in_progress"`

    - `"completed"`

    - `"incomplete"`

### OpenAI Response Text Config

- `OpenAIResponseTextConfig`

  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?: ResponseFormatText | ResponseFormatTextJsonSchemaConfig | ResponseFormatJsonObject`

    Default response format. Used to generate text responses.

    - `ResponseFormatText`

      Default response format. Used to generate text responses.

      - `type: "text"`

        - `"text"`

    - `ResponseFormatTextJsonSchemaConfig`

      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`

      - `schema: Record<string, unknown>`

      - `type: "json_schema"`

        - `"json_schema"`

      - `description?: string`

      - `strict?: boolean`

    - `ResponseFormatJsonObject`

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

        - `"json_object"`

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

    - `"low"`

    - `"medium"`

    - `"high"`

### OpenAI Response Usage

- `OpenAIResponseUsage`

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

  - `input_tokens: number`

  - `input_tokens_details: InputTokensDetails`

    A detailed breakdown of the input tokens.

    - `cached_tokens: number`

  - `output_tokens: number`

  - `output_tokens_details: OutputTokensDetails`

    A detailed breakdown of the output tokens.

    - `reasoning_tokens: number`

  - `total_tokens: number`

### OpenAI Types Responses Response Input Item Computer Call Output

- `OpenAITypesResponsesResponseInputItemComputerCallOutput`

  The output of a computer tool call.

  - `call_id: string`

  - `output: ResponseComputerToolCallOutputScreenshot`

    A computer screenshot image used with the computer use tool.

    - `type: "computer_screenshot"`

      - `"computer_screenshot"`

    - `file_id?: string`

    - `image_url?: string`

  - `type: "computer_call_output"`

    - `"computer_call_output"`

  - `id?: string`

  - `acknowledged_safety_checks?: Array<AcknowledgedSafetyCheck>`

    - `id: string`

    - `code?: string`

    - `message?: string`

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

    - `"in_progress"`

    - `"completed"`

    - `"incomplete"`

### OpenAI Types Responses Response Input Item Function Call Output

- `OpenAITypesResponsesResponseInputItemFunctionCallOutput`

  The output of a function tool call.

  - `call_id: string`

  - `output: string | Array<ResponseInputTextContent | ResponseInputImageContent | ResponseInputFileContent>`

    - `string`

    - `Array<ResponseInputTextContent | ResponseInputImageContent | ResponseInputFileContent>`

      - `ResponseInputTextContent`

        A text input to the model.

        - `text: string`

        - `type: "input_text"`

          - `"input_text"`

      - `ResponseInputImageContent`

        An image input to the model.

        Learn about [image inputs](https://platform.openai.com/docs/guides/vision)

        - `type: "input_image"`

          - `"input_image"`

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

          - `"low"`

          - `"high"`

          - `"auto"`

        - `file_id?: string`

        - `image_url?: string`

      - `ResponseInputFileContent`

        A file input to the model.

        - `type: "input_file"`

          - `"input_file"`

        - `file_data?: string`

        - `file_id?: string`

        - `file_url?: string`

        - `filename?: string`

  - `type: "function_call_output"`

    - `"function_call_output"`

  - `id?: string`

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

    - `"in_progress"`

    - `"completed"`

    - `"incomplete"`

### OpenAI Types Responses Response Input Item Image Generation Call

- `OpenAITypesResponsesResponseInputItemImageGenerationCall`

  An image generation request made by the model.

  - `id: string`

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

    - `"in_progress"`

    - `"completed"`

    - `"generating"`

    - `"failed"`

  - `type: "image_generation_call"`

    - `"image_generation_call"`

  - `result?: string`

### OpenAI Types Responses Response Input Item Item Reference

- `OpenAITypesResponsesResponseInputItemItemReference`

  An internal identifier for an item to reference.

  - `id: string`

  - `type?: "item_reference"`

    - `"item_reference"`

### OpenAI Types Responses Response Input Item Local Shell Call

- `OpenAITypesResponsesResponseInputItemLocalShellCall`

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

  - `id: string`

  - `action: Action`

    Execute a shell command on the server.

    - `command: Array<string>`

    - `env: Record<string, string>`

    - `type: "exec"`

      - `"exec"`

    - `timeout_ms?: number`

    - `user?: string`

    - `working_directory?: string`

  - `call_id: string`

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

    - `"in_progress"`

    - `"completed"`

    - `"incomplete"`

  - `type: "local_shell_call"`

    - `"local_shell_call"`

### OpenAI Types Responses Response Input Item Local Shell Call Output

- `OpenAITypesResponsesResponseInputItemLocalShellCallOutput`

  The output of a local shell tool call.

  - `id: string`

  - `output: string`

  - `type: "local_shell_call_output"`

    - `"local_shell_call_output"`

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

    - `"in_progress"`

    - `"completed"`

    - `"incomplete"`

### OpenAI Types Responses Response Input Item Mcp Approval Response

- `OpenAITypesResponsesResponseInputItemMcpApprovalResponse`

  A response to an MCP approval request.

  - `approval_request_id: string`

  - `approve: boolean`

  - `type: "mcp_approval_response"`

    - `"mcp_approval_response"`

  - `id?: string`

  - `reason?: string`

### OpenAI Types Responses Response Input Item Mcp Call

- `OpenAITypesResponsesResponseInputItemMcpCall`

  An invocation of a tool on an MCP server.

  - `id: string`

  - `arguments: string`

  - `name: string`

  - `server_label: string`

  - `type: "mcp_call"`

    - `"mcp_call"`

  - `approval_request_id?: string`

  - `error?: string`

  - `output?: string`

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

    - `"in_progress"`

    - `"completed"`

    - `"incomplete"`

    - `"calling"`

    - `"failed"`

### OpenAI Types Responses Response Input Item Mcp List Tools

- `OpenAITypesResponsesResponseInputItemMcpListTools`

  A list of tools available on an MCP server.

  - `id: string`

  - `server_label: string`

  - `tools: Array<Tool>`

    - `input_schema: unknown`

    - `name: string`

    - `annotations?: unknown`

    - `description?: string`

  - `type: "mcp_list_tools"`

    - `"mcp_list_tools"`

  - `error?: string`

### OpenAI Types Responses Response Input Item Message

- `OpenAITypesResponsesResponseInputItemMessage`

  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: Array<OpenAIResponseInputText | OpenAIResponseInputImage | OpenAIResponseInputFile>`

    - `OpenAIResponseInputText`

      A text input to the model.

      - `text: string`

      - `type: "input_text"`

        - `"input_text"`

    - `OpenAIResponseInputImage`

      An image input to the model.

      Learn about [image inputs](https://platform.openai.com/docs/guides/vision).

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

        - `"low"`

        - `"high"`

        - `"auto"`

      - `type: "input_image"`

        - `"input_image"`

      - `file_id?: string`

      - `image_url?: string`

    - `OpenAIResponseInputFile`

      A file input to the model.

      - `type: "input_file"`

        - `"input_file"`

      - `file_data?: string`

      - `file_id?: string`

      - `file_url?: string`

      - `filename?: string`

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

    - `"user"`

    - `"system"`

    - `"developer"`

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

    - `"in_progress"`

    - `"completed"`

    - `"incomplete"`

  - `type?: "message"`

    - `"message"`

### OpenAI Types Responses Response Output Item Image Generation Call

- `OpenAITypesResponsesResponseOutputItemImageGenerationCall`

  An image generation request made by the model.

  - `id: string`

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

    - `"in_progress"`

    - `"completed"`

    - `"generating"`

    - `"failed"`

  - `type: "image_generation_call"`

    - `"image_generation_call"`

  - `result?: string`

### OpenAI Types Responses Response Output Item Local Shell Call

- `OpenAITypesResponsesResponseOutputItemLocalShellCall`

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

  - `id: string`

  - `action: Action`

    Execute a shell command on the server.

    - `command: Array<string>`

    - `env: Record<string, string>`

    - `type: "exec"`

      - `"exec"`

    - `timeout_ms?: number`

    - `user?: string`

    - `working_directory?: string`

  - `call_id: string`

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

    - `"in_progress"`

    - `"completed"`

    - `"incomplete"`

  - `type: "local_shell_call"`

    - `"local_shell_call"`

### OpenAI Types Responses Response Output Item Mcp Call

- `OpenAITypesResponsesResponseOutputItemMcpCall`

  An invocation of a tool on an MCP server.

  - `id: string`

  - `arguments: string`

  - `name: string`

  - `server_label: string`

  - `type: "mcp_call"`

    - `"mcp_call"`

  - `approval_request_id?: string`

  - `error?: string`

  - `output?: string`

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

    - `"in_progress"`

    - `"completed"`

    - `"incomplete"`

    - `"calling"`

    - `"failed"`

### OpenAI Types Responses Response Output Item Mcp List Tools

- `OpenAITypesResponsesResponseOutputItemMcpListTools`

  A list of tools available on an MCP server.

  - `id: string`

  - `server_label: string`

  - `tools: Array<Tool>`

    - `input_schema: unknown`

    - `name: string`

    - `annotations?: unknown`

    - `description?: string`

  - `type: "mcp_list_tools"`

    - `"mcp_list_tools"`

  - `error?: string`

### Part Reasoning Text

- `PartReasoningText`

  Reasoning text from the model.

  - `text: string`

  - `type: "reasoning_text"`

    - `"reasoning_text"`

### Reasoning

- `Reasoning`

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

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

  - `effort?: "none" | "minimal" | "low" | 3 more`

    - `"none"`

    - `"minimal"`

    - `"low"`

    - `"medium"`

    - `"high"`

    - `"xhigh"`

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

    - `"auto"`

    - `"concise"`

    - `"detailed"`

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

    - `"auto"`

    - `"concise"`

    - `"detailed"`

### Response Apply Patch Tool Call

- `ResponseApplyPatchToolCall`

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

  - `id: string`

  - `call_id: string`

  - `operation: OperationCreateFile | OperationDeleteFile | OperationUpdateFile`

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

    - `OperationCreateFile`

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

      - `diff: string`

      - `path: string`

      - `type: "create_file"`

        - `"create_file"`

    - `OperationDeleteFile`

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

      - `path: string`

      - `type: "delete_file"`

        - `"delete_file"`

    - `OperationUpdateFile`

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

      - `diff: string`

      - `path: string`

      - `type: "update_file"`

        - `"update_file"`

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

    - `"in_progress"`

    - `"completed"`

  - `type: "apply_patch_call"`

    - `"apply_patch_call"`

  - `created_by?: string`

### Response Apply Patch Tool Call Output

- `ResponseApplyPatchToolCallOutput`

  The output emitted by an apply patch tool call.

  - `id: string`

  - `call_id: string`

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

    - `"completed"`

    - `"failed"`

  - `type: "apply_patch_call_output"`

    - `"apply_patch_call_output"`

  - `created_by?: string`

  - `output?: string`

### Response Compaction Item

- `ResponseCompactionItem`

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

  - `id: string`

  - `encrypted_content: string`

  - `type: "compaction"`

    - `"compaction"`

  - `created_by?: string`

### Response Compaction Item Param

- `ResponseCompactionItemParam`

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

  - `encrypted_content: string`

  - `type: "compaction"`

    - `"compaction"`

  - `id?: string`

### Response Computer Tool Call Output Screenshot

- `ResponseComputerToolCallOutputScreenshot`

  A computer screenshot image used with the computer use tool.

  - `type: "computer_screenshot"`

    - `"computer_screenshot"`

  - `file_id?: string`

  - `image_url?: string`

### Response Function Shell Tool Call

- `ResponseFunctionShellToolCall`

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

  - `id: string`

  - `action: Action`

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

    - `commands: Array<string>`

    - `max_output_length?: number`

    - `timeout_ms?: number`

  - `call_id: string`

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

    - `"in_progress"`

    - `"completed"`

    - `"incomplete"`

  - `type: "shell_call"`

    - `"shell_call"`

  - `created_by?: string`

  - `environment?: ResponseLocalEnvironment | ResponseContainerReference`

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

    - `ResponseLocalEnvironment`

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

      - `type: "local"`

        - `"local"`

    - `ResponseContainerReference`

      Represents a container created with /v1/containers.

      - `container_id: string`

      - `type: "container_reference"`

        - `"container_reference"`

### Response Function Shell Tool Call Output

- `ResponseFunctionShellToolCallOutput`

  The output of a shell tool call that was emitted.

  - `id: string`

  - `call_id: string`

  - `output: Array<Output>`

    - `outcome: OutputOutcomeTimeout | OutputOutcomeExit`

      Indicates that the shell call exceeded its configured time limit.

      - `OutputOutcomeTimeout`

        Indicates that the shell call exceeded its configured time limit.

        - `type: "timeout"`

          - `"timeout"`

      - `OutputOutcomeExit`

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

        - `exit_code: number`

        - `type: "exit"`

          - `"exit"`

    - `stderr: string`

    - `stdout: string`

    - `created_by?: string`

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

    - `"in_progress"`

    - `"completed"`

    - `"incomplete"`

  - `type: "shell_call_output"`

    - `"shell_call_output"`

  - `created_by?: string`

  - `max_output_length?: number`

### Shell Call

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

    - `max_output_length?: number`

    - `timeout_ms?: number`

  - `call_id: string`

  - `type: "shell_call"`

    - `"shell_call"`

  - `id?: string`

  - `environment?: LocalEnvironment | ContainerReference`

    - `LocalEnvironment`

      - `type: "local"`

        - `"local"`

      - `skills?: Array<Skill>`

        - `description: string`

        - `name: string`

        - `path: string`

    - `ContainerReference`

      - `container_id: string`

      - `type: "container_reference"`

        - `"container_reference"`

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

    - `"in_progress"`

    - `"completed"`

    - `"incomplete"`

### Shell Call Output

- `ShellCallOutput`

  The streamed output items emitted by a shell tool call.

  - `call_id: string`

  - `output: Array<Output>`

    - `outcome: OutcomeTimeout | OutcomeExit`

      Indicates that the shell call exceeded its configured time limit.

      - `OutcomeTimeout`

        Indicates that the shell call exceeded its configured time limit.

        - `type: "timeout"`

          - `"timeout"`

      - `OutcomeExit`

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

        - `exit_code: number`

        - `type: "exit"`

          - `"exit"`

    - `stderr: string`

    - `stdout: string`

  - `type: "shell_call_output"`

    - `"shell_call_output"`

  - `id?: string`

  - `max_output_length?: number`

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

    - `"in_progress"`

    - `"completed"`

    - `"incomplete"`

### Tool Choice Allowed

- `ToolChoiceAllowed`

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

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

    - `"auto"`

    - `"required"`

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

  - `type: "allowed_tools"`

    - `"allowed_tools"`

### Tool Choice Apply Patch

- `ToolChoiceApplyPatch`

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

  - `type: "apply_patch"`

    - `"apply_patch"`

### Tool Choice Custom

- `ToolChoiceCustom`

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

  - `name: string`

  - `type: "custom"`

    - `"custom"`

### Tool Choice Function

- `ToolChoiceFunction`

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

  - `name: string`

  - `type: "function"`

    - `"function"`

### Tool Choice Mcp

- `ToolChoiceMcp`

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

  - `server_label: string`

  - `type: "mcp"`

    - `"mcp"`

  - `name?: string`

### Tool Choice Shell

- `ToolChoiceShell`

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

  - `type: "shell"`

    - `"shell"`

### Tool Choice Types

- `ToolChoiceTypes`

  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_use_preview" | 3 more`

    - `"file_search"`

    - `"web_search_preview"`

    - `"computer_use_preview"`

    - `"web_search_preview_2025_03_11"`

    - `"image_generation"`

    - `"code_interpreter"`

### Web Search Preview Tool

- `WebSearchPreviewTool`

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

    - `"web_search_preview"`

    - `"web_search_preview_2025_03_11"`

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

    - `"low"`

    - `"medium"`

    - `"high"`

  - `user_location?: UserLocation`

    The user's location.

    - `type: "approximate"`

      - `"approximate"`

    - `city?: string`

    - `country?: string`

    - `region?: string`

    - `timezone?: string`

### Web Search Tool

- `WebSearchTool`

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

    - `"web_search"`

    - `"web_search_2025_08_26"`

  - `filters?: Filters`

    Filters for the search.

    - `allowed_domains?: Array<string>`

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

    - `"low"`

    - `"medium"`

    - `"high"`

  - `user_location?: UserLocation`

    The approximate location of the user.

    - `city?: string`

    - `country?: string`

    - `region?: string`

    - `timezone?: string`

    - `type?: "approximate"`

      - `"approximate"`

### Response Create Response

- `ResponseCreateResponse = OpenAIResponse | ResponseAudioDeltaEvent | ResponseAudioDoneEvent | 52 more`

  Emitted when there is a partial audio response.

  - `OpenAIResponse`

    - `id: string`

    - `created_at: number`

    - `model: "gpt-5.2" | "gpt-5.2-2025-12-11" | "gpt-5.2-chat-latest" | 83 more | (string & {})`

      - `"gpt-5.2" | "gpt-5.2-2025-12-11" | "gpt-5.2-chat-latest" | 83 more`

        - `"gpt-5.2"`

        - `"gpt-5.2-2025-12-11"`

        - `"gpt-5.2-chat-latest"`

        - `"gpt-5.2-pro"`

        - `"gpt-5.2-pro-2025-12-11"`

        - `"gpt-5.1"`

        - `"gpt-5.1-2025-11-13"`

        - `"gpt-5.1-codex"`

        - `"gpt-5.1-mini"`

        - `"gpt-5.1-chat-latest"`

        - `"gpt-5"`

        - `"gpt-5-mini"`

        - `"gpt-5-nano"`

        - `"gpt-5-2025-08-07"`

        - `"gpt-5-mini-2025-08-07"`

        - `"gpt-5-nano-2025-08-07"`

        - `"gpt-5-chat-latest"`

        - `"gpt-4.1"`

        - `"gpt-4.1-mini"`

        - `"gpt-4.1-nano"`

        - `"gpt-4.1-2025-04-14"`

        - `"gpt-4.1-mini-2025-04-14"`

        - `"gpt-4.1-nano-2025-04-14"`

        - `"o4-mini"`

        - `"o4-mini-2025-04-16"`

        - `"o3"`

        - `"o3-2025-04-16"`

        - `"o3-mini"`

        - `"o3-mini-2025-01-31"`

        - `"o1"`

        - `"o1-2024-12-17"`

        - `"o1-preview"`

        - `"o1-preview-2024-09-12"`

        - `"o1-mini"`

        - `"o1-mini-2024-09-12"`

        - `"gpt-4o"`

        - `"gpt-4o-2024-11-20"`

        - `"gpt-4o-2024-08-06"`

        - `"gpt-4o-2024-05-13"`

        - `"gpt-4o-audio-preview"`

        - `"gpt-4o-audio-preview-2024-10-01"`

        - `"gpt-4o-audio-preview-2024-12-17"`

        - `"gpt-4o-audio-preview-2025-06-03"`

        - `"gpt-4o-mini-audio-preview"`

        - `"gpt-4o-mini-audio-preview-2024-12-17"`

        - `"gpt-4o-search-preview"`

        - `"gpt-4o-mini-search-preview"`

        - `"gpt-4o-search-preview-2025-03-11"`

        - `"gpt-4o-mini-search-preview-2025-03-11"`

        - `"chatgpt-4o-latest"`

        - `"codex-mini-latest"`

        - `"gpt-4o-mini"`

        - `"gpt-4o-mini-2024-07-18"`

        - `"gpt-4-turbo"`

        - `"gpt-4-turbo-2024-04-09"`

        - `"gpt-4-0125-preview"`

        - `"gpt-4-turbo-preview"`

        - `"gpt-4-1106-preview"`

        - `"gpt-4-vision-preview"`

        - `"gpt-4"`

        - `"gpt-4-0314"`

        - `"gpt-4-0613"`

        - `"gpt-4-32k"`

        - `"gpt-4-32k-0314"`

        - `"gpt-4-32k-0613"`

        - `"gpt-3.5-turbo"`

        - `"gpt-3.5-turbo-16k"`

        - `"gpt-3.5-turbo-0301"`

        - `"gpt-3.5-turbo-0613"`

        - `"gpt-3.5-turbo-1106"`

        - `"gpt-3.5-turbo-0125"`

        - `"gpt-3.5-turbo-16k-0613"`

        - `"o1-pro"`

        - `"o1-pro-2025-03-19"`

        - `"o3-pro"`

        - `"o3-pro-2025-06-10"`

        - `"o3-deep-research"`

        - `"o3-deep-research-2025-06-26"`

        - `"o4-mini-deep-research"`

        - `"o4-mini-deep-research-2025-06-26"`

        - `"computer-use-preview"`

        - `"computer-use-preview-2025-03-11"`

        - `"gpt-5-codex"`

        - `"gpt-5-pro"`

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

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

      - `(string & {})`

    - `object: "response"`

      - `"response"`

    - `output: Array<OpenAIResponseOutputMessage | OpenAIResponseFileSearchToolCall | OpenAIResponseFunctionToolCall | 15 more>`

      - `OpenAIResponseOutputMessage`

        An output message from the model.

        - `id: string`

        - `content: Array<OpenAIResponseOutputText | OpenAIResponseOutputRefusal>`

          - `OpenAIResponseOutputText`

            A text output from the model.

            - `annotations: Array<AnnotationFileCitation | OpenAITypesResponsesResponseOutputTextAnnotationURLCitation | AnnotationContainerFileCitation | AnnotationFilePath>`

              - `AnnotationFileCitation`

                A citation to a file.

                - `file_id: string`

                - `filename: string`

                - `index: number`

                - `type: "file_citation"`

                  - `"file_citation"`

              - `OpenAITypesResponsesResponseOutputTextAnnotationURLCitation`

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

                - `end_index: number`

                - `start_index: number`

                - `title: string`

                - `type: "url_citation"`

                  - `"url_citation"`

                - `url: string`

              - `AnnotationContainerFileCitation`

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

                - `container_id: string`

                - `end_index: number`

                - `file_id: string`

                - `filename: string`

                - `start_index: number`

                - `type: "container_file_citation"`

                  - `"container_file_citation"`

              - `AnnotationFilePath`

                A path to a file.

                - `file_id: string`

                - `index: number`

                - `type: "file_path"`

                  - `"file_path"`

            - `text: string`

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

          - `OpenAIResponseOutputRefusal`

            A refusal from the model.

            - `refusal: string`

            - `type: "refusal"`

              - `"refusal"`

        - `role: "assistant"`

          - `"assistant"`

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

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

        - `type: "message"`

          - `"message"`

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

          - `"commentary"`

          - `"final_answer"`

      - `OpenAIResponseFileSearchToolCall`

        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`

        - `queries: Array<string>`

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

          - `"in_progress"`

          - `"searching"`

          - `"completed"`

          - `"incomplete"`

          - `"failed"`

        - `type: "file_search_call"`

          - `"file_search_call"`

        - `results?: Array<Result>`

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

            - `string`

            - `number`

            - `boolean`

          - `file_id?: string`

          - `filename?: string`

          - `score?: number`

          - `text?: string`

      - `OpenAIResponseFunctionToolCall`

        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`

        - `call_id: string`

        - `name: string`

        - `type: "function_call"`

          - `"function_call"`

        - `id?: string`

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

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

      - `OpenAIResponseFunctionWebSearch`

        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`

        - `action: OpenAITypesResponsesResponseFunctionWebSearchActionSearch | OpenAITypesResponsesResponseFunctionWebSearchActionOpenPage | ActionFind`

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

          - `OpenAITypesResponsesResponseFunctionWebSearchActionSearch`

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

            - `query: string`

            - `type: "search"`

              - `"search"`

            - `queries?: Array<string>`

            - `sources?: Array<Source>`

              - `type: "url"`

                - `"url"`

              - `url: string`

          - `OpenAITypesResponsesResponseFunctionWebSearchActionOpenPage`

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

            - `type: "open_page"`

              - `"open_page"`

            - `url?: string`

          - `ActionFind`

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

            - `pattern: string`

            - `type: "find_in_page"`

              - `"find_in_page"`

            - `url: string`

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

          - `"in_progress"`

          - `"searching"`

          - `"completed"`

          - `"failed"`

        - `type: "web_search_call"`

          - `"web_search_call"`

      - `OpenAIResponseComputerToolCall`

        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`

        - `action: ActionClick | ActionDoubleClick | ActionDrag | 6 more`

          A click action.

          - `ActionClick`

            A click action.

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

              - `"left"`

              - `"right"`

              - `"wheel"`

              - `"back"`

              - `"forward"`

            - `type: "click"`

              - `"click"`

            - `x: number`

            - `y: number`

          - `ActionDoubleClick`

            A double click action.

            - `type: "double_click"`

              - `"double_click"`

            - `x: number`

            - `y: number`

          - `ActionDrag`

            A drag action.

            - `path: Array<Path>`

              - `x: number`

              - `y: number`

            - `type: "drag"`

              - `"drag"`

          - `ActionKeypress`

            A collection of keypresses the model would like to perform.

            - `keys: Array<string>`

            - `type: "keypress"`

              - `"keypress"`

          - `ActionMove`

            A mouse move action.

            - `type: "move"`

              - `"move"`

            - `x: number`

            - `y: number`

          - `ActionScreenshot`

            A screenshot action.

            - `type: "screenshot"`

              - `"screenshot"`

          - `ActionScroll`

            A scroll action.

            - `scroll_x: number`

            - `scroll_y: number`

            - `type: "scroll"`

              - `"scroll"`

            - `x: number`

            - `y: number`

          - `ActionType`

            An action to type in text.

            - `text: string`

            - `type: "type"`

              - `"type"`

          - `ActionWait`

            A wait action.

            - `type: "wait"`

              - `"wait"`

        - `call_id: string`

        - `pending_safety_checks: Array<PendingSafetyCheck>`

          - `id: string`

          - `code?: string`

          - `message?: string`

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

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

        - `type: "computer_call"`

          - `"computer_call"`

      - `OpenAIResponseReasoningItem`

        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`

        - `summary: Array<Summary>`

          - `text: string`

          - `type: "summary_text"`

            - `"summary_text"`

        - `type: "reasoning"`

          - `"reasoning"`

        - `content?: Array<Content>`

          - `text: string`

          - `type: "reasoning_text"`

            - `"reasoning_text"`

        - `encrypted_content?: string`

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

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

      - `ResponseCompactionItem`

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

        - `id: string`

        - `encrypted_content: string`

        - `type: "compaction"`

          - `"compaction"`

        - `created_by?: string`

      - `OpenAITypesResponsesResponseOutputItemImageGenerationCall`

        An image generation request made by the model.

        - `id: string`

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

          - `"in_progress"`

          - `"completed"`

          - `"generating"`

          - `"failed"`

        - `type: "image_generation_call"`

          - `"image_generation_call"`

        - `result?: string`

      - `OpenAIResponseCodeInterpreterToolCall`

        A tool call to run code.

        - `id: string`

        - `container_id: string`

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

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

          - `"interpreting"`

          - `"failed"`

        - `type: "code_interpreter_call"`

          - `"code_interpreter_call"`

        - `code?: string`

        - `outputs?: Array<OutputLogs | OutputImage>`

          - `OutputLogs`

            The logs output from the code interpreter.

            - `logs: string`

            - `type: "logs"`

              - `"logs"`

          - `OutputImage`

            The image output from the code interpreter.

            - `type: "image"`

              - `"image"`

            - `url: string`

      - `OpenAITypesResponsesResponseOutputItemLocalShellCall`

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

        - `id: string`

        - `action: Action`

          Execute a shell command on the server.

          - `command: Array<string>`

          - `env: Record<string, string>`

          - `type: "exec"`

            - `"exec"`

          - `timeout_ms?: number`

          - `user?: string`

          - `working_directory?: string`

        - `call_id: string`

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

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

        - `type: "local_shell_call"`

          - `"local_shell_call"`

      - `ResponseFunctionShellToolCall`

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

        - `id: string`

        - `action: Action`

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

          - `commands: Array<string>`

          - `max_output_length?: number`

          - `timeout_ms?: number`

        - `call_id: string`

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

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

        - `type: "shell_call"`

          - `"shell_call"`

        - `created_by?: string`

        - `environment?: ResponseLocalEnvironment | ResponseContainerReference`

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

          - `ResponseLocalEnvironment`

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

            - `type: "local"`

              - `"local"`

          - `ResponseContainerReference`

            Represents a container created with /v1/containers.

            - `container_id: string`

            - `type: "container_reference"`

              - `"container_reference"`

      - `ResponseFunctionShellToolCallOutput`

        The output of a shell tool call that was emitted.

        - `id: string`

        - `call_id: string`

        - `output: Array<Output>`

          - `outcome: OutputOutcomeTimeout | OutputOutcomeExit`

            Indicates that the shell call exceeded its configured time limit.

            - `OutputOutcomeTimeout`

              Indicates that the shell call exceeded its configured time limit.

              - `type: "timeout"`

                - `"timeout"`

            - `OutputOutcomeExit`

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

              - `exit_code: number`

              - `type: "exit"`

                - `"exit"`

          - `stderr: string`

          - `stdout: string`

          - `created_by?: string`

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

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

        - `type: "shell_call_output"`

          - `"shell_call_output"`

        - `created_by?: string`

        - `max_output_length?: number`

      - `ResponseApplyPatchToolCall`

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

        - `id: string`

        - `call_id: string`

        - `operation: OperationCreateFile | OperationDeleteFile | OperationUpdateFile`

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

          - `OperationCreateFile`

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

            - `diff: string`

            - `path: string`

            - `type: "create_file"`

              - `"create_file"`

          - `OperationDeleteFile`

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

            - `path: string`

            - `type: "delete_file"`

              - `"delete_file"`

          - `OperationUpdateFile`

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

            - `diff: string`

            - `path: string`

            - `type: "update_file"`

              - `"update_file"`

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

          - `"in_progress"`

          - `"completed"`

        - `type: "apply_patch_call"`

          - `"apply_patch_call"`

        - `created_by?: string`

      - `ResponseApplyPatchToolCallOutput`

        The output emitted by an apply patch tool call.

        - `id: string`

        - `call_id: string`

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

          - `"completed"`

          - `"failed"`

        - `type: "apply_patch_call_output"`

          - `"apply_patch_call_output"`

        - `created_by?: string`

        - `output?: string`

      - `OpenAITypesResponsesResponseOutputItemMcpCall`

        An invocation of a tool on an MCP server.

        - `id: string`

        - `arguments: string`

        - `name: string`

        - `server_label: string`

        - `type: "mcp_call"`

          - `"mcp_call"`

        - `approval_request_id?: string`

        - `error?: string`

        - `output?: string`

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

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

          - `"calling"`

          - `"failed"`

      - `OpenAITypesResponsesResponseOutputItemMcpListTools`

        A list of tools available on an MCP server.

        - `id: string`

        - `server_label: string`

        - `tools: Array<Tool>`

          - `input_schema: unknown`

          - `name: string`

          - `annotations?: unknown`

          - `description?: string`

        - `type: "mcp_list_tools"`

          - `"mcp_list_tools"`

        - `error?: string`

      - `McpApprovalRequest`

        A request for human approval of a tool invocation.

        - `id: string`

        - `arguments: string`

        - `name: string`

        - `server_label: string`

        - `type: "mcp_approval_request"`

          - `"mcp_approval_request"`

      - `OpenAIResponseCustomToolCall`

        A call to a custom tool created by the model.

        - `call_id: string`

        - `input: string`

        - `name: string`

        - `type: "custom_tool_call"`

          - `"custom_tool_call"`

        - `id?: string`

    - `parallel_tool_calls: boolean`

    - `tool_choice: "none" | "auto" | "required" | ToolChoiceAllowed | ToolChoiceTypes | 5 more`

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

      - `"none" | "auto" | "required"`

        - `"none"`

        - `"auto"`

        - `"required"`

      - `ToolChoiceAllowed`

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

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

          - `"auto"`

          - `"required"`

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

        - `type: "allowed_tools"`

          - `"allowed_tools"`

      - `ToolChoiceTypes`

        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_use_preview" | 3 more`

          - `"file_search"`

          - `"web_search_preview"`

          - `"computer_use_preview"`

          - `"web_search_preview_2025_03_11"`

          - `"image_generation"`

          - `"code_interpreter"`

      - `ToolChoiceFunction`

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

        - `name: string`

        - `type: "function"`

          - `"function"`

      - `ToolChoiceMcp`

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

        - `server_label: string`

        - `type: "mcp"`

          - `"mcp"`

        - `name?: string`

      - `ToolChoiceCustom`

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

        - `name: string`

        - `type: "custom"`

          - `"custom"`

      - `ToolChoiceApplyPatch`

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

        - `type: "apply_patch"`

          - `"apply_patch"`

      - `ToolChoiceShell`

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

        - `type: "shell"`

          - `"shell"`

    - `tools: Array<FunctionTool | FileSearchTool | ComputerTool | 9 more>`

      - `FunctionTool`

        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`

        - `type: "function"`

          - `"function"`

        - `description?: string`

        - `parameters?: Record<string, unknown>`

        - `strict?: boolean`

      - `FileSearchTool`

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

          - `"file_search"`

        - `vector_store_ids: Array<string>`

        - `filters?: ComparisonFilter | CompoundFilter`

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

          - `ComparisonFilter`

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

            - `key: string`

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

              - `"eq"`

              - `"ne"`

              - `"gt"`

              - `"gte"`

              - `"lt"`

              - `"lte"`

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

              - `string`

              - `number`

              - `boolean`

              - `Array<string | number>`

                - `string`

                - `number`

          - `CompoundFilter`

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

            - `filters: Array<ComparisonFilter | unknown>`

              - `ComparisonFilter`

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

                - `key: string`

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

                  - `"eq"`

                  - `"ne"`

                  - `"gt"`

                  - `"gte"`

                  - `"lt"`

                  - `"lte"`

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

                  - `string`

                  - `number`

                  - `boolean`

                  - `Array<string | number>`

                    - `string`

                    - `number`

              - `unknown`

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

              - `"and"`

              - `"or"`

        - `max_num_results?: number`

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

            - `text_weight: number`

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

            - `"auto"`

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

          - `score_threshold?: number`

      - `ComputerTool`

        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`

        - `display_width: number`

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

          - `"windows"`

          - `"mac"`

          - `"linux"`

          - `"ubuntu"`

          - `"browser"`

        - `type: "computer_use_preview"`

          - `"computer_use_preview"`

      - `WebSearchTool`

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

          - `"web_search"`

          - `"web_search_2025_08_26"`

        - `filters?: Filters`

          Filters for the search.

          - `allowed_domains?: Array<string>`

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

          - `"low"`

          - `"medium"`

          - `"high"`

        - `user_location?: UserLocation`

          The approximate location of the user.

          - `city?: string`

          - `country?: string`

          - `region?: string`

          - `timezone?: string`

          - `type?: "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`

        - `type: "mcp"`

          - `"mcp"`

        - `allowed_tools?: Array<string> | McpAllowedToolsMcpToolFilter`

          A filter object to specify which tools are allowed.

          - `Array<string>`

          - `McpAllowedToolsMcpToolFilter`

            A filter object to specify which tools are allowed.

            - `read_only?: boolean`

            - `tool_names?: Array<string>`

        - `authorization?: string`

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

          - `"connector_dropbox"`

          - `"connector_gmail"`

          - `"connector_googlecalendar"`

          - `"connector_googledrive"`

          - `"connector_microsoftteams"`

          - `"connector_outlookcalendar"`

          - `"connector_outlookemail"`

          - `"connector_sharepoint"`

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

        - `require_approval?: McpRequireApprovalMcpToolApprovalFilter | "always" | "never"`

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

          Can be
          `always`, `never`, or a filter object associated with tools
          that require approval.

          - `McpRequireApprovalMcpToolApprovalFilter`

            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`

              - `tool_names?: Array<string>`

            - `never?: Never`

              A filter object to specify which tools are allowed.

              - `read_only?: boolean`

              - `tool_names?: Array<string>`

          - `"always" | "never"`

            - `"always"`

            - `"never"`

        - `server_description?: string`

        - `server_url?: string`

      - `CodeInterpreter`

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

        - `container: string | CodeInterpreterContainerCodeInterpreterToolAuto`

          Configuration for a code interpreter container.

          Optionally specify the IDs of the files to run the code on.

          - `string`

          - `CodeInterpreterContainerCodeInterpreterToolAuto`

            Configuration for a code interpreter container.

            Optionally specify the IDs of the files to run the code on.

            - `type: "auto"`

              - `"auto"`

            - `file_ids?: Array<string>`

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

              - `"1g"`

              - `"4g"`

              - `"16g"`

              - `"64g"`

            - `network_policy?: ContainerNetworkPolicyDisabled | ContainerNetworkPolicyAllowlist`

              - `ContainerNetworkPolicyDisabled`

                - `type: "disabled"`

                  - `"disabled"`

              - `ContainerNetworkPolicyAllowlist`

                - `allowed_domains: Array<string>`

                - `type: "allowlist"`

                  - `"allowlist"`

                - `domain_secrets?: Array<DomainSecret>`

                  - `domain: string`

                  - `name: string`

                  - `value: string`

        - `type: "code_interpreter"`

          - `"code_interpreter"`

      - `ImageGeneration`

        A tool that generates images using the GPT image models.

        - `type: "image_generation"`

          - `"image_generation"`

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

          - `"generate"`

          - `"edit"`

          - `"auto"`

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

          - `"transparent"`

          - `"opaque"`

          - `"auto"`

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

          - `"high"`

          - `"low"`

        - `input_image_mask?: InputImageMask`

          Optional mask for inpainting.

          Contains `image_url`
          (string, optional) and `file_id` (string, optional).

          - `file_id?: string`

          - `image_url?: string`

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

          - `(string & {})`

          - `"gpt-image-1" | "gpt-image-1-mini" | "gpt-image-1.5"`

            - `"gpt-image-1"`

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

            - `"gpt-image-1.5"`

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

          - `"auto"`

          - `"low"`

        - `output_compression?: number`

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

          - `"png"`

          - `"webp"`

          - `"jpeg"`

        - `partial_images?: number`

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

          - `"low"`

          - `"medium"`

          - `"high"`

          - `"auto"`

        - `size?: "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"`

          - `"local_shell"`

      - `FunctionShellTool`

        A tool that allows the model to execute shell commands.

        - `type: "shell"`

          - `"shell"`

        - `environment?: ContainerAuto | LocalEnvironment | ContainerReference`

          - `ContainerAuto`

            - `type: "container_auto"`

              - `"container_auto"`

            - `file_ids?: Array<string>`

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

              - `"1g"`

              - `"4g"`

              - `"16g"`

              - `"64g"`

            - `network_policy?: ContainerNetworkPolicyDisabled | ContainerNetworkPolicyAllowlist`

              - `ContainerNetworkPolicyDisabled`

              - `ContainerNetworkPolicyAllowlist`

            - `skills?: Array<SkillReference | InlineSkill>`

              - `SkillReference`

                - `skill_id: string`

                - `type: "skill_reference"`

                  - `"skill_reference"`

                - `version?: string`

              - `InlineSkill`

                - `description: string`

                - `name: string`

                - `source: Source`

                  Inline skill payload

                  - `data: string`

                  - `media_type: "application/zip"`

                    - `"application/zip"`

                  - `type: "base64"`

                    - `"base64"`

                - `type: "inline"`

                  - `"inline"`

          - `LocalEnvironment`

            - `type: "local"`

              - `"local"`

            - `skills?: Array<Skill>`

              - `description: string`

              - `name: string`

              - `path: string`

          - `ContainerReference`

            - `container_id: string`

            - `type: "container_reference"`

              - `"container_reference"`

      - `CustomTool`

        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`

        - `type: "custom"`

          - `"custom"`

        - `description?: string`

        - `format?: Text | Grammar`

          Unconstrained free-form text.

          - `Text`

            Unconstrained free-form text.

            - `type: "text"`

              - `"text"`

          - `Grammar`

            A grammar defined by the user.

            - `definition: string`

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

              - `"lark"`

              - `"regex"`

            - `type: "grammar"`

              - `"grammar"`

      - `WebSearchPreviewTool`

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

          - `"web_search_preview"`

          - `"web_search_preview_2025_03_11"`

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

          - `"low"`

          - `"medium"`

          - `"high"`

        - `user_location?: UserLocation`

          The user's location.

          - `type: "approximate"`

            - `"approximate"`

          - `city?: string`

          - `country?: string`

          - `region?: string`

          - `timezone?: string`

      - `ApplyPatchTool`

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

        - `type: "apply_patch"`

          - `"apply_patch"`

    - `background?: boolean`

    - `completed_at?: number`

    - `conversation?: Conversation`

      The conversation that this response belonged to.

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

      - `id: string`

    - `error?: OpenAIResponseError`

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

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

        - `"server_error"`

        - `"rate_limit_exceeded"`

        - `"invalid_prompt"`

        - `"vector_store_timeout"`

        - `"invalid_image"`

        - `"invalid_image_format"`

        - `"invalid_base64_image"`

        - `"invalid_image_url"`

        - `"image_too_large"`

        - `"image_too_small"`

        - `"image_parse_error"`

        - `"image_content_policy_violation"`

        - `"invalid_image_mode"`

        - `"image_file_too_large"`

        - `"unsupported_image_media_type"`

        - `"empty_image_file"`

        - `"failed_to_download_image"`

        - `"image_file_not_found"`

      - `message: string`

    - `incomplete_details?: IncompleteDetails`

      Details about why the response is incomplete.

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

        - `"max_output_tokens"`

        - `"content_filter"`

    - `instructions?: string | Array<EasyInputMessage | OpenAITypesResponsesResponseInputItemMessage | OpenAIResponseOutputMessage | 23 more>`

      - `string`

      - `Array<EasyInputMessage | OpenAITypesResponsesResponseInputItemMessage | OpenAIResponseOutputMessage | 23 more>`

        - `EasyInputMessage`

          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 | Array<OpenAIResponseInputText | OpenAIResponseInputImage | OpenAIResponseInputFile>`

            - `string`

            - `Array<OpenAIResponseInputText | OpenAIResponseInputImage | OpenAIResponseInputFile>`

              - `OpenAIResponseInputText`

                A text input to the model.

                - `text: string`

                - `type: "input_text"`

                  - `"input_text"`

              - `OpenAIResponseInputImage`

                An image input to the model.

                Learn about [image inputs](https://platform.openai.com/docs/guides/vision).

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

                  - `"low"`

                  - `"high"`

                  - `"auto"`

                - `type: "input_image"`

                  - `"input_image"`

                - `file_id?: string`

                - `image_url?: string`

              - `OpenAIResponseInputFile`

                A file input to the model.

                - `type: "input_file"`

                  - `"input_file"`

                - `file_data?: string`

                - `file_id?: string`

                - `file_url?: string`

                - `filename?: string`

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

            - `"user"`

            - `"assistant"`

            - `"system"`

            - `"developer"`

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

            - `"commentary"`

            - `"final_answer"`

          - `type?: "message"`

            - `"message"`

        - `OpenAITypesResponsesResponseInputItemMessage`

          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: Array<OpenAIResponseInputText | OpenAIResponseInputImage | OpenAIResponseInputFile>`

            - `OpenAIResponseInputText`

              A text input to the model.

            - `OpenAIResponseInputImage`

              An image input to the model.

              Learn about [image inputs](https://platform.openai.com/docs/guides/vision).

            - `OpenAIResponseInputFile`

              A file input to the model.

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

            - `"user"`

            - `"system"`

            - `"developer"`

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

            - `"in_progress"`

            - `"completed"`

            - `"incomplete"`

          - `type?: "message"`

            - `"message"`

        - `OpenAIResponseOutputMessage`

          An output message from the model.

        - `OpenAIResponseFileSearchToolCall`

          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.

        - `OpenAIResponseComputerToolCall`

          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.

        - `OpenAITypesResponsesResponseInputItemComputerCallOutput`

          The output of a computer tool call.

          - `call_id: string`

          - `output: ResponseComputerToolCallOutputScreenshot`

            A computer screenshot image used with the computer use tool.

            - `type: "computer_screenshot"`

              - `"computer_screenshot"`

            - `file_id?: string`

            - `image_url?: string`

          - `type: "computer_call_output"`

            - `"computer_call_output"`

          - `id?: string`

          - `acknowledged_safety_checks?: Array<AcknowledgedSafetyCheck>`

            - `id: string`

            - `code?: string`

            - `message?: string`

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

            - `"in_progress"`

            - `"completed"`

            - `"incomplete"`

        - `OpenAIResponseFunctionWebSearch`

          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.

        - `OpenAIResponseFunctionToolCall`

          A tool call to run a function.

          See the
          [function calling guide](https://platform.openai.com/docs/guides/function-calling) for more information.

        - `OpenAITypesResponsesResponseInputItemFunctionCallOutput`

          The output of a function tool call.

          - `call_id: string`

          - `output: string | Array<ResponseInputTextContent | ResponseInputImageContent | ResponseInputFileContent>`

            - `string`

            - `Array<ResponseInputTextContent | ResponseInputImageContent | ResponseInputFileContent>`

              - `ResponseInputTextContent`

                A text input to the model.

                - `text: string`

                - `type: "input_text"`

                  - `"input_text"`

              - `ResponseInputImageContent`

                An image input to the model.

                Learn about [image inputs](https://platform.openai.com/docs/guides/vision)

                - `type: "input_image"`

                  - `"input_image"`

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

                  - `"low"`

                  - `"high"`

                  - `"auto"`

                - `file_id?: string`

                - `image_url?: string`

              - `ResponseInputFileContent`

                A file input to the model.

                - `type: "input_file"`

                  - `"input_file"`

                - `file_data?: string`

                - `file_id?: string`

                - `file_url?: string`

                - `filename?: string`

          - `type: "function_call_output"`

            - `"function_call_output"`

          - `id?: string`

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

            - `"in_progress"`

            - `"completed"`

            - `"incomplete"`

        - `OpenAIResponseReasoningItem`

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

        - `ResponseCompactionItemParam`

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

          - `encrypted_content: string`

          - `type: "compaction"`

            - `"compaction"`

          - `id?: string`

        - `OpenAITypesResponsesResponseInputItemImageGenerationCall`

          An image generation request made by the model.

          - `id: string`

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

            - `"in_progress"`

            - `"completed"`

            - `"generating"`

            - `"failed"`

          - `type: "image_generation_call"`

            - `"image_generation_call"`

          - `result?: string`

        - `OpenAIResponseCodeInterpreterToolCall`

          A tool call to run code.

        - `OpenAITypesResponsesResponseInputItemLocalShellCall`

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

          - `id: string`

          - `action: Action`

            Execute a shell command on the server.

            - `command: Array<string>`

            - `env: Record<string, string>`

            - `type: "exec"`

              - `"exec"`

            - `timeout_ms?: number`

            - `user?: string`

            - `working_directory?: string`

          - `call_id: string`

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

            - `"in_progress"`

            - `"completed"`

            - `"incomplete"`

          - `type: "local_shell_call"`

            - `"local_shell_call"`

        - `OpenAITypesResponsesResponseInputItemLocalShellCallOutput`

          The output of a local shell tool call.

          - `id: string`

          - `output: string`

          - `type: "local_shell_call_output"`

            - `"local_shell_call_output"`

          - `status?: "in_progress" | "completed" | "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>`

            - `max_output_length?: number`

            - `timeout_ms?: number`

          - `call_id: string`

          - `type: "shell_call"`

            - `"shell_call"`

          - `id?: string`

          - `environment?: LocalEnvironment | ContainerReference`

            - `LocalEnvironment`

            - `ContainerReference`

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

            - `"in_progress"`

            - `"completed"`

            - `"incomplete"`

        - `ShellCallOutput`

          The streamed output items emitted by a shell tool call.

          - `call_id: string`

          - `output: Array<Output>`

            - `outcome: OutcomeTimeout | OutcomeExit`

              Indicates that the shell call exceeded its configured time limit.

              - `OutcomeTimeout`

                Indicates that the shell call exceeded its configured time limit.

                - `type: "timeout"`

                  - `"timeout"`

              - `OutcomeExit`

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

                - `exit_code: number`

                - `type: "exit"`

                  - `"exit"`

            - `stderr: string`

            - `stdout: string`

          - `type: "shell_call_output"`

            - `"shell_call_output"`

          - `id?: string`

          - `max_output_length?: number`

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

            - `"in_progress"`

            - `"completed"`

            - `"incomplete"`

        - `ApplyPatchCall`

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

          - `call_id: string`

          - `operation: ApplyPatchCallOperationCreateFile | ApplyPatchCallOperationDeleteFile | ApplyPatchCallOperationUpdateFile`

            Instruction for creating a new file via the apply_patch tool.

            - `ApplyPatchCallOperationCreateFile`

              Instruction for creating a new file via the apply_patch tool.

              - `diff: string`

              - `path: string`

              - `type: "create_file"`

                - `"create_file"`

            - `ApplyPatchCallOperationDeleteFile`

              Instruction for deleting an existing file via the apply_patch tool.

              - `path: string`

              - `type: "delete_file"`

                - `"delete_file"`

            - `ApplyPatchCallOperationUpdateFile`

              Instruction for updating an existing file via the apply_patch tool.

              - `diff: string`

              - `path: string`

              - `type: "update_file"`

                - `"update_file"`

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

            - `"in_progress"`

            - `"completed"`

          - `type: "apply_patch_call"`

            - `"apply_patch_call"`

          - `id?: string`

        - `ApplyPatchCallOutput`

          The streamed output emitted by an apply patch tool call.

          - `call_id: string`

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

            - `"completed"`

            - `"failed"`

          - `type: "apply_patch_call_output"`

            - `"apply_patch_call_output"`

          - `id?: string`

          - `output?: string`

        - `OpenAITypesResponsesResponseInputItemMcpListTools`

          A list of tools available on an MCP server.

          - `id: string`

          - `server_label: string`

          - `tools: Array<Tool>`

            - `input_schema: unknown`

            - `name: string`

            - `annotations?: unknown`

            - `description?: string`

          - `type: "mcp_list_tools"`

            - `"mcp_list_tools"`

          - `error?: string`

        - `McpApprovalRequest`

          A request for human approval of a tool invocation.

        - `OpenAITypesResponsesResponseInputItemMcpApprovalResponse`

          A response to an MCP approval request.

          - `approval_request_id: string`

          - `approve: boolean`

          - `type: "mcp_approval_response"`

            - `"mcp_approval_response"`

          - `id?: string`

          - `reason?: string`

        - `OpenAITypesResponsesResponseInputItemMcpCall`

          An invocation of a tool on an MCP server.

          - `id: string`

          - `arguments: string`

          - `name: string`

          - `server_label: string`

          - `type: "mcp_call"`

            - `"mcp_call"`

          - `approval_request_id?: string`

          - `error?: string`

          - `output?: string`

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

            - `"in_progress"`

            - `"completed"`

            - `"incomplete"`

            - `"calling"`

            - `"failed"`

        - `OpenAIResponseCustomToolCallOutput`

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

          - `call_id: string`

          - `output: string | Array<OpenAIResponseInputText | OpenAIResponseInputImage | OpenAIResponseInputFile>`

            - `string`

            - `Array<OpenAIResponseInputText | OpenAIResponseInputImage | OpenAIResponseInputFile>`

              - `OpenAIResponseInputText`

                A text input to the model.

              - `OpenAIResponseInputImage`

                An image input to the model.

                Learn about [image inputs](https://platform.openai.com/docs/guides/vision).

              - `OpenAIResponseInputFile`

                A file input to the model.

          - `type: "custom_tool_call_output"`

            - `"custom_tool_call_output"`

          - `id?: string`

        - `OpenAIResponseCustomToolCall`

          A call to a custom tool created by the model.

        - `OpenAITypesResponsesResponseInputItemItemReference`

          An internal identifier for an item to reference.

          - `id: string`

          - `type?: "item_reference"`

            - `"item_reference"`

    - `max_output_tokens?: number`

    - `max_tool_calls?: number`

    - `metadata?: Record<string, string>`

    - `previous_response_id?: string`

    - `prompt?: OpenAIResponsePrompt`

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

      - `id: string`

      - `variables?: Record<string, string | OpenAIResponseInputText | OpenAIResponseInputImage | OpenAIResponseInputFile>`

        - `string`

        - `OpenAIResponseInputText`

          A text input to the model.

        - `OpenAIResponseInputImage`

          An image input to the model.

          Learn about [image inputs](https://platform.openai.com/docs/guides/vision).

        - `OpenAIResponseInputFile`

          A file input to the model.

      - `version?: string`

    - `prompt_cache_key?: string`

    - `prompt_cache_retention?: "in-memory" | "24h"`

      - `"in-memory"`

      - `"24h"`

    - `reasoning?: Reasoning`

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

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

      - `effort?: "none" | "minimal" | "low" | 3 more`

        - `"none"`

        - `"minimal"`

        - `"low"`

        - `"medium"`

        - `"high"`

        - `"xhigh"`

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

        - `"auto"`

        - `"concise"`

        - `"detailed"`

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

        - `"auto"`

        - `"concise"`

        - `"detailed"`

    - `safety_identifier?: string`

    - `service_tier?: "auto" | "default" | "flex" | 2 more`

      - `"auto"`

      - `"default"`

      - `"flex"`

      - `"scale"`

      - `"priority"`

    - `status?: "completed" | "failed" | "in_progress" | 3 more`

      - `"completed"`

      - `"failed"`

      - `"in_progress"`

      - `"cancelled"`

      - `"queued"`

      - `"incomplete"`

    - `temperature?: number`

    - `text?: OpenAIResponseTextConfig`

      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?: ResponseFormatText | ResponseFormatTextJsonSchemaConfig | ResponseFormatJsonObject`

        Default response format. Used to generate text responses.

        - `ResponseFormatText`

          Default response format. Used to generate text responses.

          - `type: "text"`

            - `"text"`

        - `ResponseFormatTextJsonSchemaConfig`

          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`

          - `schema: Record<string, unknown>`

          - `type: "json_schema"`

            - `"json_schema"`

          - `description?: string`

          - `strict?: boolean`

        - `ResponseFormatJsonObject`

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

            - `"json_object"`

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

        - `"low"`

        - `"medium"`

        - `"high"`

    - `top_logprobs?: number`

    - `top_p?: number`

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

      - `"auto"`

      - `"disabled"`

    - `usage?: OpenAIResponseUsage`

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

      - `input_tokens: number`

      - `input_tokens_details: InputTokensDetails`

        A detailed breakdown of the input tokens.

        - `cached_tokens: number`

      - `output_tokens: number`

      - `output_tokens_details: OutputTokensDetails`

        A detailed breakdown of the output tokens.

        - `reasoning_tokens: number`

      - `total_tokens: number`

    - `user?: string`

  - `ResponseAudioDeltaEvent`

    Emitted when there is a partial audio response.

    - `delta: string`

    - `sequence_number: number`

    - `type: "response.audio.delta"`

      - `"response.audio.delta"`

  - `ResponseAudioDoneEvent`

    Emitted when the audio response is complete.

    - `sequence_number: number`

    - `type: "response.audio.done"`

      - `"response.audio.done"`

  - `ResponseAudioTranscriptDeltaEvent`

    Emitted when there is a partial transcript of audio.

    - `delta: string`

    - `sequence_number: number`

    - `type: "response.audio.transcript.delta"`

      - `"response.audio.transcript.delta"`

  - `ResponseAudioTranscriptDoneEvent`

    Emitted when the full audio transcript is completed.

    - `sequence_number: number`

    - `type: "response.audio.transcript.done"`

      - `"response.audio.transcript.done"`

  - `ResponseCodeInterpreterCallCodeDeltaEvent`

    Emitted when a partial code snippet is streamed by the code interpreter.

    - `delta: string`

    - `item_id: string`

    - `output_index: number`

    - `sequence_number: number`

    - `type: "response.code_interpreter_call_code.delta"`

      - `"response.code_interpreter_call_code.delta"`

  - `ResponseCodeInterpreterCallCodeDoneEvent`

    Emitted when the code snippet is finalized by the code interpreter.

    - `code: string`

    - `item_id: string`

    - `output_index: number`

    - `sequence_number: number`

    - `type: "response.code_interpreter_call_code.done"`

      - `"response.code_interpreter_call_code.done"`

  - `ResponseCodeInterpreterCallCompletedEvent`

    Emitted when the code interpreter call is completed.

    - `item_id: string`

    - `output_index: number`

    - `sequence_number: number`

    - `type: "response.code_interpreter_call.completed"`

      - `"response.code_interpreter_call.completed"`

  - `ResponseCodeInterpreterCallInProgressEvent`

    Emitted when a code interpreter call is in progress.

    - `item_id: string`

    - `output_index: number`

    - `sequence_number: number`

    - `type: "response.code_interpreter_call.in_progress"`

      - `"response.code_interpreter_call.in_progress"`

  - `ResponseCodeInterpreterCallInterpretingEvent`

    Emitted when the code interpreter is actively interpreting the code snippet.

    - `item_id: string`

    - `output_index: number`

    - `sequence_number: number`

    - `type: "response.code_interpreter_call.interpreting"`

      - `"response.code_interpreter_call.interpreting"`

  - `ResponseCompletedEvent`

    Emitted when the model response is complete.

    - `response: OpenAIResponse`

    - `sequence_number: number`

    - `type: "response.completed"`

      - `"response.completed"`

  - `ResponseContentPartAddedEvent`

    Emitted when a new content part is added.

    - `content_index: number`

    - `item_id: string`

    - `output_index: number`

    - `part: OpenAIResponseOutputText | OpenAIResponseOutputRefusal | PartReasoningText`

      A text output from the model.

      - `OpenAIResponseOutputText`

        A text output from the model.

      - `OpenAIResponseOutputRefusal`

        A refusal from the model.

      - `PartReasoningText`

        Reasoning text from the model.

        - `text: string`

        - `type: "reasoning_text"`

          - `"reasoning_text"`

    - `sequence_number: number`

    - `type: "response.content_part.added"`

      - `"response.content_part.added"`

  - `ResponseContentPartDoneEvent`

    Emitted when a content part is done.

    - `content_index: number`

    - `item_id: string`

    - `output_index: number`

    - `part: OpenAIResponseOutputText | OpenAIResponseOutputRefusal | PartReasoningText`

      A text output from the model.

      - `OpenAIResponseOutputText`

        A text output from the model.

      - `OpenAIResponseOutputRefusal`

        A refusal from the model.

      - `PartReasoningText`

        Reasoning text from the model.

    - `sequence_number: number`

    - `type: "response.content_part.done"`

      - `"response.content_part.done"`

  - `ResponseCreatedEvent`

    An event that is emitted when a response is created.

    - `response: OpenAIResponse`

    - `sequence_number: number`

    - `type: "response.created"`

      - `"response.created"`

  - `ResponseErrorEvent`

    Emitted when an error occurs.

    - `message: string`

    - `sequence_number: number`

    - `type: "error"`

      - `"error"`

    - `code?: string`

    - `param?: string`

  - `ResponseFileSearchCallCompletedEvent`

    Emitted when a file search call is completed (results found).

    - `item_id: string`

    - `output_index: number`

    - `sequence_number: number`

    - `type: "response.file_search_call.completed"`

      - `"response.file_search_call.completed"`

  - `ResponseFileSearchCallInProgressEvent`

    Emitted when a file search call is initiated.

    - `item_id: string`

    - `output_index: number`

    - `sequence_number: number`

    - `type: "response.file_search_call.in_progress"`

      - `"response.file_search_call.in_progress"`

  - `ResponseFileSearchCallSearchingEvent`

    Emitted when a file search is currently searching.

    - `item_id: string`

    - `output_index: number`

    - `sequence_number: number`

    - `type: "response.file_search_call.searching"`

      - `"response.file_search_call.searching"`

  - `ResponseFunctionCallArgumentsDeltaEvent`

    Emitted when there is a partial function-call arguments delta.

    - `delta: string`

    - `item_id: string`

    - `output_index: number`

    - `sequence_number: number`

    - `type: "response.function_call_arguments.delta"`

      - `"response.function_call_arguments.delta"`

  - `ResponseFunctionCallArgumentsDoneEvent`

    Emitted when function-call arguments are finalized.

    - `arguments: string`

    - `item_id: string`

    - `name: string`

    - `output_index: number`

    - `sequence_number: number`

    - `type: "response.function_call_arguments.done"`

      - `"response.function_call_arguments.done"`

  - `ResponseInProgressEvent`

    Emitted when the response is in progress.

    - `response: OpenAIResponse`

    - `sequence_number: number`

    - `type: "response.in_progress"`

      - `"response.in_progress"`

  - `ResponseFailedEvent`

    An event that is emitted when a response fails.

    - `response: OpenAIResponse`

    - `sequence_number: number`

    - `type: "response.failed"`

      - `"response.failed"`

  - `ResponseIncompleteEvent`

    An event that is emitted when a response finishes as incomplete.

    - `response: OpenAIResponse`

    - `sequence_number: number`

    - `type: "response.incomplete"`

      - `"response.incomplete"`

  - `ResponseOutputItemAddedEvent`

    Emitted when a new output item is added.

    - `item: OpenAIResponseOutputMessage | OpenAIResponseFileSearchToolCall | OpenAIResponseFunctionToolCall | 15 more`

      An output message from the model.

      - `OpenAIResponseOutputMessage`

        An output message from the model.

      - `OpenAIResponseFileSearchToolCall`

        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.

      - `OpenAIResponseFunctionToolCall`

        A tool call to run a function.

        See the
        [function calling guide](https://platform.openai.com/docs/guides/function-calling) for more information.

      - `OpenAIResponseFunctionWebSearch`

        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.

      - `OpenAIResponseComputerToolCall`

        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.

      - `OpenAIResponseReasoningItem`

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

      - `ResponseCompactionItem`

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

      - `OpenAITypesResponsesResponseOutputItemImageGenerationCall`

        An image generation request made by the model.

      - `OpenAIResponseCodeInterpreterToolCall`

        A tool call to run code.

      - `OpenAITypesResponsesResponseOutputItemLocalShellCall`

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

      - `ResponseFunctionShellToolCall`

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

      - `ResponseFunctionShellToolCallOutput`

        The output of a shell tool call that was emitted.

      - `ResponseApplyPatchToolCall`

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

      - `ResponseApplyPatchToolCallOutput`

        The output emitted by an apply patch tool call.

      - `OpenAITypesResponsesResponseOutputItemMcpCall`

        An invocation of a tool on an MCP server.

      - `OpenAITypesResponsesResponseOutputItemMcpListTools`

        A list of tools available on an MCP server.

      - `McpApprovalRequest`

        A request for human approval of a tool invocation.

      - `OpenAIResponseCustomToolCall`

        A call to a custom tool created by the model.

    - `output_index: number`

    - `sequence_number: number`

    - `type: "response.output_item.added"`

      - `"response.output_item.added"`

  - `ResponseOutputItemDoneEvent`

    Emitted when an output item is marked done.

    - `item: OpenAIResponseOutputMessage | OpenAIResponseFileSearchToolCall | OpenAIResponseFunctionToolCall | 15 more`

      An output message from the model.

      - `OpenAIResponseOutputMessage`

        An output message from the model.

      - `OpenAIResponseFileSearchToolCall`

        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.

      - `OpenAIResponseFunctionToolCall`

        A tool call to run a function.

        See the
        [function calling guide](https://platform.openai.com/docs/guides/function-calling) for more information.

      - `OpenAIResponseFunctionWebSearch`

        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.

      - `OpenAIResponseComputerToolCall`

        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.

      - `OpenAIResponseReasoningItem`

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

      - `ResponseCompactionItem`

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

      - `OpenAITypesResponsesResponseOutputItemImageGenerationCall`

        An image generation request made by the model.

      - `OpenAIResponseCodeInterpreterToolCall`

        A tool call to run code.

      - `OpenAITypesResponsesResponseOutputItemLocalShellCall`

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

      - `ResponseFunctionShellToolCall`

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

      - `ResponseFunctionShellToolCallOutput`

        The output of a shell tool call that was emitted.

      - `ResponseApplyPatchToolCall`

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

      - `ResponseApplyPatchToolCallOutput`

        The output emitted by an apply patch tool call.

      - `OpenAITypesResponsesResponseOutputItemMcpCall`

        An invocation of a tool on an MCP server.

      - `OpenAITypesResponsesResponseOutputItemMcpListTools`

        A list of tools available on an MCP server.

      - `McpApprovalRequest`

        A request for human approval of a tool invocation.

      - `OpenAIResponseCustomToolCall`

        A call to a custom tool created by the model.

    - `output_index: number`

    - `sequence_number: number`

    - `type: "response.output_item.done"`

      - `"response.output_item.done"`

  - `ResponseReasoningSummaryPartAddedEvent`

    Emitted when a new reasoning summary part is added.

    - `item_id: string`

    - `output_index: number`

    - `part: Part`

      The summary part that was added.

      - `text: string`

      - `type: "summary_text"`

        - `"summary_text"`

    - `sequence_number: number`

    - `summary_index: number`

    - `type: "response.reasoning_summary_part.added"`

      - `"response.reasoning_summary_part.added"`

  - `ResponseReasoningSummaryPartDoneEvent`

    Emitted when a reasoning summary part is completed.

    - `item_id: string`

    - `output_index: number`

    - `part: Part`

      The completed summary part.

      - `text: string`

      - `type: "summary_text"`

        - `"summary_text"`

    - `sequence_number: number`

    - `summary_index: number`

    - `type: "response.reasoning_summary_part.done"`

      - `"response.reasoning_summary_part.done"`

  - `ResponseReasoningSummaryTextDeltaEvent`

    Emitted when a delta is added to a reasoning summary text.

    - `delta: string`

    - `item_id: string`

    - `output_index: number`

    - `sequence_number: number`

    - `summary_index: number`

    - `type: "response.reasoning_summary_text.delta"`

      - `"response.reasoning_summary_text.delta"`

  - `ResponseReasoningSummaryTextDoneEvent`

    Emitted when a reasoning summary text is completed.

    - `item_id: string`

    - `output_index: number`

    - `sequence_number: number`

    - `summary_index: number`

    - `text: string`

    - `type: "response.reasoning_summary_text.done"`

      - `"response.reasoning_summary_text.done"`

  - `ResponseReasoningTextDeltaEvent`

    Emitted when a delta is added to a reasoning text.

    - `content_index: number`

    - `delta: string`

    - `item_id: string`

    - `output_index: number`

    - `sequence_number: number`

    - `type: "response.reasoning_text.delta"`

      - `"response.reasoning_text.delta"`

  - `ResponseReasoningTextDoneEvent`

    Emitted when a reasoning text is completed.

    - `content_index: number`

    - `item_id: string`

    - `output_index: number`

    - `sequence_number: number`

    - `text: string`

    - `type: "response.reasoning_text.done"`

      - `"response.reasoning_text.done"`

  - `ResponseRefusalDeltaEvent`

    Emitted when there is a partial refusal text.

    - `content_index: number`

    - `delta: string`

    - `item_id: string`

    - `output_index: number`

    - `sequence_number: number`

    - `type: "response.refusal.delta"`

      - `"response.refusal.delta"`

  - `ResponseRefusalDoneEvent`

    Emitted when refusal text is finalized.

    - `content_index: number`

    - `item_id: string`

    - `output_index: number`

    - `refusal: string`

    - `sequence_number: number`

    - `type: "response.refusal.done"`

      - `"response.refusal.done"`

  - `ResponseTextDeltaEvent`

    Emitted when there is an additional text delta.

    - `content_index: number`

    - `delta: string`

    - `item_id: string`

    - `logprobs: Array<Logprob>`

      - `token: string`

      - `logprob: number`

      - `top_logprobs?: Array<TopLogprob>`

        - `token?: string`

        - `logprob?: number`

    - `output_index: number`

    - `sequence_number: number`

    - `type: "response.output_text.delta"`

      - `"response.output_text.delta"`

  - `ResponseTextDoneEvent`

    Emitted when text content is finalized.

    - `content_index: number`

    - `item_id: string`

    - `logprobs: Array<Logprob>`

      - `token: string`

      - `logprob: number`

      - `top_logprobs?: Array<TopLogprob>`

        - `token?: string`

        - `logprob?: number`

    - `output_index: number`

    - `sequence_number: number`

    - `text: string`

    - `type: "response.output_text.done"`

      - `"response.output_text.done"`

  - `ResponseWebSearchCallCompletedEvent`

    Emitted when a web search call is completed.

    - `item_id: string`

    - `output_index: number`

    - `sequence_number: number`

    - `type: "response.web_search_call.completed"`

      - `"response.web_search_call.completed"`

  - `ResponseWebSearchCallInProgressEvent`

    Emitted when a web search call is initiated.

    - `item_id: string`

    - `output_index: number`

    - `sequence_number: number`

    - `type: "response.web_search_call.in_progress"`

      - `"response.web_search_call.in_progress"`

  - `ResponseWebSearchCallSearchingEvent`

    Emitted when a web search call is executing.

    - `item_id: string`

    - `output_index: number`

    - `sequence_number: number`

    - `type: "response.web_search_call.searching"`

      - `"response.web_search_call.searching"`

  - `ResponseImageGenCallCompletedEvent`

    Emitted when an image generation tool call has completed and the final image is available.

    - `item_id: string`

    - `output_index: number`

    - `sequence_number: number`

    - `type: "response.image_generation_call.completed"`

      - `"response.image_generation_call.completed"`

  - `ResponseImageGenCallGeneratingEvent`

    Emitted when an image generation tool call is actively generating an image (intermediate state).

    - `item_id: string`

    - `output_index: number`

    - `sequence_number: number`

    - `type: "response.image_generation_call.generating"`

      - `"response.image_generation_call.generating"`

  - `ResponseImageGenCallInProgressEvent`

    Emitted when an image generation tool call is in progress.

    - `item_id: string`

    - `output_index: number`

    - `sequence_number: number`

    - `type: "response.image_generation_call.in_progress"`

      - `"response.image_generation_call.in_progress"`

  - `ResponseImageGenCallPartialImageEvent`

    Emitted when a partial image is available during image generation streaming.

    - `item_id: string`

    - `output_index: number`

    - `partial_image_b64: string`

    - `partial_image_index: number`

    - `sequence_number: number`

    - `type: "response.image_generation_call.partial_image"`

      - `"response.image_generation_call.partial_image"`

  - `ResponseMcpCallArgumentsDeltaEvent`

    Emitted when there is a delta (partial update) to the arguments of an MCP tool call.

    - `delta: string`

    - `item_id: string`

    - `output_index: number`

    - `sequence_number: number`

    - `type: "response.mcp_call_arguments.delta"`

      - `"response.mcp_call_arguments.delta"`

  - `ResponseMcpCallArgumentsDoneEvent`

    Emitted when the arguments for an MCP tool call are finalized.

    - `arguments: string`

    - `item_id: string`

    - `output_index: number`

    - `sequence_number: number`

    - `type: "response.mcp_call_arguments.done"`

      - `"response.mcp_call_arguments.done"`

  - `ResponseMcpCallCompletedEvent`

    Emitted when an MCP  tool call has completed successfully.

    - `item_id: string`

    - `output_index: number`

    - `sequence_number: number`

    - `type: "response.mcp_call.completed"`

      - `"response.mcp_call.completed"`

  - `ResponseMcpCallFailedEvent`

    Emitted when an MCP  tool call has failed.

    - `item_id: string`

    - `output_index: number`

    - `sequence_number: number`

    - `type: "response.mcp_call.failed"`

      - `"response.mcp_call.failed"`

  - `ResponseMcpCallInProgressEvent`

    Emitted when an MCP  tool call is in progress.

    - `item_id: string`

    - `output_index: number`

    - `sequence_number: number`

    - `type: "response.mcp_call.in_progress"`

      - `"response.mcp_call.in_progress"`

  - `ResponseMcpListToolsCompletedEvent`

    Emitted when the list of available MCP tools has been successfully retrieved.

    - `item_id: string`

    - `output_index: number`

    - `sequence_number: number`

    - `type: "response.mcp_list_tools.completed"`

      - `"response.mcp_list_tools.completed"`

  - `ResponseMcpListToolsFailedEvent`

    Emitted when the attempt to list available MCP tools has failed.

    - `item_id: string`

    - `output_index: number`

    - `sequence_number: number`

    - `type: "response.mcp_list_tools.failed"`

      - `"response.mcp_list_tools.failed"`

  - `ResponseMcpListToolsInProgressEvent`

    Emitted when the system is in the process of retrieving the list of available MCP tools.

    - `item_id: string`

    - `output_index: number`

    - `sequence_number: number`

    - `type: "response.mcp_list_tools.in_progress"`

      - `"response.mcp_list_tools.in_progress"`

  - `ResponseOutputTextAnnotationAddedEvent`

    Emitted when an annotation is added to output text content.

    - `annotation: unknown`

    - `annotation_index: number`

    - `content_index: number`

    - `item_id: string`

    - `output_index: number`

    - `sequence_number: number`

    - `type: "response.output_text.annotation.added"`

      - `"response.output_text.annotation.added"`

  - `ResponseQueuedEvent`

    Emitted when a response is queued and waiting to be processed.

    - `response: OpenAIResponse`

    - `sequence_number: number`

    - `type: "response.queued"`

      - `"response.queued"`

  - `ResponseCustomToolCallInputDeltaEvent`

    Event representing a delta (partial update) to the input of a custom tool call.

    - `delta: string`

    - `item_id: string`

    - `output_index: number`

    - `sequence_number: number`

    - `type: "response.custom_tool_call_input.delta"`

      - `"response.custom_tool_call_input.delta"`

  - `ResponseCustomToolCallInputDoneEvent`

    Event indicating that input for a custom tool call is complete.

    - `input: string`

    - `item_id: string`

    - `output_index: number`

    - `sequence_number: number`

    - `type: "response.custom_tool_call_input.done"`

      - `"response.custom_tool_call_input.done"`

  - `GenericResponseEvent`

    - `type: string`
