# Responses

## Run OpenAI Responses API (OpenAI only)

`responses.create(ResponseCreateParams**kwargs)  -> 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

- `input: Union[str, Iterable[InputInputItem]]`

  - `str`

  - `Iterable[InputInputItem]`

    - `class InputInputItemEasyInputMessageParam: …`

      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: Union[str, Iterable[InputInputItemEasyInputMessageParamContentInputItem]]`

        - `str`

        - `Iterable[InputInputItemEasyInputMessageParamContentInputItem]`

          - `class OpenAIResponseInputTextParam: …`

            A text input to the model.

            - `text: str`

            - `type: Literal["input_text"]`

              - `"input_text"`

          - `class OpenAIResponseInputImageParam: …`

            An image input to the model.

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

            - `detail: Literal["low", "high", "auto"]`

              - `"low"`

              - `"high"`

              - `"auto"`

            - `type: Literal["input_image"]`

              - `"input_image"`

            - `file_id: Optional[str]`

            - `image_url: Optional[str]`

          - `class OpenAIResponseInputFileParam: …`

            A file input to the model.

            - `type: Literal["input_file"]`

              - `"input_file"`

            - `file_data: Optional[str]`

            - `file_id: Optional[str]`

            - `file_url: Optional[str]`

            - `filename: Optional[str]`

      - `role: Literal["user", "assistant", "system", "developer"]`

        - `"user"`

        - `"assistant"`

        - `"system"`

        - `"developer"`

      - `phase: Optional[Literal["commentary", "final_answer"]]`

        - `"commentary"`

        - `"final_answer"`

      - `type: Optional[Literal["message"]]`

        - `"message"`

    - `class InputInputItemOpenAITypesResponsesResponseInputParamMessage: …`

      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: Iterable[InputInputItemOpenAITypesResponsesResponseInputParamMessageContent]`

        - `class OpenAIResponseInputTextParam: …`

          A text input to the model.

        - `class OpenAIResponseInputImageParam: …`

          An image input to the model.

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

        - `class OpenAIResponseInputFileParam: …`

          A file input to the model.

      - `role: Literal["user", "system", "developer"]`

        - `"user"`

        - `"system"`

        - `"developer"`

      - `status: Optional[Literal["in_progress", "completed", "incomplete"]]`

        - `"in_progress"`

        - `"completed"`

        - `"incomplete"`

      - `type: Optional[Literal["message"]]`

        - `"message"`

    - `class InputInputItemResponseOutputMessageParam: …`

      An output message from the model.

      - `id: str`

      - `content: Iterable[InputInputItemResponseOutputMessageParamContent]`

        - `class InputInputItemResponseOutputMessageParamContentResponseOutputTextParam: …`

          A text output from the model.

          - `annotations: Iterable[InputInputItemResponseOutputMessageParamContentResponseOutputTextParamAnnotation]`

            - `class InputInputItemResponseOutputMessageParamContentResponseOutputTextParamAnnotationAnnotationFileCitation: …`

              A citation to a file.

              - `file_id: str`

              - `filename: str`

              - `index: int`

              - `type: Literal["file_citation"]`

                - `"file_citation"`

            - `class InputInputItemResponseOutputMessageParamContentResponseOutputTextParamAnnotationOpenAITypesResponsesResponseOutputTextParamAnnotationURLCitation: …`

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

              - `end_index: int`

              - `start_index: int`

              - `title: str`

              - `type: Literal["url_citation"]`

                - `"url_citation"`

              - `url: str`

            - `class InputInputItemResponseOutputMessageParamContentResponseOutputTextParamAnnotationAnnotationContainerFileCitation: …`

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

              - `container_id: str`

              - `end_index: int`

              - `file_id: str`

              - `filename: str`

              - `start_index: int`

              - `type: Literal["container_file_citation"]`

                - `"container_file_citation"`

            - `class InputInputItemResponseOutputMessageParamContentResponseOutputTextParamAnnotationAnnotationFilePath: …`

              A path to a file.

              - `file_id: str`

              - `index: int`

              - `type: Literal["file_path"]`

                - `"file_path"`

          - `text: str`

          - `type: Literal["output_text"]`

            - `"output_text"`

          - `logprobs: Optional[Iterable[InputInputItemResponseOutputMessageParamContentResponseOutputTextParamLogprob]]`

            - `token: str`

            - `bytes: Iterable[int]`

            - `logprob: float`

            - `top_logprobs: Iterable[InputInputItemResponseOutputMessageParamContentResponseOutputTextParamLogprobTopLogprob]`

              - `token: str`

              - `bytes: Iterable[int]`

              - `logprob: float`

        - `class InputInputItemResponseOutputMessageParamContentResponseOutputRefusalParam: …`

          A refusal from the model.

          - `refusal: str`

          - `type: Literal["refusal"]`

            - `"refusal"`

      - `role: Literal["assistant"]`

        - `"assistant"`

      - `status: Literal["in_progress", "completed", "incomplete"]`

        - `"in_progress"`

        - `"completed"`

        - `"incomplete"`

      - `type: Literal["message"]`

        - `"message"`

      - `phase: Optional[Literal["commentary", "final_answer"]]`

        - `"commentary"`

        - `"final_answer"`

    - `class InputInputItemResponseFileSearchToolCallParam: …`

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

      - `queries: Sequence[str]`

      - `status: Literal["in_progress", "searching", "completed", 2 more]`

        - `"in_progress"`

        - `"searching"`

        - `"completed"`

        - `"incomplete"`

        - `"failed"`

      - `type: Literal["file_search_call"]`

        - `"file_search_call"`

      - `results: Optional[Iterable[InputInputItemResponseFileSearchToolCallParamResult]]`

        - `attributes: Optional[Dict[str, Union[str, float, bool]]]`

          - `str`

          - `float`

          - `bool`

        - `file_id: Optional[str]`

        - `filename: Optional[str]`

        - `score: Optional[float]`

        - `text: Optional[str]`

    - `class InputInputItemResponseComputerToolCallParam: …`

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

      - `action: InputInputItemResponseComputerToolCallParamAction`

        A click action.

        - `class InputInputItemResponseComputerToolCallParamActionActionClick: …`

          A click action.

          - `button: Literal["left", "right", "wheel", 2 more]`

            - `"left"`

            - `"right"`

            - `"wheel"`

            - `"back"`

            - `"forward"`

          - `type: Literal["click"]`

            - `"click"`

          - `x: int`

          - `y: int`

        - `class InputInputItemResponseComputerToolCallParamActionActionDoubleClick: …`

          A double click action.

          - `type: Literal["double_click"]`

            - `"double_click"`

          - `x: int`

          - `y: int`

        - `class InputInputItemResponseComputerToolCallParamActionActionDrag: …`

          A drag action.

          - `path: Iterable[InputInputItemResponseComputerToolCallParamActionActionDragPath]`

            - `x: int`

            - `y: int`

          - `type: Literal["drag"]`

            - `"drag"`

        - `class InputInputItemResponseComputerToolCallParamActionActionKeypress: …`

          A collection of keypresses the model would like to perform.

          - `keys: Sequence[str]`

          - `type: Literal["keypress"]`

            - `"keypress"`

        - `class InputInputItemResponseComputerToolCallParamActionActionMove: …`

          A mouse move action.

          - `type: Literal["move"]`

            - `"move"`

          - `x: int`

          - `y: int`

        - `class InputInputItemResponseComputerToolCallParamActionActionScreenshot: …`

          A screenshot action.

          - `type: Literal["screenshot"]`

            - `"screenshot"`

        - `class InputInputItemResponseComputerToolCallParamActionActionScroll: …`

          A scroll action.

          - `scroll_x: int`

          - `scroll_y: int`

          - `type: Literal["scroll"]`

            - `"scroll"`

          - `x: int`

          - `y: int`

        - `class InputInputItemResponseComputerToolCallParamActionActionType: …`

          An action to type in text.

          - `text: str`

          - `type: Literal["type"]`

            - `"type"`

        - `class InputInputItemResponseComputerToolCallParamActionActionWait: …`

          A wait action.

          - `type: Literal["wait"]`

            - `"wait"`

      - `call_id: str`

      - `pending_safety_checks: Iterable[InputInputItemResponseComputerToolCallParamPendingSafetyCheck]`

        - `id: str`

        - `code: Optional[str]`

        - `message: Optional[str]`

      - `status: Literal["in_progress", "completed", "incomplete"]`

        - `"in_progress"`

        - `"completed"`

        - `"incomplete"`

      - `type: Literal["computer_call"]`

        - `"computer_call"`

    - `class InputInputItemOpenAITypesResponsesResponseInputParamComputerCallOutput: …`

      The output of a computer tool call.

      - `call_id: str`

      - `output: InputInputItemOpenAITypesResponsesResponseInputParamComputerCallOutputOutput`

        A computer screenshot image used with the computer use tool.

        - `type: Literal["computer_screenshot"]`

          - `"computer_screenshot"`

        - `file_id: Optional[str]`

        - `image_url: Optional[str]`

      - `type: Literal["computer_call_output"]`

        - `"computer_call_output"`

      - `id: Optional[str]`

      - `acknowledged_safety_checks: Optional[Iterable[InputInputItemOpenAITypesResponsesResponseInputParamComputerCallOutputAcknowledgedSafetyCheck]]`

        - `id: str`

        - `code: Optional[str]`

        - `message: Optional[str]`

      - `status: Optional[Literal["in_progress", "completed", "incomplete"]]`

        - `"in_progress"`

        - `"completed"`

        - `"incomplete"`

    - `class InputInputItemResponseFunctionWebSearchParam: …`

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

      - `action: InputInputItemResponseFunctionWebSearchParamAction`

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

        - `class InputInputItemResponseFunctionWebSearchParamActionOpenAITypesResponsesResponseFunctionWebSearchParamActionSearch: …`

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

          - `query: str`

          - `type: Literal["search"]`

            - `"search"`

          - `queries: Optional[Sequence[str]]`

          - `sources: Optional[Iterable[InputInputItemResponseFunctionWebSearchParamActionOpenAITypesResponsesResponseFunctionWebSearchParamActionSearchSource]]`

            - `type: Literal["url"]`

              - `"url"`

            - `url: str`

        - `class InputInputItemResponseFunctionWebSearchParamActionOpenAITypesResponsesResponseFunctionWebSearchParamActionOpenPage: …`

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

          - `type: Literal["open_page"]`

            - `"open_page"`

          - `url: Optional[str]`

        - `class InputInputItemResponseFunctionWebSearchParamActionActionFind: …`

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

          - `pattern: str`

          - `type: Literal["find_in_page"]`

            - `"find_in_page"`

          - `url: str`

      - `status: Literal["in_progress", "searching", "completed", "failed"]`

        - `"in_progress"`

        - `"searching"`

        - `"completed"`

        - `"failed"`

      - `type: Literal["web_search_call"]`

        - `"web_search_call"`

    - `class InputInputItemResponseFunctionToolCallParam: …`

      A tool call to run a function.

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

      - `arguments: str`

      - `call_id: str`

      - `name: str`

      - `type: Literal["function_call"]`

        - `"function_call"`

      - `id: Optional[str]`

      - `status: Optional[Literal["in_progress", "completed", "incomplete"]]`

        - `"in_progress"`

        - `"completed"`

        - `"incomplete"`

    - `class InputInputItemOpenAITypesResponsesResponseInputParamFunctionCallOutput: …`

      The output of a function tool call.

      - `call_id: str`

      - `output: Union[str, Iterable[InputInputItemOpenAITypesResponsesResponseInputParamFunctionCallOutputOutputOutputContentList]]`

        - `str`

        - `Iterable[InputInputItemOpenAITypesResponsesResponseInputParamFunctionCallOutputOutputOutputContentList]`

          - `class InputInputItemOpenAITypesResponsesResponseInputParamFunctionCallOutputOutputOutputContentListResponseInputTextContentParam: …`

            A text input to the model.

            - `text: str`

            - `type: Literal["input_text"]`

              - `"input_text"`

          - `class InputInputItemOpenAITypesResponsesResponseInputParamFunctionCallOutputOutputOutputContentListResponseInputImageContentParam: …`

            An image input to the model.

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

            - `type: Literal["input_image"]`

              - `"input_image"`

            - `detail: Optional[Literal["low", "high", "auto"]]`

              - `"low"`

              - `"high"`

              - `"auto"`

            - `file_id: Optional[str]`

            - `image_url: Optional[str]`

          - `class InputInputItemOpenAITypesResponsesResponseInputParamFunctionCallOutputOutputOutputContentListResponseInputFileContentParam: …`

            A file input to the model.

            - `type: Literal["input_file"]`

              - `"input_file"`

            - `file_data: Optional[str]`

            - `file_id: Optional[str]`

            - `file_url: Optional[str]`

            - `filename: Optional[str]`

      - `type: Literal["function_call_output"]`

        - `"function_call_output"`

      - `id: Optional[str]`

      - `status: Optional[Literal["in_progress", "completed", "incomplete"]]`

        - `"in_progress"`

        - `"completed"`

        - `"incomplete"`

    - `class InputInputItemResponseReasoningItemParam: …`

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

      - `summary: Iterable[InputInputItemResponseReasoningItemParamSummary]`

        - `text: str`

        - `type: Literal["summary_text"]`

          - `"summary_text"`

      - `type: Literal["reasoning"]`

        - `"reasoning"`

      - `content: Optional[Iterable[InputInputItemResponseReasoningItemParamContent]]`

        - `text: str`

        - `type: Literal["reasoning_text"]`

          - `"reasoning_text"`

      - `encrypted_content: Optional[str]`

      - `status: Optional[Literal["in_progress", "completed", "incomplete"]]`

        - `"in_progress"`

        - `"completed"`

        - `"incomplete"`

    - `class InputInputItemResponseCompactionItemParamParam: …`

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

      - `encrypted_content: str`

      - `type: Literal["compaction"]`

        - `"compaction"`

      - `id: Optional[str]`

    - `class InputInputItemOpenAITypesResponsesResponseInputParamImageGenerationCall: …`

      An image generation request made by the model.

      - `id: str`

      - `result: Optional[str]`

      - `status: Literal["in_progress", "completed", "generating", "failed"]`

        - `"in_progress"`

        - `"completed"`

        - `"generating"`

        - `"failed"`

      - `type: Literal["image_generation_call"]`

        - `"image_generation_call"`

    - `class InputInputItemResponseCodeInterpreterToolCallParam: …`

      A tool call to run code.

      - `id: str`

      - `code: Optional[str]`

      - `container_id: str`

      - `outputs: Optional[Iterable[InputInputItemResponseCodeInterpreterToolCallParamOutput]]`

        - `class InputInputItemResponseCodeInterpreterToolCallParamOutputOutputLogs: …`

          The logs output from the code interpreter.

          - `logs: str`

          - `type: Literal["logs"]`

            - `"logs"`

        - `class InputInputItemResponseCodeInterpreterToolCallParamOutputOutputImage: …`

          The image output from the code interpreter.

          - `type: Literal["image"]`

            - `"image"`

          - `url: str`

      - `status: Literal["in_progress", "completed", "incomplete", 2 more]`

        - `"in_progress"`

        - `"completed"`

        - `"incomplete"`

        - `"interpreting"`

        - `"failed"`

      - `type: Literal["code_interpreter_call"]`

        - `"code_interpreter_call"`

    - `class InputInputItemOpenAITypesResponsesResponseInputParamLocalShellCall: …`

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

      - `id: str`

      - `action: InputInputItemOpenAITypesResponsesResponseInputParamLocalShellCallAction`

        Execute a shell command on the server.

        - `command: Sequence[str]`

        - `env: Dict[str, str]`

        - `type: Literal["exec"]`

          - `"exec"`

        - `timeout_ms: Optional[int]`

        - `user: Optional[str]`

        - `working_directory: Optional[str]`

      - `call_id: str`

      - `status: Literal["in_progress", "completed", "incomplete"]`

        - `"in_progress"`

        - `"completed"`

        - `"incomplete"`

      - `type: Literal["local_shell_call"]`

        - `"local_shell_call"`

    - `class InputInputItemOpenAITypesResponsesResponseInputParamLocalShellCallOutput: …`

      The output of a local shell tool call.

      - `id: str`

      - `output: str`

      - `type: Literal["local_shell_call_output"]`

        - `"local_shell_call_output"`

      - `status: Optional[Literal["in_progress", "completed", "incomplete"]]`

        - `"in_progress"`

        - `"completed"`

        - `"incomplete"`

    - `class InputInputItemOpenAITypesResponsesResponseInputParamShellCall: …`

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

      - `action: InputInputItemOpenAITypesResponsesResponseInputParamShellCallAction`

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

        - `commands: Sequence[str]`

        - `max_output_length: Optional[int]`

        - `timeout_ms: Optional[int]`

      - `call_id: str`

      - `type: Literal["shell_call"]`

        - `"shell_call"`

      - `id: Optional[str]`

      - `environment: Optional[InputInputItemOpenAITypesResponsesResponseInputParamShellCallEnvironment]`

        - `class LocalEnvironmentParam: …`

          - `type: Literal["local"]`

            - `"local"`

          - `skills: Optional[List[Skill]]`

            - `description: str`

            - `name: str`

            - `path: str`

        - `class ContainerReferenceParam: …`

          - `container_id: str`

          - `type: Literal["container_reference"]`

            - `"container_reference"`

      - `status: Optional[Literal["in_progress", "completed", "incomplete"]]`

        - `"in_progress"`

        - `"completed"`

        - `"incomplete"`

    - `class InputInputItemOpenAITypesResponsesResponseInputParamShellCallOutput: …`

      The streamed output items emitted by a shell tool call.

      - `call_id: str`

      - `output: Iterable[InputInputItemOpenAITypesResponsesResponseInputParamShellCallOutputOutput]`

        - `outcome: InputInputItemOpenAITypesResponsesResponseInputParamShellCallOutputOutputOutcome`

          Indicates that the shell call exceeded its configured time limit.

          - `class InputInputItemOpenAITypesResponsesResponseInputParamShellCallOutputOutputOutcomeOutcomeTimeout: …`

            Indicates that the shell call exceeded its configured time limit.

            - `type: Literal["timeout"]`

              - `"timeout"`

          - `class InputInputItemOpenAITypesResponsesResponseInputParamShellCallOutputOutputOutcomeOutcomeExit: …`

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

            - `exit_code: int`

            - `type: Literal["exit"]`

              - `"exit"`

        - `stderr: str`

        - `stdout: str`

      - `type: Literal["shell_call_output"]`

        - `"shell_call_output"`

      - `id: Optional[str]`

      - `max_output_length: Optional[int]`

      - `status: Optional[Literal["in_progress", "completed", "incomplete"]]`

        - `"in_progress"`

        - `"completed"`

        - `"incomplete"`

    - `class InputInputItemOpenAITypesResponsesResponseInputParamApplyPatchCall: …`

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

      - `call_id: str`

      - `operation: InputInputItemOpenAITypesResponsesResponseInputParamApplyPatchCallOperation`

        Instruction for creating a new file via the apply_patch tool.

        - `class InputInputItemOpenAITypesResponsesResponseInputParamApplyPatchCallOperationApplyPatchCallOperationCreateFile: …`

          Instruction for creating a new file via the apply_patch tool.

          - `diff: str`

          - `path: str`

          - `type: Literal["create_file"]`

            - `"create_file"`

        - `class InputInputItemOpenAITypesResponsesResponseInputParamApplyPatchCallOperationApplyPatchCallOperationDeleteFile: …`

          Instruction for deleting an existing file via the apply_patch tool.

          - `path: str`

          - `type: Literal["delete_file"]`

            - `"delete_file"`

        - `class InputInputItemOpenAITypesResponsesResponseInputParamApplyPatchCallOperationApplyPatchCallOperationUpdateFile: …`

          Instruction for updating an existing file via the apply_patch tool.

          - `diff: str`

          - `path: str`

          - `type: Literal["update_file"]`

            - `"update_file"`

      - `status: Literal["in_progress", "completed"]`

        - `"in_progress"`

        - `"completed"`

      - `type: Literal["apply_patch_call"]`

        - `"apply_patch_call"`

      - `id: Optional[str]`

    - `class InputInputItemOpenAITypesResponsesResponseInputParamApplyPatchCallOutput: …`

      The streamed output emitted by an apply patch tool call.

      - `call_id: str`

      - `status: Literal["completed", "failed"]`

        - `"completed"`

        - `"failed"`

      - `type: Literal["apply_patch_call_output"]`

        - `"apply_patch_call_output"`

      - `id: Optional[str]`

      - `output: Optional[str]`

    - `class InputInputItemOpenAITypesResponsesResponseInputParamMcpListTools: …`

      A list of tools available on an MCP server.

      - `id: str`

      - `server_label: str`

      - `tools: Iterable[InputInputItemOpenAITypesResponsesResponseInputParamMcpListToolsTool]`

        - `input_schema: object`

        - `name: str`

        - `annotations: Optional[object]`

        - `description: Optional[str]`

      - `type: Literal["mcp_list_tools"]`

        - `"mcp_list_tools"`

      - `error: Optional[str]`

    - `class McpApprovalRequest: …`

      A request for human approval of a tool invocation.

      - `id: str`

      - `arguments: str`

      - `name: str`

      - `server_label: str`

      - `type: Literal["mcp_approval_request"]`

        - `"mcp_approval_request"`

    - `class InputInputItemOpenAITypesResponsesResponseInputParamMcpApprovalResponse: …`

      A response to an MCP approval request.

      - `approval_request_id: str`

      - `approve: bool`

      - `type: Literal["mcp_approval_response"]`

        - `"mcp_approval_response"`

      - `id: Optional[str]`

      - `reason: Optional[str]`

    - `class InputInputItemOpenAITypesResponsesResponseInputParamMcpCall: …`

      An invocation of a tool on an MCP server.

      - `id: str`

      - `arguments: str`

      - `name: str`

      - `server_label: str`

      - `type: Literal["mcp_call"]`

        - `"mcp_call"`

      - `approval_request_id: Optional[str]`

      - `error: Optional[str]`

      - `output: Optional[str]`

      - `status: Optional[Literal["in_progress", "completed", "incomplete", 2 more]]`

        - `"in_progress"`

        - `"completed"`

        - `"incomplete"`

        - `"calling"`

        - `"failed"`

    - `class InputInputItemResponseCustomToolCallOutputParam: …`

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

      - `call_id: str`

      - `output: Union[str, Iterable[InputInputItemResponseCustomToolCallOutputParamOutputOutputContentList]]`

        - `str`

        - `Iterable[InputInputItemResponseCustomToolCallOutputParamOutputOutputContentList]`

          - `class OpenAIResponseInputTextParam: …`

            A text input to the model.

          - `class OpenAIResponseInputImageParam: …`

            An image input to the model.

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

          - `class OpenAIResponseInputFileParam: …`

            A file input to the model.

      - `type: Literal["custom_tool_call_output"]`

        - `"custom_tool_call_output"`

      - `id: Optional[str]`

    - `class InputInputItemResponseCustomToolCallParam: …`

      A call to a custom tool created by the model.

      - `call_id: str`

      - `input: str`

      - `name: str`

      - `type: Literal["custom_tool_call"]`

        - `"custom_tool_call"`

      - `id: Optional[str]`

    - `class InputInputItemOpenAITypesResponsesResponseInputParamItemReference: …`

      An internal identifier for an item to reference.

      - `id: str`

      - `type: Optional[Literal["item_reference"]]`

        - `"item_reference"`

- `model: str`

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

- `include: Optional[Sequence[str]]`

  Which fields to include in the response

- `instructions: Optional[str]`

  Instructions for the response generation

- `max_output_tokens: Optional[int]`

  Maximum number of output tokens

- `metadata: Optional[Dict[str, object]]`

  Metadata for the response

- `parallel_tool_calls: Optional[bool]`

  Whether to enable parallel tool calls

- `previous_response_id: Optional[str]`

  ID of the previous response for chaining

- `reasoning: Optional[Dict[str, object]]`

  Reasoning configuration for the response

- `store: Optional[bool]`

  Whether to store the response

- `stream: Optional[bool]`

  Whether to stream the response

- `temperature: Optional[float]`

  Sampling temperature for randomness control

- `text: Optional[Dict[str, object]]`

  Text configuration parameters

- `tool_choice: Optional[Union[str, Dict[str, object]]]`

  Tool choice configuration

  - `str`

  - `Dict[str, object]`

- `tools: Optional[Iterable[Dict[str, object]]]`

  Tools available for the response

- `top_p: Optional[float]`

  Top-p sampling parameter

- `truncation: Optional[Literal["auto", "disabled"]]`

  Truncation configuration

  - `"auto"`

  - `"disabled"`

### Returns

- `ResponseCreateResponse`

  Emitted when there is a partial audio response.

  - `class OpenAIResponse: …`

    - `id: str`

    - `created_at: float`

    - `model: Union[Literal["gpt-5.2", "gpt-5.2-2025-12-11", "gpt-5.2-chat-latest", 83 more], str]`

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

      - `str`

    - `object: Literal["response"]`

      - `"response"`

    - `output: List[Output]`

      - `class OpenAIResponseOutputMessage: …`

        An output message from the model.

        - `id: str`

        - `content: List[Content]`

          - `class OpenAIResponseOutputText: …`

            A text output from the model.

            - `annotations: List[Annotation]`

              - `class AnnotationAnnotationFileCitation: …`

                A citation to a file.

                - `file_id: str`

                - `filename: str`

                - `index: int`

                - `type: Literal["file_citation"]`

                  - `"file_citation"`

              - `class AnnotationOpenAITypesResponsesResponseOutputTextAnnotationURLCitation: …`

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

                - `end_index: int`

                - `start_index: int`

                - `title: str`

                - `type: Literal["url_citation"]`

                  - `"url_citation"`

                - `url: str`

              - `class AnnotationAnnotationContainerFileCitation: …`

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

                - `container_id: str`

                - `end_index: int`

                - `file_id: str`

                - `filename: str`

                - `start_index: int`

                - `type: Literal["container_file_citation"]`

                  - `"container_file_citation"`

              - `class AnnotationAnnotationFilePath: …`

                A path to a file.

                - `file_id: str`

                - `index: int`

                - `type: Literal["file_path"]`

                  - `"file_path"`

            - `text: str`

            - `type: Literal["output_text"]`

              - `"output_text"`

            - `logprobs: Optional[List[Logprob]]`

              - `token: str`

              - `bytes: List[int]`

              - `logprob: float`

              - `top_logprobs: List[LogprobTopLogprob]`

                - `token: str`

                - `bytes: List[int]`

                - `logprob: float`

          - `class OpenAIResponseOutputRefusal: …`

            A refusal from the model.

            - `refusal: str`

            - `type: Literal["refusal"]`

              - `"refusal"`

        - `role: Literal["assistant"]`

          - `"assistant"`

        - `status: Literal["in_progress", "completed", "incomplete"]`

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

        - `type: Literal["message"]`

          - `"message"`

        - `phase: Optional[Literal["commentary", "final_answer"]]`

          - `"commentary"`

          - `"final_answer"`

      - `class 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: str`

        - `queries: List[str]`

        - `status: Literal["in_progress", "searching", "completed", 2 more]`

          - `"in_progress"`

          - `"searching"`

          - `"completed"`

          - `"incomplete"`

          - `"failed"`

        - `type: Literal["file_search_call"]`

          - `"file_search_call"`

        - `results: Optional[List[Result]]`

          - `attributes: Optional[Dict[str, Union[str, float, bool]]]`

            - `str`

            - `float`

            - `bool`

          - `file_id: Optional[str]`

          - `filename: Optional[str]`

          - `score: Optional[float]`

          - `text: Optional[str]`

      - `class 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: str`

        - `call_id: str`

        - `name: str`

        - `type: Literal["function_call"]`

          - `"function_call"`

        - `id: Optional[str]`

        - `status: Optional[Literal["in_progress", "completed", "incomplete"]]`

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

      - `class 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: str`

        - `action: Action`

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

          - `class ActionOpenAITypesResponsesResponseFunctionWebSearchActionSearch: …`

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

            - `query: str`

            - `type: Literal["search"]`

              - `"search"`

            - `queries: Optional[List[str]]`

            - `sources: Optional[List[ActionOpenAITypesResponsesResponseFunctionWebSearchActionSearchSource]]`

              - `type: Literal["url"]`

                - `"url"`

              - `url: str`

          - `class ActionOpenAITypesResponsesResponseFunctionWebSearchActionOpenPage: …`

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

            - `type: Literal["open_page"]`

              - `"open_page"`

            - `url: Optional[str]`

          - `class ActionActionFind: …`

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

            - `pattern: str`

            - `type: Literal["find_in_page"]`

              - `"find_in_page"`

            - `url: str`

        - `status: Literal["in_progress", "searching", "completed", "failed"]`

          - `"in_progress"`

          - `"searching"`

          - `"completed"`

          - `"failed"`

        - `type: Literal["web_search_call"]`

          - `"web_search_call"`

      - `class 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: str`

        - `action: Action`

          A click action.

          - `class ActionActionClick: …`

            A click action.

            - `button: Literal["left", "right", "wheel", 2 more]`

              - `"left"`

              - `"right"`

              - `"wheel"`

              - `"back"`

              - `"forward"`

            - `type: Literal["click"]`

              - `"click"`

            - `x: int`

            - `y: int`

          - `class ActionActionDoubleClick: …`

            A double click action.

            - `type: Literal["double_click"]`

              - `"double_click"`

            - `x: int`

            - `y: int`

          - `class ActionActionDrag: …`

            A drag action.

            - `path: List[ActionActionDragPath]`

              - `x: int`

              - `y: int`

            - `type: Literal["drag"]`

              - `"drag"`

          - `class ActionActionKeypress: …`

            A collection of keypresses the model would like to perform.

            - `keys: List[str]`

            - `type: Literal["keypress"]`

              - `"keypress"`

          - `class ActionActionMove: …`

            A mouse move action.

            - `type: Literal["move"]`

              - `"move"`

            - `x: int`

            - `y: int`

          - `class ActionActionScreenshot: …`

            A screenshot action.

            - `type: Literal["screenshot"]`

              - `"screenshot"`

          - `class ActionActionScroll: …`

            A scroll action.

            - `scroll_x: int`

            - `scroll_y: int`

            - `type: Literal["scroll"]`

              - `"scroll"`

            - `x: int`

            - `y: int`

          - `class ActionActionType: …`

            An action to type in text.

            - `text: str`

            - `type: Literal["type"]`

              - `"type"`

          - `class ActionActionWait: …`

            A wait action.

            - `type: Literal["wait"]`

              - `"wait"`

        - `call_id: str`

        - `pending_safety_checks: List[PendingSafetyCheck]`

          - `id: str`

          - `code: Optional[str]`

          - `message: Optional[str]`

        - `status: Literal["in_progress", "completed", "incomplete"]`

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

        - `type: Literal["computer_call"]`

          - `"computer_call"`

      - `class 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: str`

        - `summary: List[Summary]`

          - `text: str`

          - `type: Literal["summary_text"]`

            - `"summary_text"`

        - `type: Literal["reasoning"]`

          - `"reasoning"`

        - `content: Optional[List[Content]]`

          - `text: str`

          - `type: Literal["reasoning_text"]`

            - `"reasoning_text"`

        - `encrypted_content: Optional[str]`

        - `status: Optional[Literal["in_progress", "completed", "incomplete"]]`

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

      - `class ResponseCompactionItem: …`

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

        - `id: str`

        - `encrypted_content: str`

        - `type: Literal["compaction"]`

          - `"compaction"`

        - `created_by: Optional[str]`

      - `class OpenAITypesResponsesResponseOutputItemImageGenerationCall: …`

        An image generation request made by the model.

        - `id: str`

        - `status: Literal["in_progress", "completed", "generating", "failed"]`

          - `"in_progress"`

          - `"completed"`

          - `"generating"`

          - `"failed"`

        - `type: Literal["image_generation_call"]`

          - `"image_generation_call"`

        - `result: Optional[str]`

      - `class OpenAIResponseCodeInterpreterToolCall: …`

        A tool call to run code.

        - `id: str`

        - `container_id: str`

        - `status: Literal["in_progress", "completed", "incomplete", 2 more]`

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

          - `"interpreting"`

          - `"failed"`

        - `type: Literal["code_interpreter_call"]`

          - `"code_interpreter_call"`

        - `code: Optional[str]`

        - `outputs: Optional[List[Output]]`

          - `class OutputOutputLogs: …`

            The logs output from the code interpreter.

            - `logs: str`

            - `type: Literal["logs"]`

              - `"logs"`

          - `class OutputOutputImage: …`

            The image output from the code interpreter.

            - `type: Literal["image"]`

              - `"image"`

            - `url: str`

      - `class OpenAITypesResponsesResponseOutputItemLocalShellCall: …`

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

        - `id: str`

        - `action: Action`

          Execute a shell command on the server.

          - `command: List[str]`

          - `env: Dict[str, str]`

          - `type: Literal["exec"]`

            - `"exec"`

          - `timeout_ms: Optional[int]`

          - `user: Optional[str]`

          - `working_directory: Optional[str]`

        - `call_id: str`

        - `status: Literal["in_progress", "completed", "incomplete"]`

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

        - `type: Literal["local_shell_call"]`

          - `"local_shell_call"`

      - `class ResponseFunctionShellToolCall: …`

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

        - `id: str`

        - `action: Action`

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

          - `commands: List[str]`

          - `max_output_length: Optional[int]`

          - `timeout_ms: Optional[int]`

        - `call_id: str`

        - `status: Literal["in_progress", "completed", "incomplete"]`

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

        - `type: Literal["shell_call"]`

          - `"shell_call"`

        - `created_by: Optional[str]`

        - `environment: Optional[Environment]`

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

          - `class EnvironmentResponseLocalEnvironment: …`

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

            - `type: Literal["local"]`

              - `"local"`

          - `class EnvironmentResponseContainerReference: …`

            Represents a container created with /v1/containers.

            - `container_id: str`

            - `type: Literal["container_reference"]`

              - `"container_reference"`

      - `class ResponseFunctionShellToolCallOutput: …`

        The output of a shell tool call that was emitted.

        - `id: str`

        - `call_id: str`

        - `output: List[Output]`

          - `outcome: OutputOutcome`

            Indicates that the shell call exceeded its configured time limit.

            - `class OutputOutcomeOutputOutcomeTimeout: …`

              Indicates that the shell call exceeded its configured time limit.

              - `type: Literal["timeout"]`

                - `"timeout"`

            - `class OutputOutcomeOutputOutcomeExit: …`

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

              - `exit_code: int`

              - `type: Literal["exit"]`

                - `"exit"`

          - `stderr: str`

          - `stdout: str`

          - `created_by: Optional[str]`

        - `status: Literal["in_progress", "completed", "incomplete"]`

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

        - `type: Literal["shell_call_output"]`

          - `"shell_call_output"`

        - `created_by: Optional[str]`

        - `max_output_length: Optional[int]`

      - `class ResponseApplyPatchToolCall: …`

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

        - `id: str`

        - `call_id: str`

        - `operation: Operation`

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

          - `class OperationOperationCreateFile: …`

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

            - `diff: str`

            - `path: str`

            - `type: Literal["create_file"]`

              - `"create_file"`

          - `class OperationOperationDeleteFile: …`

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

            - `path: str`

            - `type: Literal["delete_file"]`

              - `"delete_file"`

          - `class OperationOperationUpdateFile: …`

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

            - `diff: str`

            - `path: str`

            - `type: Literal["update_file"]`

              - `"update_file"`

        - `status: Literal["in_progress", "completed"]`

          - `"in_progress"`

          - `"completed"`

        - `type: Literal["apply_patch_call"]`

          - `"apply_patch_call"`

        - `created_by: Optional[str]`

      - `class ResponseApplyPatchToolCallOutput: …`

        The output emitted by an apply patch tool call.

        - `id: str`

        - `call_id: str`

        - `status: Literal["completed", "failed"]`

          - `"completed"`

          - `"failed"`

        - `type: Literal["apply_patch_call_output"]`

          - `"apply_patch_call_output"`

        - `created_by: Optional[str]`

        - `output: Optional[str]`

      - `class OpenAITypesResponsesResponseOutputItemMcpCall: …`

        An invocation of a tool on an MCP server.

        - `id: str`

        - `arguments: str`

        - `name: str`

        - `server_label: str`

        - `type: Literal["mcp_call"]`

          - `"mcp_call"`

        - `approval_request_id: Optional[str]`

        - `error: Optional[str]`

        - `output: Optional[str]`

        - `status: Optional[Literal["in_progress", "completed", "incomplete", 2 more]]`

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

          - `"calling"`

          - `"failed"`

      - `class OpenAITypesResponsesResponseOutputItemMcpListTools: …`

        A list of tools available on an MCP server.

        - `id: str`

        - `server_label: str`

        - `tools: List[Tool]`

          - `input_schema: object`

          - `name: str`

          - `annotations: Optional[object]`

          - `description: Optional[str]`

        - `type: Literal["mcp_list_tools"]`

          - `"mcp_list_tools"`

        - `error: Optional[str]`

      - `class McpApprovalRequest: …`

        A request for human approval of a tool invocation.

        - `id: str`

        - `arguments: str`

        - `name: str`

        - `server_label: str`

        - `type: Literal["mcp_approval_request"]`

          - `"mcp_approval_request"`

      - `class OpenAIResponseCustomToolCall: …`

        A call to a custom tool created by the model.

        - `call_id: str`

        - `input: str`

        - `name: str`

        - `type: Literal["custom_tool_call"]`

          - `"custom_tool_call"`

        - `id: Optional[str]`

    - `parallel_tool_calls: bool`

    - `tool_choice: ToolChoice`

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

      - `Literal["none", "auto", "required"]`

        - `"none"`

        - `"auto"`

        - `"required"`

      - `class ToolChoiceAllowed: …`

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

        - `mode: Literal["auto", "required"]`

          - `"auto"`

          - `"required"`

        - `tools: List[Dict[str, object]]`

        - `type: Literal["allowed_tools"]`

          - `"allowed_tools"`

      - `class 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: Literal["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"`

      - `class ToolChoiceFunction: …`

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

        - `name: str`

        - `type: Literal["function"]`

          - `"function"`

      - `class ToolChoiceMcp: …`

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

        - `server_label: str`

        - `type: Literal["mcp"]`

          - `"mcp"`

        - `name: Optional[str]`

      - `class ToolChoiceCustom: …`

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

        - `name: str`

        - `type: Literal["custom"]`

          - `"custom"`

      - `class ToolChoiceApplyPatch: …`

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

        - `type: Literal["apply_patch"]`

          - `"apply_patch"`

      - `class ToolChoiceShell: …`

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

        - `type: Literal["shell"]`

          - `"shell"`

    - `tools: List[Tool]`

      - `class 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: str`

        - `type: Literal["function"]`

          - `"function"`

        - `description: Optional[str]`

        - `parameters: Optional[Dict[str, object]]`

        - `strict: Optional[bool]`

      - `class 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: Literal["file_search"]`

          - `"file_search"`

        - `vector_store_ids: List[str]`

        - `filters: Optional[Filters]`

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

          - `class FiltersComparisonFilter: …`

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

            - `key: str`

            - `type: Literal["eq", "ne", "gt", 3 more]`

              - `"eq"`

              - `"ne"`

              - `"gt"`

              - `"gte"`

              - `"lt"`

              - `"lte"`

            - `value: Union[str, float, bool, List[Union[str, float]]]`

              - `str`

              - `float`

              - `bool`

              - `List[Union[str, float]]`

                - `str`

                - `float`

          - `class FiltersCompoundFilter: …`

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

            - `filters: List[FiltersCompoundFilterFilter]`

              - `class FiltersCompoundFilterFilterComparisonFilter: …`

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

                - `key: str`

                - `type: Literal["eq", "ne", "gt", 3 more]`

                  - `"eq"`

                  - `"ne"`

                  - `"gt"`

                  - `"gte"`

                  - `"lt"`

                  - `"lte"`

                - `value: Union[str, float, bool, List[Union[str, float]]]`

                  - `str`

                  - `float`

                  - `bool`

                  - `List[Union[str, float]]`

                    - `str`

                    - `float`

              - `object`

            - `type: Literal["and", "or"]`

              - `"and"`

              - `"or"`

        - `max_num_results: Optional[int]`

        - `ranking_options: Optional[RankingOptions]`

          Ranking options for search.

          - `hybrid_search: Optional[RankingOptionsHybridSearch]`

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

            - `embedding_weight: float`

            - `text_weight: float`

          - `ranker: Optional[Literal["auto", "default-2024-11-15"]]`

            - `"auto"`

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

          - `score_threshold: Optional[float]`

      - `class 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: int`

        - `display_width: int`

        - `environment: Literal["windows", "mac", "linux", 2 more]`

          - `"windows"`

          - `"mac"`

          - `"linux"`

          - `"ubuntu"`

          - `"browser"`

        - `type: Literal["computer_use_preview"]`

          - `"computer_use_preview"`

      - `class 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: Literal["web_search", "web_search_2025_08_26"]`

          - `"web_search"`

          - `"web_search_2025_08_26"`

        - `filters: Optional[Filters]`

          Filters for the search.

          - `allowed_domains: Optional[List[str]]`

        - `search_context_size: Optional[Literal["low", "medium", "high"]]`

          - `"low"`

          - `"medium"`

          - `"high"`

        - `user_location: Optional[UserLocation]`

          The approximate location of the user.

          - `city: Optional[str]`

          - `country: Optional[str]`

          - `region: Optional[str]`

          - `timezone: Optional[str]`

          - `type: Optional[Literal["approximate"]]`

            - `"approximate"`

      - `class ToolMcp: …`

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

        - `type: Literal["mcp"]`

          - `"mcp"`

        - `allowed_tools: Optional[ToolMcpAllowedTools]`

          A filter object to specify which tools are allowed.

          - `List[str]`

          - `class ToolMcpAllowedToolsMcpAllowedToolsMcpToolFilter: …`

            A filter object to specify which tools are allowed.

            - `read_only: Optional[bool]`

            - `tool_names: Optional[List[str]]`

        - `authorization: Optional[str]`

        - `connector_id: Optional[Literal["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: Optional[Dict[str, str]]`

        - `require_approval: Optional[ToolMcpRequireApproval]`

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

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

          - `class ToolMcpRequireApprovalMcpRequireApprovalMcpToolApprovalFilter: …`

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

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

            - `always: Optional[ToolMcpRequireApprovalMcpRequireApprovalMcpToolApprovalFilterAlways]`

              A filter object to specify which tools are allowed.

              - `read_only: Optional[bool]`

              - `tool_names: Optional[List[str]]`

            - `never: Optional[ToolMcpRequireApprovalMcpRequireApprovalMcpToolApprovalFilterNever]`

              A filter object to specify which tools are allowed.

              - `read_only: Optional[bool]`

              - `tool_names: Optional[List[str]]`

          - `Literal["always", "never"]`

            - `"always"`

            - `"never"`

        - `server_description: Optional[str]`

        - `server_url: Optional[str]`

      - `class ToolCodeInterpreter: …`

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

        - `container: ToolCodeInterpreterContainer`

          Configuration for a code interpreter container.

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

          - `str`

          - `class ToolCodeInterpreterContainerCodeInterpreterContainerCodeInterpreterToolAuto: …`

            Configuration for a code interpreter container.

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

            - `type: Literal["auto"]`

              - `"auto"`

            - `file_ids: Optional[List[str]]`

            - `memory_limit: Optional[Literal["1g", "4g", "16g", "64g"]]`

              - `"1g"`

              - `"4g"`

              - `"16g"`

              - `"64g"`

            - `network_policy: Optional[ToolCodeInterpreterContainerCodeInterpreterContainerCodeInterpreterToolAutoNetworkPolicy]`

              - `class ContainerNetworkPolicyDisabled: …`

                - `type: Literal["disabled"]`

                  - `"disabled"`

              - `class ContainerNetworkPolicyAllowlist: …`

                - `allowed_domains: List[str]`

                - `type: Literal["allowlist"]`

                  - `"allowlist"`

                - `domain_secrets: Optional[List[DomainSecret]]`

                  - `domain: str`

                  - `name: str`

                  - `value: str`

        - `type: Literal["code_interpreter"]`

          - `"code_interpreter"`

      - `class ToolImageGeneration: …`

        A tool that generates images using the GPT image models.

        - `type: Literal["image_generation"]`

          - `"image_generation"`

        - `action: Optional[Literal["generate", "edit", "auto"]]`

          - `"generate"`

          - `"edit"`

          - `"auto"`

        - `background: Optional[Literal["transparent", "opaque", "auto"]]`

          - `"transparent"`

          - `"opaque"`

          - `"auto"`

        - `input_fidelity: Optional[Literal["high", "low"]]`

          - `"high"`

          - `"low"`

        - `input_image_mask: Optional[ToolImageGenerationInputImageMask]`

          Optional mask for inpainting.

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

          - `file_id: Optional[str]`

          - `image_url: Optional[str]`

        - `model: Optional[Union[str, Literal["gpt-image-1", "gpt-image-1-mini", "gpt-image-1.5"], null]]`

          - `str`

          - `Literal["gpt-image-1", "gpt-image-1-mini", "gpt-image-1.5"]`

            - `"gpt-image-1"`

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

            - `"gpt-image-1.5"`

        - `moderation: Optional[Literal["auto", "low"]]`

          - `"auto"`

          - `"low"`

        - `output_compression: Optional[int]`

        - `output_format: Optional[Literal["png", "webp", "jpeg"]]`

          - `"png"`

          - `"webp"`

          - `"jpeg"`

        - `partial_images: Optional[int]`

        - `quality: Optional[Literal["low", "medium", "high", "auto"]]`

          - `"low"`

          - `"medium"`

          - `"high"`

          - `"auto"`

        - `size: Optional[Literal["1024x1024", "1024x1536", "1536x1024", "auto"]]`

          - `"1024x1024"`

          - `"1024x1536"`

          - `"1536x1024"`

          - `"auto"`

      - `class ToolLocalShell: …`

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

        - `type: Literal["local_shell"]`

          - `"local_shell"`

      - `class FunctionShellTool: …`

        A tool that allows the model to execute shell commands.

        - `type: Literal["shell"]`

          - `"shell"`

        - `environment: Optional[Environment]`

          - `class EnvironmentContainerAuto: …`

            - `type: Literal["container_auto"]`

              - `"container_auto"`

            - `file_ids: Optional[List[str]]`

            - `memory_limit: Optional[Literal["1g", "4g", "16g", "64g"]]`

              - `"1g"`

              - `"4g"`

              - `"16g"`

              - `"64g"`

            - `network_policy: Optional[EnvironmentContainerAutoNetworkPolicy]`

              - `class ContainerNetworkPolicyDisabled: …`

              - `class ContainerNetworkPolicyAllowlist: …`

            - `skills: Optional[List[EnvironmentContainerAutoSkill]]`

              - `class EnvironmentContainerAutoSkillSkillReference: …`

                - `skill_id: str`

                - `type: Literal["skill_reference"]`

                  - `"skill_reference"`

                - `version: Optional[str]`

              - `class EnvironmentContainerAutoSkillInlineSkill: …`

                - `description: str`

                - `name: str`

                - `source: EnvironmentContainerAutoSkillInlineSkillSource`

                  Inline skill payload

                  - `data: str`

                  - `media_type: Literal["application/zip"]`

                    - `"application/zip"`

                  - `type: Literal["base64"]`

                    - `"base64"`

                - `type: Literal["inline"]`

                  - `"inline"`

          - `class LocalEnvironment: …`

            - `type: Literal["local"]`

              - `"local"`

            - `skills: Optional[List[Skill]]`

              - `description: str`

              - `name: str`

              - `path: str`

          - `class ContainerReference: …`

            - `container_id: str`

            - `type: Literal["container_reference"]`

              - `"container_reference"`

      - `class 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: str`

        - `type: Literal["custom"]`

          - `"custom"`

        - `description: Optional[str]`

        - `format: Optional[Format]`

          Unconstrained free-form text.

          - `class FormatText: …`

            Unconstrained free-form text.

            - `type: Literal["text"]`

              - `"text"`

          - `class FormatGrammar: …`

            A grammar defined by the user.

            - `definition: str`

            - `syntax: Literal["lark", "regex"]`

              - `"lark"`

              - `"regex"`

            - `type: Literal["grammar"]`

              - `"grammar"`

      - `class 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: Literal["web_search_preview", "web_search_preview_2025_03_11"]`

          - `"web_search_preview"`

          - `"web_search_preview_2025_03_11"`

        - `search_context_size: Optional[Literal["low", "medium", "high"]]`

          - `"low"`

          - `"medium"`

          - `"high"`

        - `user_location: Optional[UserLocation]`

          The user's location.

          - `type: Literal["approximate"]`

            - `"approximate"`

          - `city: Optional[str]`

          - `country: Optional[str]`

          - `region: Optional[str]`

          - `timezone: Optional[str]`

      - `class ApplyPatchTool: …`

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

        - `type: Literal["apply_patch"]`

          - `"apply_patch"`

    - `background: Optional[bool]`

    - `completed_at: Optional[float]`

    - `conversation: Optional[Conversation]`

      The conversation that this response belonged to.

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

      - `id: str`

    - `error: Optional[OpenAIResponseError]`

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

      - `code: Literal["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: str`

    - `incomplete_details: Optional[IncompleteDetails]`

      Details about why the response is incomplete.

      - `reason: Optional[Literal["max_output_tokens", "content_filter"]]`

        - `"max_output_tokens"`

        - `"content_filter"`

    - `instructions: Optional[Union[str, List[InstructionsInputItem], null]]`

      - `str`

      - `List[InstructionsInputItem]`

        - `class 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: Union[str, List[ContentInputItem]]`

            - `str`

            - `List[ContentInputItem]`

              - `class OpenAIResponseInputText: …`

                A text input to the model.

                - `text: str`

                - `type: Literal["input_text"]`

                  - `"input_text"`

              - `class OpenAIResponseInputImage: …`

                An image input to the model.

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

                - `detail: Literal["low", "high", "auto"]`

                  - `"low"`

                  - `"high"`

                  - `"auto"`

                - `type: Literal["input_image"]`

                  - `"input_image"`

                - `file_id: Optional[str]`

                - `image_url: Optional[str]`

              - `class OpenAIResponseInputFile: …`

                A file input to the model.

                - `type: Literal["input_file"]`

                  - `"input_file"`

                - `file_data: Optional[str]`

                - `file_id: Optional[str]`

                - `file_url: Optional[str]`

                - `filename: Optional[str]`

          - `role: Literal["user", "assistant", "system", "developer"]`

            - `"user"`

            - `"assistant"`

            - `"system"`

            - `"developer"`

          - `phase: Optional[Literal["commentary", "final_answer"]]`

            - `"commentary"`

            - `"final_answer"`

          - `type: Optional[Literal["message"]]`

            - `"message"`

        - `class 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: List[Content]`

            - `class OpenAIResponseInputText: …`

              A text input to the model.

            - `class OpenAIResponseInputImage: …`

              An image input to the model.

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

            - `class OpenAIResponseInputFile: …`

              A file input to the model.

          - `role: Literal["user", "system", "developer"]`

            - `"user"`

            - `"system"`

            - `"developer"`

          - `status: Optional[Literal["in_progress", "completed", "incomplete"]]`

            - `"in_progress"`

            - `"completed"`

            - `"incomplete"`

          - `type: Optional[Literal["message"]]`

            - `"message"`

        - `class OpenAIResponseOutputMessage: …`

          An output message from the model.

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

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

        - `class OpenAITypesResponsesResponseInputItemComputerCallOutput: …`

          The output of a computer tool call.

          - `call_id: str`

          - `output: ResponseComputerToolCallOutputScreenshot`

            A computer screenshot image used with the computer use tool.

            - `type: Literal["computer_screenshot"]`

              - `"computer_screenshot"`

            - `file_id: Optional[str]`

            - `image_url: Optional[str]`

          - `type: Literal["computer_call_output"]`

            - `"computer_call_output"`

          - `id: Optional[str]`

          - `acknowledged_safety_checks: Optional[List[AcknowledgedSafetyCheck]]`

            - `id: str`

            - `code: Optional[str]`

            - `message: Optional[str]`

          - `status: Optional[Literal["in_progress", "completed", "incomplete"]]`

            - `"in_progress"`

            - `"completed"`

            - `"incomplete"`

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

        - `class OpenAIResponseFunctionToolCall: …`

          A tool call to run a function.

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

        - `class OpenAITypesResponsesResponseInputItemFunctionCallOutput: …`

          The output of a function tool call.

          - `call_id: str`

          - `output: Union[str, List[OutputOutputContentList]]`

            - `str`

            - `List[OutputOutputContentList]`

              - `class OutputOutputContentListResponseInputTextContent: …`

                A text input to the model.

                - `text: str`

                - `type: Literal["input_text"]`

                  - `"input_text"`

              - `class OutputOutputContentListResponseInputImageContent: …`

                An image input to the model.

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

                - `type: Literal["input_image"]`

                  - `"input_image"`

                - `detail: Optional[Literal["low", "high", "auto"]]`

                  - `"low"`

                  - `"high"`

                  - `"auto"`

                - `file_id: Optional[str]`

                - `image_url: Optional[str]`

              - `class OutputOutputContentListResponseInputFileContent: …`

                A file input to the model.

                - `type: Literal["input_file"]`

                  - `"input_file"`

                - `file_data: Optional[str]`

                - `file_id: Optional[str]`

                - `file_url: Optional[str]`

                - `filename: Optional[str]`

          - `type: Literal["function_call_output"]`

            - `"function_call_output"`

          - `id: Optional[str]`

          - `status: Optional[Literal["in_progress", "completed", "incomplete"]]`

            - `"in_progress"`

            - `"completed"`

            - `"incomplete"`

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

        - `class ResponseCompactionItemParam: …`

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

          - `encrypted_content: str`

          - `type: Literal["compaction"]`

            - `"compaction"`

          - `id: Optional[str]`

        - `class OpenAITypesResponsesResponseInputItemImageGenerationCall: …`

          An image generation request made by the model.

          - `id: str`

          - `status: Literal["in_progress", "completed", "generating", "failed"]`

            - `"in_progress"`

            - `"completed"`

            - `"generating"`

            - `"failed"`

          - `type: Literal["image_generation_call"]`

            - `"image_generation_call"`

          - `result: Optional[str]`

        - `class OpenAIResponseCodeInterpreterToolCall: …`

          A tool call to run code.

        - `class OpenAITypesResponsesResponseInputItemLocalShellCall: …`

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

          - `id: str`

          - `action: Action`

            Execute a shell command on the server.

            - `command: List[str]`

            - `env: Dict[str, str]`

            - `type: Literal["exec"]`

              - `"exec"`

            - `timeout_ms: Optional[int]`

            - `user: Optional[str]`

            - `working_directory: Optional[str]`

          - `call_id: str`

          - `status: Literal["in_progress", "completed", "incomplete"]`

            - `"in_progress"`

            - `"completed"`

            - `"incomplete"`

          - `type: Literal["local_shell_call"]`

            - `"local_shell_call"`

        - `class OpenAITypesResponsesResponseInputItemLocalShellCallOutput: …`

          The output of a local shell tool call.

          - `id: str`

          - `output: str`

          - `type: Literal["local_shell_call_output"]`

            - `"local_shell_call_output"`

          - `status: Optional[Literal["in_progress", "completed", "incomplete"]]`

            - `"in_progress"`

            - `"completed"`

            - `"incomplete"`

        - `class 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: List[str]`

            - `max_output_length: Optional[int]`

            - `timeout_ms: Optional[int]`

          - `call_id: str`

          - `type: Literal["shell_call"]`

            - `"shell_call"`

          - `id: Optional[str]`

          - `environment: Optional[Environment]`

            - `class LocalEnvironment: …`

            - `class ContainerReference: …`

          - `status: Optional[Literal["in_progress", "completed", "incomplete"]]`

            - `"in_progress"`

            - `"completed"`

            - `"incomplete"`

        - `class ShellCallOutput: …`

          The streamed output items emitted by a shell tool call.

          - `call_id: str`

          - `output: List[Output]`

            - `outcome: OutputOutcome`

              Indicates that the shell call exceeded its configured time limit.

              - `class OutputOutcomeOutcomeTimeout: …`

                Indicates that the shell call exceeded its configured time limit.

                - `type: Literal["timeout"]`

                  - `"timeout"`

              - `class OutputOutcomeOutcomeExit: …`

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

                - `exit_code: int`

                - `type: Literal["exit"]`

                  - `"exit"`

            - `stderr: str`

            - `stdout: str`

          - `type: Literal["shell_call_output"]`

            - `"shell_call_output"`

          - `id: Optional[str]`

          - `max_output_length: Optional[int]`

          - `status: Optional[Literal["in_progress", "completed", "incomplete"]]`

            - `"in_progress"`

            - `"completed"`

            - `"incomplete"`

        - `class ApplyPatchCall: …`

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

          - `call_id: str`

          - `operation: Operation`

            Instruction for creating a new file via the apply_patch tool.

            - `class OperationApplyPatchCallOperationCreateFile: …`

              Instruction for creating a new file via the apply_patch tool.

              - `diff: str`

              - `path: str`

              - `type: Literal["create_file"]`

                - `"create_file"`

            - `class OperationApplyPatchCallOperationDeleteFile: …`

              Instruction for deleting an existing file via the apply_patch tool.

              - `path: str`

              - `type: Literal["delete_file"]`

                - `"delete_file"`

            - `class OperationApplyPatchCallOperationUpdateFile: …`

              Instruction for updating an existing file via the apply_patch tool.

              - `diff: str`

              - `path: str`

              - `type: Literal["update_file"]`

                - `"update_file"`

          - `status: Literal["in_progress", "completed"]`

            - `"in_progress"`

            - `"completed"`

          - `type: Literal["apply_patch_call"]`

            - `"apply_patch_call"`

          - `id: Optional[str]`

        - `class ApplyPatchCallOutput: …`

          The streamed output emitted by an apply patch tool call.

          - `call_id: str`

          - `status: Literal["completed", "failed"]`

            - `"completed"`

            - `"failed"`

          - `type: Literal["apply_patch_call_output"]`

            - `"apply_patch_call_output"`

          - `id: Optional[str]`

          - `output: Optional[str]`

        - `class OpenAITypesResponsesResponseInputItemMcpListTools: …`

          A list of tools available on an MCP server.

          - `id: str`

          - `server_label: str`

          - `tools: List[Tool]`

            - `input_schema: object`

            - `name: str`

            - `annotations: Optional[object]`

            - `description: Optional[str]`

          - `type: Literal["mcp_list_tools"]`

            - `"mcp_list_tools"`

          - `error: Optional[str]`

        - `class McpApprovalRequest: …`

          A request for human approval of a tool invocation.

        - `class OpenAITypesResponsesResponseInputItemMcpApprovalResponse: …`

          A response to an MCP approval request.

          - `approval_request_id: str`

          - `approve: bool`

          - `type: Literal["mcp_approval_response"]`

            - `"mcp_approval_response"`

          - `id: Optional[str]`

          - `reason: Optional[str]`

        - `class OpenAITypesResponsesResponseInputItemMcpCall: …`

          An invocation of a tool on an MCP server.

          - `id: str`

          - `arguments: str`

          - `name: str`

          - `server_label: str`

          - `type: Literal["mcp_call"]`

            - `"mcp_call"`

          - `approval_request_id: Optional[str]`

          - `error: Optional[str]`

          - `output: Optional[str]`

          - `status: Optional[Literal["in_progress", "completed", "incomplete", 2 more]]`

            - `"in_progress"`

            - `"completed"`

            - `"incomplete"`

            - `"calling"`

            - `"failed"`

        - `class OpenAIResponseCustomToolCallOutput: …`

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

          - `call_id: str`

          - `output: Union[str, List[OutputOutputContentList]]`

            - `str`

            - `List[OutputOutputContentList]`

              - `class OpenAIResponseInputText: …`

                A text input to the model.

              - `class OpenAIResponseInputImage: …`

                An image input to the model.

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

              - `class OpenAIResponseInputFile: …`

                A file input to the model.

          - `type: Literal["custom_tool_call_output"]`

            - `"custom_tool_call_output"`

          - `id: Optional[str]`

        - `class OpenAIResponseCustomToolCall: …`

          A call to a custom tool created by the model.

        - `class OpenAITypesResponsesResponseInputItemItemReference: …`

          An internal identifier for an item to reference.

          - `id: str`

          - `type: Optional[Literal["item_reference"]]`

            - `"item_reference"`

    - `max_output_tokens: Optional[int]`

    - `max_tool_calls: Optional[int]`

    - `metadata: Optional[Dict[str, str]]`

    - `previous_response_id: Optional[str]`

    - `prompt: Optional[OpenAIResponsePrompt]`

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

      - `id: str`

      - `variables: Optional[Dict[str, Variables]]`

        - `str`

        - `class OpenAIResponseInputText: …`

          A text input to the model.

        - `class OpenAIResponseInputImage: …`

          An image input to the model.

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

        - `class OpenAIResponseInputFile: …`

          A file input to the model.

      - `version: Optional[str]`

    - `prompt_cache_key: Optional[str]`

    - `prompt_cache_retention: Optional[Literal["in-memory", "24h"]]`

      - `"in-memory"`

      - `"24h"`

    - `reasoning: Optional[Reasoning]`

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

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

      - `effort: Optional[Literal["none", "minimal", "low", 3 more]]`

        - `"none"`

        - `"minimal"`

        - `"low"`

        - `"medium"`

        - `"high"`

        - `"xhigh"`

      - `generate_summary: Optional[Literal["auto", "concise", "detailed"]]`

        - `"auto"`

        - `"concise"`

        - `"detailed"`

      - `summary: Optional[Literal["auto", "concise", "detailed"]]`

        - `"auto"`

        - `"concise"`

        - `"detailed"`

    - `safety_identifier: Optional[str]`

    - `service_tier: Optional[Literal["auto", "default", "flex", 2 more]]`

      - `"auto"`

      - `"default"`

      - `"flex"`

      - `"scale"`

      - `"priority"`

    - `status: Optional[Literal["completed", "failed", "in_progress", 3 more]]`

      - `"completed"`

      - `"failed"`

      - `"in_progress"`

      - `"cancelled"`

      - `"queued"`

      - `"incomplete"`

    - `temperature: Optional[float]`

    - `text: Optional[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: Optional[Format]`

        Default response format. Used to generate text responses.

        - `class FormatResponseFormatText: …`

          Default response format. Used to generate text responses.

          - `type: Literal["text"]`

            - `"text"`

        - `class FormatResponseFormatTextJsonSchemaConfig: …`

          JSON Schema response format.

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

          - `name: str`

          - `schema: Dict[str, object]`

          - `type: Literal["json_schema"]`

            - `"json_schema"`

          - `description: Optional[str]`

          - `strict: Optional[bool]`

        - `class FormatResponseFormatJsonObject: …`

          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: Literal["json_object"]`

            - `"json_object"`

      - `verbosity: Optional[Literal["low", "medium", "high"]]`

        - `"low"`

        - `"medium"`

        - `"high"`

    - `top_logprobs: Optional[int]`

    - `top_p: Optional[float]`

    - `truncation: Optional[Literal["auto", "disabled"]]`

      - `"auto"`

      - `"disabled"`

    - `usage: Optional[OpenAIResponseUsage]`

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

      - `input_tokens: int`

      - `input_tokens_details: InputTokensDetails`

        A detailed breakdown of the input tokens.

        - `cached_tokens: int`

      - `output_tokens: int`

      - `output_tokens_details: OutputTokensDetails`

        A detailed breakdown of the output tokens.

        - `reasoning_tokens: int`

      - `total_tokens: int`

    - `user: Optional[str]`

  - `class ResponseAudioDeltaEvent: …`

    Emitted when there is a partial audio response.

    - `delta: str`

    - `sequence_number: int`

    - `type: Literal["response.audio.delta"]`

      - `"response.audio.delta"`

  - `class ResponseAudioDoneEvent: …`

    Emitted when the audio response is complete.

    - `sequence_number: int`

    - `type: Literal["response.audio.done"]`

      - `"response.audio.done"`

  - `class ResponseAudioTranscriptDeltaEvent: …`

    Emitted when there is a partial transcript of audio.

    - `delta: str`

    - `sequence_number: int`

    - `type: Literal["response.audio.transcript.delta"]`

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

  - `class ResponseAudioTranscriptDoneEvent: …`

    Emitted when the full audio transcript is completed.

    - `sequence_number: int`

    - `type: Literal["response.audio.transcript.done"]`

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

  - `class ResponseCodeInterpreterCallCodeDeltaEvent: …`

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

    - `delta: str`

    - `item_id: str`

    - `output_index: int`

    - `sequence_number: int`

    - `type: Literal["response.code_interpreter_call_code.delta"]`

      - `"response.code_interpreter_call_code.delta"`

  - `class ResponseCodeInterpreterCallCodeDoneEvent: …`

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

    - `code: str`

    - `item_id: str`

    - `output_index: int`

    - `sequence_number: int`

    - `type: Literal["response.code_interpreter_call_code.done"]`

      - `"response.code_interpreter_call_code.done"`

  - `class ResponseCodeInterpreterCallCompletedEvent: …`

    Emitted when the code interpreter call is completed.

    - `item_id: str`

    - `output_index: int`

    - `sequence_number: int`

    - `type: Literal["response.code_interpreter_call.completed"]`

      - `"response.code_interpreter_call.completed"`

  - `class ResponseCodeInterpreterCallInProgressEvent: …`

    Emitted when a code interpreter call is in progress.

    - `item_id: str`

    - `output_index: int`

    - `sequence_number: int`

    - `type: Literal["response.code_interpreter_call.in_progress"]`

      - `"response.code_interpreter_call.in_progress"`

  - `class ResponseCodeInterpreterCallInterpretingEvent: …`

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

    - `item_id: str`

    - `output_index: int`

    - `sequence_number: int`

    - `type: Literal["response.code_interpreter_call.interpreting"]`

      - `"response.code_interpreter_call.interpreting"`

  - `class ResponseCompletedEvent: …`

    Emitted when the model response is complete.

    - `response: OpenAIResponse`

    - `sequence_number: int`

    - `type: Literal["response.completed"]`

      - `"response.completed"`

  - `class ResponseContentPartAddedEvent: …`

    Emitted when a new content part is added.

    - `content_index: int`

    - `item_id: str`

    - `output_index: int`

    - `part: ResponseContentPartAddedEventPart`

      A text output from the model.

      - `class OpenAIResponseOutputText: …`

        A text output from the model.

      - `class OpenAIResponseOutputRefusal: …`

        A refusal from the model.

      - `class PartReasoningText: …`

        Reasoning text from the model.

        - `text: str`

        - `type: Literal["reasoning_text"]`

          - `"reasoning_text"`

    - `sequence_number: int`

    - `type: Literal["response.content_part.added"]`

      - `"response.content_part.added"`

  - `class ResponseContentPartDoneEvent: …`

    Emitted when a content part is done.

    - `content_index: int`

    - `item_id: str`

    - `output_index: int`

    - `part: ResponseContentPartDoneEventPart`

      A text output from the model.

      - `class OpenAIResponseOutputText: …`

        A text output from the model.

      - `class OpenAIResponseOutputRefusal: …`

        A refusal from the model.

      - `class PartReasoningText: …`

        Reasoning text from the model.

    - `sequence_number: int`

    - `type: Literal["response.content_part.done"]`

      - `"response.content_part.done"`

  - `class ResponseCreatedEvent: …`

    An event that is emitted when a response is created.

    - `response: OpenAIResponse`

    - `sequence_number: int`

    - `type: Literal["response.created"]`

      - `"response.created"`

  - `class ResponseErrorEvent: …`

    Emitted when an error occurs.

    - `message: str`

    - `sequence_number: int`

    - `type: Literal["error"]`

      - `"error"`

    - `code: Optional[str]`

    - `param: Optional[str]`

  - `class ResponseFileSearchCallCompletedEvent: …`

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

    - `item_id: str`

    - `output_index: int`

    - `sequence_number: int`

    - `type: Literal["response.file_search_call.completed"]`

      - `"response.file_search_call.completed"`

  - `class ResponseFileSearchCallInProgressEvent: …`

    Emitted when a file search call is initiated.

    - `item_id: str`

    - `output_index: int`

    - `sequence_number: int`

    - `type: Literal["response.file_search_call.in_progress"]`

      - `"response.file_search_call.in_progress"`

  - `class ResponseFileSearchCallSearchingEvent: …`

    Emitted when a file search is currently searching.

    - `item_id: str`

    - `output_index: int`

    - `sequence_number: int`

    - `type: Literal["response.file_search_call.searching"]`

      - `"response.file_search_call.searching"`

  - `class ResponseFunctionCallArgumentsDeltaEvent: …`

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

    - `delta: str`

    - `item_id: str`

    - `output_index: int`

    - `sequence_number: int`

    - `type: Literal["response.function_call_arguments.delta"]`

      - `"response.function_call_arguments.delta"`

  - `class ResponseFunctionCallArgumentsDoneEvent: …`

    Emitted when function-call arguments are finalized.

    - `arguments: str`

    - `item_id: str`

    - `name: str`

    - `output_index: int`

    - `sequence_number: int`

    - `type: Literal["response.function_call_arguments.done"]`

      - `"response.function_call_arguments.done"`

  - `class ResponseInProgressEvent: …`

    Emitted when the response is in progress.

    - `response: OpenAIResponse`

    - `sequence_number: int`

    - `type: Literal["response.in_progress"]`

      - `"response.in_progress"`

  - `class ResponseFailedEvent: …`

    An event that is emitted when a response fails.

    - `response: OpenAIResponse`

    - `sequence_number: int`

    - `type: Literal["response.failed"]`

      - `"response.failed"`

  - `class ResponseIncompleteEvent: …`

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

    - `response: OpenAIResponse`

    - `sequence_number: int`

    - `type: Literal["response.incomplete"]`

      - `"response.incomplete"`

  - `class ResponseOutputItemAddedEvent: …`

    Emitted when a new output item is added.

    - `item: ResponseOutputItemAddedEventItem`

      An output message from the model.

      - `class OpenAIResponseOutputMessage: …`

        An output message from the model.

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

      - `class OpenAIResponseFunctionToolCall: …`

        A tool call to run a function.

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

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

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

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

      - `class ResponseCompactionItem: …`

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

      - `class OpenAITypesResponsesResponseOutputItemImageGenerationCall: …`

        An image generation request made by the model.

      - `class OpenAIResponseCodeInterpreterToolCall: …`

        A tool call to run code.

      - `class OpenAITypesResponsesResponseOutputItemLocalShellCall: …`

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

      - `class ResponseFunctionShellToolCall: …`

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

      - `class ResponseFunctionShellToolCallOutput: …`

        The output of a shell tool call that was emitted.

      - `class ResponseApplyPatchToolCall: …`

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

      - `class ResponseApplyPatchToolCallOutput: …`

        The output emitted by an apply patch tool call.

      - `class OpenAITypesResponsesResponseOutputItemMcpCall: …`

        An invocation of a tool on an MCP server.

      - `class OpenAITypesResponsesResponseOutputItemMcpListTools: …`

        A list of tools available on an MCP server.

      - `class McpApprovalRequest: …`

        A request for human approval of a tool invocation.

      - `class OpenAIResponseCustomToolCall: …`

        A call to a custom tool created by the model.

    - `output_index: int`

    - `sequence_number: int`

    - `type: Literal["response.output_item.added"]`

      - `"response.output_item.added"`

  - `class ResponseOutputItemDoneEvent: …`

    Emitted when an output item is marked done.

    - `item: ResponseOutputItemDoneEventItem`

      An output message from the model.

      - `class OpenAIResponseOutputMessage: …`

        An output message from the model.

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

      - `class OpenAIResponseFunctionToolCall: …`

        A tool call to run a function.

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

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

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

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

      - `class ResponseCompactionItem: …`

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

      - `class OpenAITypesResponsesResponseOutputItemImageGenerationCall: …`

        An image generation request made by the model.

      - `class OpenAIResponseCodeInterpreterToolCall: …`

        A tool call to run code.

      - `class OpenAITypesResponsesResponseOutputItemLocalShellCall: …`

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

      - `class ResponseFunctionShellToolCall: …`

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

      - `class ResponseFunctionShellToolCallOutput: …`

        The output of a shell tool call that was emitted.

      - `class ResponseApplyPatchToolCall: …`

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

      - `class ResponseApplyPatchToolCallOutput: …`

        The output emitted by an apply patch tool call.

      - `class OpenAITypesResponsesResponseOutputItemMcpCall: …`

        An invocation of a tool on an MCP server.

      - `class OpenAITypesResponsesResponseOutputItemMcpListTools: …`

        A list of tools available on an MCP server.

      - `class McpApprovalRequest: …`

        A request for human approval of a tool invocation.

      - `class OpenAIResponseCustomToolCall: …`

        A call to a custom tool created by the model.

    - `output_index: int`

    - `sequence_number: int`

    - `type: Literal["response.output_item.done"]`

      - `"response.output_item.done"`

  - `class ResponseReasoningSummaryPartAddedEvent: …`

    Emitted when a new reasoning summary part is added.

    - `item_id: str`

    - `output_index: int`

    - `part: ResponseReasoningSummaryPartAddedEventPart`

      The summary part that was added.

      - `text: str`

      - `type: Literal["summary_text"]`

        - `"summary_text"`

    - `sequence_number: int`

    - `summary_index: int`

    - `type: Literal["response.reasoning_summary_part.added"]`

      - `"response.reasoning_summary_part.added"`

  - `class ResponseReasoningSummaryPartDoneEvent: …`

    Emitted when a reasoning summary part is completed.

    - `item_id: str`

    - `output_index: int`

    - `part: ResponseReasoningSummaryPartDoneEventPart`

      The completed summary part.

      - `text: str`

      - `type: Literal["summary_text"]`

        - `"summary_text"`

    - `sequence_number: int`

    - `summary_index: int`

    - `type: Literal["response.reasoning_summary_part.done"]`

      - `"response.reasoning_summary_part.done"`

  - `class ResponseReasoningSummaryTextDeltaEvent: …`

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

    - `delta: str`

    - `item_id: str`

    - `output_index: int`

    - `sequence_number: int`

    - `summary_index: int`

    - `type: Literal["response.reasoning_summary_text.delta"]`

      - `"response.reasoning_summary_text.delta"`

  - `class ResponseReasoningSummaryTextDoneEvent: …`

    Emitted when a reasoning summary text is completed.

    - `item_id: str`

    - `output_index: int`

    - `sequence_number: int`

    - `summary_index: int`

    - `text: str`

    - `type: Literal["response.reasoning_summary_text.done"]`

      - `"response.reasoning_summary_text.done"`

  - `class ResponseReasoningTextDeltaEvent: …`

    Emitted when a delta is added to a reasoning text.

    - `content_index: int`

    - `delta: str`

    - `item_id: str`

    - `output_index: int`

    - `sequence_number: int`

    - `type: Literal["response.reasoning_text.delta"]`

      - `"response.reasoning_text.delta"`

  - `class ResponseReasoningTextDoneEvent: …`

    Emitted when a reasoning text is completed.

    - `content_index: int`

    - `item_id: str`

    - `output_index: int`

    - `sequence_number: int`

    - `text: str`

    - `type: Literal["response.reasoning_text.done"]`

      - `"response.reasoning_text.done"`

  - `class ResponseRefusalDeltaEvent: …`

    Emitted when there is a partial refusal text.

    - `content_index: int`

    - `delta: str`

    - `item_id: str`

    - `output_index: int`

    - `sequence_number: int`

    - `type: Literal["response.refusal.delta"]`

      - `"response.refusal.delta"`

  - `class ResponseRefusalDoneEvent: …`

    Emitted when refusal text is finalized.

    - `content_index: int`

    - `item_id: str`

    - `output_index: int`

    - `refusal: str`

    - `sequence_number: int`

    - `type: Literal["response.refusal.done"]`

      - `"response.refusal.done"`

  - `class ResponseTextDeltaEvent: …`

    Emitted when there is an additional text delta.

    - `content_index: int`

    - `delta: str`

    - `item_id: str`

    - `logprobs: List[ResponseTextDeltaEventLogprob]`

      - `token: str`

      - `logprob: float`

      - `top_logprobs: Optional[List[ResponseTextDeltaEventLogprobTopLogprob]]`

        - `token: Optional[str]`

        - `logprob: Optional[float]`

    - `output_index: int`

    - `sequence_number: int`

    - `type: Literal["response.output_text.delta"]`

      - `"response.output_text.delta"`

  - `class ResponseTextDoneEvent: …`

    Emitted when text content is finalized.

    - `content_index: int`

    - `item_id: str`

    - `logprobs: List[ResponseTextDoneEventLogprob]`

      - `token: str`

      - `logprob: float`

      - `top_logprobs: Optional[List[ResponseTextDoneEventLogprobTopLogprob]]`

        - `token: Optional[str]`

        - `logprob: Optional[float]`

    - `output_index: int`

    - `sequence_number: int`

    - `text: str`

    - `type: Literal["response.output_text.done"]`

      - `"response.output_text.done"`

  - `class ResponseWebSearchCallCompletedEvent: …`

    Emitted when a web search call is completed.

    - `item_id: str`

    - `output_index: int`

    - `sequence_number: int`

    - `type: Literal["response.web_search_call.completed"]`

      - `"response.web_search_call.completed"`

  - `class ResponseWebSearchCallInProgressEvent: …`

    Emitted when a web search call is initiated.

    - `item_id: str`

    - `output_index: int`

    - `sequence_number: int`

    - `type: Literal["response.web_search_call.in_progress"]`

      - `"response.web_search_call.in_progress"`

  - `class ResponseWebSearchCallSearchingEvent: …`

    Emitted when a web search call is executing.

    - `item_id: str`

    - `output_index: int`

    - `sequence_number: int`

    - `type: Literal["response.web_search_call.searching"]`

      - `"response.web_search_call.searching"`

  - `class ResponseImageGenCallCompletedEvent: …`

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

    - `item_id: str`

    - `output_index: int`

    - `sequence_number: int`

    - `type: Literal["response.image_generation_call.completed"]`

      - `"response.image_generation_call.completed"`

  - `class ResponseImageGenCallGeneratingEvent: …`

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

    - `item_id: str`

    - `output_index: int`

    - `sequence_number: int`

    - `type: Literal["response.image_generation_call.generating"]`

      - `"response.image_generation_call.generating"`

  - `class ResponseImageGenCallInProgressEvent: …`

    Emitted when an image generation tool call is in progress.

    - `item_id: str`

    - `output_index: int`

    - `sequence_number: int`

    - `type: Literal["response.image_generation_call.in_progress"]`

      - `"response.image_generation_call.in_progress"`

  - `class ResponseImageGenCallPartialImageEvent: …`

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

    - `item_id: str`

    - `output_index: int`

    - `partial_image_b64: str`

    - `partial_image_index: int`

    - `sequence_number: int`

    - `type: Literal["response.image_generation_call.partial_image"]`

      - `"response.image_generation_call.partial_image"`

  - `class ResponseMcpCallArgumentsDeltaEvent: …`

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

    - `delta: str`

    - `item_id: str`

    - `output_index: int`

    - `sequence_number: int`

    - `type: Literal["response.mcp_call_arguments.delta"]`

      - `"response.mcp_call_arguments.delta"`

  - `class ResponseMcpCallArgumentsDoneEvent: …`

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

    - `arguments: str`

    - `item_id: str`

    - `output_index: int`

    - `sequence_number: int`

    - `type: Literal["response.mcp_call_arguments.done"]`

      - `"response.mcp_call_arguments.done"`

  - `class ResponseMcpCallCompletedEvent: …`

    Emitted when an MCP  tool call has completed successfully.

    - `item_id: str`

    - `output_index: int`

    - `sequence_number: int`

    - `type: Literal["response.mcp_call.completed"]`

      - `"response.mcp_call.completed"`

  - `class ResponseMcpCallFailedEvent: …`

    Emitted when an MCP  tool call has failed.

    - `item_id: str`

    - `output_index: int`

    - `sequence_number: int`

    - `type: Literal["response.mcp_call.failed"]`

      - `"response.mcp_call.failed"`

  - `class ResponseMcpCallInProgressEvent: …`

    Emitted when an MCP  tool call is in progress.

    - `item_id: str`

    - `output_index: int`

    - `sequence_number: int`

    - `type: Literal["response.mcp_call.in_progress"]`

      - `"response.mcp_call.in_progress"`

  - `class ResponseMcpListToolsCompletedEvent: …`

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

    - `item_id: str`

    - `output_index: int`

    - `sequence_number: int`

    - `type: Literal["response.mcp_list_tools.completed"]`

      - `"response.mcp_list_tools.completed"`

  - `class ResponseMcpListToolsFailedEvent: …`

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

    - `item_id: str`

    - `output_index: int`

    - `sequence_number: int`

    - `type: Literal["response.mcp_list_tools.failed"]`

      - `"response.mcp_list_tools.failed"`

  - `class ResponseMcpListToolsInProgressEvent: …`

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

    - `item_id: str`

    - `output_index: int`

    - `sequence_number: int`

    - `type: Literal["response.mcp_list_tools.in_progress"]`

      - `"response.mcp_list_tools.in_progress"`

  - `class ResponseOutputTextAnnotationAddedEvent: …`

    Emitted when an annotation is added to output text content.

    - `annotation: object`

    - `annotation_index: int`

    - `content_index: int`

    - `item_id: str`

    - `output_index: int`

    - `sequence_number: int`

    - `type: Literal["response.output_text.annotation.added"]`

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

  - `class ResponseQueuedEvent: …`

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

    - `response: OpenAIResponse`

    - `sequence_number: int`

    - `type: Literal["response.queued"]`

      - `"response.queued"`

  - `class ResponseCustomToolCallInputDeltaEvent: …`

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

    - `delta: str`

    - `item_id: str`

    - `output_index: int`

    - `sequence_number: int`

    - `type: Literal["response.custom_tool_call_input.delta"]`

      - `"response.custom_tool_call_input.delta"`

  - `class ResponseCustomToolCallInputDoneEvent: …`

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

    - `input: str`

    - `item_id: str`

    - `output_index: int`

    - `sequence_number: int`

    - `type: Literal["response.custom_tool_call_input.done"]`

      - `"response.custom_tool_call_input.done"`

  - `class GenericResponseEvent: …`

    - `type: str`

### Example

```python
import os
from scale_gp_beta import SGPClient

client = SGPClient(
    api_key=os.environ.get("SGP_API_KEY"),  # This is the default and can be omitted
)
response = client.responses.create(
    input="string",
    model="model",
)
print(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

- `class ApplyPatchCall: …`

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

  - `call_id: str`

  - `operation: Operation`

    Instruction for creating a new file via the apply_patch tool.

    - `class OperationApplyPatchCallOperationCreateFile: …`

      Instruction for creating a new file via the apply_patch tool.

      - `diff: str`

      - `path: str`

      - `type: Literal["create_file"]`

        - `"create_file"`

    - `class OperationApplyPatchCallOperationDeleteFile: …`

      Instruction for deleting an existing file via the apply_patch tool.

      - `path: str`

      - `type: Literal["delete_file"]`

        - `"delete_file"`

    - `class OperationApplyPatchCallOperationUpdateFile: …`

      Instruction for updating an existing file via the apply_patch tool.

      - `diff: str`

      - `path: str`

      - `type: Literal["update_file"]`

        - `"update_file"`

  - `status: Literal["in_progress", "completed"]`

    - `"in_progress"`

    - `"completed"`

  - `type: Literal["apply_patch_call"]`

    - `"apply_patch_call"`

  - `id: Optional[str]`

### Apply Patch Call Output

- `class ApplyPatchCallOutput: …`

  The streamed output emitted by an apply patch tool call.

  - `call_id: str`

  - `status: Literal["completed", "failed"]`

    - `"completed"`

    - `"failed"`

  - `type: Literal["apply_patch_call_output"]`

    - `"apply_patch_call_output"`

  - `id: Optional[str]`

  - `output: Optional[str]`

### Apply Patch Tool

- `class ApplyPatchTool: …`

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

  - `type: Literal["apply_patch"]`

    - `"apply_patch"`

### Computer Tool

- `class 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: int`

  - `display_width: int`

  - `environment: Literal["windows", "mac", "linux", 2 more]`

    - `"windows"`

    - `"mac"`

    - `"linux"`

    - `"ubuntu"`

    - `"browser"`

  - `type: Literal["computer_use_preview"]`

    - `"computer_use_preview"`

### Container Network Policy Allowlist

- `class ContainerNetworkPolicyAllowlist: …`

  - `allowed_domains: List[str]`

  - `type: Literal["allowlist"]`

    - `"allowlist"`

  - `domain_secrets: Optional[List[DomainSecret]]`

    - `domain: str`

    - `name: str`

    - `value: str`

### Container Network Policy Disabled

- `class ContainerNetworkPolicyDisabled: …`

  - `type: Literal["disabled"]`

    - `"disabled"`

### Container Reference

- `class ContainerReference: …`

  - `container_id: str`

  - `type: Literal["container_reference"]`

    - `"container_reference"`

### Container Reference Param

- `class ContainerReferenceParam: …`

  - `container_id: str`

  - `type: Literal["container_reference"]`

    - `"container_reference"`

### Conversation

- `class Conversation: …`

  The conversation that this response belonged to.

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

  - `id: str`

### Custom Tool

- `class 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: str`

  - `type: Literal["custom"]`

    - `"custom"`

  - `description: Optional[str]`

  - `format: Optional[Format]`

    Unconstrained free-form text.

    - `class FormatText: …`

      Unconstrained free-form text.

      - `type: Literal["text"]`

        - `"text"`

    - `class FormatGrammar: …`

      A grammar defined by the user.

      - `definition: str`

      - `syntax: Literal["lark", "regex"]`

        - `"lark"`

        - `"regex"`

      - `type: Literal["grammar"]`

        - `"grammar"`

### Easy Input Message

- `class 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: Union[str, List[ContentInputItem]]`

    - `str`

    - `List[ContentInputItem]`

      - `class OpenAIResponseInputText: …`

        A text input to the model.

        - `text: str`

        - `type: Literal["input_text"]`

          - `"input_text"`

      - `class OpenAIResponseInputImage: …`

        An image input to the model.

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

        - `detail: Literal["low", "high", "auto"]`

          - `"low"`

          - `"high"`

          - `"auto"`

        - `type: Literal["input_image"]`

          - `"input_image"`

        - `file_id: Optional[str]`

        - `image_url: Optional[str]`

      - `class OpenAIResponseInputFile: …`

        A file input to the model.

        - `type: Literal["input_file"]`

          - `"input_file"`

        - `file_data: Optional[str]`

        - `file_id: Optional[str]`

        - `file_url: Optional[str]`

        - `filename: Optional[str]`

  - `role: Literal["user", "assistant", "system", "developer"]`

    - `"user"`

    - `"assistant"`

    - `"system"`

    - `"developer"`

  - `phase: Optional[Literal["commentary", "final_answer"]]`

    - `"commentary"`

    - `"final_answer"`

  - `type: Optional[Literal["message"]]`

    - `"message"`

### File Search Tool

- `class 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: Literal["file_search"]`

    - `"file_search"`

  - `vector_store_ids: List[str]`

  - `filters: Optional[Filters]`

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

    - `class FiltersComparisonFilter: …`

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

      - `key: str`

      - `type: Literal["eq", "ne", "gt", 3 more]`

        - `"eq"`

        - `"ne"`

        - `"gt"`

        - `"gte"`

        - `"lt"`

        - `"lte"`

      - `value: Union[str, float, bool, List[Union[str, float]]]`

        - `str`

        - `float`

        - `bool`

        - `List[Union[str, float]]`

          - `str`

          - `float`

    - `class FiltersCompoundFilter: …`

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

      - `filters: List[FiltersCompoundFilterFilter]`

        - `class FiltersCompoundFilterFilterComparisonFilter: …`

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

          - `key: str`

          - `type: Literal["eq", "ne", "gt", 3 more]`

            - `"eq"`

            - `"ne"`

            - `"gt"`

            - `"gte"`

            - `"lt"`

            - `"lte"`

          - `value: Union[str, float, bool, List[Union[str, float]]]`

            - `str`

            - `float`

            - `bool`

            - `List[Union[str, float]]`

              - `str`

              - `float`

        - `object`

      - `type: Literal["and", "or"]`

        - `"and"`

        - `"or"`

  - `max_num_results: Optional[int]`

  - `ranking_options: Optional[RankingOptions]`

    Ranking options for search.

    - `hybrid_search: Optional[RankingOptionsHybridSearch]`

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

      - `embedding_weight: float`

      - `text_weight: float`

    - `ranker: Optional[Literal["auto", "default-2024-11-15"]]`

      - `"auto"`

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

    - `score_threshold: Optional[float]`

### Function Shell Tool

- `class FunctionShellTool: …`

  A tool that allows the model to execute shell commands.

  - `type: Literal["shell"]`

    - `"shell"`

  - `environment: Optional[Environment]`

    - `class EnvironmentContainerAuto: …`

      - `type: Literal["container_auto"]`

        - `"container_auto"`

      - `file_ids: Optional[List[str]]`

      - `memory_limit: Optional[Literal["1g", "4g", "16g", "64g"]]`

        - `"1g"`

        - `"4g"`

        - `"16g"`

        - `"64g"`

      - `network_policy: Optional[EnvironmentContainerAutoNetworkPolicy]`

        - `class ContainerNetworkPolicyDisabled: …`

          - `type: Literal["disabled"]`

            - `"disabled"`

        - `class ContainerNetworkPolicyAllowlist: …`

          - `allowed_domains: List[str]`

          - `type: Literal["allowlist"]`

            - `"allowlist"`

          - `domain_secrets: Optional[List[DomainSecret]]`

            - `domain: str`

            - `name: str`

            - `value: str`

      - `skills: Optional[List[EnvironmentContainerAutoSkill]]`

        - `class EnvironmentContainerAutoSkillSkillReference: …`

          - `skill_id: str`

          - `type: Literal["skill_reference"]`

            - `"skill_reference"`

          - `version: Optional[str]`

        - `class EnvironmentContainerAutoSkillInlineSkill: …`

          - `description: str`

          - `name: str`

          - `source: EnvironmentContainerAutoSkillInlineSkillSource`

            Inline skill payload

            - `data: str`

            - `media_type: Literal["application/zip"]`

              - `"application/zip"`

            - `type: Literal["base64"]`

              - `"base64"`

          - `type: Literal["inline"]`

            - `"inline"`

    - `class LocalEnvironment: …`

      - `type: Literal["local"]`

        - `"local"`

      - `skills: Optional[List[Skill]]`

        - `description: str`

        - `name: str`

        - `path: str`

    - `class ContainerReference: …`

      - `container_id: str`

      - `type: Literal["container_reference"]`

        - `"container_reference"`

### Function Tool

- `class 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: str`

  - `type: Literal["function"]`

    - `"function"`

  - `description: Optional[str]`

  - `parameters: Optional[Dict[str, object]]`

  - `strict: Optional[bool]`

### Incomplete Details

- `class IncompleteDetails: …`

  Details about why the response is incomplete.

  - `reason: Optional[Literal["max_output_tokens", "content_filter"]]`

    - `"max_output_tokens"`

    - `"content_filter"`

### Local Environment

- `class LocalEnvironment: …`

  - `type: Literal["local"]`

    - `"local"`

  - `skills: Optional[List[Skill]]`

    - `description: str`

    - `name: str`

    - `path: str`

### Local Environment Param

- `class LocalEnvironmentParam: …`

  - `type: Literal["local"]`

    - `"local"`

  - `skills: Optional[List[Skill]]`

    - `description: str`

    - `name: str`

    - `path: str`

### Mcp Approval Request

- `class McpApprovalRequest: …`

  A request for human approval of a tool invocation.

  - `id: str`

  - `arguments: str`

  - `name: str`

  - `server_label: str`

  - `type: Literal["mcp_approval_request"]`

    - `"mcp_approval_request"`

### OpenAI Response

- `class OpenAIResponse: …`

  - `id: str`

  - `created_at: float`

  - `model: Union[Literal["gpt-5.2", "gpt-5.2-2025-12-11", "gpt-5.2-chat-latest", 83 more], str]`

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

    - `str`

  - `object: Literal["response"]`

    - `"response"`

  - `output: List[Output]`

    - `class OpenAIResponseOutputMessage: …`

      An output message from the model.

      - `id: str`

      - `content: List[Content]`

        - `class OpenAIResponseOutputText: …`

          A text output from the model.

          - `annotations: List[Annotation]`

            - `class AnnotationAnnotationFileCitation: …`

              A citation to a file.

              - `file_id: str`

              - `filename: str`

              - `index: int`

              - `type: Literal["file_citation"]`

                - `"file_citation"`

            - `class AnnotationOpenAITypesResponsesResponseOutputTextAnnotationURLCitation: …`

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

              - `end_index: int`

              - `start_index: int`

              - `title: str`

              - `type: Literal["url_citation"]`

                - `"url_citation"`

              - `url: str`

            - `class AnnotationAnnotationContainerFileCitation: …`

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

              - `container_id: str`

              - `end_index: int`

              - `file_id: str`

              - `filename: str`

              - `start_index: int`

              - `type: Literal["container_file_citation"]`

                - `"container_file_citation"`

            - `class AnnotationAnnotationFilePath: …`

              A path to a file.

              - `file_id: str`

              - `index: int`

              - `type: Literal["file_path"]`

                - `"file_path"`

          - `text: str`

          - `type: Literal["output_text"]`

            - `"output_text"`

          - `logprobs: Optional[List[Logprob]]`

            - `token: str`

            - `bytes: List[int]`

            - `logprob: float`

            - `top_logprobs: List[LogprobTopLogprob]`

              - `token: str`

              - `bytes: List[int]`

              - `logprob: float`

        - `class OpenAIResponseOutputRefusal: …`

          A refusal from the model.

          - `refusal: str`

          - `type: Literal["refusal"]`

            - `"refusal"`

      - `role: Literal["assistant"]`

        - `"assistant"`

      - `status: Literal["in_progress", "completed", "incomplete"]`

        - `"in_progress"`

        - `"completed"`

        - `"incomplete"`

      - `type: Literal["message"]`

        - `"message"`

      - `phase: Optional[Literal["commentary", "final_answer"]]`

        - `"commentary"`

        - `"final_answer"`

    - `class 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: str`

      - `queries: List[str]`

      - `status: Literal["in_progress", "searching", "completed", 2 more]`

        - `"in_progress"`

        - `"searching"`

        - `"completed"`

        - `"incomplete"`

        - `"failed"`

      - `type: Literal["file_search_call"]`

        - `"file_search_call"`

      - `results: Optional[List[Result]]`

        - `attributes: Optional[Dict[str, Union[str, float, bool]]]`

          - `str`

          - `float`

          - `bool`

        - `file_id: Optional[str]`

        - `filename: Optional[str]`

        - `score: Optional[float]`

        - `text: Optional[str]`

    - `class 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: str`

      - `call_id: str`

      - `name: str`

      - `type: Literal["function_call"]`

        - `"function_call"`

      - `id: Optional[str]`

      - `status: Optional[Literal["in_progress", "completed", "incomplete"]]`

        - `"in_progress"`

        - `"completed"`

        - `"incomplete"`

    - `class 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: str`

      - `action: Action`

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

        - `class ActionOpenAITypesResponsesResponseFunctionWebSearchActionSearch: …`

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

          - `query: str`

          - `type: Literal["search"]`

            - `"search"`

          - `queries: Optional[List[str]]`

          - `sources: Optional[List[ActionOpenAITypesResponsesResponseFunctionWebSearchActionSearchSource]]`

            - `type: Literal["url"]`

              - `"url"`

            - `url: str`

        - `class ActionOpenAITypesResponsesResponseFunctionWebSearchActionOpenPage: …`

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

          - `type: Literal["open_page"]`

            - `"open_page"`

          - `url: Optional[str]`

        - `class ActionActionFind: …`

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

          - `pattern: str`

          - `type: Literal["find_in_page"]`

            - `"find_in_page"`

          - `url: str`

      - `status: Literal["in_progress", "searching", "completed", "failed"]`

        - `"in_progress"`

        - `"searching"`

        - `"completed"`

        - `"failed"`

      - `type: Literal["web_search_call"]`

        - `"web_search_call"`

    - `class 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: str`

      - `action: Action`

        A click action.

        - `class ActionActionClick: …`

          A click action.

          - `button: Literal["left", "right", "wheel", 2 more]`

            - `"left"`

            - `"right"`

            - `"wheel"`

            - `"back"`

            - `"forward"`

          - `type: Literal["click"]`

            - `"click"`

          - `x: int`

          - `y: int`

        - `class ActionActionDoubleClick: …`

          A double click action.

          - `type: Literal["double_click"]`

            - `"double_click"`

          - `x: int`

          - `y: int`

        - `class ActionActionDrag: …`

          A drag action.

          - `path: List[ActionActionDragPath]`

            - `x: int`

            - `y: int`

          - `type: Literal["drag"]`

            - `"drag"`

        - `class ActionActionKeypress: …`

          A collection of keypresses the model would like to perform.

          - `keys: List[str]`

          - `type: Literal["keypress"]`

            - `"keypress"`

        - `class ActionActionMove: …`

          A mouse move action.

          - `type: Literal["move"]`

            - `"move"`

          - `x: int`

          - `y: int`

        - `class ActionActionScreenshot: …`

          A screenshot action.

          - `type: Literal["screenshot"]`

            - `"screenshot"`

        - `class ActionActionScroll: …`

          A scroll action.

          - `scroll_x: int`

          - `scroll_y: int`

          - `type: Literal["scroll"]`

            - `"scroll"`

          - `x: int`

          - `y: int`

        - `class ActionActionType: …`

          An action to type in text.

          - `text: str`

          - `type: Literal["type"]`

            - `"type"`

        - `class ActionActionWait: …`

          A wait action.

          - `type: Literal["wait"]`

            - `"wait"`

      - `call_id: str`

      - `pending_safety_checks: List[PendingSafetyCheck]`

        - `id: str`

        - `code: Optional[str]`

        - `message: Optional[str]`

      - `status: Literal["in_progress", "completed", "incomplete"]`

        - `"in_progress"`

        - `"completed"`

        - `"incomplete"`

      - `type: Literal["computer_call"]`

        - `"computer_call"`

    - `class 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: str`

      - `summary: List[Summary]`

        - `text: str`

        - `type: Literal["summary_text"]`

          - `"summary_text"`

      - `type: Literal["reasoning"]`

        - `"reasoning"`

      - `content: Optional[List[Content]]`

        - `text: str`

        - `type: Literal["reasoning_text"]`

          - `"reasoning_text"`

      - `encrypted_content: Optional[str]`

      - `status: Optional[Literal["in_progress", "completed", "incomplete"]]`

        - `"in_progress"`

        - `"completed"`

        - `"incomplete"`

    - `class ResponseCompactionItem: …`

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

      - `id: str`

      - `encrypted_content: str`

      - `type: Literal["compaction"]`

        - `"compaction"`

      - `created_by: Optional[str]`

    - `class OpenAITypesResponsesResponseOutputItemImageGenerationCall: …`

      An image generation request made by the model.

      - `id: str`

      - `status: Literal["in_progress", "completed", "generating", "failed"]`

        - `"in_progress"`

        - `"completed"`

        - `"generating"`

        - `"failed"`

      - `type: Literal["image_generation_call"]`

        - `"image_generation_call"`

      - `result: Optional[str]`

    - `class OpenAIResponseCodeInterpreterToolCall: …`

      A tool call to run code.

      - `id: str`

      - `container_id: str`

      - `status: Literal["in_progress", "completed", "incomplete", 2 more]`

        - `"in_progress"`

        - `"completed"`

        - `"incomplete"`

        - `"interpreting"`

        - `"failed"`

      - `type: Literal["code_interpreter_call"]`

        - `"code_interpreter_call"`

      - `code: Optional[str]`

      - `outputs: Optional[List[Output]]`

        - `class OutputOutputLogs: …`

          The logs output from the code interpreter.

          - `logs: str`

          - `type: Literal["logs"]`

            - `"logs"`

        - `class OutputOutputImage: …`

          The image output from the code interpreter.

          - `type: Literal["image"]`

            - `"image"`

          - `url: str`

    - `class OpenAITypesResponsesResponseOutputItemLocalShellCall: …`

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

      - `id: str`

      - `action: Action`

        Execute a shell command on the server.

        - `command: List[str]`

        - `env: Dict[str, str]`

        - `type: Literal["exec"]`

          - `"exec"`

        - `timeout_ms: Optional[int]`

        - `user: Optional[str]`

        - `working_directory: Optional[str]`

      - `call_id: str`

      - `status: Literal["in_progress", "completed", "incomplete"]`

        - `"in_progress"`

        - `"completed"`

        - `"incomplete"`

      - `type: Literal["local_shell_call"]`

        - `"local_shell_call"`

    - `class ResponseFunctionShellToolCall: …`

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

      - `id: str`

      - `action: Action`

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

        - `commands: List[str]`

        - `max_output_length: Optional[int]`

        - `timeout_ms: Optional[int]`

      - `call_id: str`

      - `status: Literal["in_progress", "completed", "incomplete"]`

        - `"in_progress"`

        - `"completed"`

        - `"incomplete"`

      - `type: Literal["shell_call"]`

        - `"shell_call"`

      - `created_by: Optional[str]`

      - `environment: Optional[Environment]`

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

        - `class EnvironmentResponseLocalEnvironment: …`

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

          - `type: Literal["local"]`

            - `"local"`

        - `class EnvironmentResponseContainerReference: …`

          Represents a container created with /v1/containers.

          - `container_id: str`

          - `type: Literal["container_reference"]`

            - `"container_reference"`

    - `class ResponseFunctionShellToolCallOutput: …`

      The output of a shell tool call that was emitted.

      - `id: str`

      - `call_id: str`

      - `output: List[Output]`

        - `outcome: OutputOutcome`

          Indicates that the shell call exceeded its configured time limit.

          - `class OutputOutcomeOutputOutcomeTimeout: …`

            Indicates that the shell call exceeded its configured time limit.

            - `type: Literal["timeout"]`

              - `"timeout"`

          - `class OutputOutcomeOutputOutcomeExit: …`

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

            - `exit_code: int`

            - `type: Literal["exit"]`

              - `"exit"`

        - `stderr: str`

        - `stdout: str`

        - `created_by: Optional[str]`

      - `status: Literal["in_progress", "completed", "incomplete"]`

        - `"in_progress"`

        - `"completed"`

        - `"incomplete"`

      - `type: Literal["shell_call_output"]`

        - `"shell_call_output"`

      - `created_by: Optional[str]`

      - `max_output_length: Optional[int]`

    - `class ResponseApplyPatchToolCall: …`

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

      - `id: str`

      - `call_id: str`

      - `operation: Operation`

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

        - `class OperationOperationCreateFile: …`

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

          - `diff: str`

          - `path: str`

          - `type: Literal["create_file"]`

            - `"create_file"`

        - `class OperationOperationDeleteFile: …`

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

          - `path: str`

          - `type: Literal["delete_file"]`

            - `"delete_file"`

        - `class OperationOperationUpdateFile: …`

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

          - `diff: str`

          - `path: str`

          - `type: Literal["update_file"]`

            - `"update_file"`

      - `status: Literal["in_progress", "completed"]`

        - `"in_progress"`

        - `"completed"`

      - `type: Literal["apply_patch_call"]`

        - `"apply_patch_call"`

      - `created_by: Optional[str]`

    - `class ResponseApplyPatchToolCallOutput: …`

      The output emitted by an apply patch tool call.

      - `id: str`

      - `call_id: str`

      - `status: Literal["completed", "failed"]`

        - `"completed"`

        - `"failed"`

      - `type: Literal["apply_patch_call_output"]`

        - `"apply_patch_call_output"`

      - `created_by: Optional[str]`

      - `output: Optional[str]`

    - `class OpenAITypesResponsesResponseOutputItemMcpCall: …`

      An invocation of a tool on an MCP server.

      - `id: str`

      - `arguments: str`

      - `name: str`

      - `server_label: str`

      - `type: Literal["mcp_call"]`

        - `"mcp_call"`

      - `approval_request_id: Optional[str]`

      - `error: Optional[str]`

      - `output: Optional[str]`

      - `status: Optional[Literal["in_progress", "completed", "incomplete", 2 more]]`

        - `"in_progress"`

        - `"completed"`

        - `"incomplete"`

        - `"calling"`

        - `"failed"`

    - `class OpenAITypesResponsesResponseOutputItemMcpListTools: …`

      A list of tools available on an MCP server.

      - `id: str`

      - `server_label: str`

      - `tools: List[Tool]`

        - `input_schema: object`

        - `name: str`

        - `annotations: Optional[object]`

        - `description: Optional[str]`

      - `type: Literal["mcp_list_tools"]`

        - `"mcp_list_tools"`

      - `error: Optional[str]`

    - `class McpApprovalRequest: …`

      A request for human approval of a tool invocation.

      - `id: str`

      - `arguments: str`

      - `name: str`

      - `server_label: str`

      - `type: Literal["mcp_approval_request"]`

        - `"mcp_approval_request"`

    - `class OpenAIResponseCustomToolCall: …`

      A call to a custom tool created by the model.

      - `call_id: str`

      - `input: str`

      - `name: str`

      - `type: Literal["custom_tool_call"]`

        - `"custom_tool_call"`

      - `id: Optional[str]`

  - `parallel_tool_calls: bool`

  - `tool_choice: ToolChoice`

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

    - `Literal["none", "auto", "required"]`

      - `"none"`

      - `"auto"`

      - `"required"`

    - `class ToolChoiceAllowed: …`

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

      - `mode: Literal["auto", "required"]`

        - `"auto"`

        - `"required"`

      - `tools: List[Dict[str, object]]`

      - `type: Literal["allowed_tools"]`

        - `"allowed_tools"`

    - `class 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: Literal["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"`

    - `class ToolChoiceFunction: …`

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

      - `name: str`

      - `type: Literal["function"]`

        - `"function"`

    - `class ToolChoiceMcp: …`

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

      - `server_label: str`

      - `type: Literal["mcp"]`

        - `"mcp"`

      - `name: Optional[str]`

    - `class ToolChoiceCustom: …`

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

      - `name: str`

      - `type: Literal["custom"]`

        - `"custom"`

    - `class ToolChoiceApplyPatch: …`

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

      - `type: Literal["apply_patch"]`

        - `"apply_patch"`

    - `class ToolChoiceShell: …`

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

      - `type: Literal["shell"]`

        - `"shell"`

  - `tools: List[Tool]`

    - `class 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: str`

      - `type: Literal["function"]`

        - `"function"`

      - `description: Optional[str]`

      - `parameters: Optional[Dict[str, object]]`

      - `strict: Optional[bool]`

    - `class 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: Literal["file_search"]`

        - `"file_search"`

      - `vector_store_ids: List[str]`

      - `filters: Optional[Filters]`

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

        - `class FiltersComparisonFilter: …`

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

          - `key: str`

          - `type: Literal["eq", "ne", "gt", 3 more]`

            - `"eq"`

            - `"ne"`

            - `"gt"`

            - `"gte"`

            - `"lt"`

            - `"lte"`

          - `value: Union[str, float, bool, List[Union[str, float]]]`

            - `str`

            - `float`

            - `bool`

            - `List[Union[str, float]]`

              - `str`

              - `float`

        - `class FiltersCompoundFilter: …`

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

          - `filters: List[FiltersCompoundFilterFilter]`

            - `class FiltersCompoundFilterFilterComparisonFilter: …`

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

              - `key: str`

              - `type: Literal["eq", "ne", "gt", 3 more]`

                - `"eq"`

                - `"ne"`

                - `"gt"`

                - `"gte"`

                - `"lt"`

                - `"lte"`

              - `value: Union[str, float, bool, List[Union[str, float]]]`

                - `str`

                - `float`

                - `bool`

                - `List[Union[str, float]]`

                  - `str`

                  - `float`

            - `object`

          - `type: Literal["and", "or"]`

            - `"and"`

            - `"or"`

      - `max_num_results: Optional[int]`

      - `ranking_options: Optional[RankingOptions]`

        Ranking options for search.

        - `hybrid_search: Optional[RankingOptionsHybridSearch]`

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

          - `embedding_weight: float`

          - `text_weight: float`

        - `ranker: Optional[Literal["auto", "default-2024-11-15"]]`

          - `"auto"`

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

        - `score_threshold: Optional[float]`

    - `class 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: int`

      - `display_width: int`

      - `environment: Literal["windows", "mac", "linux", 2 more]`

        - `"windows"`

        - `"mac"`

        - `"linux"`

        - `"ubuntu"`

        - `"browser"`

      - `type: Literal["computer_use_preview"]`

        - `"computer_use_preview"`

    - `class 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: Literal["web_search", "web_search_2025_08_26"]`

        - `"web_search"`

        - `"web_search_2025_08_26"`

      - `filters: Optional[Filters]`

        Filters for the search.

        - `allowed_domains: Optional[List[str]]`

      - `search_context_size: Optional[Literal["low", "medium", "high"]]`

        - `"low"`

        - `"medium"`

        - `"high"`

      - `user_location: Optional[UserLocation]`

        The approximate location of the user.

        - `city: Optional[str]`

        - `country: Optional[str]`

        - `region: Optional[str]`

        - `timezone: Optional[str]`

        - `type: Optional[Literal["approximate"]]`

          - `"approximate"`

    - `class ToolMcp: …`

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

      - `type: Literal["mcp"]`

        - `"mcp"`

      - `allowed_tools: Optional[ToolMcpAllowedTools]`

        A filter object to specify which tools are allowed.

        - `List[str]`

        - `class ToolMcpAllowedToolsMcpAllowedToolsMcpToolFilter: …`

          A filter object to specify which tools are allowed.

          - `read_only: Optional[bool]`

          - `tool_names: Optional[List[str]]`

      - `authorization: Optional[str]`

      - `connector_id: Optional[Literal["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: Optional[Dict[str, str]]`

      - `require_approval: Optional[ToolMcpRequireApproval]`

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

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

        - `class ToolMcpRequireApprovalMcpRequireApprovalMcpToolApprovalFilter: …`

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

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

          - `always: Optional[ToolMcpRequireApprovalMcpRequireApprovalMcpToolApprovalFilterAlways]`

            A filter object to specify which tools are allowed.

            - `read_only: Optional[bool]`

            - `tool_names: Optional[List[str]]`

          - `never: Optional[ToolMcpRequireApprovalMcpRequireApprovalMcpToolApprovalFilterNever]`

            A filter object to specify which tools are allowed.

            - `read_only: Optional[bool]`

            - `tool_names: Optional[List[str]]`

        - `Literal["always", "never"]`

          - `"always"`

          - `"never"`

      - `server_description: Optional[str]`

      - `server_url: Optional[str]`

    - `class ToolCodeInterpreter: …`

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

      - `container: ToolCodeInterpreterContainer`

        Configuration for a code interpreter container.

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

        - `str`

        - `class ToolCodeInterpreterContainerCodeInterpreterContainerCodeInterpreterToolAuto: …`

          Configuration for a code interpreter container.

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

          - `type: Literal["auto"]`

            - `"auto"`

          - `file_ids: Optional[List[str]]`

          - `memory_limit: Optional[Literal["1g", "4g", "16g", "64g"]]`

            - `"1g"`

            - `"4g"`

            - `"16g"`

            - `"64g"`

          - `network_policy: Optional[ToolCodeInterpreterContainerCodeInterpreterContainerCodeInterpreterToolAutoNetworkPolicy]`

            - `class ContainerNetworkPolicyDisabled: …`

              - `type: Literal["disabled"]`

                - `"disabled"`

            - `class ContainerNetworkPolicyAllowlist: …`

              - `allowed_domains: List[str]`

              - `type: Literal["allowlist"]`

                - `"allowlist"`

              - `domain_secrets: Optional[List[DomainSecret]]`

                - `domain: str`

                - `name: str`

                - `value: str`

      - `type: Literal["code_interpreter"]`

        - `"code_interpreter"`

    - `class ToolImageGeneration: …`

      A tool that generates images using the GPT image models.

      - `type: Literal["image_generation"]`

        - `"image_generation"`

      - `action: Optional[Literal["generate", "edit", "auto"]]`

        - `"generate"`

        - `"edit"`

        - `"auto"`

      - `background: Optional[Literal["transparent", "opaque", "auto"]]`

        - `"transparent"`

        - `"opaque"`

        - `"auto"`

      - `input_fidelity: Optional[Literal["high", "low"]]`

        - `"high"`

        - `"low"`

      - `input_image_mask: Optional[ToolImageGenerationInputImageMask]`

        Optional mask for inpainting.

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

        - `file_id: Optional[str]`

        - `image_url: Optional[str]`

      - `model: Optional[Union[str, Literal["gpt-image-1", "gpt-image-1-mini", "gpt-image-1.5"], null]]`

        - `str`

        - `Literal["gpt-image-1", "gpt-image-1-mini", "gpt-image-1.5"]`

          - `"gpt-image-1"`

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

          - `"gpt-image-1.5"`

      - `moderation: Optional[Literal["auto", "low"]]`

        - `"auto"`

        - `"low"`

      - `output_compression: Optional[int]`

      - `output_format: Optional[Literal["png", "webp", "jpeg"]]`

        - `"png"`

        - `"webp"`

        - `"jpeg"`

      - `partial_images: Optional[int]`

      - `quality: Optional[Literal["low", "medium", "high", "auto"]]`

        - `"low"`

        - `"medium"`

        - `"high"`

        - `"auto"`

      - `size: Optional[Literal["1024x1024", "1024x1536", "1536x1024", "auto"]]`

        - `"1024x1024"`

        - `"1024x1536"`

        - `"1536x1024"`

        - `"auto"`

    - `class ToolLocalShell: …`

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

      - `type: Literal["local_shell"]`

        - `"local_shell"`

    - `class FunctionShellTool: …`

      A tool that allows the model to execute shell commands.

      - `type: Literal["shell"]`

        - `"shell"`

      - `environment: Optional[Environment]`

        - `class EnvironmentContainerAuto: …`

          - `type: Literal["container_auto"]`

            - `"container_auto"`

          - `file_ids: Optional[List[str]]`

          - `memory_limit: Optional[Literal["1g", "4g", "16g", "64g"]]`

            - `"1g"`

            - `"4g"`

            - `"16g"`

            - `"64g"`

          - `network_policy: Optional[EnvironmentContainerAutoNetworkPolicy]`

            - `class ContainerNetworkPolicyDisabled: …`

            - `class ContainerNetworkPolicyAllowlist: …`

          - `skills: Optional[List[EnvironmentContainerAutoSkill]]`

            - `class EnvironmentContainerAutoSkillSkillReference: …`

              - `skill_id: str`

              - `type: Literal["skill_reference"]`

                - `"skill_reference"`

              - `version: Optional[str]`

            - `class EnvironmentContainerAutoSkillInlineSkill: …`

              - `description: str`

              - `name: str`

              - `source: EnvironmentContainerAutoSkillInlineSkillSource`

                Inline skill payload

                - `data: str`

                - `media_type: Literal["application/zip"]`

                  - `"application/zip"`

                - `type: Literal["base64"]`

                  - `"base64"`

              - `type: Literal["inline"]`

                - `"inline"`

        - `class LocalEnvironment: …`

          - `type: Literal["local"]`

            - `"local"`

          - `skills: Optional[List[Skill]]`

            - `description: str`

            - `name: str`

            - `path: str`

        - `class ContainerReference: …`

          - `container_id: str`

          - `type: Literal["container_reference"]`

            - `"container_reference"`

    - `class 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: str`

      - `type: Literal["custom"]`

        - `"custom"`

      - `description: Optional[str]`

      - `format: Optional[Format]`

        Unconstrained free-form text.

        - `class FormatText: …`

          Unconstrained free-form text.

          - `type: Literal["text"]`

            - `"text"`

        - `class FormatGrammar: …`

          A grammar defined by the user.

          - `definition: str`

          - `syntax: Literal["lark", "regex"]`

            - `"lark"`

            - `"regex"`

          - `type: Literal["grammar"]`

            - `"grammar"`

    - `class 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: Literal["web_search_preview", "web_search_preview_2025_03_11"]`

        - `"web_search_preview"`

        - `"web_search_preview_2025_03_11"`

      - `search_context_size: Optional[Literal["low", "medium", "high"]]`

        - `"low"`

        - `"medium"`

        - `"high"`

      - `user_location: Optional[UserLocation]`

        The user's location.

        - `type: Literal["approximate"]`

          - `"approximate"`

        - `city: Optional[str]`

        - `country: Optional[str]`

        - `region: Optional[str]`

        - `timezone: Optional[str]`

    - `class ApplyPatchTool: …`

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

      - `type: Literal["apply_patch"]`

        - `"apply_patch"`

  - `background: Optional[bool]`

  - `completed_at: Optional[float]`

  - `conversation: Optional[Conversation]`

    The conversation that this response belonged to.

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

    - `id: str`

  - `error: Optional[OpenAIResponseError]`

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

    - `code: Literal["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: str`

  - `incomplete_details: Optional[IncompleteDetails]`

    Details about why the response is incomplete.

    - `reason: Optional[Literal["max_output_tokens", "content_filter"]]`

      - `"max_output_tokens"`

      - `"content_filter"`

  - `instructions: Optional[Union[str, List[InstructionsInputItem], null]]`

    - `str`

    - `List[InstructionsInputItem]`

      - `class 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: Union[str, List[ContentInputItem]]`

          - `str`

          - `List[ContentInputItem]`

            - `class OpenAIResponseInputText: …`

              A text input to the model.

              - `text: str`

              - `type: Literal["input_text"]`

                - `"input_text"`

            - `class OpenAIResponseInputImage: …`

              An image input to the model.

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

              - `detail: Literal["low", "high", "auto"]`

                - `"low"`

                - `"high"`

                - `"auto"`

              - `type: Literal["input_image"]`

                - `"input_image"`

              - `file_id: Optional[str]`

              - `image_url: Optional[str]`

            - `class OpenAIResponseInputFile: …`

              A file input to the model.

              - `type: Literal["input_file"]`

                - `"input_file"`

              - `file_data: Optional[str]`

              - `file_id: Optional[str]`

              - `file_url: Optional[str]`

              - `filename: Optional[str]`

        - `role: Literal["user", "assistant", "system", "developer"]`

          - `"user"`

          - `"assistant"`

          - `"system"`

          - `"developer"`

        - `phase: Optional[Literal["commentary", "final_answer"]]`

          - `"commentary"`

          - `"final_answer"`

        - `type: Optional[Literal["message"]]`

          - `"message"`

      - `class 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: List[Content]`

          - `class OpenAIResponseInputText: …`

            A text input to the model.

          - `class OpenAIResponseInputImage: …`

            An image input to the model.

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

          - `class OpenAIResponseInputFile: …`

            A file input to the model.

        - `role: Literal["user", "system", "developer"]`

          - `"user"`

          - `"system"`

          - `"developer"`

        - `status: Optional[Literal["in_progress", "completed", "incomplete"]]`

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

        - `type: Optional[Literal["message"]]`

          - `"message"`

      - `class OpenAIResponseOutputMessage: …`

        An output message from the model.

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

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

      - `class OpenAITypesResponsesResponseInputItemComputerCallOutput: …`

        The output of a computer tool call.

        - `call_id: str`

        - `output: ResponseComputerToolCallOutputScreenshot`

          A computer screenshot image used with the computer use tool.

          - `type: Literal["computer_screenshot"]`

            - `"computer_screenshot"`

          - `file_id: Optional[str]`

          - `image_url: Optional[str]`

        - `type: Literal["computer_call_output"]`

          - `"computer_call_output"`

        - `id: Optional[str]`

        - `acknowledged_safety_checks: Optional[List[AcknowledgedSafetyCheck]]`

          - `id: str`

          - `code: Optional[str]`

          - `message: Optional[str]`

        - `status: Optional[Literal["in_progress", "completed", "incomplete"]]`

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

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

      - `class OpenAIResponseFunctionToolCall: …`

        A tool call to run a function.

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

      - `class OpenAITypesResponsesResponseInputItemFunctionCallOutput: …`

        The output of a function tool call.

        - `call_id: str`

        - `output: Union[str, List[OutputOutputContentList]]`

          - `str`

          - `List[OutputOutputContentList]`

            - `class OutputOutputContentListResponseInputTextContent: …`

              A text input to the model.

              - `text: str`

              - `type: Literal["input_text"]`

                - `"input_text"`

            - `class OutputOutputContentListResponseInputImageContent: …`

              An image input to the model.

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

              - `type: Literal["input_image"]`

                - `"input_image"`

              - `detail: Optional[Literal["low", "high", "auto"]]`

                - `"low"`

                - `"high"`

                - `"auto"`

              - `file_id: Optional[str]`

              - `image_url: Optional[str]`

            - `class OutputOutputContentListResponseInputFileContent: …`

              A file input to the model.

              - `type: Literal["input_file"]`

                - `"input_file"`

              - `file_data: Optional[str]`

              - `file_id: Optional[str]`

              - `file_url: Optional[str]`

              - `filename: Optional[str]`

        - `type: Literal["function_call_output"]`

          - `"function_call_output"`

        - `id: Optional[str]`

        - `status: Optional[Literal["in_progress", "completed", "incomplete"]]`

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

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

      - `class ResponseCompactionItemParam: …`

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

        - `encrypted_content: str`

        - `type: Literal["compaction"]`

          - `"compaction"`

        - `id: Optional[str]`

      - `class OpenAITypesResponsesResponseInputItemImageGenerationCall: …`

        An image generation request made by the model.

        - `id: str`

        - `status: Literal["in_progress", "completed", "generating", "failed"]`

          - `"in_progress"`

          - `"completed"`

          - `"generating"`

          - `"failed"`

        - `type: Literal["image_generation_call"]`

          - `"image_generation_call"`

        - `result: Optional[str]`

      - `class OpenAIResponseCodeInterpreterToolCall: …`

        A tool call to run code.

      - `class OpenAITypesResponsesResponseInputItemLocalShellCall: …`

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

        - `id: str`

        - `action: Action`

          Execute a shell command on the server.

          - `command: List[str]`

          - `env: Dict[str, str]`

          - `type: Literal["exec"]`

            - `"exec"`

          - `timeout_ms: Optional[int]`

          - `user: Optional[str]`

          - `working_directory: Optional[str]`

        - `call_id: str`

        - `status: Literal["in_progress", "completed", "incomplete"]`

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

        - `type: Literal["local_shell_call"]`

          - `"local_shell_call"`

      - `class OpenAITypesResponsesResponseInputItemLocalShellCallOutput: …`

        The output of a local shell tool call.

        - `id: str`

        - `output: str`

        - `type: Literal["local_shell_call_output"]`

          - `"local_shell_call_output"`

        - `status: Optional[Literal["in_progress", "completed", "incomplete"]]`

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

      - `class 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: List[str]`

          - `max_output_length: Optional[int]`

          - `timeout_ms: Optional[int]`

        - `call_id: str`

        - `type: Literal["shell_call"]`

          - `"shell_call"`

        - `id: Optional[str]`

        - `environment: Optional[Environment]`

          - `class LocalEnvironment: …`

          - `class ContainerReference: …`

        - `status: Optional[Literal["in_progress", "completed", "incomplete"]]`

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

      - `class ShellCallOutput: …`

        The streamed output items emitted by a shell tool call.

        - `call_id: str`

        - `output: List[Output]`

          - `outcome: OutputOutcome`

            Indicates that the shell call exceeded its configured time limit.

            - `class OutputOutcomeOutcomeTimeout: …`

              Indicates that the shell call exceeded its configured time limit.

              - `type: Literal["timeout"]`

                - `"timeout"`

            - `class OutputOutcomeOutcomeExit: …`

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

              - `exit_code: int`

              - `type: Literal["exit"]`

                - `"exit"`

          - `stderr: str`

          - `stdout: str`

        - `type: Literal["shell_call_output"]`

          - `"shell_call_output"`

        - `id: Optional[str]`

        - `max_output_length: Optional[int]`

        - `status: Optional[Literal["in_progress", "completed", "incomplete"]]`

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

      - `class ApplyPatchCall: …`

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

        - `call_id: str`

        - `operation: Operation`

          Instruction for creating a new file via the apply_patch tool.

          - `class OperationApplyPatchCallOperationCreateFile: …`

            Instruction for creating a new file via the apply_patch tool.

            - `diff: str`

            - `path: str`

            - `type: Literal["create_file"]`

              - `"create_file"`

          - `class OperationApplyPatchCallOperationDeleteFile: …`

            Instruction for deleting an existing file via the apply_patch tool.

            - `path: str`

            - `type: Literal["delete_file"]`

              - `"delete_file"`

          - `class OperationApplyPatchCallOperationUpdateFile: …`

            Instruction for updating an existing file via the apply_patch tool.

            - `diff: str`

            - `path: str`

            - `type: Literal["update_file"]`

              - `"update_file"`

        - `status: Literal["in_progress", "completed"]`

          - `"in_progress"`

          - `"completed"`

        - `type: Literal["apply_patch_call"]`

          - `"apply_patch_call"`

        - `id: Optional[str]`

      - `class ApplyPatchCallOutput: …`

        The streamed output emitted by an apply patch tool call.

        - `call_id: str`

        - `status: Literal["completed", "failed"]`

          - `"completed"`

          - `"failed"`

        - `type: Literal["apply_patch_call_output"]`

          - `"apply_patch_call_output"`

        - `id: Optional[str]`

        - `output: Optional[str]`

      - `class OpenAITypesResponsesResponseInputItemMcpListTools: …`

        A list of tools available on an MCP server.

        - `id: str`

        - `server_label: str`

        - `tools: List[Tool]`

          - `input_schema: object`

          - `name: str`

          - `annotations: Optional[object]`

          - `description: Optional[str]`

        - `type: Literal["mcp_list_tools"]`

          - `"mcp_list_tools"`

        - `error: Optional[str]`

      - `class McpApprovalRequest: …`

        A request for human approval of a tool invocation.

      - `class OpenAITypesResponsesResponseInputItemMcpApprovalResponse: …`

        A response to an MCP approval request.

        - `approval_request_id: str`

        - `approve: bool`

        - `type: Literal["mcp_approval_response"]`

          - `"mcp_approval_response"`

        - `id: Optional[str]`

        - `reason: Optional[str]`

      - `class OpenAITypesResponsesResponseInputItemMcpCall: …`

        An invocation of a tool on an MCP server.

        - `id: str`

        - `arguments: str`

        - `name: str`

        - `server_label: str`

        - `type: Literal["mcp_call"]`

          - `"mcp_call"`

        - `approval_request_id: Optional[str]`

        - `error: Optional[str]`

        - `output: Optional[str]`

        - `status: Optional[Literal["in_progress", "completed", "incomplete", 2 more]]`

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

          - `"calling"`

          - `"failed"`

      - `class OpenAIResponseCustomToolCallOutput: …`

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

        - `call_id: str`

        - `output: Union[str, List[OutputOutputContentList]]`

          - `str`

          - `List[OutputOutputContentList]`

            - `class OpenAIResponseInputText: …`

              A text input to the model.

            - `class OpenAIResponseInputImage: …`

              An image input to the model.

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

            - `class OpenAIResponseInputFile: …`

              A file input to the model.

        - `type: Literal["custom_tool_call_output"]`

          - `"custom_tool_call_output"`

        - `id: Optional[str]`

      - `class OpenAIResponseCustomToolCall: …`

        A call to a custom tool created by the model.

      - `class OpenAITypesResponsesResponseInputItemItemReference: …`

        An internal identifier for an item to reference.

        - `id: str`

        - `type: Optional[Literal["item_reference"]]`

          - `"item_reference"`

  - `max_output_tokens: Optional[int]`

  - `max_tool_calls: Optional[int]`

  - `metadata: Optional[Dict[str, str]]`

  - `previous_response_id: Optional[str]`

  - `prompt: Optional[OpenAIResponsePrompt]`

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

    - `id: str`

    - `variables: Optional[Dict[str, Variables]]`

      - `str`

      - `class OpenAIResponseInputText: …`

        A text input to the model.

      - `class OpenAIResponseInputImage: …`

        An image input to the model.

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

      - `class OpenAIResponseInputFile: …`

        A file input to the model.

    - `version: Optional[str]`

  - `prompt_cache_key: Optional[str]`

  - `prompt_cache_retention: Optional[Literal["in-memory", "24h"]]`

    - `"in-memory"`

    - `"24h"`

  - `reasoning: Optional[Reasoning]`

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

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

    - `effort: Optional[Literal["none", "minimal", "low", 3 more]]`

      - `"none"`

      - `"minimal"`

      - `"low"`

      - `"medium"`

      - `"high"`

      - `"xhigh"`

    - `generate_summary: Optional[Literal["auto", "concise", "detailed"]]`

      - `"auto"`

      - `"concise"`

      - `"detailed"`

    - `summary: Optional[Literal["auto", "concise", "detailed"]]`

      - `"auto"`

      - `"concise"`

      - `"detailed"`

  - `safety_identifier: Optional[str]`

  - `service_tier: Optional[Literal["auto", "default", "flex", 2 more]]`

    - `"auto"`

    - `"default"`

    - `"flex"`

    - `"scale"`

    - `"priority"`

  - `status: Optional[Literal["completed", "failed", "in_progress", 3 more]]`

    - `"completed"`

    - `"failed"`

    - `"in_progress"`

    - `"cancelled"`

    - `"queued"`

    - `"incomplete"`

  - `temperature: Optional[float]`

  - `text: Optional[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: Optional[Format]`

      Default response format. Used to generate text responses.

      - `class FormatResponseFormatText: …`

        Default response format. Used to generate text responses.

        - `type: Literal["text"]`

          - `"text"`

      - `class FormatResponseFormatTextJsonSchemaConfig: …`

        JSON Schema response format.

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

        - `name: str`

        - `schema: Dict[str, object]`

        - `type: Literal["json_schema"]`

          - `"json_schema"`

        - `description: Optional[str]`

        - `strict: Optional[bool]`

      - `class FormatResponseFormatJsonObject: …`

        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: Literal["json_object"]`

          - `"json_object"`

    - `verbosity: Optional[Literal["low", "medium", "high"]]`

      - `"low"`

      - `"medium"`

      - `"high"`

  - `top_logprobs: Optional[int]`

  - `top_p: Optional[float]`

  - `truncation: Optional[Literal["auto", "disabled"]]`

    - `"auto"`

    - `"disabled"`

  - `usage: Optional[OpenAIResponseUsage]`

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

    - `input_tokens: int`

    - `input_tokens_details: InputTokensDetails`

      A detailed breakdown of the input tokens.

      - `cached_tokens: int`

    - `output_tokens: int`

    - `output_tokens_details: OutputTokensDetails`

      A detailed breakdown of the output tokens.

      - `reasoning_tokens: int`

    - `total_tokens: int`

  - `user: Optional[str]`

### OpenAI Response Code Interpreter Tool Call

- `class OpenAIResponseCodeInterpreterToolCall: …`

  A tool call to run code.

  - `id: str`

  - `container_id: str`

  - `status: Literal["in_progress", "completed", "incomplete", 2 more]`

    - `"in_progress"`

    - `"completed"`

    - `"incomplete"`

    - `"interpreting"`

    - `"failed"`

  - `type: Literal["code_interpreter_call"]`

    - `"code_interpreter_call"`

  - `code: Optional[str]`

  - `outputs: Optional[List[Output]]`

    - `class OutputOutputLogs: …`

      The logs output from the code interpreter.

      - `logs: str`

      - `type: Literal["logs"]`

        - `"logs"`

    - `class OutputOutputImage: …`

      The image output from the code interpreter.

      - `type: Literal["image"]`

        - `"image"`

      - `url: str`

### OpenAI Response Computer Tool Call

- `class 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: str`

  - `action: Action`

    A click action.

    - `class ActionActionClick: …`

      A click action.

      - `button: Literal["left", "right", "wheel", 2 more]`

        - `"left"`

        - `"right"`

        - `"wheel"`

        - `"back"`

        - `"forward"`

      - `type: Literal["click"]`

        - `"click"`

      - `x: int`

      - `y: int`

    - `class ActionActionDoubleClick: …`

      A double click action.

      - `type: Literal["double_click"]`

        - `"double_click"`

      - `x: int`

      - `y: int`

    - `class ActionActionDrag: …`

      A drag action.

      - `path: List[ActionActionDragPath]`

        - `x: int`

        - `y: int`

      - `type: Literal["drag"]`

        - `"drag"`

    - `class ActionActionKeypress: …`

      A collection of keypresses the model would like to perform.

      - `keys: List[str]`

      - `type: Literal["keypress"]`

        - `"keypress"`

    - `class ActionActionMove: …`

      A mouse move action.

      - `type: Literal["move"]`

        - `"move"`

      - `x: int`

      - `y: int`

    - `class ActionActionScreenshot: …`

      A screenshot action.

      - `type: Literal["screenshot"]`

        - `"screenshot"`

    - `class ActionActionScroll: …`

      A scroll action.

      - `scroll_x: int`

      - `scroll_y: int`

      - `type: Literal["scroll"]`

        - `"scroll"`

      - `x: int`

      - `y: int`

    - `class ActionActionType: …`

      An action to type in text.

      - `text: str`

      - `type: Literal["type"]`

        - `"type"`

    - `class ActionActionWait: …`

      A wait action.

      - `type: Literal["wait"]`

        - `"wait"`

  - `call_id: str`

  - `pending_safety_checks: List[PendingSafetyCheck]`

    - `id: str`

    - `code: Optional[str]`

    - `message: Optional[str]`

  - `status: Literal["in_progress", "completed", "incomplete"]`

    - `"in_progress"`

    - `"completed"`

    - `"incomplete"`

  - `type: Literal["computer_call"]`

    - `"computer_call"`

### OpenAI Response Custom Tool Call

- `class OpenAIResponseCustomToolCall: …`

  A call to a custom tool created by the model.

  - `call_id: str`

  - `input: str`

  - `name: str`

  - `type: Literal["custom_tool_call"]`

    - `"custom_tool_call"`

  - `id: Optional[str]`

### OpenAI Response Custom Tool Call Output

- `class OpenAIResponseCustomToolCallOutput: …`

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

  - `call_id: str`

  - `output: Union[str, List[OutputOutputContentList]]`

    - `str`

    - `List[OutputOutputContentList]`

      - `class OpenAIResponseInputText: …`

        A text input to the model.

        - `text: str`

        - `type: Literal["input_text"]`

          - `"input_text"`

      - `class OpenAIResponseInputImage: …`

        An image input to the model.

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

        - `detail: Literal["low", "high", "auto"]`

          - `"low"`

          - `"high"`

          - `"auto"`

        - `type: Literal["input_image"]`

          - `"input_image"`

        - `file_id: Optional[str]`

        - `image_url: Optional[str]`

      - `class OpenAIResponseInputFile: …`

        A file input to the model.

        - `type: Literal["input_file"]`

          - `"input_file"`

        - `file_data: Optional[str]`

        - `file_id: Optional[str]`

        - `file_url: Optional[str]`

        - `filename: Optional[str]`

  - `type: Literal["custom_tool_call_output"]`

    - `"custom_tool_call_output"`

  - `id: Optional[str]`

### OpenAI Response Error

- `class OpenAIResponseError: …`

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

  - `code: Literal["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: str`

### OpenAI Response File Search Tool Call

- `class 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: str`

  - `queries: List[str]`

  - `status: Literal["in_progress", "searching", "completed", 2 more]`

    - `"in_progress"`

    - `"searching"`

    - `"completed"`

    - `"incomplete"`

    - `"failed"`

  - `type: Literal["file_search_call"]`

    - `"file_search_call"`

  - `results: Optional[List[Result]]`

    - `attributes: Optional[Dict[str, Union[str, float, bool]]]`

      - `str`

      - `float`

      - `bool`

    - `file_id: Optional[str]`

    - `filename: Optional[str]`

    - `score: Optional[float]`

    - `text: Optional[str]`

### OpenAI Response Function Tool Call

- `class 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: str`

  - `call_id: str`

  - `name: str`

  - `type: Literal["function_call"]`

    - `"function_call"`

  - `id: Optional[str]`

  - `status: Optional[Literal["in_progress", "completed", "incomplete"]]`

    - `"in_progress"`

    - `"completed"`

    - `"incomplete"`

### OpenAI Response Function Web Search

- `class 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: str`

  - `action: Action`

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

    - `class ActionOpenAITypesResponsesResponseFunctionWebSearchActionSearch: …`

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

      - `query: str`

      - `type: Literal["search"]`

        - `"search"`

      - `queries: Optional[List[str]]`

      - `sources: Optional[List[ActionOpenAITypesResponsesResponseFunctionWebSearchActionSearchSource]]`

        - `type: Literal["url"]`

          - `"url"`

        - `url: str`

    - `class ActionOpenAITypesResponsesResponseFunctionWebSearchActionOpenPage: …`

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

      - `type: Literal["open_page"]`

        - `"open_page"`

      - `url: Optional[str]`

    - `class ActionActionFind: …`

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

      - `pattern: str`

      - `type: Literal["find_in_page"]`

        - `"find_in_page"`

      - `url: str`

  - `status: Literal["in_progress", "searching", "completed", "failed"]`

    - `"in_progress"`

    - `"searching"`

    - `"completed"`

    - `"failed"`

  - `type: Literal["web_search_call"]`

    - `"web_search_call"`

### OpenAI Response Input File

- `class OpenAIResponseInputFile: …`

  A file input to the model.

  - `type: Literal["input_file"]`

    - `"input_file"`

  - `file_data: Optional[str]`

  - `file_id: Optional[str]`

  - `file_url: Optional[str]`

  - `filename: Optional[str]`

### OpenAI Response Input File Param

- `class OpenAIResponseInputFileParam: …`

  A file input to the model.

  - `type: Literal["input_file"]`

    - `"input_file"`

  - `file_data: Optional[str]`

  - `file_id: Optional[str]`

  - `file_url: Optional[str]`

  - `filename: Optional[str]`

### OpenAI Response Input Image

- `class OpenAIResponseInputImage: …`

  An image input to the model.

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

  - `detail: Literal["low", "high", "auto"]`

    - `"low"`

    - `"high"`

    - `"auto"`

  - `type: Literal["input_image"]`

    - `"input_image"`

  - `file_id: Optional[str]`

  - `image_url: Optional[str]`

### OpenAI Response Input Image Param

- `class OpenAIResponseInputImageParam: …`

  An image input to the model.

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

  - `detail: Literal["low", "high", "auto"]`

    - `"low"`

    - `"high"`

    - `"auto"`

  - `type: Literal["input_image"]`

    - `"input_image"`

  - `file_id: Optional[str]`

  - `image_url: Optional[str]`

### OpenAI Response Input Text

- `class OpenAIResponseInputText: …`

  A text input to the model.

  - `text: str`

  - `type: Literal["input_text"]`

    - `"input_text"`

### OpenAI Response Input Text Param

- `class OpenAIResponseInputTextParam: …`

  A text input to the model.

  - `text: str`

  - `type: Literal["input_text"]`

    - `"input_text"`

### OpenAI Response Output Message

- `class OpenAIResponseOutputMessage: …`

  An output message from the model.

  - `id: str`

  - `content: List[Content]`

    - `class OpenAIResponseOutputText: …`

      A text output from the model.

      - `annotations: List[Annotation]`

        - `class AnnotationAnnotationFileCitation: …`

          A citation to a file.

          - `file_id: str`

          - `filename: str`

          - `index: int`

          - `type: Literal["file_citation"]`

            - `"file_citation"`

        - `class AnnotationOpenAITypesResponsesResponseOutputTextAnnotationURLCitation: …`

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

          - `end_index: int`

          - `start_index: int`

          - `title: str`

          - `type: Literal["url_citation"]`

            - `"url_citation"`

          - `url: str`

        - `class AnnotationAnnotationContainerFileCitation: …`

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

          - `container_id: str`

          - `end_index: int`

          - `file_id: str`

          - `filename: str`

          - `start_index: int`

          - `type: Literal["container_file_citation"]`

            - `"container_file_citation"`

        - `class AnnotationAnnotationFilePath: …`

          A path to a file.

          - `file_id: str`

          - `index: int`

          - `type: Literal["file_path"]`

            - `"file_path"`

      - `text: str`

      - `type: Literal["output_text"]`

        - `"output_text"`

      - `logprobs: Optional[List[Logprob]]`

        - `token: str`

        - `bytes: List[int]`

        - `logprob: float`

        - `top_logprobs: List[LogprobTopLogprob]`

          - `token: str`

          - `bytes: List[int]`

          - `logprob: float`

    - `class OpenAIResponseOutputRefusal: …`

      A refusal from the model.

      - `refusal: str`

      - `type: Literal["refusal"]`

        - `"refusal"`

  - `role: Literal["assistant"]`

    - `"assistant"`

  - `status: Literal["in_progress", "completed", "incomplete"]`

    - `"in_progress"`

    - `"completed"`

    - `"incomplete"`

  - `type: Literal["message"]`

    - `"message"`

  - `phase: Optional[Literal["commentary", "final_answer"]]`

    - `"commentary"`

    - `"final_answer"`

### OpenAI Response Output Refusal

- `class OpenAIResponseOutputRefusal: …`

  A refusal from the model.

  - `refusal: str`

  - `type: Literal["refusal"]`

    - `"refusal"`

### OpenAI Response Output Text

- `class OpenAIResponseOutputText: …`

  A text output from the model.

  - `annotations: List[Annotation]`

    - `class AnnotationAnnotationFileCitation: …`

      A citation to a file.

      - `file_id: str`

      - `filename: str`

      - `index: int`

      - `type: Literal["file_citation"]`

        - `"file_citation"`

    - `class AnnotationOpenAITypesResponsesResponseOutputTextAnnotationURLCitation: …`

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

      - `end_index: int`

      - `start_index: int`

      - `title: str`

      - `type: Literal["url_citation"]`

        - `"url_citation"`

      - `url: str`

    - `class AnnotationAnnotationContainerFileCitation: …`

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

      - `container_id: str`

      - `end_index: int`

      - `file_id: str`

      - `filename: str`

      - `start_index: int`

      - `type: Literal["container_file_citation"]`

        - `"container_file_citation"`

    - `class AnnotationAnnotationFilePath: …`

      A path to a file.

      - `file_id: str`

      - `index: int`

      - `type: Literal["file_path"]`

        - `"file_path"`

  - `text: str`

  - `type: Literal["output_text"]`

    - `"output_text"`

  - `logprobs: Optional[List[Logprob]]`

    - `token: str`

    - `bytes: List[int]`

    - `logprob: float`

    - `top_logprobs: List[LogprobTopLogprob]`

      - `token: str`

      - `bytes: List[int]`

      - `logprob: float`

### OpenAI Response Prompt

- `class OpenAIResponsePrompt: …`

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

  - `id: str`

  - `variables: Optional[Dict[str, Variables]]`

    - `str`

    - `class OpenAIResponseInputText: …`

      A text input to the model.

      - `text: str`

      - `type: Literal["input_text"]`

        - `"input_text"`

    - `class OpenAIResponseInputImage: …`

      An image input to the model.

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

      - `detail: Literal["low", "high", "auto"]`

        - `"low"`

        - `"high"`

        - `"auto"`

      - `type: Literal["input_image"]`

        - `"input_image"`

      - `file_id: Optional[str]`

      - `image_url: Optional[str]`

    - `class OpenAIResponseInputFile: …`

      A file input to the model.

      - `type: Literal["input_file"]`

        - `"input_file"`

      - `file_data: Optional[str]`

      - `file_id: Optional[str]`

      - `file_url: Optional[str]`

      - `filename: Optional[str]`

  - `version: Optional[str]`

### OpenAI Response Reasoning Item

- `class 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: str`

  - `summary: List[Summary]`

    - `text: str`

    - `type: Literal["summary_text"]`

      - `"summary_text"`

  - `type: Literal["reasoning"]`

    - `"reasoning"`

  - `content: Optional[List[Content]]`

    - `text: str`

    - `type: Literal["reasoning_text"]`

      - `"reasoning_text"`

  - `encrypted_content: Optional[str]`

  - `status: Optional[Literal["in_progress", "completed", "incomplete"]]`

    - `"in_progress"`

    - `"completed"`

    - `"incomplete"`

### OpenAI Response Text Config

- `class 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: Optional[Format]`

    Default response format. Used to generate text responses.

    - `class FormatResponseFormatText: …`

      Default response format. Used to generate text responses.

      - `type: Literal["text"]`

        - `"text"`

    - `class FormatResponseFormatTextJsonSchemaConfig: …`

      JSON Schema response format.

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

      - `name: str`

      - `schema: Dict[str, object]`

      - `type: Literal["json_schema"]`

        - `"json_schema"`

      - `description: Optional[str]`

      - `strict: Optional[bool]`

    - `class FormatResponseFormatJsonObject: …`

      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: Literal["json_object"]`

        - `"json_object"`

  - `verbosity: Optional[Literal["low", "medium", "high"]]`

    - `"low"`

    - `"medium"`

    - `"high"`

### OpenAI Response Usage

- `class OpenAIResponseUsage: …`

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

  - `input_tokens: int`

  - `input_tokens_details: InputTokensDetails`

    A detailed breakdown of the input tokens.

    - `cached_tokens: int`

  - `output_tokens: int`

  - `output_tokens_details: OutputTokensDetails`

    A detailed breakdown of the output tokens.

    - `reasoning_tokens: int`

  - `total_tokens: int`

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

- `class OpenAITypesResponsesResponseInputItemComputerCallOutput: …`

  The output of a computer tool call.

  - `call_id: str`

  - `output: ResponseComputerToolCallOutputScreenshot`

    A computer screenshot image used with the computer use tool.

    - `type: Literal["computer_screenshot"]`

      - `"computer_screenshot"`

    - `file_id: Optional[str]`

    - `image_url: Optional[str]`

  - `type: Literal["computer_call_output"]`

    - `"computer_call_output"`

  - `id: Optional[str]`

  - `acknowledged_safety_checks: Optional[List[AcknowledgedSafetyCheck]]`

    - `id: str`

    - `code: Optional[str]`

    - `message: Optional[str]`

  - `status: Optional[Literal["in_progress", "completed", "incomplete"]]`

    - `"in_progress"`

    - `"completed"`

    - `"incomplete"`

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

- `class OpenAITypesResponsesResponseInputItemFunctionCallOutput: …`

  The output of a function tool call.

  - `call_id: str`

  - `output: Union[str, List[OutputOutputContentList]]`

    - `str`

    - `List[OutputOutputContentList]`

      - `class OutputOutputContentListResponseInputTextContent: …`

        A text input to the model.

        - `text: str`

        - `type: Literal["input_text"]`

          - `"input_text"`

      - `class OutputOutputContentListResponseInputImageContent: …`

        An image input to the model.

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

        - `type: Literal["input_image"]`

          - `"input_image"`

        - `detail: Optional[Literal["low", "high", "auto"]]`

          - `"low"`

          - `"high"`

          - `"auto"`

        - `file_id: Optional[str]`

        - `image_url: Optional[str]`

      - `class OutputOutputContentListResponseInputFileContent: …`

        A file input to the model.

        - `type: Literal["input_file"]`

          - `"input_file"`

        - `file_data: Optional[str]`

        - `file_id: Optional[str]`

        - `file_url: Optional[str]`

        - `filename: Optional[str]`

  - `type: Literal["function_call_output"]`

    - `"function_call_output"`

  - `id: Optional[str]`

  - `status: Optional[Literal["in_progress", "completed", "incomplete"]]`

    - `"in_progress"`

    - `"completed"`

    - `"incomplete"`

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

- `class OpenAITypesResponsesResponseInputItemImageGenerationCall: …`

  An image generation request made by the model.

  - `id: str`

  - `status: Literal["in_progress", "completed", "generating", "failed"]`

    - `"in_progress"`

    - `"completed"`

    - `"generating"`

    - `"failed"`

  - `type: Literal["image_generation_call"]`

    - `"image_generation_call"`

  - `result: Optional[str]`

### OpenAI Types Responses Response Input Item Item Reference

- `class OpenAITypesResponsesResponseInputItemItemReference: …`

  An internal identifier for an item to reference.

  - `id: str`

  - `type: Optional[Literal["item_reference"]]`

    - `"item_reference"`

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

- `class OpenAITypesResponsesResponseInputItemLocalShellCall: …`

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

  - `id: str`

  - `action: Action`

    Execute a shell command on the server.

    - `command: List[str]`

    - `env: Dict[str, str]`

    - `type: Literal["exec"]`

      - `"exec"`

    - `timeout_ms: Optional[int]`

    - `user: Optional[str]`

    - `working_directory: Optional[str]`

  - `call_id: str`

  - `status: Literal["in_progress", "completed", "incomplete"]`

    - `"in_progress"`

    - `"completed"`

    - `"incomplete"`

  - `type: Literal["local_shell_call"]`

    - `"local_shell_call"`

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

- `class OpenAITypesResponsesResponseInputItemLocalShellCallOutput: …`

  The output of a local shell tool call.

  - `id: str`

  - `output: str`

  - `type: Literal["local_shell_call_output"]`

    - `"local_shell_call_output"`

  - `status: Optional[Literal["in_progress", "completed", "incomplete"]]`

    - `"in_progress"`

    - `"completed"`

    - `"incomplete"`

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

- `class OpenAITypesResponsesResponseInputItemMcpApprovalResponse: …`

  A response to an MCP approval request.

  - `approval_request_id: str`

  - `approve: bool`

  - `type: Literal["mcp_approval_response"]`

    - `"mcp_approval_response"`

  - `id: Optional[str]`

  - `reason: Optional[str]`

### OpenAI Types Responses Response Input Item Mcp Call

- `class OpenAITypesResponsesResponseInputItemMcpCall: …`

  An invocation of a tool on an MCP server.

  - `id: str`

  - `arguments: str`

  - `name: str`

  - `server_label: str`

  - `type: Literal["mcp_call"]`

    - `"mcp_call"`

  - `approval_request_id: Optional[str]`

  - `error: Optional[str]`

  - `output: Optional[str]`

  - `status: Optional[Literal["in_progress", "completed", "incomplete", 2 more]]`

    - `"in_progress"`

    - `"completed"`

    - `"incomplete"`

    - `"calling"`

    - `"failed"`

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

- `class OpenAITypesResponsesResponseInputItemMcpListTools: …`

  A list of tools available on an MCP server.

  - `id: str`

  - `server_label: str`

  - `tools: List[Tool]`

    - `input_schema: object`

    - `name: str`

    - `annotations: Optional[object]`

    - `description: Optional[str]`

  - `type: Literal["mcp_list_tools"]`

    - `"mcp_list_tools"`

  - `error: Optional[str]`

### OpenAI Types Responses Response Input Item Message

- `class 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: List[Content]`

    - `class OpenAIResponseInputText: …`

      A text input to the model.

      - `text: str`

      - `type: Literal["input_text"]`

        - `"input_text"`

    - `class OpenAIResponseInputImage: …`

      An image input to the model.

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

      - `detail: Literal["low", "high", "auto"]`

        - `"low"`

        - `"high"`

        - `"auto"`

      - `type: Literal["input_image"]`

        - `"input_image"`

      - `file_id: Optional[str]`

      - `image_url: Optional[str]`

    - `class OpenAIResponseInputFile: …`

      A file input to the model.

      - `type: Literal["input_file"]`

        - `"input_file"`

      - `file_data: Optional[str]`

      - `file_id: Optional[str]`

      - `file_url: Optional[str]`

      - `filename: Optional[str]`

  - `role: Literal["user", "system", "developer"]`

    - `"user"`

    - `"system"`

    - `"developer"`

  - `status: Optional[Literal["in_progress", "completed", "incomplete"]]`

    - `"in_progress"`

    - `"completed"`

    - `"incomplete"`

  - `type: Optional[Literal["message"]]`

    - `"message"`

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

- `class OpenAITypesResponsesResponseOutputItemImageGenerationCall: …`

  An image generation request made by the model.

  - `id: str`

  - `status: Literal["in_progress", "completed", "generating", "failed"]`

    - `"in_progress"`

    - `"completed"`

    - `"generating"`

    - `"failed"`

  - `type: Literal["image_generation_call"]`

    - `"image_generation_call"`

  - `result: Optional[str]`

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

- `class OpenAITypesResponsesResponseOutputItemLocalShellCall: …`

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

  - `id: str`

  - `action: Action`

    Execute a shell command on the server.

    - `command: List[str]`

    - `env: Dict[str, str]`

    - `type: Literal["exec"]`

      - `"exec"`

    - `timeout_ms: Optional[int]`

    - `user: Optional[str]`

    - `working_directory: Optional[str]`

  - `call_id: str`

  - `status: Literal["in_progress", "completed", "incomplete"]`

    - `"in_progress"`

    - `"completed"`

    - `"incomplete"`

  - `type: Literal["local_shell_call"]`

    - `"local_shell_call"`

### OpenAI Types Responses Response Output Item Mcp Call

- `class OpenAITypesResponsesResponseOutputItemMcpCall: …`

  An invocation of a tool on an MCP server.

  - `id: str`

  - `arguments: str`

  - `name: str`

  - `server_label: str`

  - `type: Literal["mcp_call"]`

    - `"mcp_call"`

  - `approval_request_id: Optional[str]`

  - `error: Optional[str]`

  - `output: Optional[str]`

  - `status: Optional[Literal["in_progress", "completed", "incomplete", 2 more]]`

    - `"in_progress"`

    - `"completed"`

    - `"incomplete"`

    - `"calling"`

    - `"failed"`

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

- `class OpenAITypesResponsesResponseOutputItemMcpListTools: …`

  A list of tools available on an MCP server.

  - `id: str`

  - `server_label: str`

  - `tools: List[Tool]`

    - `input_schema: object`

    - `name: str`

    - `annotations: Optional[object]`

    - `description: Optional[str]`

  - `type: Literal["mcp_list_tools"]`

    - `"mcp_list_tools"`

  - `error: Optional[str]`

### Part Reasoning Text

- `class PartReasoningText: …`

  Reasoning text from the model.

  - `text: str`

  - `type: Literal["reasoning_text"]`

    - `"reasoning_text"`

### Reasoning

- `class Reasoning: …`

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

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

  - `effort: Optional[Literal["none", "minimal", "low", 3 more]]`

    - `"none"`

    - `"minimal"`

    - `"low"`

    - `"medium"`

    - `"high"`

    - `"xhigh"`

  - `generate_summary: Optional[Literal["auto", "concise", "detailed"]]`

    - `"auto"`

    - `"concise"`

    - `"detailed"`

  - `summary: Optional[Literal["auto", "concise", "detailed"]]`

    - `"auto"`

    - `"concise"`

    - `"detailed"`

### Response Apply Patch Tool Call

- `class ResponseApplyPatchToolCall: …`

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

  - `id: str`

  - `call_id: str`

  - `operation: Operation`

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

    - `class OperationOperationCreateFile: …`

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

      - `diff: str`

      - `path: str`

      - `type: Literal["create_file"]`

        - `"create_file"`

    - `class OperationOperationDeleteFile: …`

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

      - `path: str`

      - `type: Literal["delete_file"]`

        - `"delete_file"`

    - `class OperationOperationUpdateFile: …`

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

      - `diff: str`

      - `path: str`

      - `type: Literal["update_file"]`

        - `"update_file"`

  - `status: Literal["in_progress", "completed"]`

    - `"in_progress"`

    - `"completed"`

  - `type: Literal["apply_patch_call"]`

    - `"apply_patch_call"`

  - `created_by: Optional[str]`

### Response Apply Patch Tool Call Output

- `class ResponseApplyPatchToolCallOutput: …`

  The output emitted by an apply patch tool call.

  - `id: str`

  - `call_id: str`

  - `status: Literal["completed", "failed"]`

    - `"completed"`

    - `"failed"`

  - `type: Literal["apply_patch_call_output"]`

    - `"apply_patch_call_output"`

  - `created_by: Optional[str]`

  - `output: Optional[str]`

### Response Compaction Item

- `class ResponseCompactionItem: …`

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

  - `id: str`

  - `encrypted_content: str`

  - `type: Literal["compaction"]`

    - `"compaction"`

  - `created_by: Optional[str]`

### Response Compaction Item Param

- `class ResponseCompactionItemParam: …`

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

  - `encrypted_content: str`

  - `type: Literal["compaction"]`

    - `"compaction"`

  - `id: Optional[str]`

### Response Computer Tool Call Output Screenshot

- `class ResponseComputerToolCallOutputScreenshot: …`

  A computer screenshot image used with the computer use tool.

  - `type: Literal["computer_screenshot"]`

    - `"computer_screenshot"`

  - `file_id: Optional[str]`

  - `image_url: Optional[str]`

### Response Function Shell Tool Call

- `class ResponseFunctionShellToolCall: …`

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

  - `id: str`

  - `action: Action`

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

    - `commands: List[str]`

    - `max_output_length: Optional[int]`

    - `timeout_ms: Optional[int]`

  - `call_id: str`

  - `status: Literal["in_progress", "completed", "incomplete"]`

    - `"in_progress"`

    - `"completed"`

    - `"incomplete"`

  - `type: Literal["shell_call"]`

    - `"shell_call"`

  - `created_by: Optional[str]`

  - `environment: Optional[Environment]`

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

    - `class EnvironmentResponseLocalEnvironment: …`

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

      - `type: Literal["local"]`

        - `"local"`

    - `class EnvironmentResponseContainerReference: …`

      Represents a container created with /v1/containers.

      - `container_id: str`

      - `type: Literal["container_reference"]`

        - `"container_reference"`

### Response Function Shell Tool Call Output

- `class ResponseFunctionShellToolCallOutput: …`

  The output of a shell tool call that was emitted.

  - `id: str`

  - `call_id: str`

  - `output: List[Output]`

    - `outcome: OutputOutcome`

      Indicates that the shell call exceeded its configured time limit.

      - `class OutputOutcomeOutputOutcomeTimeout: …`

        Indicates that the shell call exceeded its configured time limit.

        - `type: Literal["timeout"]`

          - `"timeout"`

      - `class OutputOutcomeOutputOutcomeExit: …`

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

        - `exit_code: int`

        - `type: Literal["exit"]`

          - `"exit"`

    - `stderr: str`

    - `stdout: str`

    - `created_by: Optional[str]`

  - `status: Literal["in_progress", "completed", "incomplete"]`

    - `"in_progress"`

    - `"completed"`

    - `"incomplete"`

  - `type: Literal["shell_call_output"]`

    - `"shell_call_output"`

  - `created_by: Optional[str]`

  - `max_output_length: Optional[int]`

### Shell Call

- `class 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: List[str]`

    - `max_output_length: Optional[int]`

    - `timeout_ms: Optional[int]`

  - `call_id: str`

  - `type: Literal["shell_call"]`

    - `"shell_call"`

  - `id: Optional[str]`

  - `environment: Optional[Environment]`

    - `class LocalEnvironment: …`

      - `type: Literal["local"]`

        - `"local"`

      - `skills: Optional[List[Skill]]`

        - `description: str`

        - `name: str`

        - `path: str`

    - `class ContainerReference: …`

      - `container_id: str`

      - `type: Literal["container_reference"]`

        - `"container_reference"`

  - `status: Optional[Literal["in_progress", "completed", "incomplete"]]`

    - `"in_progress"`

    - `"completed"`

    - `"incomplete"`

### Shell Call Output

- `class ShellCallOutput: …`

  The streamed output items emitted by a shell tool call.

  - `call_id: str`

  - `output: List[Output]`

    - `outcome: OutputOutcome`

      Indicates that the shell call exceeded its configured time limit.

      - `class OutputOutcomeOutcomeTimeout: …`

        Indicates that the shell call exceeded its configured time limit.

        - `type: Literal["timeout"]`

          - `"timeout"`

      - `class OutputOutcomeOutcomeExit: …`

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

        - `exit_code: int`

        - `type: Literal["exit"]`

          - `"exit"`

    - `stderr: str`

    - `stdout: str`

  - `type: Literal["shell_call_output"]`

    - `"shell_call_output"`

  - `id: Optional[str]`

  - `max_output_length: Optional[int]`

  - `status: Optional[Literal["in_progress", "completed", "incomplete"]]`

    - `"in_progress"`

    - `"completed"`

    - `"incomplete"`

### Tool Choice Allowed

- `class ToolChoiceAllowed: …`

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

  - `mode: Literal["auto", "required"]`

    - `"auto"`

    - `"required"`

  - `tools: List[Dict[str, object]]`

  - `type: Literal["allowed_tools"]`

    - `"allowed_tools"`

### Tool Choice Apply Patch

- `class ToolChoiceApplyPatch: …`

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

  - `type: Literal["apply_patch"]`

    - `"apply_patch"`

### Tool Choice Custom

- `class ToolChoiceCustom: …`

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

  - `name: str`

  - `type: Literal["custom"]`

    - `"custom"`

### Tool Choice Function

- `class ToolChoiceFunction: …`

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

  - `name: str`

  - `type: Literal["function"]`

    - `"function"`

### Tool Choice Mcp

- `class ToolChoiceMcp: …`

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

  - `server_label: str`

  - `type: Literal["mcp"]`

    - `"mcp"`

  - `name: Optional[str]`

### Tool Choice Shell

- `class ToolChoiceShell: …`

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

  - `type: Literal["shell"]`

    - `"shell"`

### Tool Choice Types

- `class 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: Literal["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

- `class 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: Literal["web_search_preview", "web_search_preview_2025_03_11"]`

    - `"web_search_preview"`

    - `"web_search_preview_2025_03_11"`

  - `search_context_size: Optional[Literal["low", "medium", "high"]]`

    - `"low"`

    - `"medium"`

    - `"high"`

  - `user_location: Optional[UserLocation]`

    The user's location.

    - `type: Literal["approximate"]`

      - `"approximate"`

    - `city: Optional[str]`

    - `country: Optional[str]`

    - `region: Optional[str]`

    - `timezone: Optional[str]`

### Web Search Tool

- `class 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: Literal["web_search", "web_search_2025_08_26"]`

    - `"web_search"`

    - `"web_search_2025_08_26"`

  - `filters: Optional[Filters]`

    Filters for the search.

    - `allowed_domains: Optional[List[str]]`

  - `search_context_size: Optional[Literal["low", "medium", "high"]]`

    - `"low"`

    - `"medium"`

    - `"high"`

  - `user_location: Optional[UserLocation]`

    The approximate location of the user.

    - `city: Optional[str]`

    - `country: Optional[str]`

    - `region: Optional[str]`

    - `timezone: Optional[str]`

    - `type: Optional[Literal["approximate"]]`

      - `"approximate"`

### Response Create Response

- `ResponseCreateResponse`

  Emitted when there is a partial audio response.

  - `class OpenAIResponse: …`

    - `id: str`

    - `created_at: float`

    - `model: Union[Literal["gpt-5.2", "gpt-5.2-2025-12-11", "gpt-5.2-chat-latest", 83 more], str]`

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

      - `str`

    - `object: Literal["response"]`

      - `"response"`

    - `output: List[Output]`

      - `class OpenAIResponseOutputMessage: …`

        An output message from the model.

        - `id: str`

        - `content: List[Content]`

          - `class OpenAIResponseOutputText: …`

            A text output from the model.

            - `annotations: List[Annotation]`

              - `class AnnotationAnnotationFileCitation: …`

                A citation to a file.

                - `file_id: str`

                - `filename: str`

                - `index: int`

                - `type: Literal["file_citation"]`

                  - `"file_citation"`

              - `class AnnotationOpenAITypesResponsesResponseOutputTextAnnotationURLCitation: …`

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

                - `end_index: int`

                - `start_index: int`

                - `title: str`

                - `type: Literal["url_citation"]`

                  - `"url_citation"`

                - `url: str`

              - `class AnnotationAnnotationContainerFileCitation: …`

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

                - `container_id: str`

                - `end_index: int`

                - `file_id: str`

                - `filename: str`

                - `start_index: int`

                - `type: Literal["container_file_citation"]`

                  - `"container_file_citation"`

              - `class AnnotationAnnotationFilePath: …`

                A path to a file.

                - `file_id: str`

                - `index: int`

                - `type: Literal["file_path"]`

                  - `"file_path"`

            - `text: str`

            - `type: Literal["output_text"]`

              - `"output_text"`

            - `logprobs: Optional[List[Logprob]]`

              - `token: str`

              - `bytes: List[int]`

              - `logprob: float`

              - `top_logprobs: List[LogprobTopLogprob]`

                - `token: str`

                - `bytes: List[int]`

                - `logprob: float`

          - `class OpenAIResponseOutputRefusal: …`

            A refusal from the model.

            - `refusal: str`

            - `type: Literal["refusal"]`

              - `"refusal"`

        - `role: Literal["assistant"]`

          - `"assistant"`

        - `status: Literal["in_progress", "completed", "incomplete"]`

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

        - `type: Literal["message"]`

          - `"message"`

        - `phase: Optional[Literal["commentary", "final_answer"]]`

          - `"commentary"`

          - `"final_answer"`

      - `class 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: str`

        - `queries: List[str]`

        - `status: Literal["in_progress", "searching", "completed", 2 more]`

          - `"in_progress"`

          - `"searching"`

          - `"completed"`

          - `"incomplete"`

          - `"failed"`

        - `type: Literal["file_search_call"]`

          - `"file_search_call"`

        - `results: Optional[List[Result]]`

          - `attributes: Optional[Dict[str, Union[str, float, bool]]]`

            - `str`

            - `float`

            - `bool`

          - `file_id: Optional[str]`

          - `filename: Optional[str]`

          - `score: Optional[float]`

          - `text: Optional[str]`

      - `class 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: str`

        - `call_id: str`

        - `name: str`

        - `type: Literal["function_call"]`

          - `"function_call"`

        - `id: Optional[str]`

        - `status: Optional[Literal["in_progress", "completed", "incomplete"]]`

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

      - `class 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: str`

        - `action: Action`

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

          - `class ActionOpenAITypesResponsesResponseFunctionWebSearchActionSearch: …`

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

            - `query: str`

            - `type: Literal["search"]`

              - `"search"`

            - `queries: Optional[List[str]]`

            - `sources: Optional[List[ActionOpenAITypesResponsesResponseFunctionWebSearchActionSearchSource]]`

              - `type: Literal["url"]`

                - `"url"`

              - `url: str`

          - `class ActionOpenAITypesResponsesResponseFunctionWebSearchActionOpenPage: …`

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

            - `type: Literal["open_page"]`

              - `"open_page"`

            - `url: Optional[str]`

          - `class ActionActionFind: …`

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

            - `pattern: str`

            - `type: Literal["find_in_page"]`

              - `"find_in_page"`

            - `url: str`

        - `status: Literal["in_progress", "searching", "completed", "failed"]`

          - `"in_progress"`

          - `"searching"`

          - `"completed"`

          - `"failed"`

        - `type: Literal["web_search_call"]`

          - `"web_search_call"`

      - `class 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: str`

        - `action: Action`

          A click action.

          - `class ActionActionClick: …`

            A click action.

            - `button: Literal["left", "right", "wheel", 2 more]`

              - `"left"`

              - `"right"`

              - `"wheel"`

              - `"back"`

              - `"forward"`

            - `type: Literal["click"]`

              - `"click"`

            - `x: int`

            - `y: int`

          - `class ActionActionDoubleClick: …`

            A double click action.

            - `type: Literal["double_click"]`

              - `"double_click"`

            - `x: int`

            - `y: int`

          - `class ActionActionDrag: …`

            A drag action.

            - `path: List[ActionActionDragPath]`

              - `x: int`

              - `y: int`

            - `type: Literal["drag"]`

              - `"drag"`

          - `class ActionActionKeypress: …`

            A collection of keypresses the model would like to perform.

            - `keys: List[str]`

            - `type: Literal["keypress"]`

              - `"keypress"`

          - `class ActionActionMove: …`

            A mouse move action.

            - `type: Literal["move"]`

              - `"move"`

            - `x: int`

            - `y: int`

          - `class ActionActionScreenshot: …`

            A screenshot action.

            - `type: Literal["screenshot"]`

              - `"screenshot"`

          - `class ActionActionScroll: …`

            A scroll action.

            - `scroll_x: int`

            - `scroll_y: int`

            - `type: Literal["scroll"]`

              - `"scroll"`

            - `x: int`

            - `y: int`

          - `class ActionActionType: …`

            An action to type in text.

            - `text: str`

            - `type: Literal["type"]`

              - `"type"`

          - `class ActionActionWait: …`

            A wait action.

            - `type: Literal["wait"]`

              - `"wait"`

        - `call_id: str`

        - `pending_safety_checks: List[PendingSafetyCheck]`

          - `id: str`

          - `code: Optional[str]`

          - `message: Optional[str]`

        - `status: Literal["in_progress", "completed", "incomplete"]`

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

        - `type: Literal["computer_call"]`

          - `"computer_call"`

      - `class 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: str`

        - `summary: List[Summary]`

          - `text: str`

          - `type: Literal["summary_text"]`

            - `"summary_text"`

        - `type: Literal["reasoning"]`

          - `"reasoning"`

        - `content: Optional[List[Content]]`

          - `text: str`

          - `type: Literal["reasoning_text"]`

            - `"reasoning_text"`

        - `encrypted_content: Optional[str]`

        - `status: Optional[Literal["in_progress", "completed", "incomplete"]]`

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

      - `class ResponseCompactionItem: …`

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

        - `id: str`

        - `encrypted_content: str`

        - `type: Literal["compaction"]`

          - `"compaction"`

        - `created_by: Optional[str]`

      - `class OpenAITypesResponsesResponseOutputItemImageGenerationCall: …`

        An image generation request made by the model.

        - `id: str`

        - `status: Literal["in_progress", "completed", "generating", "failed"]`

          - `"in_progress"`

          - `"completed"`

          - `"generating"`

          - `"failed"`

        - `type: Literal["image_generation_call"]`

          - `"image_generation_call"`

        - `result: Optional[str]`

      - `class OpenAIResponseCodeInterpreterToolCall: …`

        A tool call to run code.

        - `id: str`

        - `container_id: str`

        - `status: Literal["in_progress", "completed", "incomplete", 2 more]`

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

          - `"interpreting"`

          - `"failed"`

        - `type: Literal["code_interpreter_call"]`

          - `"code_interpreter_call"`

        - `code: Optional[str]`

        - `outputs: Optional[List[Output]]`

          - `class OutputOutputLogs: …`

            The logs output from the code interpreter.

            - `logs: str`

            - `type: Literal["logs"]`

              - `"logs"`

          - `class OutputOutputImage: …`

            The image output from the code interpreter.

            - `type: Literal["image"]`

              - `"image"`

            - `url: str`

      - `class OpenAITypesResponsesResponseOutputItemLocalShellCall: …`

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

        - `id: str`

        - `action: Action`

          Execute a shell command on the server.

          - `command: List[str]`

          - `env: Dict[str, str]`

          - `type: Literal["exec"]`

            - `"exec"`

          - `timeout_ms: Optional[int]`

          - `user: Optional[str]`

          - `working_directory: Optional[str]`

        - `call_id: str`

        - `status: Literal["in_progress", "completed", "incomplete"]`

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

        - `type: Literal["local_shell_call"]`

          - `"local_shell_call"`

      - `class ResponseFunctionShellToolCall: …`

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

        - `id: str`

        - `action: Action`

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

          - `commands: List[str]`

          - `max_output_length: Optional[int]`

          - `timeout_ms: Optional[int]`

        - `call_id: str`

        - `status: Literal["in_progress", "completed", "incomplete"]`

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

        - `type: Literal["shell_call"]`

          - `"shell_call"`

        - `created_by: Optional[str]`

        - `environment: Optional[Environment]`

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

          - `class EnvironmentResponseLocalEnvironment: …`

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

            - `type: Literal["local"]`

              - `"local"`

          - `class EnvironmentResponseContainerReference: …`

            Represents a container created with /v1/containers.

            - `container_id: str`

            - `type: Literal["container_reference"]`

              - `"container_reference"`

      - `class ResponseFunctionShellToolCallOutput: …`

        The output of a shell tool call that was emitted.

        - `id: str`

        - `call_id: str`

        - `output: List[Output]`

          - `outcome: OutputOutcome`

            Indicates that the shell call exceeded its configured time limit.

            - `class OutputOutcomeOutputOutcomeTimeout: …`

              Indicates that the shell call exceeded its configured time limit.

              - `type: Literal["timeout"]`

                - `"timeout"`

            - `class OutputOutcomeOutputOutcomeExit: …`

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

              - `exit_code: int`

              - `type: Literal["exit"]`

                - `"exit"`

          - `stderr: str`

          - `stdout: str`

          - `created_by: Optional[str]`

        - `status: Literal["in_progress", "completed", "incomplete"]`

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

        - `type: Literal["shell_call_output"]`

          - `"shell_call_output"`

        - `created_by: Optional[str]`

        - `max_output_length: Optional[int]`

      - `class ResponseApplyPatchToolCall: …`

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

        - `id: str`

        - `call_id: str`

        - `operation: Operation`

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

          - `class OperationOperationCreateFile: …`

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

            - `diff: str`

            - `path: str`

            - `type: Literal["create_file"]`

              - `"create_file"`

          - `class OperationOperationDeleteFile: …`

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

            - `path: str`

            - `type: Literal["delete_file"]`

              - `"delete_file"`

          - `class OperationOperationUpdateFile: …`

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

            - `diff: str`

            - `path: str`

            - `type: Literal["update_file"]`

              - `"update_file"`

        - `status: Literal["in_progress", "completed"]`

          - `"in_progress"`

          - `"completed"`

        - `type: Literal["apply_patch_call"]`

          - `"apply_patch_call"`

        - `created_by: Optional[str]`

      - `class ResponseApplyPatchToolCallOutput: …`

        The output emitted by an apply patch tool call.

        - `id: str`

        - `call_id: str`

        - `status: Literal["completed", "failed"]`

          - `"completed"`

          - `"failed"`

        - `type: Literal["apply_patch_call_output"]`

          - `"apply_patch_call_output"`

        - `created_by: Optional[str]`

        - `output: Optional[str]`

      - `class OpenAITypesResponsesResponseOutputItemMcpCall: …`

        An invocation of a tool on an MCP server.

        - `id: str`

        - `arguments: str`

        - `name: str`

        - `server_label: str`

        - `type: Literal["mcp_call"]`

          - `"mcp_call"`

        - `approval_request_id: Optional[str]`

        - `error: Optional[str]`

        - `output: Optional[str]`

        - `status: Optional[Literal["in_progress", "completed", "incomplete", 2 more]]`

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

          - `"calling"`

          - `"failed"`

      - `class OpenAITypesResponsesResponseOutputItemMcpListTools: …`

        A list of tools available on an MCP server.

        - `id: str`

        - `server_label: str`

        - `tools: List[Tool]`

          - `input_schema: object`

          - `name: str`

          - `annotations: Optional[object]`

          - `description: Optional[str]`

        - `type: Literal["mcp_list_tools"]`

          - `"mcp_list_tools"`

        - `error: Optional[str]`

      - `class McpApprovalRequest: …`

        A request for human approval of a tool invocation.

        - `id: str`

        - `arguments: str`

        - `name: str`

        - `server_label: str`

        - `type: Literal["mcp_approval_request"]`

          - `"mcp_approval_request"`

      - `class OpenAIResponseCustomToolCall: …`

        A call to a custom tool created by the model.

        - `call_id: str`

        - `input: str`

        - `name: str`

        - `type: Literal["custom_tool_call"]`

          - `"custom_tool_call"`

        - `id: Optional[str]`

    - `parallel_tool_calls: bool`

    - `tool_choice: ToolChoice`

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

      - `Literal["none", "auto", "required"]`

        - `"none"`

        - `"auto"`

        - `"required"`

      - `class ToolChoiceAllowed: …`

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

        - `mode: Literal["auto", "required"]`

          - `"auto"`

          - `"required"`

        - `tools: List[Dict[str, object]]`

        - `type: Literal["allowed_tools"]`

          - `"allowed_tools"`

      - `class 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: Literal["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"`

      - `class ToolChoiceFunction: …`

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

        - `name: str`

        - `type: Literal["function"]`

          - `"function"`

      - `class ToolChoiceMcp: …`

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

        - `server_label: str`

        - `type: Literal["mcp"]`

          - `"mcp"`

        - `name: Optional[str]`

      - `class ToolChoiceCustom: …`

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

        - `name: str`

        - `type: Literal["custom"]`

          - `"custom"`

      - `class ToolChoiceApplyPatch: …`

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

        - `type: Literal["apply_patch"]`

          - `"apply_patch"`

      - `class ToolChoiceShell: …`

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

        - `type: Literal["shell"]`

          - `"shell"`

    - `tools: List[Tool]`

      - `class 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: str`

        - `type: Literal["function"]`

          - `"function"`

        - `description: Optional[str]`

        - `parameters: Optional[Dict[str, object]]`

        - `strict: Optional[bool]`

      - `class 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: Literal["file_search"]`

          - `"file_search"`

        - `vector_store_ids: List[str]`

        - `filters: Optional[Filters]`

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

          - `class FiltersComparisonFilter: …`

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

            - `key: str`

            - `type: Literal["eq", "ne", "gt", 3 more]`

              - `"eq"`

              - `"ne"`

              - `"gt"`

              - `"gte"`

              - `"lt"`

              - `"lte"`

            - `value: Union[str, float, bool, List[Union[str, float]]]`

              - `str`

              - `float`

              - `bool`

              - `List[Union[str, float]]`

                - `str`

                - `float`

          - `class FiltersCompoundFilter: …`

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

            - `filters: List[FiltersCompoundFilterFilter]`

              - `class FiltersCompoundFilterFilterComparisonFilter: …`

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

                - `key: str`

                - `type: Literal["eq", "ne", "gt", 3 more]`

                  - `"eq"`

                  - `"ne"`

                  - `"gt"`

                  - `"gte"`

                  - `"lt"`

                  - `"lte"`

                - `value: Union[str, float, bool, List[Union[str, float]]]`

                  - `str`

                  - `float`

                  - `bool`

                  - `List[Union[str, float]]`

                    - `str`

                    - `float`

              - `object`

            - `type: Literal["and", "or"]`

              - `"and"`

              - `"or"`

        - `max_num_results: Optional[int]`

        - `ranking_options: Optional[RankingOptions]`

          Ranking options for search.

          - `hybrid_search: Optional[RankingOptionsHybridSearch]`

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

            - `embedding_weight: float`

            - `text_weight: float`

          - `ranker: Optional[Literal["auto", "default-2024-11-15"]]`

            - `"auto"`

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

          - `score_threshold: Optional[float]`

      - `class 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: int`

        - `display_width: int`

        - `environment: Literal["windows", "mac", "linux", 2 more]`

          - `"windows"`

          - `"mac"`

          - `"linux"`

          - `"ubuntu"`

          - `"browser"`

        - `type: Literal["computer_use_preview"]`

          - `"computer_use_preview"`

      - `class 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: Literal["web_search", "web_search_2025_08_26"]`

          - `"web_search"`

          - `"web_search_2025_08_26"`

        - `filters: Optional[Filters]`

          Filters for the search.

          - `allowed_domains: Optional[List[str]]`

        - `search_context_size: Optional[Literal["low", "medium", "high"]]`

          - `"low"`

          - `"medium"`

          - `"high"`

        - `user_location: Optional[UserLocation]`

          The approximate location of the user.

          - `city: Optional[str]`

          - `country: Optional[str]`

          - `region: Optional[str]`

          - `timezone: Optional[str]`

          - `type: Optional[Literal["approximate"]]`

            - `"approximate"`

      - `class ToolMcp: …`

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

        - `type: Literal["mcp"]`

          - `"mcp"`

        - `allowed_tools: Optional[ToolMcpAllowedTools]`

          A filter object to specify which tools are allowed.

          - `List[str]`

          - `class ToolMcpAllowedToolsMcpAllowedToolsMcpToolFilter: …`

            A filter object to specify which tools are allowed.

            - `read_only: Optional[bool]`

            - `tool_names: Optional[List[str]]`

        - `authorization: Optional[str]`

        - `connector_id: Optional[Literal["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: Optional[Dict[str, str]]`

        - `require_approval: Optional[ToolMcpRequireApproval]`

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

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

          - `class ToolMcpRequireApprovalMcpRequireApprovalMcpToolApprovalFilter: …`

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

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

            - `always: Optional[ToolMcpRequireApprovalMcpRequireApprovalMcpToolApprovalFilterAlways]`

              A filter object to specify which tools are allowed.

              - `read_only: Optional[bool]`

              - `tool_names: Optional[List[str]]`

            - `never: Optional[ToolMcpRequireApprovalMcpRequireApprovalMcpToolApprovalFilterNever]`

              A filter object to specify which tools are allowed.

              - `read_only: Optional[bool]`

              - `tool_names: Optional[List[str]]`

          - `Literal["always", "never"]`

            - `"always"`

            - `"never"`

        - `server_description: Optional[str]`

        - `server_url: Optional[str]`

      - `class ToolCodeInterpreter: …`

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

        - `container: ToolCodeInterpreterContainer`

          Configuration for a code interpreter container.

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

          - `str`

          - `class ToolCodeInterpreterContainerCodeInterpreterContainerCodeInterpreterToolAuto: …`

            Configuration for a code interpreter container.

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

            - `type: Literal["auto"]`

              - `"auto"`

            - `file_ids: Optional[List[str]]`

            - `memory_limit: Optional[Literal["1g", "4g", "16g", "64g"]]`

              - `"1g"`

              - `"4g"`

              - `"16g"`

              - `"64g"`

            - `network_policy: Optional[ToolCodeInterpreterContainerCodeInterpreterContainerCodeInterpreterToolAutoNetworkPolicy]`

              - `class ContainerNetworkPolicyDisabled: …`

                - `type: Literal["disabled"]`

                  - `"disabled"`

              - `class ContainerNetworkPolicyAllowlist: …`

                - `allowed_domains: List[str]`

                - `type: Literal["allowlist"]`

                  - `"allowlist"`

                - `domain_secrets: Optional[List[DomainSecret]]`

                  - `domain: str`

                  - `name: str`

                  - `value: str`

        - `type: Literal["code_interpreter"]`

          - `"code_interpreter"`

      - `class ToolImageGeneration: …`

        A tool that generates images using the GPT image models.

        - `type: Literal["image_generation"]`

          - `"image_generation"`

        - `action: Optional[Literal["generate", "edit", "auto"]]`

          - `"generate"`

          - `"edit"`

          - `"auto"`

        - `background: Optional[Literal["transparent", "opaque", "auto"]]`

          - `"transparent"`

          - `"opaque"`

          - `"auto"`

        - `input_fidelity: Optional[Literal["high", "low"]]`

          - `"high"`

          - `"low"`

        - `input_image_mask: Optional[ToolImageGenerationInputImageMask]`

          Optional mask for inpainting.

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

          - `file_id: Optional[str]`

          - `image_url: Optional[str]`

        - `model: Optional[Union[str, Literal["gpt-image-1", "gpt-image-1-mini", "gpt-image-1.5"], null]]`

          - `str`

          - `Literal["gpt-image-1", "gpt-image-1-mini", "gpt-image-1.5"]`

            - `"gpt-image-1"`

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

            - `"gpt-image-1.5"`

        - `moderation: Optional[Literal["auto", "low"]]`

          - `"auto"`

          - `"low"`

        - `output_compression: Optional[int]`

        - `output_format: Optional[Literal["png", "webp", "jpeg"]]`

          - `"png"`

          - `"webp"`

          - `"jpeg"`

        - `partial_images: Optional[int]`

        - `quality: Optional[Literal["low", "medium", "high", "auto"]]`

          - `"low"`

          - `"medium"`

          - `"high"`

          - `"auto"`

        - `size: Optional[Literal["1024x1024", "1024x1536", "1536x1024", "auto"]]`

          - `"1024x1024"`

          - `"1024x1536"`

          - `"1536x1024"`

          - `"auto"`

      - `class ToolLocalShell: …`

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

        - `type: Literal["local_shell"]`

          - `"local_shell"`

      - `class FunctionShellTool: …`

        A tool that allows the model to execute shell commands.

        - `type: Literal["shell"]`

          - `"shell"`

        - `environment: Optional[Environment]`

          - `class EnvironmentContainerAuto: …`

            - `type: Literal["container_auto"]`

              - `"container_auto"`

            - `file_ids: Optional[List[str]]`

            - `memory_limit: Optional[Literal["1g", "4g", "16g", "64g"]]`

              - `"1g"`

              - `"4g"`

              - `"16g"`

              - `"64g"`

            - `network_policy: Optional[EnvironmentContainerAutoNetworkPolicy]`

              - `class ContainerNetworkPolicyDisabled: …`

              - `class ContainerNetworkPolicyAllowlist: …`

            - `skills: Optional[List[EnvironmentContainerAutoSkill]]`

              - `class EnvironmentContainerAutoSkillSkillReference: …`

                - `skill_id: str`

                - `type: Literal["skill_reference"]`

                  - `"skill_reference"`

                - `version: Optional[str]`

              - `class EnvironmentContainerAutoSkillInlineSkill: …`

                - `description: str`

                - `name: str`

                - `source: EnvironmentContainerAutoSkillInlineSkillSource`

                  Inline skill payload

                  - `data: str`

                  - `media_type: Literal["application/zip"]`

                    - `"application/zip"`

                  - `type: Literal["base64"]`

                    - `"base64"`

                - `type: Literal["inline"]`

                  - `"inline"`

          - `class LocalEnvironment: …`

            - `type: Literal["local"]`

              - `"local"`

            - `skills: Optional[List[Skill]]`

              - `description: str`

              - `name: str`

              - `path: str`

          - `class ContainerReference: …`

            - `container_id: str`

            - `type: Literal["container_reference"]`

              - `"container_reference"`

      - `class 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: str`

        - `type: Literal["custom"]`

          - `"custom"`

        - `description: Optional[str]`

        - `format: Optional[Format]`

          Unconstrained free-form text.

          - `class FormatText: …`

            Unconstrained free-form text.

            - `type: Literal["text"]`

              - `"text"`

          - `class FormatGrammar: …`

            A grammar defined by the user.

            - `definition: str`

            - `syntax: Literal["lark", "regex"]`

              - `"lark"`

              - `"regex"`

            - `type: Literal["grammar"]`

              - `"grammar"`

      - `class 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: Literal["web_search_preview", "web_search_preview_2025_03_11"]`

          - `"web_search_preview"`

          - `"web_search_preview_2025_03_11"`

        - `search_context_size: Optional[Literal["low", "medium", "high"]]`

          - `"low"`

          - `"medium"`

          - `"high"`

        - `user_location: Optional[UserLocation]`

          The user's location.

          - `type: Literal["approximate"]`

            - `"approximate"`

          - `city: Optional[str]`

          - `country: Optional[str]`

          - `region: Optional[str]`

          - `timezone: Optional[str]`

      - `class ApplyPatchTool: …`

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

        - `type: Literal["apply_patch"]`

          - `"apply_patch"`

    - `background: Optional[bool]`

    - `completed_at: Optional[float]`

    - `conversation: Optional[Conversation]`

      The conversation that this response belonged to.

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

      - `id: str`

    - `error: Optional[OpenAIResponseError]`

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

      - `code: Literal["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: str`

    - `incomplete_details: Optional[IncompleteDetails]`

      Details about why the response is incomplete.

      - `reason: Optional[Literal["max_output_tokens", "content_filter"]]`

        - `"max_output_tokens"`

        - `"content_filter"`

    - `instructions: Optional[Union[str, List[InstructionsInputItem], null]]`

      - `str`

      - `List[InstructionsInputItem]`

        - `class 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: Union[str, List[ContentInputItem]]`

            - `str`

            - `List[ContentInputItem]`

              - `class OpenAIResponseInputText: …`

                A text input to the model.

                - `text: str`

                - `type: Literal["input_text"]`

                  - `"input_text"`

              - `class OpenAIResponseInputImage: …`

                An image input to the model.

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

                - `detail: Literal["low", "high", "auto"]`

                  - `"low"`

                  - `"high"`

                  - `"auto"`

                - `type: Literal["input_image"]`

                  - `"input_image"`

                - `file_id: Optional[str]`

                - `image_url: Optional[str]`

              - `class OpenAIResponseInputFile: …`

                A file input to the model.

                - `type: Literal["input_file"]`

                  - `"input_file"`

                - `file_data: Optional[str]`

                - `file_id: Optional[str]`

                - `file_url: Optional[str]`

                - `filename: Optional[str]`

          - `role: Literal["user", "assistant", "system", "developer"]`

            - `"user"`

            - `"assistant"`

            - `"system"`

            - `"developer"`

          - `phase: Optional[Literal["commentary", "final_answer"]]`

            - `"commentary"`

            - `"final_answer"`

          - `type: Optional[Literal["message"]]`

            - `"message"`

        - `class 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: List[Content]`

            - `class OpenAIResponseInputText: …`

              A text input to the model.

            - `class OpenAIResponseInputImage: …`

              An image input to the model.

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

            - `class OpenAIResponseInputFile: …`

              A file input to the model.

          - `role: Literal["user", "system", "developer"]`

            - `"user"`

            - `"system"`

            - `"developer"`

          - `status: Optional[Literal["in_progress", "completed", "incomplete"]]`

            - `"in_progress"`

            - `"completed"`

            - `"incomplete"`

          - `type: Optional[Literal["message"]]`

            - `"message"`

        - `class OpenAIResponseOutputMessage: …`

          An output message from the model.

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

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

        - `class OpenAITypesResponsesResponseInputItemComputerCallOutput: …`

          The output of a computer tool call.

          - `call_id: str`

          - `output: ResponseComputerToolCallOutputScreenshot`

            A computer screenshot image used with the computer use tool.

            - `type: Literal["computer_screenshot"]`

              - `"computer_screenshot"`

            - `file_id: Optional[str]`

            - `image_url: Optional[str]`

          - `type: Literal["computer_call_output"]`

            - `"computer_call_output"`

          - `id: Optional[str]`

          - `acknowledged_safety_checks: Optional[List[AcknowledgedSafetyCheck]]`

            - `id: str`

            - `code: Optional[str]`

            - `message: Optional[str]`

          - `status: Optional[Literal["in_progress", "completed", "incomplete"]]`

            - `"in_progress"`

            - `"completed"`

            - `"incomplete"`

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

        - `class OpenAIResponseFunctionToolCall: …`

          A tool call to run a function.

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

        - `class OpenAITypesResponsesResponseInputItemFunctionCallOutput: …`

          The output of a function tool call.

          - `call_id: str`

          - `output: Union[str, List[OutputOutputContentList]]`

            - `str`

            - `List[OutputOutputContentList]`

              - `class OutputOutputContentListResponseInputTextContent: …`

                A text input to the model.

                - `text: str`

                - `type: Literal["input_text"]`

                  - `"input_text"`

              - `class OutputOutputContentListResponseInputImageContent: …`

                An image input to the model.

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

                - `type: Literal["input_image"]`

                  - `"input_image"`

                - `detail: Optional[Literal["low", "high", "auto"]]`

                  - `"low"`

                  - `"high"`

                  - `"auto"`

                - `file_id: Optional[str]`

                - `image_url: Optional[str]`

              - `class OutputOutputContentListResponseInputFileContent: …`

                A file input to the model.

                - `type: Literal["input_file"]`

                  - `"input_file"`

                - `file_data: Optional[str]`

                - `file_id: Optional[str]`

                - `file_url: Optional[str]`

                - `filename: Optional[str]`

          - `type: Literal["function_call_output"]`

            - `"function_call_output"`

          - `id: Optional[str]`

          - `status: Optional[Literal["in_progress", "completed", "incomplete"]]`

            - `"in_progress"`

            - `"completed"`

            - `"incomplete"`

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

        - `class ResponseCompactionItemParam: …`

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

          - `encrypted_content: str`

          - `type: Literal["compaction"]`

            - `"compaction"`

          - `id: Optional[str]`

        - `class OpenAITypesResponsesResponseInputItemImageGenerationCall: …`

          An image generation request made by the model.

          - `id: str`

          - `status: Literal["in_progress", "completed", "generating", "failed"]`

            - `"in_progress"`

            - `"completed"`

            - `"generating"`

            - `"failed"`

          - `type: Literal["image_generation_call"]`

            - `"image_generation_call"`

          - `result: Optional[str]`

        - `class OpenAIResponseCodeInterpreterToolCall: …`

          A tool call to run code.

        - `class OpenAITypesResponsesResponseInputItemLocalShellCall: …`

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

          - `id: str`

          - `action: Action`

            Execute a shell command on the server.

            - `command: List[str]`

            - `env: Dict[str, str]`

            - `type: Literal["exec"]`

              - `"exec"`

            - `timeout_ms: Optional[int]`

            - `user: Optional[str]`

            - `working_directory: Optional[str]`

          - `call_id: str`

          - `status: Literal["in_progress", "completed", "incomplete"]`

            - `"in_progress"`

            - `"completed"`

            - `"incomplete"`

          - `type: Literal["local_shell_call"]`

            - `"local_shell_call"`

        - `class OpenAITypesResponsesResponseInputItemLocalShellCallOutput: …`

          The output of a local shell tool call.

          - `id: str`

          - `output: str`

          - `type: Literal["local_shell_call_output"]`

            - `"local_shell_call_output"`

          - `status: Optional[Literal["in_progress", "completed", "incomplete"]]`

            - `"in_progress"`

            - `"completed"`

            - `"incomplete"`

        - `class 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: List[str]`

            - `max_output_length: Optional[int]`

            - `timeout_ms: Optional[int]`

          - `call_id: str`

          - `type: Literal["shell_call"]`

            - `"shell_call"`

          - `id: Optional[str]`

          - `environment: Optional[Environment]`

            - `class LocalEnvironment: …`

            - `class ContainerReference: …`

          - `status: Optional[Literal["in_progress", "completed", "incomplete"]]`

            - `"in_progress"`

            - `"completed"`

            - `"incomplete"`

        - `class ShellCallOutput: …`

          The streamed output items emitted by a shell tool call.

          - `call_id: str`

          - `output: List[Output]`

            - `outcome: OutputOutcome`

              Indicates that the shell call exceeded its configured time limit.

              - `class OutputOutcomeOutcomeTimeout: …`

                Indicates that the shell call exceeded its configured time limit.

                - `type: Literal["timeout"]`

                  - `"timeout"`

              - `class OutputOutcomeOutcomeExit: …`

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

                - `exit_code: int`

                - `type: Literal["exit"]`

                  - `"exit"`

            - `stderr: str`

            - `stdout: str`

          - `type: Literal["shell_call_output"]`

            - `"shell_call_output"`

          - `id: Optional[str]`

          - `max_output_length: Optional[int]`

          - `status: Optional[Literal["in_progress", "completed", "incomplete"]]`

            - `"in_progress"`

            - `"completed"`

            - `"incomplete"`

        - `class ApplyPatchCall: …`

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

          - `call_id: str`

          - `operation: Operation`

            Instruction for creating a new file via the apply_patch tool.

            - `class OperationApplyPatchCallOperationCreateFile: …`

              Instruction for creating a new file via the apply_patch tool.

              - `diff: str`

              - `path: str`

              - `type: Literal["create_file"]`

                - `"create_file"`

            - `class OperationApplyPatchCallOperationDeleteFile: …`

              Instruction for deleting an existing file via the apply_patch tool.

              - `path: str`

              - `type: Literal["delete_file"]`

                - `"delete_file"`

            - `class OperationApplyPatchCallOperationUpdateFile: …`

              Instruction for updating an existing file via the apply_patch tool.

              - `diff: str`

              - `path: str`

              - `type: Literal["update_file"]`

                - `"update_file"`

          - `status: Literal["in_progress", "completed"]`

            - `"in_progress"`

            - `"completed"`

          - `type: Literal["apply_patch_call"]`

            - `"apply_patch_call"`

          - `id: Optional[str]`

        - `class ApplyPatchCallOutput: …`

          The streamed output emitted by an apply patch tool call.

          - `call_id: str`

          - `status: Literal["completed", "failed"]`

            - `"completed"`

            - `"failed"`

          - `type: Literal["apply_patch_call_output"]`

            - `"apply_patch_call_output"`

          - `id: Optional[str]`

          - `output: Optional[str]`

        - `class OpenAITypesResponsesResponseInputItemMcpListTools: …`

          A list of tools available on an MCP server.

          - `id: str`

          - `server_label: str`

          - `tools: List[Tool]`

            - `input_schema: object`

            - `name: str`

            - `annotations: Optional[object]`

            - `description: Optional[str]`

          - `type: Literal["mcp_list_tools"]`

            - `"mcp_list_tools"`

          - `error: Optional[str]`

        - `class McpApprovalRequest: …`

          A request for human approval of a tool invocation.

        - `class OpenAITypesResponsesResponseInputItemMcpApprovalResponse: …`

          A response to an MCP approval request.

          - `approval_request_id: str`

          - `approve: bool`

          - `type: Literal["mcp_approval_response"]`

            - `"mcp_approval_response"`

          - `id: Optional[str]`

          - `reason: Optional[str]`

        - `class OpenAITypesResponsesResponseInputItemMcpCall: …`

          An invocation of a tool on an MCP server.

          - `id: str`

          - `arguments: str`

          - `name: str`

          - `server_label: str`

          - `type: Literal["mcp_call"]`

            - `"mcp_call"`

          - `approval_request_id: Optional[str]`

          - `error: Optional[str]`

          - `output: Optional[str]`

          - `status: Optional[Literal["in_progress", "completed", "incomplete", 2 more]]`

            - `"in_progress"`

            - `"completed"`

            - `"incomplete"`

            - `"calling"`

            - `"failed"`

        - `class OpenAIResponseCustomToolCallOutput: …`

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

          - `call_id: str`

          - `output: Union[str, List[OutputOutputContentList]]`

            - `str`

            - `List[OutputOutputContentList]`

              - `class OpenAIResponseInputText: …`

                A text input to the model.

              - `class OpenAIResponseInputImage: …`

                An image input to the model.

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

              - `class OpenAIResponseInputFile: …`

                A file input to the model.

          - `type: Literal["custom_tool_call_output"]`

            - `"custom_tool_call_output"`

          - `id: Optional[str]`

        - `class OpenAIResponseCustomToolCall: …`

          A call to a custom tool created by the model.

        - `class OpenAITypesResponsesResponseInputItemItemReference: …`

          An internal identifier for an item to reference.

          - `id: str`

          - `type: Optional[Literal["item_reference"]]`

            - `"item_reference"`

    - `max_output_tokens: Optional[int]`

    - `max_tool_calls: Optional[int]`

    - `metadata: Optional[Dict[str, str]]`

    - `previous_response_id: Optional[str]`

    - `prompt: Optional[OpenAIResponsePrompt]`

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

      - `id: str`

      - `variables: Optional[Dict[str, Variables]]`

        - `str`

        - `class OpenAIResponseInputText: …`

          A text input to the model.

        - `class OpenAIResponseInputImage: …`

          An image input to the model.

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

        - `class OpenAIResponseInputFile: …`

          A file input to the model.

      - `version: Optional[str]`

    - `prompt_cache_key: Optional[str]`

    - `prompt_cache_retention: Optional[Literal["in-memory", "24h"]]`

      - `"in-memory"`

      - `"24h"`

    - `reasoning: Optional[Reasoning]`

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

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

      - `effort: Optional[Literal["none", "minimal", "low", 3 more]]`

        - `"none"`

        - `"minimal"`

        - `"low"`

        - `"medium"`

        - `"high"`

        - `"xhigh"`

      - `generate_summary: Optional[Literal["auto", "concise", "detailed"]]`

        - `"auto"`

        - `"concise"`

        - `"detailed"`

      - `summary: Optional[Literal["auto", "concise", "detailed"]]`

        - `"auto"`

        - `"concise"`

        - `"detailed"`

    - `safety_identifier: Optional[str]`

    - `service_tier: Optional[Literal["auto", "default", "flex", 2 more]]`

      - `"auto"`

      - `"default"`

      - `"flex"`

      - `"scale"`

      - `"priority"`

    - `status: Optional[Literal["completed", "failed", "in_progress", 3 more]]`

      - `"completed"`

      - `"failed"`

      - `"in_progress"`

      - `"cancelled"`

      - `"queued"`

      - `"incomplete"`

    - `temperature: Optional[float]`

    - `text: Optional[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: Optional[Format]`

        Default response format. Used to generate text responses.

        - `class FormatResponseFormatText: …`

          Default response format. Used to generate text responses.

          - `type: Literal["text"]`

            - `"text"`

        - `class FormatResponseFormatTextJsonSchemaConfig: …`

          JSON Schema response format.

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

          - `name: str`

          - `schema: Dict[str, object]`

          - `type: Literal["json_schema"]`

            - `"json_schema"`

          - `description: Optional[str]`

          - `strict: Optional[bool]`

        - `class FormatResponseFormatJsonObject: …`

          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: Literal["json_object"]`

            - `"json_object"`

      - `verbosity: Optional[Literal["low", "medium", "high"]]`

        - `"low"`

        - `"medium"`

        - `"high"`

    - `top_logprobs: Optional[int]`

    - `top_p: Optional[float]`

    - `truncation: Optional[Literal["auto", "disabled"]]`

      - `"auto"`

      - `"disabled"`

    - `usage: Optional[OpenAIResponseUsage]`

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

      - `input_tokens: int`

      - `input_tokens_details: InputTokensDetails`

        A detailed breakdown of the input tokens.

        - `cached_tokens: int`

      - `output_tokens: int`

      - `output_tokens_details: OutputTokensDetails`

        A detailed breakdown of the output tokens.

        - `reasoning_tokens: int`

      - `total_tokens: int`

    - `user: Optional[str]`

  - `class ResponseAudioDeltaEvent: …`

    Emitted when there is a partial audio response.

    - `delta: str`

    - `sequence_number: int`

    - `type: Literal["response.audio.delta"]`

      - `"response.audio.delta"`

  - `class ResponseAudioDoneEvent: …`

    Emitted when the audio response is complete.

    - `sequence_number: int`

    - `type: Literal["response.audio.done"]`

      - `"response.audio.done"`

  - `class ResponseAudioTranscriptDeltaEvent: …`

    Emitted when there is a partial transcript of audio.

    - `delta: str`

    - `sequence_number: int`

    - `type: Literal["response.audio.transcript.delta"]`

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

  - `class ResponseAudioTranscriptDoneEvent: …`

    Emitted when the full audio transcript is completed.

    - `sequence_number: int`

    - `type: Literal["response.audio.transcript.done"]`

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

  - `class ResponseCodeInterpreterCallCodeDeltaEvent: …`

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

    - `delta: str`

    - `item_id: str`

    - `output_index: int`

    - `sequence_number: int`

    - `type: Literal["response.code_interpreter_call_code.delta"]`

      - `"response.code_interpreter_call_code.delta"`

  - `class ResponseCodeInterpreterCallCodeDoneEvent: …`

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

    - `code: str`

    - `item_id: str`

    - `output_index: int`

    - `sequence_number: int`

    - `type: Literal["response.code_interpreter_call_code.done"]`

      - `"response.code_interpreter_call_code.done"`

  - `class ResponseCodeInterpreterCallCompletedEvent: …`

    Emitted when the code interpreter call is completed.

    - `item_id: str`

    - `output_index: int`

    - `sequence_number: int`

    - `type: Literal["response.code_interpreter_call.completed"]`

      - `"response.code_interpreter_call.completed"`

  - `class ResponseCodeInterpreterCallInProgressEvent: …`

    Emitted when a code interpreter call is in progress.

    - `item_id: str`

    - `output_index: int`

    - `sequence_number: int`

    - `type: Literal["response.code_interpreter_call.in_progress"]`

      - `"response.code_interpreter_call.in_progress"`

  - `class ResponseCodeInterpreterCallInterpretingEvent: …`

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

    - `item_id: str`

    - `output_index: int`

    - `sequence_number: int`

    - `type: Literal["response.code_interpreter_call.interpreting"]`

      - `"response.code_interpreter_call.interpreting"`

  - `class ResponseCompletedEvent: …`

    Emitted when the model response is complete.

    - `response: OpenAIResponse`

    - `sequence_number: int`

    - `type: Literal["response.completed"]`

      - `"response.completed"`

  - `class ResponseContentPartAddedEvent: …`

    Emitted when a new content part is added.

    - `content_index: int`

    - `item_id: str`

    - `output_index: int`

    - `part: ResponseContentPartAddedEventPart`

      A text output from the model.

      - `class OpenAIResponseOutputText: …`

        A text output from the model.

      - `class OpenAIResponseOutputRefusal: …`

        A refusal from the model.

      - `class PartReasoningText: …`

        Reasoning text from the model.

        - `text: str`

        - `type: Literal["reasoning_text"]`

          - `"reasoning_text"`

    - `sequence_number: int`

    - `type: Literal["response.content_part.added"]`

      - `"response.content_part.added"`

  - `class ResponseContentPartDoneEvent: …`

    Emitted when a content part is done.

    - `content_index: int`

    - `item_id: str`

    - `output_index: int`

    - `part: ResponseContentPartDoneEventPart`

      A text output from the model.

      - `class OpenAIResponseOutputText: …`

        A text output from the model.

      - `class OpenAIResponseOutputRefusal: …`

        A refusal from the model.

      - `class PartReasoningText: …`

        Reasoning text from the model.

    - `sequence_number: int`

    - `type: Literal["response.content_part.done"]`

      - `"response.content_part.done"`

  - `class ResponseCreatedEvent: …`

    An event that is emitted when a response is created.

    - `response: OpenAIResponse`

    - `sequence_number: int`

    - `type: Literal["response.created"]`

      - `"response.created"`

  - `class ResponseErrorEvent: …`

    Emitted when an error occurs.

    - `message: str`

    - `sequence_number: int`

    - `type: Literal["error"]`

      - `"error"`

    - `code: Optional[str]`

    - `param: Optional[str]`

  - `class ResponseFileSearchCallCompletedEvent: …`

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

    - `item_id: str`

    - `output_index: int`

    - `sequence_number: int`

    - `type: Literal["response.file_search_call.completed"]`

      - `"response.file_search_call.completed"`

  - `class ResponseFileSearchCallInProgressEvent: …`

    Emitted when a file search call is initiated.

    - `item_id: str`

    - `output_index: int`

    - `sequence_number: int`

    - `type: Literal["response.file_search_call.in_progress"]`

      - `"response.file_search_call.in_progress"`

  - `class ResponseFileSearchCallSearchingEvent: …`

    Emitted when a file search is currently searching.

    - `item_id: str`

    - `output_index: int`

    - `sequence_number: int`

    - `type: Literal["response.file_search_call.searching"]`

      - `"response.file_search_call.searching"`

  - `class ResponseFunctionCallArgumentsDeltaEvent: …`

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

    - `delta: str`

    - `item_id: str`

    - `output_index: int`

    - `sequence_number: int`

    - `type: Literal["response.function_call_arguments.delta"]`

      - `"response.function_call_arguments.delta"`

  - `class ResponseFunctionCallArgumentsDoneEvent: …`

    Emitted when function-call arguments are finalized.

    - `arguments: str`

    - `item_id: str`

    - `name: str`

    - `output_index: int`

    - `sequence_number: int`

    - `type: Literal["response.function_call_arguments.done"]`

      - `"response.function_call_arguments.done"`

  - `class ResponseInProgressEvent: …`

    Emitted when the response is in progress.

    - `response: OpenAIResponse`

    - `sequence_number: int`

    - `type: Literal["response.in_progress"]`

      - `"response.in_progress"`

  - `class ResponseFailedEvent: …`

    An event that is emitted when a response fails.

    - `response: OpenAIResponse`

    - `sequence_number: int`

    - `type: Literal["response.failed"]`

      - `"response.failed"`

  - `class ResponseIncompleteEvent: …`

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

    - `response: OpenAIResponse`

    - `sequence_number: int`

    - `type: Literal["response.incomplete"]`

      - `"response.incomplete"`

  - `class ResponseOutputItemAddedEvent: …`

    Emitted when a new output item is added.

    - `item: ResponseOutputItemAddedEventItem`

      An output message from the model.

      - `class OpenAIResponseOutputMessage: …`

        An output message from the model.

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

      - `class OpenAIResponseFunctionToolCall: …`

        A tool call to run a function.

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

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

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

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

      - `class ResponseCompactionItem: …`

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

      - `class OpenAITypesResponsesResponseOutputItemImageGenerationCall: …`

        An image generation request made by the model.

      - `class OpenAIResponseCodeInterpreterToolCall: …`

        A tool call to run code.

      - `class OpenAITypesResponsesResponseOutputItemLocalShellCall: …`

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

      - `class ResponseFunctionShellToolCall: …`

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

      - `class ResponseFunctionShellToolCallOutput: …`

        The output of a shell tool call that was emitted.

      - `class ResponseApplyPatchToolCall: …`

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

      - `class ResponseApplyPatchToolCallOutput: …`

        The output emitted by an apply patch tool call.

      - `class OpenAITypesResponsesResponseOutputItemMcpCall: …`

        An invocation of a tool on an MCP server.

      - `class OpenAITypesResponsesResponseOutputItemMcpListTools: …`

        A list of tools available on an MCP server.

      - `class McpApprovalRequest: …`

        A request for human approval of a tool invocation.

      - `class OpenAIResponseCustomToolCall: …`

        A call to a custom tool created by the model.

    - `output_index: int`

    - `sequence_number: int`

    - `type: Literal["response.output_item.added"]`

      - `"response.output_item.added"`

  - `class ResponseOutputItemDoneEvent: …`

    Emitted when an output item is marked done.

    - `item: ResponseOutputItemDoneEventItem`

      An output message from the model.

      - `class OpenAIResponseOutputMessage: …`

        An output message from the model.

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

      - `class OpenAIResponseFunctionToolCall: …`

        A tool call to run a function.

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

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

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

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

      - `class ResponseCompactionItem: …`

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

      - `class OpenAITypesResponsesResponseOutputItemImageGenerationCall: …`

        An image generation request made by the model.

      - `class OpenAIResponseCodeInterpreterToolCall: …`

        A tool call to run code.

      - `class OpenAITypesResponsesResponseOutputItemLocalShellCall: …`

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

      - `class ResponseFunctionShellToolCall: …`

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

      - `class ResponseFunctionShellToolCallOutput: …`

        The output of a shell tool call that was emitted.

      - `class ResponseApplyPatchToolCall: …`

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

      - `class ResponseApplyPatchToolCallOutput: …`

        The output emitted by an apply patch tool call.

      - `class OpenAITypesResponsesResponseOutputItemMcpCall: …`

        An invocation of a tool on an MCP server.

      - `class OpenAITypesResponsesResponseOutputItemMcpListTools: …`

        A list of tools available on an MCP server.

      - `class McpApprovalRequest: …`

        A request for human approval of a tool invocation.

      - `class OpenAIResponseCustomToolCall: …`

        A call to a custom tool created by the model.

    - `output_index: int`

    - `sequence_number: int`

    - `type: Literal["response.output_item.done"]`

      - `"response.output_item.done"`

  - `class ResponseReasoningSummaryPartAddedEvent: …`

    Emitted when a new reasoning summary part is added.

    - `item_id: str`

    - `output_index: int`

    - `part: ResponseReasoningSummaryPartAddedEventPart`

      The summary part that was added.

      - `text: str`

      - `type: Literal["summary_text"]`

        - `"summary_text"`

    - `sequence_number: int`

    - `summary_index: int`

    - `type: Literal["response.reasoning_summary_part.added"]`

      - `"response.reasoning_summary_part.added"`

  - `class ResponseReasoningSummaryPartDoneEvent: …`

    Emitted when a reasoning summary part is completed.

    - `item_id: str`

    - `output_index: int`

    - `part: ResponseReasoningSummaryPartDoneEventPart`

      The completed summary part.

      - `text: str`

      - `type: Literal["summary_text"]`

        - `"summary_text"`

    - `sequence_number: int`

    - `summary_index: int`

    - `type: Literal["response.reasoning_summary_part.done"]`

      - `"response.reasoning_summary_part.done"`

  - `class ResponseReasoningSummaryTextDeltaEvent: …`

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

    - `delta: str`

    - `item_id: str`

    - `output_index: int`

    - `sequence_number: int`

    - `summary_index: int`

    - `type: Literal["response.reasoning_summary_text.delta"]`

      - `"response.reasoning_summary_text.delta"`

  - `class ResponseReasoningSummaryTextDoneEvent: …`

    Emitted when a reasoning summary text is completed.

    - `item_id: str`

    - `output_index: int`

    - `sequence_number: int`

    - `summary_index: int`

    - `text: str`

    - `type: Literal["response.reasoning_summary_text.done"]`

      - `"response.reasoning_summary_text.done"`

  - `class ResponseReasoningTextDeltaEvent: …`

    Emitted when a delta is added to a reasoning text.

    - `content_index: int`

    - `delta: str`

    - `item_id: str`

    - `output_index: int`

    - `sequence_number: int`

    - `type: Literal["response.reasoning_text.delta"]`

      - `"response.reasoning_text.delta"`

  - `class ResponseReasoningTextDoneEvent: …`

    Emitted when a reasoning text is completed.

    - `content_index: int`

    - `item_id: str`

    - `output_index: int`

    - `sequence_number: int`

    - `text: str`

    - `type: Literal["response.reasoning_text.done"]`

      - `"response.reasoning_text.done"`

  - `class ResponseRefusalDeltaEvent: …`

    Emitted when there is a partial refusal text.

    - `content_index: int`

    - `delta: str`

    - `item_id: str`

    - `output_index: int`

    - `sequence_number: int`

    - `type: Literal["response.refusal.delta"]`

      - `"response.refusal.delta"`

  - `class ResponseRefusalDoneEvent: …`

    Emitted when refusal text is finalized.

    - `content_index: int`

    - `item_id: str`

    - `output_index: int`

    - `refusal: str`

    - `sequence_number: int`

    - `type: Literal["response.refusal.done"]`

      - `"response.refusal.done"`

  - `class ResponseTextDeltaEvent: …`

    Emitted when there is an additional text delta.

    - `content_index: int`

    - `delta: str`

    - `item_id: str`

    - `logprobs: List[ResponseTextDeltaEventLogprob]`

      - `token: str`

      - `logprob: float`

      - `top_logprobs: Optional[List[ResponseTextDeltaEventLogprobTopLogprob]]`

        - `token: Optional[str]`

        - `logprob: Optional[float]`

    - `output_index: int`

    - `sequence_number: int`

    - `type: Literal["response.output_text.delta"]`

      - `"response.output_text.delta"`

  - `class ResponseTextDoneEvent: …`

    Emitted when text content is finalized.

    - `content_index: int`

    - `item_id: str`

    - `logprobs: List[ResponseTextDoneEventLogprob]`

      - `token: str`

      - `logprob: float`

      - `top_logprobs: Optional[List[ResponseTextDoneEventLogprobTopLogprob]]`

        - `token: Optional[str]`

        - `logprob: Optional[float]`

    - `output_index: int`

    - `sequence_number: int`

    - `text: str`

    - `type: Literal["response.output_text.done"]`

      - `"response.output_text.done"`

  - `class ResponseWebSearchCallCompletedEvent: …`

    Emitted when a web search call is completed.

    - `item_id: str`

    - `output_index: int`

    - `sequence_number: int`

    - `type: Literal["response.web_search_call.completed"]`

      - `"response.web_search_call.completed"`

  - `class ResponseWebSearchCallInProgressEvent: …`

    Emitted when a web search call is initiated.

    - `item_id: str`

    - `output_index: int`

    - `sequence_number: int`

    - `type: Literal["response.web_search_call.in_progress"]`

      - `"response.web_search_call.in_progress"`

  - `class ResponseWebSearchCallSearchingEvent: …`

    Emitted when a web search call is executing.

    - `item_id: str`

    - `output_index: int`

    - `sequence_number: int`

    - `type: Literal["response.web_search_call.searching"]`

      - `"response.web_search_call.searching"`

  - `class ResponseImageGenCallCompletedEvent: …`

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

    - `item_id: str`

    - `output_index: int`

    - `sequence_number: int`

    - `type: Literal["response.image_generation_call.completed"]`

      - `"response.image_generation_call.completed"`

  - `class ResponseImageGenCallGeneratingEvent: …`

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

    - `item_id: str`

    - `output_index: int`

    - `sequence_number: int`

    - `type: Literal["response.image_generation_call.generating"]`

      - `"response.image_generation_call.generating"`

  - `class ResponseImageGenCallInProgressEvent: …`

    Emitted when an image generation tool call is in progress.

    - `item_id: str`

    - `output_index: int`

    - `sequence_number: int`

    - `type: Literal["response.image_generation_call.in_progress"]`

      - `"response.image_generation_call.in_progress"`

  - `class ResponseImageGenCallPartialImageEvent: …`

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

    - `item_id: str`

    - `output_index: int`

    - `partial_image_b64: str`

    - `partial_image_index: int`

    - `sequence_number: int`

    - `type: Literal["response.image_generation_call.partial_image"]`

      - `"response.image_generation_call.partial_image"`

  - `class ResponseMcpCallArgumentsDeltaEvent: …`

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

    - `delta: str`

    - `item_id: str`

    - `output_index: int`

    - `sequence_number: int`

    - `type: Literal["response.mcp_call_arguments.delta"]`

      - `"response.mcp_call_arguments.delta"`

  - `class ResponseMcpCallArgumentsDoneEvent: …`

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

    - `arguments: str`

    - `item_id: str`

    - `output_index: int`

    - `sequence_number: int`

    - `type: Literal["response.mcp_call_arguments.done"]`

      - `"response.mcp_call_arguments.done"`

  - `class ResponseMcpCallCompletedEvent: …`

    Emitted when an MCP  tool call has completed successfully.

    - `item_id: str`

    - `output_index: int`

    - `sequence_number: int`

    - `type: Literal["response.mcp_call.completed"]`

      - `"response.mcp_call.completed"`

  - `class ResponseMcpCallFailedEvent: …`

    Emitted when an MCP  tool call has failed.

    - `item_id: str`

    - `output_index: int`

    - `sequence_number: int`

    - `type: Literal["response.mcp_call.failed"]`

      - `"response.mcp_call.failed"`

  - `class ResponseMcpCallInProgressEvent: …`

    Emitted when an MCP  tool call is in progress.

    - `item_id: str`

    - `output_index: int`

    - `sequence_number: int`

    - `type: Literal["response.mcp_call.in_progress"]`

      - `"response.mcp_call.in_progress"`

  - `class ResponseMcpListToolsCompletedEvent: …`

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

    - `item_id: str`

    - `output_index: int`

    - `sequence_number: int`

    - `type: Literal["response.mcp_list_tools.completed"]`

      - `"response.mcp_list_tools.completed"`

  - `class ResponseMcpListToolsFailedEvent: …`

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

    - `item_id: str`

    - `output_index: int`

    - `sequence_number: int`

    - `type: Literal["response.mcp_list_tools.failed"]`

      - `"response.mcp_list_tools.failed"`

  - `class ResponseMcpListToolsInProgressEvent: …`

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

    - `item_id: str`

    - `output_index: int`

    - `sequence_number: int`

    - `type: Literal["response.mcp_list_tools.in_progress"]`

      - `"response.mcp_list_tools.in_progress"`

  - `class ResponseOutputTextAnnotationAddedEvent: …`

    Emitted when an annotation is added to output text content.

    - `annotation: object`

    - `annotation_index: int`

    - `content_index: int`

    - `item_id: str`

    - `output_index: int`

    - `sequence_number: int`

    - `type: Literal["response.output_text.annotation.added"]`

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

  - `class ResponseQueuedEvent: …`

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

    - `response: OpenAIResponse`

    - `sequence_number: int`

    - `type: Literal["response.queued"]`

      - `"response.queued"`

  - `class ResponseCustomToolCallInputDeltaEvent: …`

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

    - `delta: str`

    - `item_id: str`

    - `output_index: int`

    - `sequence_number: int`

    - `type: Literal["response.custom_tool_call_input.delta"]`

      - `"response.custom_tool_call_input.delta"`

  - `class ResponseCustomToolCallInputDoneEvent: …`

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

    - `input: str`

    - `item_id: str`

    - `output_index: int`

    - `sequence_number: int`

    - `type: Literal["response.custom_tool_call_input.done"]`

      - `"response.custom_tool_call_input.done"`

  - `class GenericResponseEvent: …`

    - `type: str`
