# Responses

## Run OpenAI Responses API (OpenAI only)

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

### Body Parameters

- `input: string or array of object { content, role, phase, type }  or object { content, role, status, type }  or object { id, content, role, 3 more }  or 23 more`

  - `string`

  - `InputItems = array of object { content, role, phase, type }  or object { content, role, status, type }  or object { id, content, role, 3 more }  or 23 more`

    - `EasyInputMessageParam object { content, role, phase, type }`

      A message input to the model with a role indicating instruction following
      hierarchy. Instructions given with the `developer` or `system` role take
      precedence over instructions given with the `user` role. Messages with the
      `assistant` role are presumed to have been generated by the model in previous
      interactions.

      - `content: string or array of OpenAIResponseInputTextParam or OpenAIResponseInputImageParam or OpenAIResponseInputFileParam`

        - `string`

        - `InputItems = array of OpenAIResponseInputTextParam or OpenAIResponseInputImageParam or OpenAIResponseInputFileParam`

          - `OpenAIResponseInputTextParam object { text, type }`

            A text input to the model.

            - `text: string`

            - `type: "input_text"`

              - `"input_text"`

          - `OpenAIResponseInputImageParam object { detail, type, file_id, image_url }`

            An image input to the model.

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

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

              - `"low"`

              - `"high"`

              - `"auto"`

            - `type: "input_image"`

              - `"input_image"`

            - `file_id: optional string`

            - `image_url: optional string`

          - `OpenAIResponseInputFileParam object { type, file_data, file_id, 2 more }`

            A file input to the model.

            - `type: "input_file"`

              - `"input_file"`

            - `file_data: optional string`

            - `file_id: optional string`

            - `file_url: optional string`

            - `filename: optional string`

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

        - `"user"`

        - `"assistant"`

        - `"system"`

        - `"developer"`

      - `phase: optional "commentary" or "final_answer"`

        - `"commentary"`

        - `"final_answer"`

      - `type: optional "message"`

        - `"message"`

    - `OpenAITypesResponsesResponseInputParamMessage object { content, role, status, type }`

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

      - `content: array of OpenAIResponseInputTextParam or OpenAIResponseInputImageParam or OpenAIResponseInputFileParam`

        - `OpenAIResponseInputTextParam object { text, type }`

          A text input to the model.

        - `OpenAIResponseInputImageParam object { detail, type, file_id, image_url }`

          An image input to the model.

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

        - `OpenAIResponseInputFileParam object { type, file_data, file_id, 2 more }`

          A file input to the model.

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

        - `"user"`

        - `"system"`

        - `"developer"`

      - `status: optional "in_progress" or "completed" or "incomplete"`

        - `"in_progress"`

        - `"completed"`

        - `"incomplete"`

      - `type: optional "message"`

        - `"message"`

    - `ResponseOutputMessageParam object { id, content, role, 3 more }`

      An output message from the model.

      - `id: string`

      - `content: array of object { annotations, text, type, logprobs }  or object { refusal, type }`

        - `ResponseOutputTextParam object { annotations, text, type, logprobs }`

          A text output from the model.

          - `annotations: array of object { file_id, filename, index, type }  or object { end_index, start_index, title, 2 more }  or object { container_id, end_index, file_id, 3 more }  or object { file_id, index, type }`

            - `AnnotationFileCitation object { file_id, filename, index, type }`

              A citation to a file.

              - `file_id: string`

              - `filename: string`

              - `index: number`

              - `type: "file_citation"`

                - `"file_citation"`

            - `OpenAITypesResponsesResponseOutputTextParamAnnotationURLCitation object { end_index, start_index, title, 2 more }`

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

              - `end_index: number`

              - `start_index: number`

              - `title: string`

              - `type: "url_citation"`

                - `"url_citation"`

              - `url: string`

            - `AnnotationContainerFileCitation object { container_id, end_index, file_id, 3 more }`

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

              - `container_id: string`

              - `end_index: number`

              - `file_id: string`

              - `filename: string`

              - `start_index: number`

              - `type: "container_file_citation"`

                - `"container_file_citation"`

            - `AnnotationFilePath object { file_id, index, type }`

              A path to a file.

              - `file_id: string`

              - `index: number`

              - `type: "file_path"`

                - `"file_path"`

          - `text: string`

          - `type: "output_text"`

            - `"output_text"`

          - `logprobs: optional array of object { token, bytes, logprob, top_logprobs }`

            - `token: string`

            - `bytes: array of number`

            - `logprob: number`

            - `top_logprobs: array of object { token, bytes, logprob }`

              - `token: string`

              - `bytes: array of number`

              - `logprob: number`

        - `ResponseOutputRefusalParam object { refusal, type }`

          A refusal from the model.

          - `refusal: string`

          - `type: "refusal"`

            - `"refusal"`

      - `role: "assistant"`

        - `"assistant"`

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

        - `"in_progress"`

        - `"completed"`

        - `"incomplete"`

      - `type: "message"`

        - `"message"`

      - `phase: optional "commentary" or "final_answer"`

        - `"commentary"`

        - `"final_answer"`

    - `ResponseFileSearchToolCallParam object { id, queries, status, 2 more }`

      The results of a file search tool call.

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

      - `id: string`

      - `queries: array of string`

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

        - `"in_progress"`

        - `"searching"`

        - `"completed"`

        - `"incomplete"`

        - `"failed"`

      - `type: "file_search_call"`

        - `"file_search_call"`

      - `results: optional array of object { attributes, file_id, filename, 2 more }`

        - `attributes: optional map[string or number or boolean]`

          - `string`

          - `number`

          - `boolean`

        - `file_id: optional string`

        - `filename: optional string`

        - `score: optional number`

        - `text: optional string`

    - `ResponseComputerToolCallParam object { id, action, call_id, 3 more }`

      A tool call to a computer use tool.

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

      - `id: string`

      - `action: object { button, type, x, y }  or object { type, x, y }  or object { path, type }  or 6 more`

        A click action.

        - `ActionClick object { button, type, x, y }`

          A click action.

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

            - `"left"`

            - `"right"`

            - `"wheel"`

            - `"back"`

            - `"forward"`

          - `type: "click"`

            - `"click"`

          - `x: number`

          - `y: number`

        - `ActionDoubleClick object { type, x, y }`

          A double click action.

          - `type: "double_click"`

            - `"double_click"`

          - `x: number`

          - `y: number`

        - `ActionDrag object { path, type }`

          A drag action.

          - `path: array of object { x, y }`

            - `x: number`

            - `y: number`

          - `type: "drag"`

            - `"drag"`

        - `ActionKeypress object { keys, type }`

          A collection of keypresses the model would like to perform.

          - `keys: array of string`

          - `type: "keypress"`

            - `"keypress"`

        - `ActionMove object { type, x, y }`

          A mouse move action.

          - `type: "move"`

            - `"move"`

          - `x: number`

          - `y: number`

        - `ActionScreenshot object { type }`

          A screenshot action.

          - `type: "screenshot"`

            - `"screenshot"`

        - `ActionScroll object { scroll_x, scroll_y, type, 2 more }`

          A scroll action.

          - `scroll_x: number`

          - `scroll_y: number`

          - `type: "scroll"`

            - `"scroll"`

          - `x: number`

          - `y: number`

        - `ActionType object { text, type }`

          An action to type in text.

          - `text: string`

          - `type: "type"`

            - `"type"`

        - `ActionWait object { type }`

          A wait action.

          - `type: "wait"`

            - `"wait"`

      - `call_id: string`

      - `pending_safety_checks: array of object { id, code, message }`

        - `id: string`

        - `code: optional string`

        - `message: optional string`

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

        - `"in_progress"`

        - `"completed"`

        - `"incomplete"`

      - `type: "computer_call"`

        - `"computer_call"`

    - `OpenAITypesResponsesResponseInputParamComputerCallOutput object { call_id, output, type, 3 more }`

      The output of a computer tool call.

      - `call_id: string`

      - `output: object { type, file_id, image_url }`

        A computer screenshot image used with the computer use tool.

        - `type: "computer_screenshot"`

          - `"computer_screenshot"`

        - `file_id: optional string`

        - `image_url: optional string`

      - `type: "computer_call_output"`

        - `"computer_call_output"`

      - `id: optional string`

      - `acknowledged_safety_checks: optional array of object { id, code, message }`

        - `id: string`

        - `code: optional string`

        - `message: optional string`

      - `status: optional "in_progress" or "completed" or "incomplete"`

        - `"in_progress"`

        - `"completed"`

        - `"incomplete"`

    - `ResponseFunctionWebSearchParam object { id, action, status, type }`

      The results of a web search tool call.

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

      - `id: string`

      - `action: object { query, type, queries, sources }  or object { type, url }  or object { pattern, type, url }`

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

        - `OpenAITypesResponsesResponseFunctionWebSearchParamActionSearch object { query, type, queries, sources }`

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

          - `query: string`

          - `type: "search"`

            - `"search"`

          - `queries: optional array of string`

          - `sources: optional array of object { type, url }`

            - `type: "url"`

              - `"url"`

            - `url: string`

        - `OpenAITypesResponsesResponseFunctionWebSearchParamActionOpenPage object { type, url }`

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

          - `type: "open_page"`

            - `"open_page"`

          - `url: optional string`

        - `ActionFind object { pattern, type, url }`

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

          - `pattern: string`

          - `type: "find_in_page"`

            - `"find_in_page"`

          - `url: string`

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

        - `"in_progress"`

        - `"searching"`

        - `"completed"`

        - `"failed"`

      - `type: "web_search_call"`

        - `"web_search_call"`

    - `ResponseFunctionToolCallParam object { arguments, call_id, name, 3 more }`

      A tool call to run a function.

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

      - `arguments: string`

      - `call_id: string`

      - `name: string`

      - `type: "function_call"`

        - `"function_call"`

      - `id: optional string`

      - `status: optional "in_progress" or "completed" or "incomplete"`

        - `"in_progress"`

        - `"completed"`

        - `"incomplete"`

    - `OpenAITypesResponsesResponseInputParamFunctionCallOutput object { call_id, output, type, 2 more }`

      The output of a function tool call.

      - `call_id: string`

      - `output: string or array of object { text, type }  or object { type, detail, file_id, image_url }  or object { type, file_data, file_id, 2 more }`

        - `string`

        - `OutputContentList = array of object { text, type }  or object { type, detail, file_id, image_url }  or object { type, file_data, file_id, 2 more }`

          - `ResponseInputTextContentParam object { text, type }`

            A text input to the model.

            - `text: string`

            - `type: "input_text"`

              - `"input_text"`

          - `ResponseInputImageContentParam object { type, detail, file_id, image_url }`

            An image input to the model.

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

            - `type: "input_image"`

              - `"input_image"`

            - `detail: optional "low" or "high" or "auto"`

              - `"low"`

              - `"high"`

              - `"auto"`

            - `file_id: optional string`

            - `image_url: optional string`

          - `ResponseInputFileContentParam object { type, file_data, file_id, 2 more }`

            A file input to the model.

            - `type: "input_file"`

              - `"input_file"`

            - `file_data: optional string`

            - `file_id: optional string`

            - `file_url: optional string`

            - `filename: optional string`

      - `type: "function_call_output"`

        - `"function_call_output"`

      - `id: optional string`

      - `status: optional "in_progress" or "completed" or "incomplete"`

        - `"in_progress"`

        - `"completed"`

        - `"incomplete"`

    - `ResponseReasoningItemParam object { id, summary, type, 3 more }`

      A description of the chain of thought used by a reasoning model while generating
      a response. Be sure to include these items in your `input` to the Responses API
      for subsequent turns of a conversation if you are manually
      [managing context](https://platform.openai.com/docs/guides/conversation-state).

      - `id: string`

      - `summary: array of object { text, type }`

        - `text: string`

        - `type: "summary_text"`

          - `"summary_text"`

      - `type: "reasoning"`

        - `"reasoning"`

      - `content: optional array of object { text, type }`

        - `text: string`

        - `type: "reasoning_text"`

          - `"reasoning_text"`

      - `encrypted_content: optional string`

      - `status: optional "in_progress" or "completed" or "incomplete"`

        - `"in_progress"`

        - `"completed"`

        - `"incomplete"`

    - `ResponseCompactionItemParamParam object { encrypted_content, type, id }`

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

      - `encrypted_content: string`

      - `type: "compaction"`

        - `"compaction"`

      - `id: optional string`

    - `OpenAITypesResponsesResponseInputParamImageGenerationCall object { id, result, status, type }`

      An image generation request made by the model.

      - `id: string`

      - `result: string`

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

        - `"in_progress"`

        - `"completed"`

        - `"generating"`

        - `"failed"`

      - `type: "image_generation_call"`

        - `"image_generation_call"`

    - `ResponseCodeInterpreterToolCallParam object { id, code, container_id, 3 more }`

      A tool call to run code.

      - `id: string`

      - `code: string`

      - `container_id: string`

      - `outputs: array of object { logs, type }  or object { type, url }`

        - `OutputLogs object { logs, type }`

          The logs output from the code interpreter.

          - `logs: string`

          - `type: "logs"`

            - `"logs"`

        - `OutputImage object { type, url }`

          The image output from the code interpreter.

          - `type: "image"`

            - `"image"`

          - `url: string`

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

        - `"in_progress"`

        - `"completed"`

        - `"incomplete"`

        - `"interpreting"`

        - `"failed"`

      - `type: "code_interpreter_call"`

        - `"code_interpreter_call"`

    - `OpenAITypesResponsesResponseInputParamLocalShellCall object { id, action, call_id, 2 more }`

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

      - `id: string`

      - `action: object { command, env, type, 3 more }`

        Execute a shell command on the server.

        - `command: array of string`

        - `env: map[string]`

        - `type: "exec"`

          - `"exec"`

        - `timeout_ms: optional number`

        - `user: optional string`

        - `working_directory: optional string`

      - `call_id: string`

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

        - `"in_progress"`

        - `"completed"`

        - `"incomplete"`

      - `type: "local_shell_call"`

        - `"local_shell_call"`

    - `OpenAITypesResponsesResponseInputParamLocalShellCallOutput object { id, output, type, status }`

      The output of a local shell tool call.

      - `id: string`

      - `output: string`

      - `type: "local_shell_call_output"`

        - `"local_shell_call_output"`

      - `status: optional "in_progress" or "completed" or "incomplete"`

        - `"in_progress"`

        - `"completed"`

        - `"incomplete"`

    - `OpenAITypesResponsesResponseInputParamShellCall object { action, call_id, type, 3 more }`

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

      - `action: object { commands, max_output_length, timeout_ms }`

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

        - `commands: array of string`

        - `max_output_length: optional number`

        - `timeout_ms: optional number`

      - `call_id: string`

      - `type: "shell_call"`

        - `"shell_call"`

      - `id: optional string`

      - `environment: optional LocalEnvironmentParam or ContainerReferenceParam`

        - `LocalEnvironmentParam object { type, skills }`

          - `type: "local"`

            - `"local"`

          - `skills: optional array of object { description, name, path }`

            - `description: string`

            - `name: string`

            - `path: string`

        - `ContainerReferenceParam object { container_id, type }`

          - `container_id: string`

          - `type: "container_reference"`

            - `"container_reference"`

      - `status: optional "in_progress" or "completed" or "incomplete"`

        - `"in_progress"`

        - `"completed"`

        - `"incomplete"`

    - `OpenAITypesResponsesResponseInputParamShellCallOutput object { call_id, output, type, 3 more }`

      The streamed output items emitted by a shell tool call.

      - `call_id: string`

      - `output: array of object { outcome, stderr, stdout }`

        - `outcome: object { type }  or object { exit_code, type }`

          Indicates that the shell call exceeded its configured time limit.

          - `OutcomeTimeout object { type }`

            Indicates that the shell call exceeded its configured time limit.

            - `type: "timeout"`

              - `"timeout"`

          - `OutcomeExit object { exit_code, type }`

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

            - `exit_code: number`

            - `type: "exit"`

              - `"exit"`

        - `stderr: string`

        - `stdout: string`

      - `type: "shell_call_output"`

        - `"shell_call_output"`

      - `id: optional string`

      - `max_output_length: optional number`

      - `status: optional "in_progress" or "completed" or "incomplete"`

        - `"in_progress"`

        - `"completed"`

        - `"incomplete"`

    - `OpenAITypesResponsesResponseInputParamApplyPatchCall object { call_id, operation, status, 2 more }`

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

      - `call_id: string`

      - `operation: object { diff, path, type }  or object { path, type }  or object { diff, path, type }`

        Instruction for creating a new file via the apply_patch tool.

        - `ApplyPatchCallOperationCreateFile object { diff, path, type }`

          Instruction for creating a new file via the apply_patch tool.

          - `diff: string`

          - `path: string`

          - `type: "create_file"`

            - `"create_file"`

        - `ApplyPatchCallOperationDeleteFile object { path, type }`

          Instruction for deleting an existing file via the apply_patch tool.

          - `path: string`

          - `type: "delete_file"`

            - `"delete_file"`

        - `ApplyPatchCallOperationUpdateFile object { diff, path, type }`

          Instruction for updating an existing file via the apply_patch tool.

          - `diff: string`

          - `path: string`

          - `type: "update_file"`

            - `"update_file"`

      - `status: "in_progress" or "completed"`

        - `"in_progress"`

        - `"completed"`

      - `type: "apply_patch_call"`

        - `"apply_patch_call"`

      - `id: optional string`

    - `OpenAITypesResponsesResponseInputParamApplyPatchCallOutput object { call_id, status, type, 2 more }`

      The streamed output emitted by an apply patch tool call.

      - `call_id: string`

      - `status: "completed" or "failed"`

        - `"completed"`

        - `"failed"`

      - `type: "apply_patch_call_output"`

        - `"apply_patch_call_output"`

      - `id: optional string`

      - `output: optional string`

    - `OpenAITypesResponsesResponseInputParamMcpListTools object { id, server_label, tools, 2 more }`

      A list of tools available on an MCP server.

      - `id: string`

      - `server_label: string`

      - `tools: array of object { input_schema, name, annotations, description }`

        - `input_schema: unknown`

        - `name: string`

        - `annotations: optional unknown`

        - `description: optional string`

      - `type: "mcp_list_tools"`

        - `"mcp_list_tools"`

      - `error: optional string`

    - `McpApprovalRequest object { id, arguments, name, 2 more }`

      A request for human approval of a tool invocation.

      - `id: string`

      - `arguments: string`

      - `name: string`

      - `server_label: string`

      - `type: "mcp_approval_request"`

        - `"mcp_approval_request"`

    - `OpenAITypesResponsesResponseInputParamMcpApprovalResponse object { approval_request_id, approve, type, 2 more }`

      A response to an MCP approval request.

      - `approval_request_id: string`

      - `approve: boolean`

      - `type: "mcp_approval_response"`

        - `"mcp_approval_response"`

      - `id: optional string`

      - `reason: optional string`

    - `OpenAITypesResponsesResponseInputParamMcpCall object { id, arguments, name, 6 more }`

      An invocation of a tool on an MCP server.

      - `id: string`

      - `arguments: string`

      - `name: string`

      - `server_label: string`

      - `type: "mcp_call"`

        - `"mcp_call"`

      - `approval_request_id: optional string`

      - `error: optional string`

      - `output: optional string`

      - `status: optional "in_progress" or "completed" or "incomplete" or 2 more`

        - `"in_progress"`

        - `"completed"`

        - `"incomplete"`

        - `"calling"`

        - `"failed"`

    - `ResponseCustomToolCallOutputParam object { call_id, output, type, id }`

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

      - `call_id: string`

      - `output: string or array of OpenAIResponseInputTextParam or OpenAIResponseInputImageParam or OpenAIResponseInputFileParam`

        - `string`

        - `OutputContentList = array of OpenAIResponseInputTextParam or OpenAIResponseInputImageParam or OpenAIResponseInputFileParam`

          - `OpenAIResponseInputTextParam object { text, type }`

            A text input to the model.

          - `OpenAIResponseInputImageParam object { detail, type, file_id, image_url }`

            An image input to the model.

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

          - `OpenAIResponseInputFileParam object { type, file_data, file_id, 2 more }`

            A file input to the model.

      - `type: "custom_tool_call_output"`

        - `"custom_tool_call_output"`

      - `id: optional string`

    - `ResponseCustomToolCallParam object { call_id, input, name, 2 more }`

      A call to a custom tool created by the model.

      - `call_id: string`

      - `input: string`

      - `name: string`

      - `type: "custom_tool_call"`

        - `"custom_tool_call"`

      - `id: optional string`

    - `OpenAITypesResponsesResponseInputParamItemReference object { id, type }`

      An internal identifier for an item to reference.

      - `id: string`

      - `type: optional "item_reference"`

        - `"item_reference"`

- `model: string`

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

- `include: optional array of string`

  Which fields to include in the response

- `instructions: optional string`

  Instructions for the response generation

- `max_output_tokens: optional number`

  Maximum number of output tokens

- `metadata: optional map[unknown]`

  Metadata for the response

- `parallel_tool_calls: optional boolean`

  Whether to enable parallel tool calls

- `previous_response_id: optional string`

  ID of the previous response for chaining

- `reasoning: optional map[unknown]`

  Reasoning configuration for the response

- `store: optional boolean`

  Whether to store the response

- `stream: optional boolean`

  Whether to stream the response

- `temperature: optional number`

  Sampling temperature for randomness control

- `text: optional map[unknown]`

  Text configuration parameters

- `tool_choice: optional string or map[unknown]`

  Tool choice configuration

  - `string`

  - `map[unknown]`

- `tools: optional array of map[unknown]`

  Tools available for the response

- `top_p: optional number`

  Top-p sampling parameter

- `truncation: optional "auto" or "disabled"`

  Truncation configuration

  - `"auto"`

  - `"disabled"`

### Returns

- `OpenAIResponse object { id, created_at, model, 29 more }`

  - `id: string`

  - `created_at: number`

  - `model: "gpt-5.2" or "gpt-5.2-2025-12-11" or "gpt-5.2-chat-latest" or 83 more or string`

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

      - `"gpt-5.2"`

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

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

      - `"gpt-5.2-pro"`

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

      - `"gpt-5.1"`

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

      - `"gpt-5.1-codex"`

      - `"gpt-5.1-mini"`

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

      - `"gpt-5"`

      - `"gpt-5-mini"`

      - `"gpt-5-nano"`

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

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

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

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

      - `"gpt-4.1"`

      - `"gpt-4.1-mini"`

      - `"gpt-4.1-nano"`

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

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

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

      - `"o4-mini"`

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

      - `"o3"`

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

      - `"o3-mini"`

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

      - `"o1"`

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

      - `"o1-preview"`

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

      - `"o1-mini"`

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

      - `"gpt-4o"`

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

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

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

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

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

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

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

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

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

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

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

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

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

      - `"chatgpt-4o-latest"`

      - `"codex-mini-latest"`

      - `"gpt-4o-mini"`

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

      - `"gpt-4-turbo"`

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

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

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

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

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

      - `"gpt-4"`

      - `"gpt-4-0314"`

      - `"gpt-4-0613"`

      - `"gpt-4-32k"`

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

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

      - `"gpt-3.5-turbo"`

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

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

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

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

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

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

      - `"o1-pro"`

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

      - `"o3-pro"`

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

      - `"o3-deep-research"`

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

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

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

      - `"computer-use-preview"`

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

      - `"gpt-5-codex"`

      - `"gpt-5-pro"`

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

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

    - `string`

  - `object: "response"`

    - `"response"`

  - `output: array of OpenAIResponseOutputMessage or OpenAIResponseFileSearchToolCall or OpenAIResponseFunctionToolCall or 15 more`

    - `OpenAIResponseOutputMessage object { id, content, role, 3 more }`

      An output message from the model.

      - `id: string`

      - `content: array of OpenAIResponseOutputText or OpenAIResponseOutputRefusal`

        - `OpenAIResponseOutputText object { annotations, text, type, logprobs }`

          A text output from the model.

          - `annotations: array of object { file_id, filename, index, type }  or object { end_index, start_index, title, 2 more }  or object { container_id, end_index, file_id, 3 more }  or object { file_id, index, type }`

            - `AnnotationFileCitation object { file_id, filename, index, type }`

              A citation to a file.

              - `file_id: string`

              - `filename: string`

              - `index: number`

              - `type: "file_citation"`

                - `"file_citation"`

            - `OpenAITypesResponsesResponseOutputTextAnnotationURLCitation object { end_index, start_index, title, 2 more }`

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

              - `end_index: number`

              - `start_index: number`

              - `title: string`

              - `type: "url_citation"`

                - `"url_citation"`

              - `url: string`

            - `AnnotationContainerFileCitation object { container_id, end_index, file_id, 3 more }`

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

              - `container_id: string`

              - `end_index: number`

              - `file_id: string`

              - `filename: string`

              - `start_index: number`

              - `type: "container_file_citation"`

                - `"container_file_citation"`

            - `AnnotationFilePath object { file_id, index, type }`

              A path to a file.

              - `file_id: string`

              - `index: number`

              - `type: "file_path"`

                - `"file_path"`

          - `text: string`

          - `type: "output_text"`

            - `"output_text"`

          - `logprobs: optional array of object { token, bytes, logprob, top_logprobs }`

            - `token: string`

            - `bytes: array of number`

            - `logprob: number`

            - `top_logprobs: array of object { token, bytes, logprob }`

              - `token: string`

              - `bytes: array of number`

              - `logprob: number`

        - `OpenAIResponseOutputRefusal object { refusal, type }`

          A refusal from the model.

          - `refusal: string`

          - `type: "refusal"`

            - `"refusal"`

      - `role: "assistant"`

        - `"assistant"`

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

        - `"in_progress"`

        - `"completed"`

        - `"incomplete"`

      - `type: "message"`

        - `"message"`

      - `phase: optional "commentary" or "final_answer"`

        - `"commentary"`

        - `"final_answer"`

    - `OpenAIResponseFileSearchToolCall object { id, queries, status, 2 more }`

      The results of a file search tool call.

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

      - `id: string`

      - `queries: array of string`

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

        - `"in_progress"`

        - `"searching"`

        - `"completed"`

        - `"incomplete"`

        - `"failed"`

      - `type: "file_search_call"`

        - `"file_search_call"`

      - `results: optional array of object { attributes, file_id, filename, 2 more }`

        - `attributes: optional map[string or number or boolean]`

          - `string`

          - `number`

          - `boolean`

        - `file_id: optional string`

        - `filename: optional string`

        - `score: optional number`

        - `text: optional string`

    - `OpenAIResponseFunctionToolCall object { arguments, call_id, name, 3 more }`

      A tool call to run a function.

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

      - `arguments: string`

      - `call_id: string`

      - `name: string`

      - `type: "function_call"`

        - `"function_call"`

      - `id: optional string`

      - `status: optional "in_progress" or "completed" or "incomplete"`

        - `"in_progress"`

        - `"completed"`

        - `"incomplete"`

    - `OpenAIResponseFunctionWebSearch object { id, action, status, type }`

      The results of a web search tool call.

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

      - `id: string`

      - `action: object { query, type, queries, sources }  or object { type, url }  or object { pattern, type, url }`

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

        - `OpenAITypesResponsesResponseFunctionWebSearchActionSearch object { query, type, queries, sources }`

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

          - `query: string`

          - `type: "search"`

            - `"search"`

          - `queries: optional array of string`

          - `sources: optional array of object { type, url }`

            - `type: "url"`

              - `"url"`

            - `url: string`

        - `OpenAITypesResponsesResponseFunctionWebSearchActionOpenPage object { type, url }`

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

          - `type: "open_page"`

            - `"open_page"`

          - `url: optional string`

        - `ActionFind object { pattern, type, url }`

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

          - `pattern: string`

          - `type: "find_in_page"`

            - `"find_in_page"`

          - `url: string`

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

        - `"in_progress"`

        - `"searching"`

        - `"completed"`

        - `"failed"`

      - `type: "web_search_call"`

        - `"web_search_call"`

    - `OpenAIResponseComputerToolCall object { id, action, call_id, 3 more }`

      A tool call to a computer use tool.

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

      - `id: string`

      - `action: object { button, type, x, y }  or object { type, x, y }  or object { path, type }  or 6 more`

        A click action.

        - `ActionClick object { button, type, x, y }`

          A click action.

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

            - `"left"`

            - `"right"`

            - `"wheel"`

            - `"back"`

            - `"forward"`

          - `type: "click"`

            - `"click"`

          - `x: number`

          - `y: number`

        - `ActionDoubleClick object { type, x, y }`

          A double click action.

          - `type: "double_click"`

            - `"double_click"`

          - `x: number`

          - `y: number`

        - `ActionDrag object { path, type }`

          A drag action.

          - `path: array of object { x, y }`

            - `x: number`

            - `y: number`

          - `type: "drag"`

            - `"drag"`

        - `ActionKeypress object { keys, type }`

          A collection of keypresses the model would like to perform.

          - `keys: array of string`

          - `type: "keypress"`

            - `"keypress"`

        - `ActionMove object { type, x, y }`

          A mouse move action.

          - `type: "move"`

            - `"move"`

          - `x: number`

          - `y: number`

        - `ActionScreenshot object { type }`

          A screenshot action.

          - `type: "screenshot"`

            - `"screenshot"`

        - `ActionScroll object { scroll_x, scroll_y, type, 2 more }`

          A scroll action.

          - `scroll_x: number`

          - `scroll_y: number`

          - `type: "scroll"`

            - `"scroll"`

          - `x: number`

          - `y: number`

        - `ActionType object { text, type }`

          An action to type in text.

          - `text: string`

          - `type: "type"`

            - `"type"`

        - `ActionWait object { type }`

          A wait action.

          - `type: "wait"`

            - `"wait"`

      - `call_id: string`

      - `pending_safety_checks: array of object { id, code, message }`

        - `id: string`

        - `code: optional string`

        - `message: optional string`

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

        - `"in_progress"`

        - `"completed"`

        - `"incomplete"`

      - `type: "computer_call"`

        - `"computer_call"`

    - `OpenAIResponseReasoningItem object { id, summary, type, 3 more }`

      A description of the chain of thought used by a reasoning model while generating
      a response. Be sure to include these items in your `input` to the Responses API
      for subsequent turns of a conversation if you are manually
      [managing context](https://platform.openai.com/docs/guides/conversation-state).

      - `id: string`

      - `summary: array of object { text, type }`

        - `text: string`

        - `type: "summary_text"`

          - `"summary_text"`

      - `type: "reasoning"`

        - `"reasoning"`

      - `content: optional array of object { text, type }`

        - `text: string`

        - `type: "reasoning_text"`

          - `"reasoning_text"`

      - `encrypted_content: optional string`

      - `status: optional "in_progress" or "completed" or "incomplete"`

        - `"in_progress"`

        - `"completed"`

        - `"incomplete"`

    - `ResponseCompactionItem object { id, encrypted_content, type, created_by }`

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

      - `id: string`

      - `encrypted_content: string`

      - `type: "compaction"`

        - `"compaction"`

      - `created_by: optional string`

    - `OpenAITypesResponsesResponseOutputItemImageGenerationCall object { id, status, type, result }`

      An image generation request made by the model.

      - `id: string`

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

        - `"in_progress"`

        - `"completed"`

        - `"generating"`

        - `"failed"`

      - `type: "image_generation_call"`

        - `"image_generation_call"`

      - `result: optional string`

    - `OpenAIResponseCodeInterpreterToolCall object { id, container_id, status, 3 more }`

      A tool call to run code.

      - `id: string`

      - `container_id: string`

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

        - `"in_progress"`

        - `"completed"`

        - `"incomplete"`

        - `"interpreting"`

        - `"failed"`

      - `type: "code_interpreter_call"`

        - `"code_interpreter_call"`

      - `code: optional string`

      - `outputs: optional array of object { logs, type }  or object { type, url }`

        - `OutputLogs object { logs, type }`

          The logs output from the code interpreter.

          - `logs: string`

          - `type: "logs"`

            - `"logs"`

        - `OutputImage object { type, url }`

          The image output from the code interpreter.

          - `type: "image"`

            - `"image"`

          - `url: string`

    - `OpenAITypesResponsesResponseOutputItemLocalShellCall object { id, action, call_id, 2 more }`

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

      - `id: string`

      - `action: object { command, env, type, 3 more }`

        Execute a shell command on the server.

        - `command: array of string`

        - `env: map[string]`

        - `type: "exec"`

          - `"exec"`

        - `timeout_ms: optional number`

        - `user: optional string`

        - `working_directory: optional string`

      - `call_id: string`

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

        - `"in_progress"`

        - `"completed"`

        - `"incomplete"`

      - `type: "local_shell_call"`

        - `"local_shell_call"`

    - `ResponseFunctionShellToolCall object { id, action, call_id, 4 more }`

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

      - `id: string`

      - `action: object { commands, max_output_length, timeout_ms }`

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

        - `commands: array of string`

        - `max_output_length: optional number`

        - `timeout_ms: optional number`

      - `call_id: string`

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

        - `"in_progress"`

        - `"completed"`

        - `"incomplete"`

      - `type: "shell_call"`

        - `"shell_call"`

      - `created_by: optional string`

      - `environment: optional object { type }  or object { container_id, type }`

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

        - `ResponseLocalEnvironment object { type }`

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

          - `type: "local"`

            - `"local"`

        - `ResponseContainerReference object { container_id, type }`

          Represents a container created with /v1/containers.

          - `container_id: string`

          - `type: "container_reference"`

            - `"container_reference"`

    - `ResponseFunctionShellToolCallOutput object { id, call_id, output, 4 more }`

      The output of a shell tool call that was emitted.

      - `id: string`

      - `call_id: string`

      - `output: array of object { outcome, stderr, stdout, created_by }`

        - `outcome: object { type }  or object { exit_code, type }`

          Indicates that the shell call exceeded its configured time limit.

          - `OutputOutcomeTimeout object { type }`

            Indicates that the shell call exceeded its configured time limit.

            - `type: "timeout"`

              - `"timeout"`

          - `OutputOutcomeExit object { exit_code, type }`

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

            - `exit_code: number`

            - `type: "exit"`

              - `"exit"`

        - `stderr: string`

        - `stdout: string`

        - `created_by: optional string`

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

        - `"in_progress"`

        - `"completed"`

        - `"incomplete"`

      - `type: "shell_call_output"`

        - `"shell_call_output"`

      - `created_by: optional string`

      - `max_output_length: optional number`

    - `ResponseApplyPatchToolCall object { id, call_id, operation, 3 more }`

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

      - `id: string`

      - `call_id: string`

      - `operation: object { diff, path, type }  or object { path, type }  or object { diff, path, type }`

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

        - `OperationCreateFile object { diff, path, type }`

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

          - `diff: string`

          - `path: string`

          - `type: "create_file"`

            - `"create_file"`

        - `OperationDeleteFile object { path, type }`

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

          - `path: string`

          - `type: "delete_file"`

            - `"delete_file"`

        - `OperationUpdateFile object { diff, path, type }`

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

          - `diff: string`

          - `path: string`

          - `type: "update_file"`

            - `"update_file"`

      - `status: "in_progress" or "completed"`

        - `"in_progress"`

        - `"completed"`

      - `type: "apply_patch_call"`

        - `"apply_patch_call"`

      - `created_by: optional string`

    - `ResponseApplyPatchToolCallOutput object { id, call_id, status, 3 more }`

      The output emitted by an apply patch tool call.

      - `id: string`

      - `call_id: string`

      - `status: "completed" or "failed"`

        - `"completed"`

        - `"failed"`

      - `type: "apply_patch_call_output"`

        - `"apply_patch_call_output"`

      - `created_by: optional string`

      - `output: optional string`

    - `OpenAITypesResponsesResponseOutputItemMcpCall object { id, arguments, name, 6 more }`

      An invocation of a tool on an MCP server.

      - `id: string`

      - `arguments: string`

      - `name: string`

      - `server_label: string`

      - `type: "mcp_call"`

        - `"mcp_call"`

      - `approval_request_id: optional string`

      - `error: optional string`

      - `output: optional string`

      - `status: optional "in_progress" or "completed" or "incomplete" or 2 more`

        - `"in_progress"`

        - `"completed"`

        - `"incomplete"`

        - `"calling"`

        - `"failed"`

    - `OpenAITypesResponsesResponseOutputItemMcpListTools object { id, server_label, tools, 2 more }`

      A list of tools available on an MCP server.

      - `id: string`

      - `server_label: string`

      - `tools: array of object { input_schema, name, annotations, description }`

        - `input_schema: unknown`

        - `name: string`

        - `annotations: optional unknown`

        - `description: optional string`

      - `type: "mcp_list_tools"`

        - `"mcp_list_tools"`

      - `error: optional string`

    - `McpApprovalRequest object { id, arguments, name, 2 more }`

      A request for human approval of a tool invocation.

      - `id: string`

      - `arguments: string`

      - `name: string`

      - `server_label: string`

      - `type: "mcp_approval_request"`

        - `"mcp_approval_request"`

    - `OpenAIResponseCustomToolCall object { call_id, input, name, 2 more }`

      A call to a custom tool created by the model.

      - `call_id: string`

      - `input: string`

      - `name: string`

      - `type: "custom_tool_call"`

        - `"custom_tool_call"`

      - `id: optional string`

  - `parallel_tool_calls: boolean`

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

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

    - `"none" or "auto" or "required"`

      - `"none"`

      - `"auto"`

      - `"required"`

    - `ToolChoiceAllowed object { mode, tools, type }`

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

      - `mode: "auto" or "required"`

        - `"auto"`

        - `"required"`

      - `tools: array of map[unknown]`

      - `type: "allowed_tools"`

        - `"allowed_tools"`

    - `ToolChoiceTypes object { type }`

      Indicates that the model should use a built-in tool to generate a response.
      [Learn more about built-in tools](https://platform.openai.com/docs/guides/tools).

      - `type: "file_search" or "web_search_preview" or "computer_use_preview" or 3 more`

        - `"file_search"`

        - `"web_search_preview"`

        - `"computer_use_preview"`

        - `"web_search_preview_2025_03_11"`

        - `"image_generation"`

        - `"code_interpreter"`

    - `ToolChoiceFunction object { name, type }`

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

      - `name: string`

      - `type: "function"`

        - `"function"`

    - `ToolChoiceMcp object { server_label, type, name }`

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

      - `server_label: string`

      - `type: "mcp"`

        - `"mcp"`

      - `name: optional string`

    - `ToolChoiceCustom object { name, type }`

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

      - `name: string`

      - `type: "custom"`

        - `"custom"`

    - `ToolChoiceApplyPatch object { type }`

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

      - `type: "apply_patch"`

        - `"apply_patch"`

    - `ToolChoiceShell object { type }`

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

      - `type: "shell"`

        - `"shell"`

  - `tools: array of FunctionTool or FileSearchTool or ComputerTool or 9 more`

    - `FunctionTool object { name, type, description, 2 more }`

      Defines a function in your own code the model can choose to call.

      Learn more about [function calling](https://platform.openai.com/docs/guides/function-calling).

      - `name: string`

      - `type: "function"`

        - `"function"`

      - `description: optional string`

      - `parameters: optional map[unknown]`

      - `strict: optional boolean`

    - `FileSearchTool object { type, vector_store_ids, filters, 2 more }`

      A tool that searches for relevant content from uploaded files.

      Learn more about the [file search tool](https://platform.openai.com/docs/guides/tools-file-search).

      - `type: "file_search"`

        - `"file_search"`

      - `vector_store_ids: array of string`

      - `filters: optional object { key, type, value }  or object { filters, type }`

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

        - `ComparisonFilter object { key, type, value }`

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

          - `key: string`

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

            - `"eq"`

            - `"ne"`

            - `"gt"`

            - `"gte"`

            - `"lt"`

            - `"lte"`

          - `value: string or number or boolean or array of string or number`

            - `string`

            - `number`

            - `boolean`

            - `array of string or number`

              - `string`

              - `number`

        - `CompoundFilter object { filters, type }`

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

          - `filters: array of object { key, type, value }  or unknown`

            - `ComparisonFilter object { key, type, value }`

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

              - `key: string`

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

                - `"eq"`

                - `"ne"`

                - `"gt"`

                - `"gte"`

                - `"lt"`

                - `"lte"`

              - `value: string or number or boolean or array of string or number`

                - `string`

                - `number`

                - `boolean`

                - `array of string or number`

                  - `string`

                  - `number`

            - `unknown`

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

            - `"and"`

            - `"or"`

      - `max_num_results: optional number`

      - `ranking_options: optional object { hybrid_search, ranker, score_threshold }`

        Ranking options for search.

        - `hybrid_search: optional object { embedding_weight, text_weight }`

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

          - `embedding_weight: number`

          - `text_weight: number`

        - `ranker: optional "auto" or "default-2024-11-15"`

          - `"auto"`

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

        - `score_threshold: optional number`

    - `ComputerTool object { display_height, display_width, environment, type }`

      A tool that controls a virtual computer.

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

      - `display_height: number`

      - `display_width: number`

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

        - `"windows"`

        - `"mac"`

        - `"linux"`

        - `"ubuntu"`

        - `"browser"`

      - `type: "computer_use_preview"`

        - `"computer_use_preview"`

    - `WebSearchTool object { type, filters, search_context_size, user_location }`

      Search the Internet for sources related to the prompt.

      Learn more about the
      [web search tool](https://platform.openai.com/docs/guides/tools-web-search).

      - `type: "web_search" or "web_search_2025_08_26"`

        - `"web_search"`

        - `"web_search_2025_08_26"`

      - `filters: optional object { allowed_domains }`

        Filters for the search.

        - `allowed_domains: optional array of string`

      - `search_context_size: optional "low" or "medium" or "high"`

        - `"low"`

        - `"medium"`

        - `"high"`

      - `user_location: optional object { city, country, region, 2 more }`

        The approximate location of the user.

        - `city: optional string`

        - `country: optional string`

        - `region: optional string`

        - `timezone: optional string`

        - `type: optional "approximate"`

          - `"approximate"`

    - `Mcp object { server_label, type, allowed_tools, 6 more }`

      Give the model access to additional tools via remote Model Context Protocol
      (MCP) servers. [Learn more about MCP](https://platform.openai.com/docs/guides/tools-remote-mcp).

      - `server_label: string`

      - `type: "mcp"`

        - `"mcp"`

      - `allowed_tools: optional array of string or object { read_only, tool_names }`

        A filter object to specify which tools are allowed.

        - `array of string`

        - `McpAllowedToolsMcpToolFilter object { read_only, tool_names }`

          A filter object to specify which tools are allowed.

          - `read_only: optional boolean`

          - `tool_names: optional array of string`

      - `authorization: optional string`

      - `connector_id: optional "connector_dropbox" or "connector_gmail" or "connector_googlecalendar" or 5 more`

        - `"connector_dropbox"`

        - `"connector_gmail"`

        - `"connector_googlecalendar"`

        - `"connector_googledrive"`

        - `"connector_microsoftteams"`

        - `"connector_outlookcalendar"`

        - `"connector_outlookemail"`

        - `"connector_sharepoint"`

      - `headers: optional map[string]`

      - `require_approval: optional object { always, never }  or "always" or "never"`

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

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

        - `McpRequireApprovalMcpToolApprovalFilter object { always, never }`

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

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

          - `always: optional object { read_only, tool_names }`

            A filter object to specify which tools are allowed.

            - `read_only: optional boolean`

            - `tool_names: optional array of string`

          - `never: optional object { read_only, tool_names }`

            A filter object to specify which tools are allowed.

            - `read_only: optional boolean`

            - `tool_names: optional array of string`

        - `"always" or "never"`

          - `"always"`

          - `"never"`

      - `server_description: optional string`

      - `server_url: optional string`

    - `CodeInterpreter object { container, type }`

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

      - `container: string or object { type, file_ids, memory_limit, network_policy }`

        Configuration for a code interpreter container.

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

        - `string`

        - `CodeInterpreterContainerCodeInterpreterToolAuto object { type, file_ids, memory_limit, network_policy }`

          Configuration for a code interpreter container.

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

          - `type: "auto"`

            - `"auto"`

          - `file_ids: optional array of string`

          - `memory_limit: optional "1g" or "4g" or "16g" or "64g"`

            - `"1g"`

            - `"4g"`

            - `"16g"`

            - `"64g"`

          - `network_policy: optional ContainerNetworkPolicyDisabled or ContainerNetworkPolicyAllowlist`

            - `ContainerNetworkPolicyDisabled object { type }`

              - `type: "disabled"`

                - `"disabled"`

            - `ContainerNetworkPolicyAllowlist object { allowed_domains, type, domain_secrets }`

              - `allowed_domains: array of string`

              - `type: "allowlist"`

                - `"allowlist"`

              - `domain_secrets: optional array of object { domain, name, value }`

                - `domain: string`

                - `name: string`

                - `value: string`

      - `type: "code_interpreter"`

        - `"code_interpreter"`

    - `ImageGeneration object { type, action, background, 9 more }`

      A tool that generates images using the GPT image models.

      - `type: "image_generation"`

        - `"image_generation"`

      - `action: optional "generate" or "edit" or "auto"`

        - `"generate"`

        - `"edit"`

        - `"auto"`

      - `background: optional "transparent" or "opaque" or "auto"`

        - `"transparent"`

        - `"opaque"`

        - `"auto"`

      - `input_fidelity: optional "high" or "low"`

        - `"high"`

        - `"low"`

      - `input_image_mask: optional object { file_id, image_url }`

        Optional mask for inpainting.

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

        - `file_id: optional string`

        - `image_url: optional string`

      - `model: optional string or "gpt-image-1" or "gpt-image-1-mini" or "gpt-image-1.5"`

        - `string`

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

          - `"gpt-image-1"`

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

          - `"gpt-image-1.5"`

      - `moderation: optional "auto" or "low"`

        - `"auto"`

        - `"low"`

      - `output_compression: optional number`

      - `output_format: optional "png" or "webp" or "jpeg"`

        - `"png"`

        - `"webp"`

        - `"jpeg"`

      - `partial_images: optional number`

      - `quality: optional "low" or "medium" or "high" or "auto"`

        - `"low"`

        - `"medium"`

        - `"high"`

        - `"auto"`

      - `size: optional "1024x1024" or "1024x1536" or "1536x1024" or "auto"`

        - `"1024x1024"`

        - `"1024x1536"`

        - `"1536x1024"`

        - `"auto"`

    - `LocalShell object { type }`

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

      - `type: "local_shell"`

        - `"local_shell"`

    - `FunctionShellTool object { type, environment }`

      A tool that allows the model to execute shell commands.

      - `type: "shell"`

        - `"shell"`

      - `environment: optional object { type, file_ids, memory_limit, 2 more }  or LocalEnvironment or ContainerReference`

        - `ContainerAuto object { type, file_ids, memory_limit, 2 more }`

          - `type: "container_auto"`

            - `"container_auto"`

          - `file_ids: optional array of string`

          - `memory_limit: optional "1g" or "4g" or "16g" or "64g"`

            - `"1g"`

            - `"4g"`

            - `"16g"`

            - `"64g"`

          - `network_policy: optional ContainerNetworkPolicyDisabled or ContainerNetworkPolicyAllowlist`

            - `ContainerNetworkPolicyDisabled object { type }`

            - `ContainerNetworkPolicyAllowlist object { allowed_domains, type, domain_secrets }`

          - `skills: optional array of object { skill_id, type, version }  or object { description, name, source, type }`

            - `SkillReference object { skill_id, type, version }`

              - `skill_id: string`

              - `type: "skill_reference"`

                - `"skill_reference"`

              - `version: optional string`

            - `InlineSkill object { description, name, source, type }`

              - `description: string`

              - `name: string`

              - `source: object { data, media_type, type }`

                Inline skill payload

                - `data: string`

                - `media_type: "application/zip"`

                  - `"application/zip"`

                - `type: "base64"`

                  - `"base64"`

              - `type: "inline"`

                - `"inline"`

        - `LocalEnvironment object { type, skills }`

          - `type: "local"`

            - `"local"`

          - `skills: optional array of object { description, name, path }`

            - `description: string`

            - `name: string`

            - `path: string`

        - `ContainerReference object { container_id, type }`

          - `container_id: string`

          - `type: "container_reference"`

            - `"container_reference"`

    - `CustomTool object { name, type, description, format }`

      A custom tool that processes input using a specified format.

      Learn more about   [custom tools](https://platform.openai.com/docs/guides/function-calling#custom-tools)

      - `name: string`

      - `type: "custom"`

        - `"custom"`

      - `description: optional string`

      - `format: optional object { type }  or object { definition, syntax, type }`

        Unconstrained free-form text.

        - `Text object { type }`

          Unconstrained free-form text.

          - `type: "text"`

            - `"text"`

        - `Grammar object { definition, syntax, type }`

          A grammar defined by the user.

          - `definition: string`

          - `syntax: "lark" or "regex"`

            - `"lark"`

            - `"regex"`

          - `type: "grammar"`

            - `"grammar"`

    - `WebSearchPreviewTool object { type, search_context_size, user_location }`

      This tool searches the web for relevant results to use in a response.

      Learn more about the [web search tool](https://platform.openai.com/docs/guides/tools-web-search).

      - `type: "web_search_preview" or "web_search_preview_2025_03_11"`

        - `"web_search_preview"`

        - `"web_search_preview_2025_03_11"`

      - `search_context_size: optional "low" or "medium" or "high"`

        - `"low"`

        - `"medium"`

        - `"high"`

      - `user_location: optional object { type, city, country, 2 more }`

        The user's location.

        - `type: "approximate"`

          - `"approximate"`

        - `city: optional string`

        - `country: optional string`

        - `region: optional string`

        - `timezone: optional string`

    - `ApplyPatchTool object { type }`

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

      - `type: "apply_patch"`

        - `"apply_patch"`

  - `background: optional boolean`

  - `completed_at: optional number`

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

  - `error: optional OpenAIResponseError`

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

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

      - `"server_error"`

      - `"rate_limit_exceeded"`

      - `"invalid_prompt"`

      - `"vector_store_timeout"`

      - `"invalid_image"`

      - `"invalid_image_format"`

      - `"invalid_base64_image"`

      - `"invalid_image_url"`

      - `"image_too_large"`

      - `"image_too_small"`

      - `"image_parse_error"`

      - `"image_content_policy_violation"`

      - `"invalid_image_mode"`

      - `"image_file_too_large"`

      - `"unsupported_image_media_type"`

      - `"empty_image_file"`

      - `"failed_to_download_image"`

      - `"image_file_not_found"`

    - `message: string`

  - `incomplete_details: optional IncompleteDetails`

    Details about why the response is incomplete.

    - `reason: optional "max_output_tokens" or "content_filter"`

      - `"max_output_tokens"`

      - `"content_filter"`

  - `instructions: optional string or array of EasyInputMessage or OpenAITypesResponsesResponseInputItemMessage or OpenAIResponseOutputMessage or 23 more`

    - `string`

    - `InputItems = array of EasyInputMessage or OpenAITypesResponsesResponseInputItemMessage or OpenAIResponseOutputMessage or 23 more`

      - `EasyInputMessage object { content, role, phase, type }`

        A message input to the model with a role indicating instruction following
        hierarchy. Instructions given with the `developer` or `system` role take
        precedence over instructions given with the `user` role. Messages with the
        `assistant` role are presumed to have been generated by the model in previous
        interactions.

        - `content: string or array of OpenAIResponseInputText or OpenAIResponseInputImage or OpenAIResponseInputFile`

          - `string`

          - `InputItems = array of OpenAIResponseInputText or OpenAIResponseInputImage or OpenAIResponseInputFile`

            - `OpenAIResponseInputText object { text, type }`

              A text input to the model.

              - `text: string`

              - `type: "input_text"`

                - `"input_text"`

            - `OpenAIResponseInputImage object { detail, type, file_id, image_url }`

              An image input to the model.

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

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

                - `"low"`

                - `"high"`

                - `"auto"`

              - `type: "input_image"`

                - `"input_image"`

              - `file_id: optional string`

              - `image_url: optional string`

            - `OpenAIResponseInputFile object { type, file_data, file_id, 2 more }`

              A file input to the model.

              - `type: "input_file"`

                - `"input_file"`

              - `file_data: optional string`

              - `file_id: optional string`

              - `file_url: optional string`

              - `filename: optional string`

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

          - `"user"`

          - `"assistant"`

          - `"system"`

          - `"developer"`

        - `phase: optional "commentary" or "final_answer"`

          - `"commentary"`

          - `"final_answer"`

        - `type: optional "message"`

          - `"message"`

      - `OpenAITypesResponsesResponseInputItemMessage object { content, role, status, type }`

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

        - `content: array of OpenAIResponseInputText or OpenAIResponseInputImage or OpenAIResponseInputFile`

          - `OpenAIResponseInputText object { text, type }`

            A text input to the model.

          - `OpenAIResponseInputImage object { detail, type, file_id, image_url }`

            An image input to the model.

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

          - `OpenAIResponseInputFile object { type, file_data, file_id, 2 more }`

            A file input to the model.

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

          - `"user"`

          - `"system"`

          - `"developer"`

        - `status: optional "in_progress" or "completed" or "incomplete"`

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

        - `type: optional "message"`

          - `"message"`

      - `OpenAIResponseOutputMessage object { id, content, role, 3 more }`

        An output message from the model.

      - `OpenAIResponseFileSearchToolCall object { id, queries, status, 2 more }`

        The results of a file search tool call.

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

      - `OpenAIResponseComputerToolCall object { id, action, call_id, 3 more }`

        A tool call to a computer use tool.

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

      - `OpenAITypesResponsesResponseInputItemComputerCallOutput object { call_id, output, type, 3 more }`

        The output of a computer tool call.

        - `call_id: string`

        - `output: ResponseComputerToolCallOutputScreenshot`

          A computer screenshot image used with the computer use tool.

          - `type: "computer_screenshot"`

            - `"computer_screenshot"`

          - `file_id: optional string`

          - `image_url: optional string`

        - `type: "computer_call_output"`

          - `"computer_call_output"`

        - `id: optional string`

        - `acknowledged_safety_checks: optional array of object { id, code, message }`

          - `id: string`

          - `code: optional string`

          - `message: optional string`

        - `status: optional "in_progress" or "completed" or "incomplete"`

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

      - `OpenAIResponseFunctionWebSearch object { id, action, status, type }`

        The results of a web search tool call.

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

      - `OpenAIResponseFunctionToolCall object { arguments, call_id, name, 3 more }`

        A tool call to run a function.

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

      - `OpenAITypesResponsesResponseInputItemFunctionCallOutput object { call_id, output, type, 2 more }`

        The output of a function tool call.

        - `call_id: string`

        - `output: string or array of object { text, type }  or object { type, detail, file_id, image_url }  or object { type, file_data, file_id, 2 more }`

          - `string`

          - `OutputContentList = array of object { text, type }  or object { type, detail, file_id, image_url }  or object { type, file_data, file_id, 2 more }`

            - `ResponseInputTextContent object { text, type }`

              A text input to the model.

              - `text: string`

              - `type: "input_text"`

                - `"input_text"`

            - `ResponseInputImageContent object { type, detail, file_id, image_url }`

              An image input to the model.

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

              - `type: "input_image"`

                - `"input_image"`

              - `detail: optional "low" or "high" or "auto"`

                - `"low"`

                - `"high"`

                - `"auto"`

              - `file_id: optional string`

              - `image_url: optional string`

            - `ResponseInputFileContent object { type, file_data, file_id, 2 more }`

              A file input to the model.

              - `type: "input_file"`

                - `"input_file"`

              - `file_data: optional string`

              - `file_id: optional string`

              - `file_url: optional string`

              - `filename: optional string`

        - `type: "function_call_output"`

          - `"function_call_output"`

        - `id: optional string`

        - `status: optional "in_progress" or "completed" or "incomplete"`

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

      - `OpenAIResponseReasoningItem object { id, summary, type, 3 more }`

        A description of the chain of thought used by a reasoning model while generating
        a response. Be sure to include these items in your `input` to the Responses API
        for subsequent turns of a conversation if you are manually
        [managing context](https://platform.openai.com/docs/guides/conversation-state).

      - `ResponseCompactionItemParam object { encrypted_content, type, id }`

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

        - `encrypted_content: string`

        - `type: "compaction"`

          - `"compaction"`

        - `id: optional string`

      - `OpenAITypesResponsesResponseInputItemImageGenerationCall object { id, status, type, result }`

        An image generation request made by the model.

        - `id: string`

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

          - `"in_progress"`

          - `"completed"`

          - `"generating"`

          - `"failed"`

        - `type: "image_generation_call"`

          - `"image_generation_call"`

        - `result: optional string`

      - `OpenAIResponseCodeInterpreterToolCall object { id, container_id, status, 3 more }`

        A tool call to run code.

      - `OpenAITypesResponsesResponseInputItemLocalShellCall object { id, action, call_id, 2 more }`

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

        - `id: string`

        - `action: object { command, env, type, 3 more }`

          Execute a shell command on the server.

          - `command: array of string`

          - `env: map[string]`

          - `type: "exec"`

            - `"exec"`

          - `timeout_ms: optional number`

          - `user: optional string`

          - `working_directory: optional string`

        - `call_id: string`

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

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

        - `type: "local_shell_call"`

          - `"local_shell_call"`

      - `OpenAITypesResponsesResponseInputItemLocalShellCallOutput object { id, output, type, status }`

        The output of a local shell tool call.

        - `id: string`

        - `output: string`

        - `type: "local_shell_call_output"`

          - `"local_shell_call_output"`

        - `status: optional "in_progress" or "completed" or "incomplete"`

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

      - `ShellCall object { action, call_id, type, 3 more }`

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

        - `action: object { commands, max_output_length, timeout_ms }`

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

          - `commands: array of string`

          - `max_output_length: optional number`

          - `timeout_ms: optional number`

        - `call_id: string`

        - `type: "shell_call"`

          - `"shell_call"`

        - `id: optional string`

        - `environment: optional LocalEnvironment or ContainerReference`

          - `LocalEnvironment object { type, skills }`

          - `ContainerReference object { container_id, type }`

        - `status: optional "in_progress" or "completed" or "incomplete"`

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

      - `ShellCallOutput object { call_id, output, type, 3 more }`

        The streamed output items emitted by a shell tool call.

        - `call_id: string`

        - `output: array of object { outcome, stderr, stdout }`

          - `outcome: object { type }  or object { exit_code, type }`

            Indicates that the shell call exceeded its configured time limit.

            - `OutcomeTimeout object { type }`

              Indicates that the shell call exceeded its configured time limit.

              - `type: "timeout"`

                - `"timeout"`

            - `OutcomeExit object { exit_code, type }`

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

              - `exit_code: number`

              - `type: "exit"`

                - `"exit"`

          - `stderr: string`

          - `stdout: string`

        - `type: "shell_call_output"`

          - `"shell_call_output"`

        - `id: optional string`

        - `max_output_length: optional number`

        - `status: optional "in_progress" or "completed" or "incomplete"`

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

      - `ApplyPatchCall object { call_id, operation, status, 2 more }`

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

        - `call_id: string`

        - `operation: object { diff, path, type }  or object { path, type }  or object { diff, path, type }`

          Instruction for creating a new file via the apply_patch tool.

          - `ApplyPatchCallOperationCreateFile object { diff, path, type }`

            Instruction for creating a new file via the apply_patch tool.

            - `diff: string`

            - `path: string`

            - `type: "create_file"`

              - `"create_file"`

          - `ApplyPatchCallOperationDeleteFile object { path, type }`

            Instruction for deleting an existing file via the apply_patch tool.

            - `path: string`

            - `type: "delete_file"`

              - `"delete_file"`

          - `ApplyPatchCallOperationUpdateFile object { diff, path, type }`

            Instruction for updating an existing file via the apply_patch tool.

            - `diff: string`

            - `path: string`

            - `type: "update_file"`

              - `"update_file"`

        - `status: "in_progress" or "completed"`

          - `"in_progress"`

          - `"completed"`

        - `type: "apply_patch_call"`

          - `"apply_patch_call"`

        - `id: optional string`

      - `ApplyPatchCallOutput object { call_id, status, type, 2 more }`

        The streamed output emitted by an apply patch tool call.

        - `call_id: string`

        - `status: "completed" or "failed"`

          - `"completed"`

          - `"failed"`

        - `type: "apply_patch_call_output"`

          - `"apply_patch_call_output"`

        - `id: optional string`

        - `output: optional string`

      - `OpenAITypesResponsesResponseInputItemMcpListTools object { id, server_label, tools, 2 more }`

        A list of tools available on an MCP server.

        - `id: string`

        - `server_label: string`

        - `tools: array of object { input_schema, name, annotations, description }`

          - `input_schema: unknown`

          - `name: string`

          - `annotations: optional unknown`

          - `description: optional string`

        - `type: "mcp_list_tools"`

          - `"mcp_list_tools"`

        - `error: optional string`

      - `McpApprovalRequest object { id, arguments, name, 2 more }`

        A request for human approval of a tool invocation.

      - `OpenAITypesResponsesResponseInputItemMcpApprovalResponse object { approval_request_id, approve, type, 2 more }`

        A response to an MCP approval request.

        - `approval_request_id: string`

        - `approve: boolean`

        - `type: "mcp_approval_response"`

          - `"mcp_approval_response"`

        - `id: optional string`

        - `reason: optional string`

      - `OpenAITypesResponsesResponseInputItemMcpCall object { id, arguments, name, 6 more }`

        An invocation of a tool on an MCP server.

        - `id: string`

        - `arguments: string`

        - `name: string`

        - `server_label: string`

        - `type: "mcp_call"`

          - `"mcp_call"`

        - `approval_request_id: optional string`

        - `error: optional string`

        - `output: optional string`

        - `status: optional "in_progress" or "completed" or "incomplete" or 2 more`

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

          - `"calling"`

          - `"failed"`

      - `OpenAIResponseCustomToolCallOutput object { call_id, output, type, id }`

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

        - `call_id: string`

        - `output: string or array of OpenAIResponseInputText or OpenAIResponseInputImage or OpenAIResponseInputFile`

          - `string`

          - `OutputContentList = array of OpenAIResponseInputText or OpenAIResponseInputImage or OpenAIResponseInputFile`

            - `OpenAIResponseInputText object { text, type }`

              A text input to the model.

            - `OpenAIResponseInputImage object { detail, type, file_id, image_url }`

              An image input to the model.

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

            - `OpenAIResponseInputFile object { type, file_data, file_id, 2 more }`

              A file input to the model.

        - `type: "custom_tool_call_output"`

          - `"custom_tool_call_output"`

        - `id: optional string`

      - `OpenAIResponseCustomToolCall object { call_id, input, name, 2 more }`

        A call to a custom tool created by the model.

      - `OpenAITypesResponsesResponseInputItemItemReference object { id, type }`

        An internal identifier for an item to reference.

        - `id: string`

        - `type: optional "item_reference"`

          - `"item_reference"`

  - `max_output_tokens: optional number`

  - `max_tool_calls: optional number`

  - `metadata: optional map[string]`

  - `previous_response_id: optional string`

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

    - `variables: optional map[string or OpenAIResponseInputText or OpenAIResponseInputImage or OpenAIResponseInputFile]`

      - `string`

      - `OpenAIResponseInputText object { text, type }`

        A text input to the model.

      - `OpenAIResponseInputImage object { detail, type, file_id, image_url }`

        An image input to the model.

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

      - `OpenAIResponseInputFile object { type, file_data, file_id, 2 more }`

        A file input to the model.

    - `version: optional string`

  - `prompt_cache_key: optional string`

  - `prompt_cache_retention: optional "in-memory" or "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 "none" or "minimal" or "low" or 3 more`

      - `"none"`

      - `"minimal"`

      - `"low"`

      - `"medium"`

      - `"high"`

      - `"xhigh"`

    - `generate_summary: optional "auto" or "concise" or "detailed"`

      - `"auto"`

      - `"concise"`

      - `"detailed"`

    - `summary: optional "auto" or "concise" or "detailed"`

      - `"auto"`

      - `"concise"`

      - `"detailed"`

  - `safety_identifier: optional string`

  - `service_tier: optional "auto" or "default" or "flex" or 2 more`

    - `"auto"`

    - `"default"`

    - `"flex"`

    - `"scale"`

    - `"priority"`

  - `status: optional "completed" or "failed" or "in_progress" or 3 more`

    - `"completed"`

    - `"failed"`

    - `"in_progress"`

    - `"cancelled"`

    - `"queued"`

    - `"incomplete"`

  - `temperature: optional number`

  - `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 object { type }  or object { name, schema, type, 2 more }  or object { type }`

      Default response format. Used to generate text responses.

      - `ResponseFormatText object { type }`

        Default response format. Used to generate text responses.

        - `type: "text"`

          - `"text"`

      - `ResponseFormatTextJsonSchemaConfig object { name, schema, type, 2 more }`

        JSON Schema response format.

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

        - `name: string`

        - `schema: map[unknown]`

        - `type: "json_schema"`

          - `"json_schema"`

        - `description: optional string`

        - `strict: optional boolean`

      - `ResponseFormatJsonObject object { type }`

        JSON object response format.

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

        - `type: "json_object"`

          - `"json_object"`

    - `verbosity: optional "low" or "medium" or "high"`

      - `"low"`

      - `"medium"`

      - `"high"`

  - `top_logprobs: optional number`

  - `top_p: optional number`

  - `truncation: optional "auto" or "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: number`

    - `input_tokens_details: object { cached_tokens }`

      A detailed breakdown of the input tokens.

      - `cached_tokens: number`

    - `output_tokens: number`

    - `output_tokens_details: object { reasoning_tokens }`

      A detailed breakdown of the output tokens.

      - `reasoning_tokens: number`

    - `total_tokens: number`

  - `user: optional string`

- `ResponseAudioDeltaEvent object { delta, sequence_number, type }`

  Emitted when there is a partial audio response.

  - `delta: string`

  - `sequence_number: number`

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

    - `"response.audio.delta"`

- `ResponseAudioDoneEvent object { sequence_number, type }`

  Emitted when the audio response is complete.

  - `sequence_number: number`

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

    - `"response.audio.done"`

- `ResponseAudioTranscriptDeltaEvent object { delta, sequence_number, type }`

  Emitted when there is a partial transcript of audio.

  - `delta: string`

  - `sequence_number: number`

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

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

- `ResponseAudioTranscriptDoneEvent object { sequence_number, type }`

  Emitted when the full audio transcript is completed.

  - `sequence_number: number`

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

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

- `ResponseCodeInterpreterCallCodeDeltaEvent object { delta, item_id, output_index, 2 more }`

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

  - `delta: string`

  - `item_id: string`

  - `output_index: number`

  - `sequence_number: number`

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

    - `"response.code_interpreter_call_code.delta"`

- `ResponseCodeInterpreterCallCodeDoneEvent object { code, item_id, output_index, 2 more }`

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

  - `code: string`

  - `item_id: string`

  - `output_index: number`

  - `sequence_number: number`

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

    - `"response.code_interpreter_call_code.done"`

- `ResponseCodeInterpreterCallCompletedEvent object { item_id, output_index, sequence_number, type }`

  Emitted when the code interpreter call is completed.

  - `item_id: string`

  - `output_index: number`

  - `sequence_number: number`

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

    - `"response.code_interpreter_call.completed"`

- `ResponseCodeInterpreterCallInProgressEvent object { item_id, output_index, sequence_number, type }`

  Emitted when a code interpreter call is in progress.

  - `item_id: string`

  - `output_index: number`

  - `sequence_number: number`

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

    - `"response.code_interpreter_call.in_progress"`

- `ResponseCodeInterpreterCallInterpretingEvent object { item_id, output_index, sequence_number, type }`

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

  - `item_id: string`

  - `output_index: number`

  - `sequence_number: number`

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

    - `"response.code_interpreter_call.interpreting"`

- `ResponseCompletedEvent object { response, sequence_number, type }`

  Emitted when the model response is complete.

  - `response: OpenAIResponse`

  - `sequence_number: number`

  - `type: "response.completed"`

    - `"response.completed"`

- `ResponseContentPartAddedEvent object { content_index, item_id, output_index, 3 more }`

  Emitted when a new content part is added.

  - `content_index: number`

  - `item_id: string`

  - `output_index: number`

  - `part: OpenAIResponseOutputText or OpenAIResponseOutputRefusal or PartReasoningText`

    A text output from the model.

    - `OpenAIResponseOutputText object { annotations, text, type, logprobs }`

      A text output from the model.

    - `OpenAIResponseOutputRefusal object { refusal, type }`

      A refusal from the model.

    - `PartReasoningText object { text, type }`

      Reasoning text from the model.

      - `text: string`

      - `type: "reasoning_text"`

        - `"reasoning_text"`

  - `sequence_number: number`

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

    - `"response.content_part.added"`

- `ResponseContentPartDoneEvent object { content_index, item_id, output_index, 3 more }`

  Emitted when a content part is done.

  - `content_index: number`

  - `item_id: string`

  - `output_index: number`

  - `part: OpenAIResponseOutputText or OpenAIResponseOutputRefusal or PartReasoningText`

    A text output from the model.

    - `OpenAIResponseOutputText object { annotations, text, type, logprobs }`

      A text output from the model.

    - `OpenAIResponseOutputRefusal object { refusal, type }`

      A refusal from the model.

    - `PartReasoningText object { text, type }`

      Reasoning text from the model.

  - `sequence_number: number`

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

    - `"response.content_part.done"`

- `ResponseCreatedEvent object { response, sequence_number, type }`

  An event that is emitted when a response is created.

  - `response: OpenAIResponse`

  - `sequence_number: number`

  - `type: "response.created"`

    - `"response.created"`

- `ResponseErrorEvent object { message, sequence_number, type, 2 more }`

  Emitted when an error occurs.

  - `message: string`

  - `sequence_number: number`

  - `type: "error"`

    - `"error"`

  - `code: optional string`

  - `param: optional string`

- `ResponseFileSearchCallCompletedEvent object { item_id, output_index, sequence_number, type }`

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

  - `item_id: string`

  - `output_index: number`

  - `sequence_number: number`

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

    - `"response.file_search_call.completed"`

- `ResponseFileSearchCallInProgressEvent object { item_id, output_index, sequence_number, type }`

  Emitted when a file search call is initiated.

  - `item_id: string`

  - `output_index: number`

  - `sequence_number: number`

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

    - `"response.file_search_call.in_progress"`

- `ResponseFileSearchCallSearchingEvent object { item_id, output_index, sequence_number, type }`

  Emitted when a file search is currently searching.

  - `item_id: string`

  - `output_index: number`

  - `sequence_number: number`

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

    - `"response.file_search_call.searching"`

- `ResponseFunctionCallArgumentsDeltaEvent object { delta, item_id, output_index, 2 more }`

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

  - `delta: string`

  - `item_id: string`

  - `output_index: number`

  - `sequence_number: number`

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

    - `"response.function_call_arguments.delta"`

- `ResponseFunctionCallArgumentsDoneEvent object { arguments, item_id, name, 3 more }`

  Emitted when function-call arguments are finalized.

  - `arguments: string`

  - `item_id: string`

  - `name: string`

  - `output_index: number`

  - `sequence_number: number`

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

    - `"response.function_call_arguments.done"`

- `ResponseInProgressEvent object { response, sequence_number, type }`

  Emitted when the response is in progress.

  - `response: OpenAIResponse`

  - `sequence_number: number`

  - `type: "response.in_progress"`

    - `"response.in_progress"`

- `ResponseFailedEvent object { response, sequence_number, type }`

  An event that is emitted when a response fails.

  - `response: OpenAIResponse`

  - `sequence_number: number`

  - `type: "response.failed"`

    - `"response.failed"`

- `ResponseIncompleteEvent object { response, sequence_number, type }`

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

  - `response: OpenAIResponse`

  - `sequence_number: number`

  - `type: "response.incomplete"`

    - `"response.incomplete"`

- `ResponseOutputItemAddedEvent object { item, output_index, sequence_number, type }`

  Emitted when a new output item is added.

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

    An output message from the model.

    - `OpenAIResponseOutputMessage object { id, content, role, 3 more }`

      An output message from the model.

    - `OpenAIResponseFileSearchToolCall object { id, queries, status, 2 more }`

      The results of a file search tool call.

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

    - `OpenAIResponseFunctionToolCall object { arguments, call_id, name, 3 more }`

      A tool call to run a function.

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

    - `OpenAIResponseFunctionWebSearch object { id, action, status, type }`

      The results of a web search tool call.

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

    - `OpenAIResponseComputerToolCall object { id, action, call_id, 3 more }`

      A tool call to a computer use tool.

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

    - `OpenAIResponseReasoningItem object { id, summary, type, 3 more }`

      A description of the chain of thought used by a reasoning model while generating
      a response. Be sure to include these items in your `input` to the Responses API
      for subsequent turns of a conversation if you are manually
      [managing context](https://platform.openai.com/docs/guides/conversation-state).

    - `ResponseCompactionItem object { id, encrypted_content, type, created_by }`

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

    - `OpenAITypesResponsesResponseOutputItemImageGenerationCall object { id, status, type, result }`

      An image generation request made by the model.

    - `OpenAIResponseCodeInterpreterToolCall object { id, container_id, status, 3 more }`

      A tool call to run code.

    - `OpenAITypesResponsesResponseOutputItemLocalShellCall object { id, action, call_id, 2 more }`

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

    - `ResponseFunctionShellToolCall object { id, action, call_id, 4 more }`

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

    - `ResponseFunctionShellToolCallOutput object { id, call_id, output, 4 more }`

      The output of a shell tool call that was emitted.

    - `ResponseApplyPatchToolCall object { id, call_id, operation, 3 more }`

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

    - `ResponseApplyPatchToolCallOutput object { id, call_id, status, 3 more }`

      The output emitted by an apply patch tool call.

    - `OpenAITypesResponsesResponseOutputItemMcpCall object { id, arguments, name, 6 more }`

      An invocation of a tool on an MCP server.

    - `OpenAITypesResponsesResponseOutputItemMcpListTools object { id, server_label, tools, 2 more }`

      A list of tools available on an MCP server.

    - `McpApprovalRequest object { id, arguments, name, 2 more }`

      A request for human approval of a tool invocation.

    - `OpenAIResponseCustomToolCall object { call_id, input, name, 2 more }`

      A call to a custom tool created by the model.

  - `output_index: number`

  - `sequence_number: number`

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

    - `"response.output_item.added"`

- `ResponseOutputItemDoneEvent object { item, output_index, sequence_number, type }`

  Emitted when an output item is marked done.

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

    An output message from the model.

    - `OpenAIResponseOutputMessage object { id, content, role, 3 more }`

      An output message from the model.

    - `OpenAIResponseFileSearchToolCall object { id, queries, status, 2 more }`

      The results of a file search tool call.

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

    - `OpenAIResponseFunctionToolCall object { arguments, call_id, name, 3 more }`

      A tool call to run a function.

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

    - `OpenAIResponseFunctionWebSearch object { id, action, status, type }`

      The results of a web search tool call.

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

    - `OpenAIResponseComputerToolCall object { id, action, call_id, 3 more }`

      A tool call to a computer use tool.

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

    - `OpenAIResponseReasoningItem object { id, summary, type, 3 more }`

      A description of the chain of thought used by a reasoning model while generating
      a response. Be sure to include these items in your `input` to the Responses API
      for subsequent turns of a conversation if you are manually
      [managing context](https://platform.openai.com/docs/guides/conversation-state).

    - `ResponseCompactionItem object { id, encrypted_content, type, created_by }`

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

    - `OpenAITypesResponsesResponseOutputItemImageGenerationCall object { id, status, type, result }`

      An image generation request made by the model.

    - `OpenAIResponseCodeInterpreterToolCall object { id, container_id, status, 3 more }`

      A tool call to run code.

    - `OpenAITypesResponsesResponseOutputItemLocalShellCall object { id, action, call_id, 2 more }`

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

    - `ResponseFunctionShellToolCall object { id, action, call_id, 4 more }`

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

    - `ResponseFunctionShellToolCallOutput object { id, call_id, output, 4 more }`

      The output of a shell tool call that was emitted.

    - `ResponseApplyPatchToolCall object { id, call_id, operation, 3 more }`

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

    - `ResponseApplyPatchToolCallOutput object { id, call_id, status, 3 more }`

      The output emitted by an apply patch tool call.

    - `OpenAITypesResponsesResponseOutputItemMcpCall object { id, arguments, name, 6 more }`

      An invocation of a tool on an MCP server.

    - `OpenAITypesResponsesResponseOutputItemMcpListTools object { id, server_label, tools, 2 more }`

      A list of tools available on an MCP server.

    - `McpApprovalRequest object { id, arguments, name, 2 more }`

      A request for human approval of a tool invocation.

    - `OpenAIResponseCustomToolCall object { call_id, input, name, 2 more }`

      A call to a custom tool created by the model.

  - `output_index: number`

  - `sequence_number: number`

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

    - `"response.output_item.done"`

- `ResponseReasoningSummaryPartAddedEvent object { item_id, output_index, part, 3 more }`

  Emitted when a new reasoning summary part is added.

  - `item_id: string`

  - `output_index: number`

  - `part: object { text, type }`

    The summary part that was added.

    - `text: string`

    - `type: "summary_text"`

      - `"summary_text"`

  - `sequence_number: number`

  - `summary_index: number`

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

    - `"response.reasoning_summary_part.added"`

- `ResponseReasoningSummaryPartDoneEvent object { item_id, output_index, part, 3 more }`

  Emitted when a reasoning summary part is completed.

  - `item_id: string`

  - `output_index: number`

  - `part: object { text, type }`

    The completed summary part.

    - `text: string`

    - `type: "summary_text"`

      - `"summary_text"`

  - `sequence_number: number`

  - `summary_index: number`

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

    - `"response.reasoning_summary_part.done"`

- `ResponseReasoningSummaryTextDeltaEvent object { delta, item_id, output_index, 3 more }`

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

  - `delta: string`

  - `item_id: string`

  - `output_index: number`

  - `sequence_number: number`

  - `summary_index: number`

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

    - `"response.reasoning_summary_text.delta"`

- `ResponseReasoningSummaryTextDoneEvent object { item_id, output_index, sequence_number, 3 more }`

  Emitted when a reasoning summary text is completed.

  - `item_id: string`

  - `output_index: number`

  - `sequence_number: number`

  - `summary_index: number`

  - `text: string`

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

    - `"response.reasoning_summary_text.done"`

- `ResponseReasoningTextDeltaEvent object { content_index, delta, item_id, 3 more }`

  Emitted when a delta is added to a reasoning text.

  - `content_index: number`

  - `delta: string`

  - `item_id: string`

  - `output_index: number`

  - `sequence_number: number`

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

    - `"response.reasoning_text.delta"`

- `ResponseReasoningTextDoneEvent object { content_index, item_id, output_index, 3 more }`

  Emitted when a reasoning text is completed.

  - `content_index: number`

  - `item_id: string`

  - `output_index: number`

  - `sequence_number: number`

  - `text: string`

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

    - `"response.reasoning_text.done"`

- `ResponseRefusalDeltaEvent object { content_index, delta, item_id, 3 more }`

  Emitted when there is a partial refusal text.

  - `content_index: number`

  - `delta: string`

  - `item_id: string`

  - `output_index: number`

  - `sequence_number: number`

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

    - `"response.refusal.delta"`

- `ResponseRefusalDoneEvent object { content_index, item_id, output_index, 3 more }`

  Emitted when refusal text is finalized.

  - `content_index: number`

  - `item_id: string`

  - `output_index: number`

  - `refusal: string`

  - `sequence_number: number`

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

    - `"response.refusal.done"`

- `ResponseTextDeltaEvent object { content_index, delta, item_id, 4 more }`

  Emitted when there is an additional text delta.

  - `content_index: number`

  - `delta: string`

  - `item_id: string`

  - `logprobs: array of object { token, logprob, top_logprobs }`

    - `token: string`

    - `logprob: number`

    - `top_logprobs: optional array of object { token, logprob }`

      - `token: optional string`

      - `logprob: optional number`

  - `output_index: number`

  - `sequence_number: number`

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

    - `"response.output_text.delta"`

- `ResponseTextDoneEvent object { content_index, item_id, logprobs, 4 more }`

  Emitted when text content is finalized.

  - `content_index: number`

  - `item_id: string`

  - `logprobs: array of object { token, logprob, top_logprobs }`

    - `token: string`

    - `logprob: number`

    - `top_logprobs: optional array of object { token, logprob }`

      - `token: optional string`

      - `logprob: optional number`

  - `output_index: number`

  - `sequence_number: number`

  - `text: string`

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

    - `"response.output_text.done"`

- `ResponseWebSearchCallCompletedEvent object { item_id, output_index, sequence_number, type }`

  Emitted when a web search call is completed.

  - `item_id: string`

  - `output_index: number`

  - `sequence_number: number`

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

    - `"response.web_search_call.completed"`

- `ResponseWebSearchCallInProgressEvent object { item_id, output_index, sequence_number, type }`

  Emitted when a web search call is initiated.

  - `item_id: string`

  - `output_index: number`

  - `sequence_number: number`

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

    - `"response.web_search_call.in_progress"`

- `ResponseWebSearchCallSearchingEvent object { item_id, output_index, sequence_number, type }`

  Emitted when a web search call is executing.

  - `item_id: string`

  - `output_index: number`

  - `sequence_number: number`

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

    - `"response.web_search_call.searching"`

- `ResponseImageGenCallCompletedEvent object { item_id, output_index, sequence_number, type }`

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

  - `item_id: string`

  - `output_index: number`

  - `sequence_number: number`

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

    - `"response.image_generation_call.completed"`

- `ResponseImageGenCallGeneratingEvent object { item_id, output_index, sequence_number, type }`

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

  - `item_id: string`

  - `output_index: number`

  - `sequence_number: number`

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

    - `"response.image_generation_call.generating"`

- `ResponseImageGenCallInProgressEvent object { item_id, output_index, sequence_number, type }`

  Emitted when an image generation tool call is in progress.

  - `item_id: string`

  - `output_index: number`

  - `sequence_number: number`

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

    - `"response.image_generation_call.in_progress"`

- `ResponseImageGenCallPartialImageEvent object { item_id, output_index, partial_image_b64, 3 more }`

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

  - `item_id: string`

  - `output_index: number`

  - `partial_image_b64: string`

  - `partial_image_index: number`

  - `sequence_number: number`

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

    - `"response.image_generation_call.partial_image"`

- `ResponseMcpCallArgumentsDeltaEvent object { delta, item_id, output_index, 2 more }`

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

  - `delta: string`

  - `item_id: string`

  - `output_index: number`

  - `sequence_number: number`

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

    - `"response.mcp_call_arguments.delta"`

- `ResponseMcpCallArgumentsDoneEvent object { arguments, item_id, output_index, 2 more }`

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

  - `arguments: string`

  - `item_id: string`

  - `output_index: number`

  - `sequence_number: number`

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

    - `"response.mcp_call_arguments.done"`

- `ResponseMcpCallCompletedEvent object { item_id, output_index, sequence_number, type }`

  Emitted when an MCP  tool call has completed successfully.

  - `item_id: string`

  - `output_index: number`

  - `sequence_number: number`

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

    - `"response.mcp_call.completed"`

- `ResponseMcpCallFailedEvent object { item_id, output_index, sequence_number, type }`

  Emitted when an MCP  tool call has failed.

  - `item_id: string`

  - `output_index: number`

  - `sequence_number: number`

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

    - `"response.mcp_call.failed"`

- `ResponseMcpCallInProgressEvent object { item_id, output_index, sequence_number, type }`

  Emitted when an MCP  tool call is in progress.

  - `item_id: string`

  - `output_index: number`

  - `sequence_number: number`

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

    - `"response.mcp_call.in_progress"`

- `ResponseMcpListToolsCompletedEvent object { item_id, output_index, sequence_number, type }`

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

  - `item_id: string`

  - `output_index: number`

  - `sequence_number: number`

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

    - `"response.mcp_list_tools.completed"`

- `ResponseMcpListToolsFailedEvent object { item_id, output_index, sequence_number, type }`

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

  - `item_id: string`

  - `output_index: number`

  - `sequence_number: number`

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

    - `"response.mcp_list_tools.failed"`

- `ResponseMcpListToolsInProgressEvent object { item_id, output_index, sequence_number, type }`

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

  - `item_id: string`

  - `output_index: number`

  - `sequence_number: number`

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

    - `"response.mcp_list_tools.in_progress"`

- `ResponseOutputTextAnnotationAddedEvent object { annotation, annotation_index, content_index, 4 more }`

  Emitted when an annotation is added to output text content.

  - `annotation: unknown`

  - `annotation_index: number`

  - `content_index: number`

  - `item_id: string`

  - `output_index: number`

  - `sequence_number: number`

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

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

- `ResponseQueuedEvent object { response, sequence_number, type }`

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

  - `response: OpenAIResponse`

  - `sequence_number: number`

  - `type: "response.queued"`

    - `"response.queued"`

- `ResponseCustomToolCallInputDeltaEvent object { delta, item_id, output_index, 2 more }`

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

  - `delta: string`

  - `item_id: string`

  - `output_index: number`

  - `sequence_number: number`

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

    - `"response.custom_tool_call_input.delta"`

- `ResponseCustomToolCallInputDoneEvent object { input, item_id, output_index, 2 more }`

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

  - `input: string`

  - `item_id: string`

  - `output_index: number`

  - `sequence_number: number`

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

    - `"response.custom_tool_call_input.done"`

- `GenericResponseEvent object { type }`

  - `type: string`

### Example

```http
curl https://api.egp.scale.com/v5/responses \
    -H 'Content-Type: application/json' \
    -H "x-api-key: $SGP_API_KEY" \
    -d '{
          "input": "string",
          "model": "model"
        }'
```

#### Response

```json
{
  "id": "id",
  "created_at": 0,
  "model": "gpt-5.2",
  "object": "response",
  "output": [
    {
      "id": "id",
      "content": [
        {
          "annotations": [
            {
              "file_id": "file_id",
              "filename": "filename",
              "index": 0,
              "type": "file_citation"
            }
          ],
          "text": "text",
          "type": "output_text",
          "logprobs": [
            {
              "token": "token",
              "bytes": [
                0
              ],
              "logprob": 0,
              "top_logprobs": [
                {
                  "token": "token",
                  "bytes": [
                    0
                  ],
                  "logprob": 0
                }
              ]
            }
          ]
        }
      ],
      "role": "assistant",
      "status": "in_progress",
      "type": "message",
      "phase": "commentary"
    }
  ],
  "parallel_tool_calls": true,
  "tool_choice": "none",
  "tools": [
    {
      "name": "name",
      "type": "function",
      "description": "description",
      "parameters": {
        "foo": "bar"
      },
      "strict": true
    }
  ],
  "background": true,
  "completed_at": 0,
  "conversation": {
    "id": "id"
  },
  "error": {
    "code": "server_error",
    "message": "message"
  },
  "incomplete_details": {
    "reason": "max_output_tokens"
  },
  "instructions": "string",
  "max_output_tokens": 0,
  "max_tool_calls": 0,
  "metadata": {
    "foo": "string"
  },
  "previous_response_id": "previous_response_id",
  "prompt": {
    "id": "id",
    "variables": {
      "foo": "string"
    },
    "version": "version"
  },
  "prompt_cache_key": "prompt_cache_key",
  "prompt_cache_retention": "in-memory",
  "reasoning": {
    "effort": "none",
    "generate_summary": "auto",
    "summary": "auto"
  },
  "safety_identifier": "safety_identifier",
  "service_tier": "auto",
  "status": "completed",
  "temperature": 0,
  "text": {
    "format": {
      "type": "text"
    },
    "verbosity": "low"
  },
  "top_logprobs": 0,
  "top_p": 0,
  "truncation": "auto",
  "usage": {
    "input_tokens": 0,
    "input_tokens_details": {
      "cached_tokens": 0
    },
    "output_tokens": 0,
    "output_tokens_details": {
      "reasoning_tokens": 0
    },
    "total_tokens": 0
  },
  "user": "user"
}
```

## Domain Types

### Apply Patch Call

- `ApplyPatchCall object { call_id, operation, status, 2 more }`

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

  - `call_id: string`

  - `operation: object { diff, path, type }  or object { path, type }  or object { diff, path, type }`

    Instruction for creating a new file via the apply_patch tool.

    - `ApplyPatchCallOperationCreateFile object { diff, path, type }`

      Instruction for creating a new file via the apply_patch tool.

      - `diff: string`

      - `path: string`

      - `type: "create_file"`

        - `"create_file"`

    - `ApplyPatchCallOperationDeleteFile object { path, type }`

      Instruction for deleting an existing file via the apply_patch tool.

      - `path: string`

      - `type: "delete_file"`

        - `"delete_file"`

    - `ApplyPatchCallOperationUpdateFile object { diff, path, type }`

      Instruction for updating an existing file via the apply_patch tool.

      - `diff: string`

      - `path: string`

      - `type: "update_file"`

        - `"update_file"`

  - `status: "in_progress" or "completed"`

    - `"in_progress"`

    - `"completed"`

  - `type: "apply_patch_call"`

    - `"apply_patch_call"`

  - `id: optional string`

### Apply Patch Call Output

- `ApplyPatchCallOutput object { call_id, status, type, 2 more }`

  The streamed output emitted by an apply patch tool call.

  - `call_id: string`

  - `status: "completed" or "failed"`

    - `"completed"`

    - `"failed"`

  - `type: "apply_patch_call_output"`

    - `"apply_patch_call_output"`

  - `id: optional string`

  - `output: optional string`

### Apply Patch Tool

- `ApplyPatchTool object { type }`

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

  - `type: "apply_patch"`

    - `"apply_patch"`

### Computer Tool

- `ComputerTool object { display_height, display_width, environment, type }`

  A tool that controls a virtual computer.

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

  - `display_height: number`

  - `display_width: number`

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

    - `"windows"`

    - `"mac"`

    - `"linux"`

    - `"ubuntu"`

    - `"browser"`

  - `type: "computer_use_preview"`

    - `"computer_use_preview"`

### Container Network Policy Allowlist

- `ContainerNetworkPolicyAllowlist object { allowed_domains, type, domain_secrets }`

  - `allowed_domains: array of string`

  - `type: "allowlist"`

    - `"allowlist"`

  - `domain_secrets: optional array of object { domain, name, value }`

    - `domain: string`

    - `name: string`

    - `value: string`

### Container Network Policy Disabled

- `ContainerNetworkPolicyDisabled object { type }`

  - `type: "disabled"`

    - `"disabled"`

### Container Reference

- `ContainerReference object { container_id, type }`

  - `container_id: string`

  - `type: "container_reference"`

    - `"container_reference"`

### Container Reference Param

- `ContainerReferenceParam object { container_id, type }`

  - `container_id: string`

  - `type: "container_reference"`

    - `"container_reference"`

### Conversation

- `Conversation object { id }`

  The conversation that this response belonged to.

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

  - `id: string`

### Custom Tool

- `CustomTool object { name, type, description, format }`

  A custom tool that processes input using a specified format.

  Learn more about   [custom tools](https://platform.openai.com/docs/guides/function-calling#custom-tools)

  - `name: string`

  - `type: "custom"`

    - `"custom"`

  - `description: optional string`

  - `format: optional object { type }  or object { definition, syntax, type }`

    Unconstrained free-form text.

    - `Text object { type }`

      Unconstrained free-form text.

      - `type: "text"`

        - `"text"`

    - `Grammar object { definition, syntax, type }`

      A grammar defined by the user.

      - `definition: string`

      - `syntax: "lark" or "regex"`

        - `"lark"`

        - `"regex"`

      - `type: "grammar"`

        - `"grammar"`

### Easy Input Message

- `EasyInputMessage object { content, role, phase, type }`

  A message input to the model with a role indicating instruction following
  hierarchy. Instructions given with the `developer` or `system` role take
  precedence over instructions given with the `user` role. Messages with the
  `assistant` role are presumed to have been generated by the model in previous
  interactions.

  - `content: string or array of OpenAIResponseInputText or OpenAIResponseInputImage or OpenAIResponseInputFile`

    - `string`

    - `InputItems = array of OpenAIResponseInputText or OpenAIResponseInputImage or OpenAIResponseInputFile`

      - `OpenAIResponseInputText object { text, type }`

        A text input to the model.

        - `text: string`

        - `type: "input_text"`

          - `"input_text"`

      - `OpenAIResponseInputImage object { detail, type, file_id, image_url }`

        An image input to the model.

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

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

          - `"low"`

          - `"high"`

          - `"auto"`

        - `type: "input_image"`

          - `"input_image"`

        - `file_id: optional string`

        - `image_url: optional string`

      - `OpenAIResponseInputFile object { type, file_data, file_id, 2 more }`

        A file input to the model.

        - `type: "input_file"`

          - `"input_file"`

        - `file_data: optional string`

        - `file_id: optional string`

        - `file_url: optional string`

        - `filename: optional string`

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

    - `"user"`

    - `"assistant"`

    - `"system"`

    - `"developer"`

  - `phase: optional "commentary" or "final_answer"`

    - `"commentary"`

    - `"final_answer"`

  - `type: optional "message"`

    - `"message"`

### File Search Tool

- `FileSearchTool object { type, vector_store_ids, filters, 2 more }`

  A tool that searches for relevant content from uploaded files.

  Learn more about the [file search tool](https://platform.openai.com/docs/guides/tools-file-search).

  - `type: "file_search"`

    - `"file_search"`

  - `vector_store_ids: array of string`

  - `filters: optional object { key, type, value }  or object { filters, type }`

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

    - `ComparisonFilter object { key, type, value }`

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

      - `key: string`

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

        - `"eq"`

        - `"ne"`

        - `"gt"`

        - `"gte"`

        - `"lt"`

        - `"lte"`

      - `value: string or number or boolean or array of string or number`

        - `string`

        - `number`

        - `boolean`

        - `array of string or number`

          - `string`

          - `number`

    - `CompoundFilter object { filters, type }`

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

      - `filters: array of object { key, type, value }  or unknown`

        - `ComparisonFilter object { key, type, value }`

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

          - `key: string`

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

            - `"eq"`

            - `"ne"`

            - `"gt"`

            - `"gte"`

            - `"lt"`

            - `"lte"`

          - `value: string or number or boolean or array of string or number`

            - `string`

            - `number`

            - `boolean`

            - `array of string or number`

              - `string`

              - `number`

        - `unknown`

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

        - `"and"`

        - `"or"`

  - `max_num_results: optional number`

  - `ranking_options: optional object { hybrid_search, ranker, score_threshold }`

    Ranking options for search.

    - `hybrid_search: optional object { embedding_weight, text_weight }`

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

      - `embedding_weight: number`

      - `text_weight: number`

    - `ranker: optional "auto" or "default-2024-11-15"`

      - `"auto"`

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

    - `score_threshold: optional number`

### Function Shell Tool

- `FunctionShellTool object { type, environment }`

  A tool that allows the model to execute shell commands.

  - `type: "shell"`

    - `"shell"`

  - `environment: optional object { type, file_ids, memory_limit, 2 more }  or LocalEnvironment or ContainerReference`

    - `ContainerAuto object { type, file_ids, memory_limit, 2 more }`

      - `type: "container_auto"`

        - `"container_auto"`

      - `file_ids: optional array of string`

      - `memory_limit: optional "1g" or "4g" or "16g" or "64g"`

        - `"1g"`

        - `"4g"`

        - `"16g"`

        - `"64g"`

      - `network_policy: optional ContainerNetworkPolicyDisabled or ContainerNetworkPolicyAllowlist`

        - `ContainerNetworkPolicyDisabled object { type }`

          - `type: "disabled"`

            - `"disabled"`

        - `ContainerNetworkPolicyAllowlist object { allowed_domains, type, domain_secrets }`

          - `allowed_domains: array of string`

          - `type: "allowlist"`

            - `"allowlist"`

          - `domain_secrets: optional array of object { domain, name, value }`

            - `domain: string`

            - `name: string`

            - `value: string`

      - `skills: optional array of object { skill_id, type, version }  or object { description, name, source, type }`

        - `SkillReference object { skill_id, type, version }`

          - `skill_id: string`

          - `type: "skill_reference"`

            - `"skill_reference"`

          - `version: optional string`

        - `InlineSkill object { description, name, source, type }`

          - `description: string`

          - `name: string`

          - `source: object { data, media_type, type }`

            Inline skill payload

            - `data: string`

            - `media_type: "application/zip"`

              - `"application/zip"`

            - `type: "base64"`

              - `"base64"`

          - `type: "inline"`

            - `"inline"`

    - `LocalEnvironment object { type, skills }`

      - `type: "local"`

        - `"local"`

      - `skills: optional array of object { description, name, path }`

        - `description: string`

        - `name: string`

        - `path: string`

    - `ContainerReference object { container_id, type }`

      - `container_id: string`

      - `type: "container_reference"`

        - `"container_reference"`

### Function Tool

- `FunctionTool object { name, type, description, 2 more }`

  Defines a function in your own code the model can choose to call.

  Learn more about [function calling](https://platform.openai.com/docs/guides/function-calling).

  - `name: string`

  - `type: "function"`

    - `"function"`

  - `description: optional string`

  - `parameters: optional map[unknown]`

  - `strict: optional boolean`

### Incomplete Details

- `IncompleteDetails object { reason }`

  Details about why the response is incomplete.

  - `reason: optional "max_output_tokens" or "content_filter"`

    - `"max_output_tokens"`

    - `"content_filter"`

### Local Environment

- `LocalEnvironment object { type, skills }`

  - `type: "local"`

    - `"local"`

  - `skills: optional array of object { description, name, path }`

    - `description: string`

    - `name: string`

    - `path: string`

### Local Environment Param

- `LocalEnvironmentParam object { type, skills }`

  - `type: "local"`

    - `"local"`

  - `skills: optional array of object { description, name, path }`

    - `description: string`

    - `name: string`

    - `path: string`

### Mcp Approval Request

- `McpApprovalRequest object { id, arguments, name, 2 more }`

  A request for human approval of a tool invocation.

  - `id: string`

  - `arguments: string`

  - `name: string`

  - `server_label: string`

  - `type: "mcp_approval_request"`

    - `"mcp_approval_request"`

### OpenAI Response

- `OpenAIResponse object { id, created_at, model, 29 more }`

  - `id: string`

  - `created_at: number`

  - `model: "gpt-5.2" or "gpt-5.2-2025-12-11" or "gpt-5.2-chat-latest" or 83 more or string`

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

      - `"gpt-5.2"`

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

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

      - `"gpt-5.2-pro"`

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

      - `"gpt-5.1"`

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

      - `"gpt-5.1-codex"`

      - `"gpt-5.1-mini"`

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

      - `"gpt-5"`

      - `"gpt-5-mini"`

      - `"gpt-5-nano"`

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

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

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

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

      - `"gpt-4.1"`

      - `"gpt-4.1-mini"`

      - `"gpt-4.1-nano"`

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

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

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

      - `"o4-mini"`

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

      - `"o3"`

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

      - `"o3-mini"`

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

      - `"o1"`

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

      - `"o1-preview"`

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

      - `"o1-mini"`

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

      - `"gpt-4o"`

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

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

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

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

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

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

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

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

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

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

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

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

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

      - `"chatgpt-4o-latest"`

      - `"codex-mini-latest"`

      - `"gpt-4o-mini"`

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

      - `"gpt-4-turbo"`

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

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

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

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

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

      - `"gpt-4"`

      - `"gpt-4-0314"`

      - `"gpt-4-0613"`

      - `"gpt-4-32k"`

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

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

      - `"gpt-3.5-turbo"`

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

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

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

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

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

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

      - `"o1-pro"`

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

      - `"o3-pro"`

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

      - `"o3-deep-research"`

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

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

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

      - `"computer-use-preview"`

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

      - `"gpt-5-codex"`

      - `"gpt-5-pro"`

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

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

    - `string`

  - `object: "response"`

    - `"response"`

  - `output: array of OpenAIResponseOutputMessage or OpenAIResponseFileSearchToolCall or OpenAIResponseFunctionToolCall or 15 more`

    - `OpenAIResponseOutputMessage object { id, content, role, 3 more }`

      An output message from the model.

      - `id: string`

      - `content: array of OpenAIResponseOutputText or OpenAIResponseOutputRefusal`

        - `OpenAIResponseOutputText object { annotations, text, type, logprobs }`

          A text output from the model.

          - `annotations: array of object { file_id, filename, index, type }  or object { end_index, start_index, title, 2 more }  or object { container_id, end_index, file_id, 3 more }  or object { file_id, index, type }`

            - `AnnotationFileCitation object { file_id, filename, index, type }`

              A citation to a file.

              - `file_id: string`

              - `filename: string`

              - `index: number`

              - `type: "file_citation"`

                - `"file_citation"`

            - `OpenAITypesResponsesResponseOutputTextAnnotationURLCitation object { end_index, start_index, title, 2 more }`

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

              - `end_index: number`

              - `start_index: number`

              - `title: string`

              - `type: "url_citation"`

                - `"url_citation"`

              - `url: string`

            - `AnnotationContainerFileCitation object { container_id, end_index, file_id, 3 more }`

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

              - `container_id: string`

              - `end_index: number`

              - `file_id: string`

              - `filename: string`

              - `start_index: number`

              - `type: "container_file_citation"`

                - `"container_file_citation"`

            - `AnnotationFilePath object { file_id, index, type }`

              A path to a file.

              - `file_id: string`

              - `index: number`

              - `type: "file_path"`

                - `"file_path"`

          - `text: string`

          - `type: "output_text"`

            - `"output_text"`

          - `logprobs: optional array of object { token, bytes, logprob, top_logprobs }`

            - `token: string`

            - `bytes: array of number`

            - `logprob: number`

            - `top_logprobs: array of object { token, bytes, logprob }`

              - `token: string`

              - `bytes: array of number`

              - `logprob: number`

        - `OpenAIResponseOutputRefusal object { refusal, type }`

          A refusal from the model.

          - `refusal: string`

          - `type: "refusal"`

            - `"refusal"`

      - `role: "assistant"`

        - `"assistant"`

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

        - `"in_progress"`

        - `"completed"`

        - `"incomplete"`

      - `type: "message"`

        - `"message"`

      - `phase: optional "commentary" or "final_answer"`

        - `"commentary"`

        - `"final_answer"`

    - `OpenAIResponseFileSearchToolCall object { id, queries, status, 2 more }`

      The results of a file search tool call.

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

      - `id: string`

      - `queries: array of string`

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

        - `"in_progress"`

        - `"searching"`

        - `"completed"`

        - `"incomplete"`

        - `"failed"`

      - `type: "file_search_call"`

        - `"file_search_call"`

      - `results: optional array of object { attributes, file_id, filename, 2 more }`

        - `attributes: optional map[string or number or boolean]`

          - `string`

          - `number`

          - `boolean`

        - `file_id: optional string`

        - `filename: optional string`

        - `score: optional number`

        - `text: optional string`

    - `OpenAIResponseFunctionToolCall object { arguments, call_id, name, 3 more }`

      A tool call to run a function.

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

      - `arguments: string`

      - `call_id: string`

      - `name: string`

      - `type: "function_call"`

        - `"function_call"`

      - `id: optional string`

      - `status: optional "in_progress" or "completed" or "incomplete"`

        - `"in_progress"`

        - `"completed"`

        - `"incomplete"`

    - `OpenAIResponseFunctionWebSearch object { id, action, status, type }`

      The results of a web search tool call.

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

      - `id: string`

      - `action: object { query, type, queries, sources }  or object { type, url }  or object { pattern, type, url }`

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

        - `OpenAITypesResponsesResponseFunctionWebSearchActionSearch object { query, type, queries, sources }`

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

          - `query: string`

          - `type: "search"`

            - `"search"`

          - `queries: optional array of string`

          - `sources: optional array of object { type, url }`

            - `type: "url"`

              - `"url"`

            - `url: string`

        - `OpenAITypesResponsesResponseFunctionWebSearchActionOpenPage object { type, url }`

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

          - `type: "open_page"`

            - `"open_page"`

          - `url: optional string`

        - `ActionFind object { pattern, type, url }`

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

          - `pattern: string`

          - `type: "find_in_page"`

            - `"find_in_page"`

          - `url: string`

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

        - `"in_progress"`

        - `"searching"`

        - `"completed"`

        - `"failed"`

      - `type: "web_search_call"`

        - `"web_search_call"`

    - `OpenAIResponseComputerToolCall object { id, action, call_id, 3 more }`

      A tool call to a computer use tool.

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

      - `id: string`

      - `action: object { button, type, x, y }  or object { type, x, y }  or object { path, type }  or 6 more`

        A click action.

        - `ActionClick object { button, type, x, y }`

          A click action.

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

            - `"left"`

            - `"right"`

            - `"wheel"`

            - `"back"`

            - `"forward"`

          - `type: "click"`

            - `"click"`

          - `x: number`

          - `y: number`

        - `ActionDoubleClick object { type, x, y }`

          A double click action.

          - `type: "double_click"`

            - `"double_click"`

          - `x: number`

          - `y: number`

        - `ActionDrag object { path, type }`

          A drag action.

          - `path: array of object { x, y }`

            - `x: number`

            - `y: number`

          - `type: "drag"`

            - `"drag"`

        - `ActionKeypress object { keys, type }`

          A collection of keypresses the model would like to perform.

          - `keys: array of string`

          - `type: "keypress"`

            - `"keypress"`

        - `ActionMove object { type, x, y }`

          A mouse move action.

          - `type: "move"`

            - `"move"`

          - `x: number`

          - `y: number`

        - `ActionScreenshot object { type }`

          A screenshot action.

          - `type: "screenshot"`

            - `"screenshot"`

        - `ActionScroll object { scroll_x, scroll_y, type, 2 more }`

          A scroll action.

          - `scroll_x: number`

          - `scroll_y: number`

          - `type: "scroll"`

            - `"scroll"`

          - `x: number`

          - `y: number`

        - `ActionType object { text, type }`

          An action to type in text.

          - `text: string`

          - `type: "type"`

            - `"type"`

        - `ActionWait object { type }`

          A wait action.

          - `type: "wait"`

            - `"wait"`

      - `call_id: string`

      - `pending_safety_checks: array of object { id, code, message }`

        - `id: string`

        - `code: optional string`

        - `message: optional string`

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

        - `"in_progress"`

        - `"completed"`

        - `"incomplete"`

      - `type: "computer_call"`

        - `"computer_call"`

    - `OpenAIResponseReasoningItem object { id, summary, type, 3 more }`

      A description of the chain of thought used by a reasoning model while generating
      a response. Be sure to include these items in your `input` to the Responses API
      for subsequent turns of a conversation if you are manually
      [managing context](https://platform.openai.com/docs/guides/conversation-state).

      - `id: string`

      - `summary: array of object { text, type }`

        - `text: string`

        - `type: "summary_text"`

          - `"summary_text"`

      - `type: "reasoning"`

        - `"reasoning"`

      - `content: optional array of object { text, type }`

        - `text: string`

        - `type: "reasoning_text"`

          - `"reasoning_text"`

      - `encrypted_content: optional string`

      - `status: optional "in_progress" or "completed" or "incomplete"`

        - `"in_progress"`

        - `"completed"`

        - `"incomplete"`

    - `ResponseCompactionItem object { id, encrypted_content, type, created_by }`

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

      - `id: string`

      - `encrypted_content: string`

      - `type: "compaction"`

        - `"compaction"`

      - `created_by: optional string`

    - `OpenAITypesResponsesResponseOutputItemImageGenerationCall object { id, status, type, result }`

      An image generation request made by the model.

      - `id: string`

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

        - `"in_progress"`

        - `"completed"`

        - `"generating"`

        - `"failed"`

      - `type: "image_generation_call"`

        - `"image_generation_call"`

      - `result: optional string`

    - `OpenAIResponseCodeInterpreterToolCall object { id, container_id, status, 3 more }`

      A tool call to run code.

      - `id: string`

      - `container_id: string`

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

        - `"in_progress"`

        - `"completed"`

        - `"incomplete"`

        - `"interpreting"`

        - `"failed"`

      - `type: "code_interpreter_call"`

        - `"code_interpreter_call"`

      - `code: optional string`

      - `outputs: optional array of object { logs, type }  or object { type, url }`

        - `OutputLogs object { logs, type }`

          The logs output from the code interpreter.

          - `logs: string`

          - `type: "logs"`

            - `"logs"`

        - `OutputImage object { type, url }`

          The image output from the code interpreter.

          - `type: "image"`

            - `"image"`

          - `url: string`

    - `OpenAITypesResponsesResponseOutputItemLocalShellCall object { id, action, call_id, 2 more }`

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

      - `id: string`

      - `action: object { command, env, type, 3 more }`

        Execute a shell command on the server.

        - `command: array of string`

        - `env: map[string]`

        - `type: "exec"`

          - `"exec"`

        - `timeout_ms: optional number`

        - `user: optional string`

        - `working_directory: optional string`

      - `call_id: string`

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

        - `"in_progress"`

        - `"completed"`

        - `"incomplete"`

      - `type: "local_shell_call"`

        - `"local_shell_call"`

    - `ResponseFunctionShellToolCall object { id, action, call_id, 4 more }`

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

      - `id: string`

      - `action: object { commands, max_output_length, timeout_ms }`

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

        - `commands: array of string`

        - `max_output_length: optional number`

        - `timeout_ms: optional number`

      - `call_id: string`

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

        - `"in_progress"`

        - `"completed"`

        - `"incomplete"`

      - `type: "shell_call"`

        - `"shell_call"`

      - `created_by: optional string`

      - `environment: optional object { type }  or object { container_id, type }`

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

        - `ResponseLocalEnvironment object { type }`

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

          - `type: "local"`

            - `"local"`

        - `ResponseContainerReference object { container_id, type }`

          Represents a container created with /v1/containers.

          - `container_id: string`

          - `type: "container_reference"`

            - `"container_reference"`

    - `ResponseFunctionShellToolCallOutput object { id, call_id, output, 4 more }`

      The output of a shell tool call that was emitted.

      - `id: string`

      - `call_id: string`

      - `output: array of object { outcome, stderr, stdout, created_by }`

        - `outcome: object { type }  or object { exit_code, type }`

          Indicates that the shell call exceeded its configured time limit.

          - `OutputOutcomeTimeout object { type }`

            Indicates that the shell call exceeded its configured time limit.

            - `type: "timeout"`

              - `"timeout"`

          - `OutputOutcomeExit object { exit_code, type }`

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

            - `exit_code: number`

            - `type: "exit"`

              - `"exit"`

        - `stderr: string`

        - `stdout: string`

        - `created_by: optional string`

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

        - `"in_progress"`

        - `"completed"`

        - `"incomplete"`

      - `type: "shell_call_output"`

        - `"shell_call_output"`

      - `created_by: optional string`

      - `max_output_length: optional number`

    - `ResponseApplyPatchToolCall object { id, call_id, operation, 3 more }`

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

      - `id: string`

      - `call_id: string`

      - `operation: object { diff, path, type }  or object { path, type }  or object { diff, path, type }`

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

        - `OperationCreateFile object { diff, path, type }`

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

          - `diff: string`

          - `path: string`

          - `type: "create_file"`

            - `"create_file"`

        - `OperationDeleteFile object { path, type }`

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

          - `path: string`

          - `type: "delete_file"`

            - `"delete_file"`

        - `OperationUpdateFile object { diff, path, type }`

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

          - `diff: string`

          - `path: string`

          - `type: "update_file"`

            - `"update_file"`

      - `status: "in_progress" or "completed"`

        - `"in_progress"`

        - `"completed"`

      - `type: "apply_patch_call"`

        - `"apply_patch_call"`

      - `created_by: optional string`

    - `ResponseApplyPatchToolCallOutput object { id, call_id, status, 3 more }`

      The output emitted by an apply patch tool call.

      - `id: string`

      - `call_id: string`

      - `status: "completed" or "failed"`

        - `"completed"`

        - `"failed"`

      - `type: "apply_patch_call_output"`

        - `"apply_patch_call_output"`

      - `created_by: optional string`

      - `output: optional string`

    - `OpenAITypesResponsesResponseOutputItemMcpCall object { id, arguments, name, 6 more }`

      An invocation of a tool on an MCP server.

      - `id: string`

      - `arguments: string`

      - `name: string`

      - `server_label: string`

      - `type: "mcp_call"`

        - `"mcp_call"`

      - `approval_request_id: optional string`

      - `error: optional string`

      - `output: optional string`

      - `status: optional "in_progress" or "completed" or "incomplete" or 2 more`

        - `"in_progress"`

        - `"completed"`

        - `"incomplete"`

        - `"calling"`

        - `"failed"`

    - `OpenAITypesResponsesResponseOutputItemMcpListTools object { id, server_label, tools, 2 more }`

      A list of tools available on an MCP server.

      - `id: string`

      - `server_label: string`

      - `tools: array of object { input_schema, name, annotations, description }`

        - `input_schema: unknown`

        - `name: string`

        - `annotations: optional unknown`

        - `description: optional string`

      - `type: "mcp_list_tools"`

        - `"mcp_list_tools"`

      - `error: optional string`

    - `McpApprovalRequest object { id, arguments, name, 2 more }`

      A request for human approval of a tool invocation.

      - `id: string`

      - `arguments: string`

      - `name: string`

      - `server_label: string`

      - `type: "mcp_approval_request"`

        - `"mcp_approval_request"`

    - `OpenAIResponseCustomToolCall object { call_id, input, name, 2 more }`

      A call to a custom tool created by the model.

      - `call_id: string`

      - `input: string`

      - `name: string`

      - `type: "custom_tool_call"`

        - `"custom_tool_call"`

      - `id: optional string`

  - `parallel_tool_calls: boolean`

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

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

    - `"none" or "auto" or "required"`

      - `"none"`

      - `"auto"`

      - `"required"`

    - `ToolChoiceAllowed object { mode, tools, type }`

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

      - `mode: "auto" or "required"`

        - `"auto"`

        - `"required"`

      - `tools: array of map[unknown]`

      - `type: "allowed_tools"`

        - `"allowed_tools"`

    - `ToolChoiceTypes object { type }`

      Indicates that the model should use a built-in tool to generate a response.
      [Learn more about built-in tools](https://platform.openai.com/docs/guides/tools).

      - `type: "file_search" or "web_search_preview" or "computer_use_preview" or 3 more`

        - `"file_search"`

        - `"web_search_preview"`

        - `"computer_use_preview"`

        - `"web_search_preview_2025_03_11"`

        - `"image_generation"`

        - `"code_interpreter"`

    - `ToolChoiceFunction object { name, type }`

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

      - `name: string`

      - `type: "function"`

        - `"function"`

    - `ToolChoiceMcp object { server_label, type, name }`

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

      - `server_label: string`

      - `type: "mcp"`

        - `"mcp"`

      - `name: optional string`

    - `ToolChoiceCustom object { name, type }`

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

      - `name: string`

      - `type: "custom"`

        - `"custom"`

    - `ToolChoiceApplyPatch object { type }`

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

      - `type: "apply_patch"`

        - `"apply_patch"`

    - `ToolChoiceShell object { type }`

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

      - `type: "shell"`

        - `"shell"`

  - `tools: array of FunctionTool or FileSearchTool or ComputerTool or 9 more`

    - `FunctionTool object { name, type, description, 2 more }`

      Defines a function in your own code the model can choose to call.

      Learn more about [function calling](https://platform.openai.com/docs/guides/function-calling).

      - `name: string`

      - `type: "function"`

        - `"function"`

      - `description: optional string`

      - `parameters: optional map[unknown]`

      - `strict: optional boolean`

    - `FileSearchTool object { type, vector_store_ids, filters, 2 more }`

      A tool that searches for relevant content from uploaded files.

      Learn more about the [file search tool](https://platform.openai.com/docs/guides/tools-file-search).

      - `type: "file_search"`

        - `"file_search"`

      - `vector_store_ids: array of string`

      - `filters: optional object { key, type, value }  or object { filters, type }`

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

        - `ComparisonFilter object { key, type, value }`

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

          - `key: string`

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

            - `"eq"`

            - `"ne"`

            - `"gt"`

            - `"gte"`

            - `"lt"`

            - `"lte"`

          - `value: string or number or boolean or array of string or number`

            - `string`

            - `number`

            - `boolean`

            - `array of string or number`

              - `string`

              - `number`

        - `CompoundFilter object { filters, type }`

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

          - `filters: array of object { key, type, value }  or unknown`

            - `ComparisonFilter object { key, type, value }`

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

              - `key: string`

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

                - `"eq"`

                - `"ne"`

                - `"gt"`

                - `"gte"`

                - `"lt"`

                - `"lte"`

              - `value: string or number or boolean or array of string or number`

                - `string`

                - `number`

                - `boolean`

                - `array of string or number`

                  - `string`

                  - `number`

            - `unknown`

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

            - `"and"`

            - `"or"`

      - `max_num_results: optional number`

      - `ranking_options: optional object { hybrid_search, ranker, score_threshold }`

        Ranking options for search.

        - `hybrid_search: optional object { embedding_weight, text_weight }`

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

          - `embedding_weight: number`

          - `text_weight: number`

        - `ranker: optional "auto" or "default-2024-11-15"`

          - `"auto"`

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

        - `score_threshold: optional number`

    - `ComputerTool object { display_height, display_width, environment, type }`

      A tool that controls a virtual computer.

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

      - `display_height: number`

      - `display_width: number`

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

        - `"windows"`

        - `"mac"`

        - `"linux"`

        - `"ubuntu"`

        - `"browser"`

      - `type: "computer_use_preview"`

        - `"computer_use_preview"`

    - `WebSearchTool object { type, filters, search_context_size, user_location }`

      Search the Internet for sources related to the prompt.

      Learn more about the
      [web search tool](https://platform.openai.com/docs/guides/tools-web-search).

      - `type: "web_search" or "web_search_2025_08_26"`

        - `"web_search"`

        - `"web_search_2025_08_26"`

      - `filters: optional object { allowed_domains }`

        Filters for the search.

        - `allowed_domains: optional array of string`

      - `search_context_size: optional "low" or "medium" or "high"`

        - `"low"`

        - `"medium"`

        - `"high"`

      - `user_location: optional object { city, country, region, 2 more }`

        The approximate location of the user.

        - `city: optional string`

        - `country: optional string`

        - `region: optional string`

        - `timezone: optional string`

        - `type: optional "approximate"`

          - `"approximate"`

    - `Mcp object { server_label, type, allowed_tools, 6 more }`

      Give the model access to additional tools via remote Model Context Protocol
      (MCP) servers. [Learn more about MCP](https://platform.openai.com/docs/guides/tools-remote-mcp).

      - `server_label: string`

      - `type: "mcp"`

        - `"mcp"`

      - `allowed_tools: optional array of string or object { read_only, tool_names }`

        A filter object to specify which tools are allowed.

        - `array of string`

        - `McpAllowedToolsMcpToolFilter object { read_only, tool_names }`

          A filter object to specify which tools are allowed.

          - `read_only: optional boolean`

          - `tool_names: optional array of string`

      - `authorization: optional string`

      - `connector_id: optional "connector_dropbox" or "connector_gmail" or "connector_googlecalendar" or 5 more`

        - `"connector_dropbox"`

        - `"connector_gmail"`

        - `"connector_googlecalendar"`

        - `"connector_googledrive"`

        - `"connector_microsoftteams"`

        - `"connector_outlookcalendar"`

        - `"connector_outlookemail"`

        - `"connector_sharepoint"`

      - `headers: optional map[string]`

      - `require_approval: optional object { always, never }  or "always" or "never"`

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

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

        - `McpRequireApprovalMcpToolApprovalFilter object { always, never }`

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

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

          - `always: optional object { read_only, tool_names }`

            A filter object to specify which tools are allowed.

            - `read_only: optional boolean`

            - `tool_names: optional array of string`

          - `never: optional object { read_only, tool_names }`

            A filter object to specify which tools are allowed.

            - `read_only: optional boolean`

            - `tool_names: optional array of string`

        - `"always" or "never"`

          - `"always"`

          - `"never"`

      - `server_description: optional string`

      - `server_url: optional string`

    - `CodeInterpreter object { container, type }`

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

      - `container: string or object { type, file_ids, memory_limit, network_policy }`

        Configuration for a code interpreter container.

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

        - `string`

        - `CodeInterpreterContainerCodeInterpreterToolAuto object { type, file_ids, memory_limit, network_policy }`

          Configuration for a code interpreter container.

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

          - `type: "auto"`

            - `"auto"`

          - `file_ids: optional array of string`

          - `memory_limit: optional "1g" or "4g" or "16g" or "64g"`

            - `"1g"`

            - `"4g"`

            - `"16g"`

            - `"64g"`

          - `network_policy: optional ContainerNetworkPolicyDisabled or ContainerNetworkPolicyAllowlist`

            - `ContainerNetworkPolicyDisabled object { type }`

              - `type: "disabled"`

                - `"disabled"`

            - `ContainerNetworkPolicyAllowlist object { allowed_domains, type, domain_secrets }`

              - `allowed_domains: array of string`

              - `type: "allowlist"`

                - `"allowlist"`

              - `domain_secrets: optional array of object { domain, name, value }`

                - `domain: string`

                - `name: string`

                - `value: string`

      - `type: "code_interpreter"`

        - `"code_interpreter"`

    - `ImageGeneration object { type, action, background, 9 more }`

      A tool that generates images using the GPT image models.

      - `type: "image_generation"`

        - `"image_generation"`

      - `action: optional "generate" or "edit" or "auto"`

        - `"generate"`

        - `"edit"`

        - `"auto"`

      - `background: optional "transparent" or "opaque" or "auto"`

        - `"transparent"`

        - `"opaque"`

        - `"auto"`

      - `input_fidelity: optional "high" or "low"`

        - `"high"`

        - `"low"`

      - `input_image_mask: optional object { file_id, image_url }`

        Optional mask for inpainting.

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

        - `file_id: optional string`

        - `image_url: optional string`

      - `model: optional string or "gpt-image-1" or "gpt-image-1-mini" or "gpt-image-1.5"`

        - `string`

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

          - `"gpt-image-1"`

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

          - `"gpt-image-1.5"`

      - `moderation: optional "auto" or "low"`

        - `"auto"`

        - `"low"`

      - `output_compression: optional number`

      - `output_format: optional "png" or "webp" or "jpeg"`

        - `"png"`

        - `"webp"`

        - `"jpeg"`

      - `partial_images: optional number`

      - `quality: optional "low" or "medium" or "high" or "auto"`

        - `"low"`

        - `"medium"`

        - `"high"`

        - `"auto"`

      - `size: optional "1024x1024" or "1024x1536" or "1536x1024" or "auto"`

        - `"1024x1024"`

        - `"1024x1536"`

        - `"1536x1024"`

        - `"auto"`

    - `LocalShell object { type }`

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

      - `type: "local_shell"`

        - `"local_shell"`

    - `FunctionShellTool object { type, environment }`

      A tool that allows the model to execute shell commands.

      - `type: "shell"`

        - `"shell"`

      - `environment: optional object { type, file_ids, memory_limit, 2 more }  or LocalEnvironment or ContainerReference`

        - `ContainerAuto object { type, file_ids, memory_limit, 2 more }`

          - `type: "container_auto"`

            - `"container_auto"`

          - `file_ids: optional array of string`

          - `memory_limit: optional "1g" or "4g" or "16g" or "64g"`

            - `"1g"`

            - `"4g"`

            - `"16g"`

            - `"64g"`

          - `network_policy: optional ContainerNetworkPolicyDisabled or ContainerNetworkPolicyAllowlist`

            - `ContainerNetworkPolicyDisabled object { type }`

            - `ContainerNetworkPolicyAllowlist object { allowed_domains, type, domain_secrets }`

          - `skills: optional array of object { skill_id, type, version }  or object { description, name, source, type }`

            - `SkillReference object { skill_id, type, version }`

              - `skill_id: string`

              - `type: "skill_reference"`

                - `"skill_reference"`

              - `version: optional string`

            - `InlineSkill object { description, name, source, type }`

              - `description: string`

              - `name: string`

              - `source: object { data, media_type, type }`

                Inline skill payload

                - `data: string`

                - `media_type: "application/zip"`

                  - `"application/zip"`

                - `type: "base64"`

                  - `"base64"`

              - `type: "inline"`

                - `"inline"`

        - `LocalEnvironment object { type, skills }`

          - `type: "local"`

            - `"local"`

          - `skills: optional array of object { description, name, path }`

            - `description: string`

            - `name: string`

            - `path: string`

        - `ContainerReference object { container_id, type }`

          - `container_id: string`

          - `type: "container_reference"`

            - `"container_reference"`

    - `CustomTool object { name, type, description, format }`

      A custom tool that processes input using a specified format.

      Learn more about   [custom tools](https://platform.openai.com/docs/guides/function-calling#custom-tools)

      - `name: string`

      - `type: "custom"`

        - `"custom"`

      - `description: optional string`

      - `format: optional object { type }  or object { definition, syntax, type }`

        Unconstrained free-form text.

        - `Text object { type }`

          Unconstrained free-form text.

          - `type: "text"`

            - `"text"`

        - `Grammar object { definition, syntax, type }`

          A grammar defined by the user.

          - `definition: string`

          - `syntax: "lark" or "regex"`

            - `"lark"`

            - `"regex"`

          - `type: "grammar"`

            - `"grammar"`

    - `WebSearchPreviewTool object { type, search_context_size, user_location }`

      This tool searches the web for relevant results to use in a response.

      Learn more about the [web search tool](https://platform.openai.com/docs/guides/tools-web-search).

      - `type: "web_search_preview" or "web_search_preview_2025_03_11"`

        - `"web_search_preview"`

        - `"web_search_preview_2025_03_11"`

      - `search_context_size: optional "low" or "medium" or "high"`

        - `"low"`

        - `"medium"`

        - `"high"`

      - `user_location: optional object { type, city, country, 2 more }`

        The user's location.

        - `type: "approximate"`

          - `"approximate"`

        - `city: optional string`

        - `country: optional string`

        - `region: optional string`

        - `timezone: optional string`

    - `ApplyPatchTool object { type }`

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

      - `type: "apply_patch"`

        - `"apply_patch"`

  - `background: optional boolean`

  - `completed_at: optional number`

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

  - `error: optional OpenAIResponseError`

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

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

      - `"server_error"`

      - `"rate_limit_exceeded"`

      - `"invalid_prompt"`

      - `"vector_store_timeout"`

      - `"invalid_image"`

      - `"invalid_image_format"`

      - `"invalid_base64_image"`

      - `"invalid_image_url"`

      - `"image_too_large"`

      - `"image_too_small"`

      - `"image_parse_error"`

      - `"image_content_policy_violation"`

      - `"invalid_image_mode"`

      - `"image_file_too_large"`

      - `"unsupported_image_media_type"`

      - `"empty_image_file"`

      - `"failed_to_download_image"`

      - `"image_file_not_found"`

    - `message: string`

  - `incomplete_details: optional IncompleteDetails`

    Details about why the response is incomplete.

    - `reason: optional "max_output_tokens" or "content_filter"`

      - `"max_output_tokens"`

      - `"content_filter"`

  - `instructions: optional string or array of EasyInputMessage or OpenAITypesResponsesResponseInputItemMessage or OpenAIResponseOutputMessage or 23 more`

    - `string`

    - `InputItems = array of EasyInputMessage or OpenAITypesResponsesResponseInputItemMessage or OpenAIResponseOutputMessage or 23 more`

      - `EasyInputMessage object { content, role, phase, type }`

        A message input to the model with a role indicating instruction following
        hierarchy. Instructions given with the `developer` or `system` role take
        precedence over instructions given with the `user` role. Messages with the
        `assistant` role are presumed to have been generated by the model in previous
        interactions.

        - `content: string or array of OpenAIResponseInputText or OpenAIResponseInputImage or OpenAIResponseInputFile`

          - `string`

          - `InputItems = array of OpenAIResponseInputText or OpenAIResponseInputImage or OpenAIResponseInputFile`

            - `OpenAIResponseInputText object { text, type }`

              A text input to the model.

              - `text: string`

              - `type: "input_text"`

                - `"input_text"`

            - `OpenAIResponseInputImage object { detail, type, file_id, image_url }`

              An image input to the model.

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

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

                - `"low"`

                - `"high"`

                - `"auto"`

              - `type: "input_image"`

                - `"input_image"`

              - `file_id: optional string`

              - `image_url: optional string`

            - `OpenAIResponseInputFile object { type, file_data, file_id, 2 more }`

              A file input to the model.

              - `type: "input_file"`

                - `"input_file"`

              - `file_data: optional string`

              - `file_id: optional string`

              - `file_url: optional string`

              - `filename: optional string`

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

          - `"user"`

          - `"assistant"`

          - `"system"`

          - `"developer"`

        - `phase: optional "commentary" or "final_answer"`

          - `"commentary"`

          - `"final_answer"`

        - `type: optional "message"`

          - `"message"`

      - `OpenAITypesResponsesResponseInputItemMessage object { content, role, status, type }`

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

        - `content: array of OpenAIResponseInputText or OpenAIResponseInputImage or OpenAIResponseInputFile`

          - `OpenAIResponseInputText object { text, type }`

            A text input to the model.

          - `OpenAIResponseInputImage object { detail, type, file_id, image_url }`

            An image input to the model.

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

          - `OpenAIResponseInputFile object { type, file_data, file_id, 2 more }`

            A file input to the model.

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

          - `"user"`

          - `"system"`

          - `"developer"`

        - `status: optional "in_progress" or "completed" or "incomplete"`

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

        - `type: optional "message"`

          - `"message"`

      - `OpenAIResponseOutputMessage object { id, content, role, 3 more }`

        An output message from the model.

      - `OpenAIResponseFileSearchToolCall object { id, queries, status, 2 more }`

        The results of a file search tool call.

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

      - `OpenAIResponseComputerToolCall object { id, action, call_id, 3 more }`

        A tool call to a computer use tool.

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

      - `OpenAITypesResponsesResponseInputItemComputerCallOutput object { call_id, output, type, 3 more }`

        The output of a computer tool call.

        - `call_id: string`

        - `output: ResponseComputerToolCallOutputScreenshot`

          A computer screenshot image used with the computer use tool.

          - `type: "computer_screenshot"`

            - `"computer_screenshot"`

          - `file_id: optional string`

          - `image_url: optional string`

        - `type: "computer_call_output"`

          - `"computer_call_output"`

        - `id: optional string`

        - `acknowledged_safety_checks: optional array of object { id, code, message }`

          - `id: string`

          - `code: optional string`

          - `message: optional string`

        - `status: optional "in_progress" or "completed" or "incomplete"`

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

      - `OpenAIResponseFunctionWebSearch object { id, action, status, type }`

        The results of a web search tool call.

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

      - `OpenAIResponseFunctionToolCall object { arguments, call_id, name, 3 more }`

        A tool call to run a function.

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

      - `OpenAITypesResponsesResponseInputItemFunctionCallOutput object { call_id, output, type, 2 more }`

        The output of a function tool call.

        - `call_id: string`

        - `output: string or array of object { text, type }  or object { type, detail, file_id, image_url }  or object { type, file_data, file_id, 2 more }`

          - `string`

          - `OutputContentList = array of object { text, type }  or object { type, detail, file_id, image_url }  or object { type, file_data, file_id, 2 more }`

            - `ResponseInputTextContent object { text, type }`

              A text input to the model.

              - `text: string`

              - `type: "input_text"`

                - `"input_text"`

            - `ResponseInputImageContent object { type, detail, file_id, image_url }`

              An image input to the model.

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

              - `type: "input_image"`

                - `"input_image"`

              - `detail: optional "low" or "high" or "auto"`

                - `"low"`

                - `"high"`

                - `"auto"`

              - `file_id: optional string`

              - `image_url: optional string`

            - `ResponseInputFileContent object { type, file_data, file_id, 2 more }`

              A file input to the model.

              - `type: "input_file"`

                - `"input_file"`

              - `file_data: optional string`

              - `file_id: optional string`

              - `file_url: optional string`

              - `filename: optional string`

        - `type: "function_call_output"`

          - `"function_call_output"`

        - `id: optional string`

        - `status: optional "in_progress" or "completed" or "incomplete"`

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

      - `OpenAIResponseReasoningItem object { id, summary, type, 3 more }`

        A description of the chain of thought used by a reasoning model while generating
        a response. Be sure to include these items in your `input` to the Responses API
        for subsequent turns of a conversation if you are manually
        [managing context](https://platform.openai.com/docs/guides/conversation-state).

      - `ResponseCompactionItemParam object { encrypted_content, type, id }`

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

        - `encrypted_content: string`

        - `type: "compaction"`

          - `"compaction"`

        - `id: optional string`

      - `OpenAITypesResponsesResponseInputItemImageGenerationCall object { id, status, type, result }`

        An image generation request made by the model.

        - `id: string`

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

          - `"in_progress"`

          - `"completed"`

          - `"generating"`

          - `"failed"`

        - `type: "image_generation_call"`

          - `"image_generation_call"`

        - `result: optional string`

      - `OpenAIResponseCodeInterpreterToolCall object { id, container_id, status, 3 more }`

        A tool call to run code.

      - `OpenAITypesResponsesResponseInputItemLocalShellCall object { id, action, call_id, 2 more }`

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

        - `id: string`

        - `action: object { command, env, type, 3 more }`

          Execute a shell command on the server.

          - `command: array of string`

          - `env: map[string]`

          - `type: "exec"`

            - `"exec"`

          - `timeout_ms: optional number`

          - `user: optional string`

          - `working_directory: optional string`

        - `call_id: string`

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

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

        - `type: "local_shell_call"`

          - `"local_shell_call"`

      - `OpenAITypesResponsesResponseInputItemLocalShellCallOutput object { id, output, type, status }`

        The output of a local shell tool call.

        - `id: string`

        - `output: string`

        - `type: "local_shell_call_output"`

          - `"local_shell_call_output"`

        - `status: optional "in_progress" or "completed" or "incomplete"`

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

      - `ShellCall object { action, call_id, type, 3 more }`

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

        - `action: object { commands, max_output_length, timeout_ms }`

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

          - `commands: array of string`

          - `max_output_length: optional number`

          - `timeout_ms: optional number`

        - `call_id: string`

        - `type: "shell_call"`

          - `"shell_call"`

        - `id: optional string`

        - `environment: optional LocalEnvironment or ContainerReference`

          - `LocalEnvironment object { type, skills }`

          - `ContainerReference object { container_id, type }`

        - `status: optional "in_progress" or "completed" or "incomplete"`

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

      - `ShellCallOutput object { call_id, output, type, 3 more }`

        The streamed output items emitted by a shell tool call.

        - `call_id: string`

        - `output: array of object { outcome, stderr, stdout }`

          - `outcome: object { type }  or object { exit_code, type }`

            Indicates that the shell call exceeded its configured time limit.

            - `OutcomeTimeout object { type }`

              Indicates that the shell call exceeded its configured time limit.

              - `type: "timeout"`

                - `"timeout"`

            - `OutcomeExit object { exit_code, type }`

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

              - `exit_code: number`

              - `type: "exit"`

                - `"exit"`

          - `stderr: string`

          - `stdout: string`

        - `type: "shell_call_output"`

          - `"shell_call_output"`

        - `id: optional string`

        - `max_output_length: optional number`

        - `status: optional "in_progress" or "completed" or "incomplete"`

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

      - `ApplyPatchCall object { call_id, operation, status, 2 more }`

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

        - `call_id: string`

        - `operation: object { diff, path, type }  or object { path, type }  or object { diff, path, type }`

          Instruction for creating a new file via the apply_patch tool.

          - `ApplyPatchCallOperationCreateFile object { diff, path, type }`

            Instruction for creating a new file via the apply_patch tool.

            - `diff: string`

            - `path: string`

            - `type: "create_file"`

              - `"create_file"`

          - `ApplyPatchCallOperationDeleteFile object { path, type }`

            Instruction for deleting an existing file via the apply_patch tool.

            - `path: string`

            - `type: "delete_file"`

              - `"delete_file"`

          - `ApplyPatchCallOperationUpdateFile object { diff, path, type }`

            Instruction for updating an existing file via the apply_patch tool.

            - `diff: string`

            - `path: string`

            - `type: "update_file"`

              - `"update_file"`

        - `status: "in_progress" or "completed"`

          - `"in_progress"`

          - `"completed"`

        - `type: "apply_patch_call"`

          - `"apply_patch_call"`

        - `id: optional string`

      - `ApplyPatchCallOutput object { call_id, status, type, 2 more }`

        The streamed output emitted by an apply patch tool call.

        - `call_id: string`

        - `status: "completed" or "failed"`

          - `"completed"`

          - `"failed"`

        - `type: "apply_patch_call_output"`

          - `"apply_patch_call_output"`

        - `id: optional string`

        - `output: optional string`

      - `OpenAITypesResponsesResponseInputItemMcpListTools object { id, server_label, tools, 2 more }`

        A list of tools available on an MCP server.

        - `id: string`

        - `server_label: string`

        - `tools: array of object { input_schema, name, annotations, description }`

          - `input_schema: unknown`

          - `name: string`

          - `annotations: optional unknown`

          - `description: optional string`

        - `type: "mcp_list_tools"`

          - `"mcp_list_tools"`

        - `error: optional string`

      - `McpApprovalRequest object { id, arguments, name, 2 more }`

        A request for human approval of a tool invocation.

      - `OpenAITypesResponsesResponseInputItemMcpApprovalResponse object { approval_request_id, approve, type, 2 more }`

        A response to an MCP approval request.

        - `approval_request_id: string`

        - `approve: boolean`

        - `type: "mcp_approval_response"`

          - `"mcp_approval_response"`

        - `id: optional string`

        - `reason: optional string`

      - `OpenAITypesResponsesResponseInputItemMcpCall object { id, arguments, name, 6 more }`

        An invocation of a tool on an MCP server.

        - `id: string`

        - `arguments: string`

        - `name: string`

        - `server_label: string`

        - `type: "mcp_call"`

          - `"mcp_call"`

        - `approval_request_id: optional string`

        - `error: optional string`

        - `output: optional string`

        - `status: optional "in_progress" or "completed" or "incomplete" or 2 more`

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

          - `"calling"`

          - `"failed"`

      - `OpenAIResponseCustomToolCallOutput object { call_id, output, type, id }`

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

        - `call_id: string`

        - `output: string or array of OpenAIResponseInputText or OpenAIResponseInputImage or OpenAIResponseInputFile`

          - `string`

          - `OutputContentList = array of OpenAIResponseInputText or OpenAIResponseInputImage or OpenAIResponseInputFile`

            - `OpenAIResponseInputText object { text, type }`

              A text input to the model.

            - `OpenAIResponseInputImage object { detail, type, file_id, image_url }`

              An image input to the model.

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

            - `OpenAIResponseInputFile object { type, file_data, file_id, 2 more }`

              A file input to the model.

        - `type: "custom_tool_call_output"`

          - `"custom_tool_call_output"`

        - `id: optional string`

      - `OpenAIResponseCustomToolCall object { call_id, input, name, 2 more }`

        A call to a custom tool created by the model.

      - `OpenAITypesResponsesResponseInputItemItemReference object { id, type }`

        An internal identifier for an item to reference.

        - `id: string`

        - `type: optional "item_reference"`

          - `"item_reference"`

  - `max_output_tokens: optional number`

  - `max_tool_calls: optional number`

  - `metadata: optional map[string]`

  - `previous_response_id: optional string`

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

    - `variables: optional map[string or OpenAIResponseInputText or OpenAIResponseInputImage or OpenAIResponseInputFile]`

      - `string`

      - `OpenAIResponseInputText object { text, type }`

        A text input to the model.

      - `OpenAIResponseInputImage object { detail, type, file_id, image_url }`

        An image input to the model.

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

      - `OpenAIResponseInputFile object { type, file_data, file_id, 2 more }`

        A file input to the model.

    - `version: optional string`

  - `prompt_cache_key: optional string`

  - `prompt_cache_retention: optional "in-memory" or "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 "none" or "minimal" or "low" or 3 more`

      - `"none"`

      - `"minimal"`

      - `"low"`

      - `"medium"`

      - `"high"`

      - `"xhigh"`

    - `generate_summary: optional "auto" or "concise" or "detailed"`

      - `"auto"`

      - `"concise"`

      - `"detailed"`

    - `summary: optional "auto" or "concise" or "detailed"`

      - `"auto"`

      - `"concise"`

      - `"detailed"`

  - `safety_identifier: optional string`

  - `service_tier: optional "auto" or "default" or "flex" or 2 more`

    - `"auto"`

    - `"default"`

    - `"flex"`

    - `"scale"`

    - `"priority"`

  - `status: optional "completed" or "failed" or "in_progress" or 3 more`

    - `"completed"`

    - `"failed"`

    - `"in_progress"`

    - `"cancelled"`

    - `"queued"`

    - `"incomplete"`

  - `temperature: optional number`

  - `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 object { type }  or object { name, schema, type, 2 more }  or object { type }`

      Default response format. Used to generate text responses.

      - `ResponseFormatText object { type }`

        Default response format. Used to generate text responses.

        - `type: "text"`

          - `"text"`

      - `ResponseFormatTextJsonSchemaConfig object { name, schema, type, 2 more }`

        JSON Schema response format.

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

        - `name: string`

        - `schema: map[unknown]`

        - `type: "json_schema"`

          - `"json_schema"`

        - `description: optional string`

        - `strict: optional boolean`

      - `ResponseFormatJsonObject object { type }`

        JSON object response format.

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

        - `type: "json_object"`

          - `"json_object"`

    - `verbosity: optional "low" or "medium" or "high"`

      - `"low"`

      - `"medium"`

      - `"high"`

  - `top_logprobs: optional number`

  - `top_p: optional number`

  - `truncation: optional "auto" or "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: number`

    - `input_tokens_details: object { cached_tokens }`

      A detailed breakdown of the input tokens.

      - `cached_tokens: number`

    - `output_tokens: number`

    - `output_tokens_details: object { reasoning_tokens }`

      A detailed breakdown of the output tokens.

      - `reasoning_tokens: number`

    - `total_tokens: number`

  - `user: optional string`

### OpenAI Response Code Interpreter Tool Call

- `OpenAIResponseCodeInterpreterToolCall object { id, container_id, status, 3 more }`

  A tool call to run code.

  - `id: string`

  - `container_id: string`

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

    - `"in_progress"`

    - `"completed"`

    - `"incomplete"`

    - `"interpreting"`

    - `"failed"`

  - `type: "code_interpreter_call"`

    - `"code_interpreter_call"`

  - `code: optional string`

  - `outputs: optional array of object { logs, type }  or object { type, url }`

    - `OutputLogs object { logs, type }`

      The logs output from the code interpreter.

      - `logs: string`

      - `type: "logs"`

        - `"logs"`

    - `OutputImage object { type, url }`

      The image output from the code interpreter.

      - `type: "image"`

        - `"image"`

      - `url: string`

### OpenAI Response Computer Tool Call

- `OpenAIResponseComputerToolCall object { id, action, call_id, 3 more }`

  A tool call to a computer use tool.

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

  - `id: string`

  - `action: object { button, type, x, y }  or object { type, x, y }  or object { path, type }  or 6 more`

    A click action.

    - `ActionClick object { button, type, x, y }`

      A click action.

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

        - `"left"`

        - `"right"`

        - `"wheel"`

        - `"back"`

        - `"forward"`

      - `type: "click"`

        - `"click"`

      - `x: number`

      - `y: number`

    - `ActionDoubleClick object { type, x, y }`

      A double click action.

      - `type: "double_click"`

        - `"double_click"`

      - `x: number`

      - `y: number`

    - `ActionDrag object { path, type }`

      A drag action.

      - `path: array of object { x, y }`

        - `x: number`

        - `y: number`

      - `type: "drag"`

        - `"drag"`

    - `ActionKeypress object { keys, type }`

      A collection of keypresses the model would like to perform.

      - `keys: array of string`

      - `type: "keypress"`

        - `"keypress"`

    - `ActionMove object { type, x, y }`

      A mouse move action.

      - `type: "move"`

        - `"move"`

      - `x: number`

      - `y: number`

    - `ActionScreenshot object { type }`

      A screenshot action.

      - `type: "screenshot"`

        - `"screenshot"`

    - `ActionScroll object { scroll_x, scroll_y, type, 2 more }`

      A scroll action.

      - `scroll_x: number`

      - `scroll_y: number`

      - `type: "scroll"`

        - `"scroll"`

      - `x: number`

      - `y: number`

    - `ActionType object { text, type }`

      An action to type in text.

      - `text: string`

      - `type: "type"`

        - `"type"`

    - `ActionWait object { type }`

      A wait action.

      - `type: "wait"`

        - `"wait"`

  - `call_id: string`

  - `pending_safety_checks: array of object { id, code, message }`

    - `id: string`

    - `code: optional string`

    - `message: optional string`

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

    - `"in_progress"`

    - `"completed"`

    - `"incomplete"`

  - `type: "computer_call"`

    - `"computer_call"`

### OpenAI Response Custom Tool Call

- `OpenAIResponseCustomToolCall object { call_id, input, name, 2 more }`

  A call to a custom tool created by the model.

  - `call_id: string`

  - `input: string`

  - `name: string`

  - `type: "custom_tool_call"`

    - `"custom_tool_call"`

  - `id: optional string`

### OpenAI Response Custom Tool Call Output

- `OpenAIResponseCustomToolCallOutput object { call_id, output, type, id }`

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

  - `call_id: string`

  - `output: string or array of OpenAIResponseInputText or OpenAIResponseInputImage or OpenAIResponseInputFile`

    - `string`

    - `OutputContentList = array of OpenAIResponseInputText or OpenAIResponseInputImage or OpenAIResponseInputFile`

      - `OpenAIResponseInputText object { text, type }`

        A text input to the model.

        - `text: string`

        - `type: "input_text"`

          - `"input_text"`

      - `OpenAIResponseInputImage object { detail, type, file_id, image_url }`

        An image input to the model.

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

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

          - `"low"`

          - `"high"`

          - `"auto"`

        - `type: "input_image"`

          - `"input_image"`

        - `file_id: optional string`

        - `image_url: optional string`

      - `OpenAIResponseInputFile object { type, file_data, file_id, 2 more }`

        A file input to the model.

        - `type: "input_file"`

          - `"input_file"`

        - `file_data: optional string`

        - `file_id: optional string`

        - `file_url: optional string`

        - `filename: optional string`

  - `type: "custom_tool_call_output"`

    - `"custom_tool_call_output"`

  - `id: optional string`

### OpenAI Response Error

- `OpenAIResponseError object { code, message }`

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

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

    - `"server_error"`

    - `"rate_limit_exceeded"`

    - `"invalid_prompt"`

    - `"vector_store_timeout"`

    - `"invalid_image"`

    - `"invalid_image_format"`

    - `"invalid_base64_image"`

    - `"invalid_image_url"`

    - `"image_too_large"`

    - `"image_too_small"`

    - `"image_parse_error"`

    - `"image_content_policy_violation"`

    - `"invalid_image_mode"`

    - `"image_file_too_large"`

    - `"unsupported_image_media_type"`

    - `"empty_image_file"`

    - `"failed_to_download_image"`

    - `"image_file_not_found"`

  - `message: string`

### OpenAI Response File Search Tool Call

- `OpenAIResponseFileSearchToolCall object { id, queries, status, 2 more }`

  The results of a file search tool call.

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

  - `id: string`

  - `queries: array of string`

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

    - `"in_progress"`

    - `"searching"`

    - `"completed"`

    - `"incomplete"`

    - `"failed"`

  - `type: "file_search_call"`

    - `"file_search_call"`

  - `results: optional array of object { attributes, file_id, filename, 2 more }`

    - `attributes: optional map[string or number or boolean]`

      - `string`

      - `number`

      - `boolean`

    - `file_id: optional string`

    - `filename: optional string`

    - `score: optional number`

    - `text: optional string`

### OpenAI Response Function Tool Call

- `OpenAIResponseFunctionToolCall object { arguments, call_id, name, 3 more }`

  A tool call to run a function.

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

  - `arguments: string`

  - `call_id: string`

  - `name: string`

  - `type: "function_call"`

    - `"function_call"`

  - `id: optional string`

  - `status: optional "in_progress" or "completed" or "incomplete"`

    - `"in_progress"`

    - `"completed"`

    - `"incomplete"`

### OpenAI Response Function Web Search

- `OpenAIResponseFunctionWebSearch object { id, action, status, type }`

  The results of a web search tool call.

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

  - `id: string`

  - `action: object { query, type, queries, sources }  or object { type, url }  or object { pattern, type, url }`

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

    - `OpenAITypesResponsesResponseFunctionWebSearchActionSearch object { query, type, queries, sources }`

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

      - `query: string`

      - `type: "search"`

        - `"search"`

      - `queries: optional array of string`

      - `sources: optional array of object { type, url }`

        - `type: "url"`

          - `"url"`

        - `url: string`

    - `OpenAITypesResponsesResponseFunctionWebSearchActionOpenPage object { type, url }`

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

      - `type: "open_page"`

        - `"open_page"`

      - `url: optional string`

    - `ActionFind object { pattern, type, url }`

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

      - `pattern: string`

      - `type: "find_in_page"`

        - `"find_in_page"`

      - `url: string`

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

    - `"in_progress"`

    - `"searching"`

    - `"completed"`

    - `"failed"`

  - `type: "web_search_call"`

    - `"web_search_call"`

### OpenAI Response Input File

- `OpenAIResponseInputFile object { type, file_data, file_id, 2 more }`

  A file input to the model.

  - `type: "input_file"`

    - `"input_file"`

  - `file_data: optional string`

  - `file_id: optional string`

  - `file_url: optional string`

  - `filename: optional string`

### OpenAI Response Input File Param

- `OpenAIResponseInputFileParam object { type, file_data, file_id, 2 more }`

  A file input to the model.

  - `type: "input_file"`

    - `"input_file"`

  - `file_data: optional string`

  - `file_id: optional string`

  - `file_url: optional string`

  - `filename: optional string`

### OpenAI Response Input Image

- `OpenAIResponseInputImage object { detail, type, file_id, image_url }`

  An image input to the model.

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

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

    - `"low"`

    - `"high"`

    - `"auto"`

  - `type: "input_image"`

    - `"input_image"`

  - `file_id: optional string`

  - `image_url: optional string`

### OpenAI Response Input Image Param

- `OpenAIResponseInputImageParam object { detail, type, file_id, image_url }`

  An image input to the model.

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

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

    - `"low"`

    - `"high"`

    - `"auto"`

  - `type: "input_image"`

    - `"input_image"`

  - `file_id: optional string`

  - `image_url: optional string`

### OpenAI Response Input Text

- `OpenAIResponseInputText object { text, type }`

  A text input to the model.

  - `text: string`

  - `type: "input_text"`

    - `"input_text"`

### OpenAI Response Input Text Param

- `OpenAIResponseInputTextParam object { text, type }`

  A text input to the model.

  - `text: string`

  - `type: "input_text"`

    - `"input_text"`

### OpenAI Response Output Message

- `OpenAIResponseOutputMessage object { id, content, role, 3 more }`

  An output message from the model.

  - `id: string`

  - `content: array of OpenAIResponseOutputText or OpenAIResponseOutputRefusal`

    - `OpenAIResponseOutputText object { annotations, text, type, logprobs }`

      A text output from the model.

      - `annotations: array of object { file_id, filename, index, type }  or object { end_index, start_index, title, 2 more }  or object { container_id, end_index, file_id, 3 more }  or object { file_id, index, type }`

        - `AnnotationFileCitation object { file_id, filename, index, type }`

          A citation to a file.

          - `file_id: string`

          - `filename: string`

          - `index: number`

          - `type: "file_citation"`

            - `"file_citation"`

        - `OpenAITypesResponsesResponseOutputTextAnnotationURLCitation object { end_index, start_index, title, 2 more }`

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

          - `end_index: number`

          - `start_index: number`

          - `title: string`

          - `type: "url_citation"`

            - `"url_citation"`

          - `url: string`

        - `AnnotationContainerFileCitation object { container_id, end_index, file_id, 3 more }`

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

          - `container_id: string`

          - `end_index: number`

          - `file_id: string`

          - `filename: string`

          - `start_index: number`

          - `type: "container_file_citation"`

            - `"container_file_citation"`

        - `AnnotationFilePath object { file_id, index, type }`

          A path to a file.

          - `file_id: string`

          - `index: number`

          - `type: "file_path"`

            - `"file_path"`

      - `text: string`

      - `type: "output_text"`

        - `"output_text"`

      - `logprobs: optional array of object { token, bytes, logprob, top_logprobs }`

        - `token: string`

        - `bytes: array of number`

        - `logprob: number`

        - `top_logprobs: array of object { token, bytes, logprob }`

          - `token: string`

          - `bytes: array of number`

          - `logprob: number`

    - `OpenAIResponseOutputRefusal object { refusal, type }`

      A refusal from the model.

      - `refusal: string`

      - `type: "refusal"`

        - `"refusal"`

  - `role: "assistant"`

    - `"assistant"`

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

    - `"in_progress"`

    - `"completed"`

    - `"incomplete"`

  - `type: "message"`

    - `"message"`

  - `phase: optional "commentary" or "final_answer"`

    - `"commentary"`

    - `"final_answer"`

### OpenAI Response Output Refusal

- `OpenAIResponseOutputRefusal object { refusal, type }`

  A refusal from the model.

  - `refusal: string`

  - `type: "refusal"`

    - `"refusal"`

### OpenAI Response Output Text

- `OpenAIResponseOutputText object { annotations, text, type, logprobs }`

  A text output from the model.

  - `annotations: array of object { file_id, filename, index, type }  or object { end_index, start_index, title, 2 more }  or object { container_id, end_index, file_id, 3 more }  or object { file_id, index, type }`

    - `AnnotationFileCitation object { file_id, filename, index, type }`

      A citation to a file.

      - `file_id: string`

      - `filename: string`

      - `index: number`

      - `type: "file_citation"`

        - `"file_citation"`

    - `OpenAITypesResponsesResponseOutputTextAnnotationURLCitation object { end_index, start_index, title, 2 more }`

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

      - `end_index: number`

      - `start_index: number`

      - `title: string`

      - `type: "url_citation"`

        - `"url_citation"`

      - `url: string`

    - `AnnotationContainerFileCitation object { container_id, end_index, file_id, 3 more }`

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

      - `container_id: string`

      - `end_index: number`

      - `file_id: string`

      - `filename: string`

      - `start_index: number`

      - `type: "container_file_citation"`

        - `"container_file_citation"`

    - `AnnotationFilePath object { file_id, index, type }`

      A path to a file.

      - `file_id: string`

      - `index: number`

      - `type: "file_path"`

        - `"file_path"`

  - `text: string`

  - `type: "output_text"`

    - `"output_text"`

  - `logprobs: optional array of object { token, bytes, logprob, top_logprobs }`

    - `token: string`

    - `bytes: array of number`

    - `logprob: number`

    - `top_logprobs: array of object { token, bytes, logprob }`

      - `token: string`

      - `bytes: array of number`

      - `logprob: number`

### OpenAI Response Prompt

- `OpenAIResponsePrompt object { id, variables, version }`

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

  - `id: string`

  - `variables: optional map[string or OpenAIResponseInputText or OpenAIResponseInputImage or OpenAIResponseInputFile]`

    - `string`

    - `OpenAIResponseInputText object { text, type }`

      A text input to the model.

      - `text: string`

      - `type: "input_text"`

        - `"input_text"`

    - `OpenAIResponseInputImage object { detail, type, file_id, image_url }`

      An image input to the model.

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

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

        - `"low"`

        - `"high"`

        - `"auto"`

      - `type: "input_image"`

        - `"input_image"`

      - `file_id: optional string`

      - `image_url: optional string`

    - `OpenAIResponseInputFile object { type, file_data, file_id, 2 more }`

      A file input to the model.

      - `type: "input_file"`

        - `"input_file"`

      - `file_data: optional string`

      - `file_id: optional string`

      - `file_url: optional string`

      - `filename: optional string`

  - `version: optional string`

### OpenAI Response Reasoning Item

- `OpenAIResponseReasoningItem object { id, summary, type, 3 more }`

  A description of the chain of thought used by a reasoning model while generating
  a response. Be sure to include these items in your `input` to the Responses API
  for subsequent turns of a conversation if you are manually
  [managing context](https://platform.openai.com/docs/guides/conversation-state).

  - `id: string`

  - `summary: array of object { text, type }`

    - `text: string`

    - `type: "summary_text"`

      - `"summary_text"`

  - `type: "reasoning"`

    - `"reasoning"`

  - `content: optional array of object { text, type }`

    - `text: string`

    - `type: "reasoning_text"`

      - `"reasoning_text"`

  - `encrypted_content: optional string`

  - `status: optional "in_progress" or "completed" or "incomplete"`

    - `"in_progress"`

    - `"completed"`

    - `"incomplete"`

### OpenAI Response Text Config

- `OpenAIResponseTextConfig object { format, verbosity }`

  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 object { type }  or object { name, schema, type, 2 more }  or object { type }`

    Default response format. Used to generate text responses.

    - `ResponseFormatText object { type }`

      Default response format. Used to generate text responses.

      - `type: "text"`

        - `"text"`

    - `ResponseFormatTextJsonSchemaConfig object { name, schema, type, 2 more }`

      JSON Schema response format.

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

      - `name: string`

      - `schema: map[unknown]`

      - `type: "json_schema"`

        - `"json_schema"`

      - `description: optional string`

      - `strict: optional boolean`

    - `ResponseFormatJsonObject object { type }`

      JSON object response format.

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

      - `type: "json_object"`

        - `"json_object"`

  - `verbosity: optional "low" or "medium" or "high"`

    - `"low"`

    - `"medium"`

    - `"high"`

### OpenAI Response Usage

- `OpenAIResponseUsage object { input_tokens, input_tokens_details, output_tokens, 2 more }`

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

  - `input_tokens: number`

  - `input_tokens_details: object { cached_tokens }`

    A detailed breakdown of the input tokens.

    - `cached_tokens: number`

  - `output_tokens: number`

  - `output_tokens_details: object { reasoning_tokens }`

    A detailed breakdown of the output tokens.

    - `reasoning_tokens: number`

  - `total_tokens: number`

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

- `OpenAITypesResponsesResponseInputItemComputerCallOutput object { call_id, output, type, 3 more }`

  The output of a computer tool call.

  - `call_id: string`

  - `output: ResponseComputerToolCallOutputScreenshot`

    A computer screenshot image used with the computer use tool.

    - `type: "computer_screenshot"`

      - `"computer_screenshot"`

    - `file_id: optional string`

    - `image_url: optional string`

  - `type: "computer_call_output"`

    - `"computer_call_output"`

  - `id: optional string`

  - `acknowledged_safety_checks: optional array of object { id, code, message }`

    - `id: string`

    - `code: optional string`

    - `message: optional string`

  - `status: optional "in_progress" or "completed" or "incomplete"`

    - `"in_progress"`

    - `"completed"`

    - `"incomplete"`

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

- `OpenAITypesResponsesResponseInputItemFunctionCallOutput object { call_id, output, type, 2 more }`

  The output of a function tool call.

  - `call_id: string`

  - `output: string or array of object { text, type }  or object { type, detail, file_id, image_url }  or object { type, file_data, file_id, 2 more }`

    - `string`

    - `OutputContentList = array of object { text, type }  or object { type, detail, file_id, image_url }  or object { type, file_data, file_id, 2 more }`

      - `ResponseInputTextContent object { text, type }`

        A text input to the model.

        - `text: string`

        - `type: "input_text"`

          - `"input_text"`

      - `ResponseInputImageContent object { type, detail, file_id, image_url }`

        An image input to the model.

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

        - `type: "input_image"`

          - `"input_image"`

        - `detail: optional "low" or "high" or "auto"`

          - `"low"`

          - `"high"`

          - `"auto"`

        - `file_id: optional string`

        - `image_url: optional string`

      - `ResponseInputFileContent object { type, file_data, file_id, 2 more }`

        A file input to the model.

        - `type: "input_file"`

          - `"input_file"`

        - `file_data: optional string`

        - `file_id: optional string`

        - `file_url: optional string`

        - `filename: optional string`

  - `type: "function_call_output"`

    - `"function_call_output"`

  - `id: optional string`

  - `status: optional "in_progress" or "completed" or "incomplete"`

    - `"in_progress"`

    - `"completed"`

    - `"incomplete"`

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

- `OpenAITypesResponsesResponseInputItemImageGenerationCall object { id, status, type, result }`

  An image generation request made by the model.

  - `id: string`

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

    - `"in_progress"`

    - `"completed"`

    - `"generating"`

    - `"failed"`

  - `type: "image_generation_call"`

    - `"image_generation_call"`

  - `result: optional string`

### OpenAI Types Responses Response Input Item Item Reference

- `OpenAITypesResponsesResponseInputItemItemReference object { id, type }`

  An internal identifier for an item to reference.

  - `id: string`

  - `type: optional "item_reference"`

    - `"item_reference"`

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

- `OpenAITypesResponsesResponseInputItemLocalShellCall object { id, action, call_id, 2 more }`

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

  - `id: string`

  - `action: object { command, env, type, 3 more }`

    Execute a shell command on the server.

    - `command: array of string`

    - `env: map[string]`

    - `type: "exec"`

      - `"exec"`

    - `timeout_ms: optional number`

    - `user: optional string`

    - `working_directory: optional string`

  - `call_id: string`

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

    - `"in_progress"`

    - `"completed"`

    - `"incomplete"`

  - `type: "local_shell_call"`

    - `"local_shell_call"`

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

- `OpenAITypesResponsesResponseInputItemLocalShellCallOutput object { id, output, type, status }`

  The output of a local shell tool call.

  - `id: string`

  - `output: string`

  - `type: "local_shell_call_output"`

    - `"local_shell_call_output"`

  - `status: optional "in_progress" or "completed" or "incomplete"`

    - `"in_progress"`

    - `"completed"`

    - `"incomplete"`

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

- `OpenAITypesResponsesResponseInputItemMcpApprovalResponse object { approval_request_id, approve, type, 2 more }`

  A response to an MCP approval request.

  - `approval_request_id: string`

  - `approve: boolean`

  - `type: "mcp_approval_response"`

    - `"mcp_approval_response"`

  - `id: optional string`

  - `reason: optional string`

### OpenAI Types Responses Response Input Item Mcp Call

- `OpenAITypesResponsesResponseInputItemMcpCall object { id, arguments, name, 6 more }`

  An invocation of a tool on an MCP server.

  - `id: string`

  - `arguments: string`

  - `name: string`

  - `server_label: string`

  - `type: "mcp_call"`

    - `"mcp_call"`

  - `approval_request_id: optional string`

  - `error: optional string`

  - `output: optional string`

  - `status: optional "in_progress" or "completed" or "incomplete" or 2 more`

    - `"in_progress"`

    - `"completed"`

    - `"incomplete"`

    - `"calling"`

    - `"failed"`

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

- `OpenAITypesResponsesResponseInputItemMcpListTools object { id, server_label, tools, 2 more }`

  A list of tools available on an MCP server.

  - `id: string`

  - `server_label: string`

  - `tools: array of object { input_schema, name, annotations, description }`

    - `input_schema: unknown`

    - `name: string`

    - `annotations: optional unknown`

    - `description: optional string`

  - `type: "mcp_list_tools"`

    - `"mcp_list_tools"`

  - `error: optional string`

### OpenAI Types Responses Response Input Item Message

- `OpenAITypesResponsesResponseInputItemMessage object { content, role, status, type }`

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

  - `content: array of OpenAIResponseInputText or OpenAIResponseInputImage or OpenAIResponseInputFile`

    - `OpenAIResponseInputText object { text, type }`

      A text input to the model.

      - `text: string`

      - `type: "input_text"`

        - `"input_text"`

    - `OpenAIResponseInputImage object { detail, type, file_id, image_url }`

      An image input to the model.

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

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

        - `"low"`

        - `"high"`

        - `"auto"`

      - `type: "input_image"`

        - `"input_image"`

      - `file_id: optional string`

      - `image_url: optional string`

    - `OpenAIResponseInputFile object { type, file_data, file_id, 2 more }`

      A file input to the model.

      - `type: "input_file"`

        - `"input_file"`

      - `file_data: optional string`

      - `file_id: optional string`

      - `file_url: optional string`

      - `filename: optional string`

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

    - `"user"`

    - `"system"`

    - `"developer"`

  - `status: optional "in_progress" or "completed" or "incomplete"`

    - `"in_progress"`

    - `"completed"`

    - `"incomplete"`

  - `type: optional "message"`

    - `"message"`

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

- `OpenAITypesResponsesResponseOutputItemImageGenerationCall object { id, status, type, result }`

  An image generation request made by the model.

  - `id: string`

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

    - `"in_progress"`

    - `"completed"`

    - `"generating"`

    - `"failed"`

  - `type: "image_generation_call"`

    - `"image_generation_call"`

  - `result: optional string`

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

- `OpenAITypesResponsesResponseOutputItemLocalShellCall object { id, action, call_id, 2 more }`

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

  - `id: string`

  - `action: object { command, env, type, 3 more }`

    Execute a shell command on the server.

    - `command: array of string`

    - `env: map[string]`

    - `type: "exec"`

      - `"exec"`

    - `timeout_ms: optional number`

    - `user: optional string`

    - `working_directory: optional string`

  - `call_id: string`

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

    - `"in_progress"`

    - `"completed"`

    - `"incomplete"`

  - `type: "local_shell_call"`

    - `"local_shell_call"`

### OpenAI Types Responses Response Output Item Mcp Call

- `OpenAITypesResponsesResponseOutputItemMcpCall object { id, arguments, name, 6 more }`

  An invocation of a tool on an MCP server.

  - `id: string`

  - `arguments: string`

  - `name: string`

  - `server_label: string`

  - `type: "mcp_call"`

    - `"mcp_call"`

  - `approval_request_id: optional string`

  - `error: optional string`

  - `output: optional string`

  - `status: optional "in_progress" or "completed" or "incomplete" or 2 more`

    - `"in_progress"`

    - `"completed"`

    - `"incomplete"`

    - `"calling"`

    - `"failed"`

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

- `OpenAITypesResponsesResponseOutputItemMcpListTools object { id, server_label, tools, 2 more }`

  A list of tools available on an MCP server.

  - `id: string`

  - `server_label: string`

  - `tools: array of object { input_schema, name, annotations, description }`

    - `input_schema: unknown`

    - `name: string`

    - `annotations: optional unknown`

    - `description: optional string`

  - `type: "mcp_list_tools"`

    - `"mcp_list_tools"`

  - `error: optional string`

### Part Reasoning Text

- `PartReasoningText object { text, type }`

  Reasoning text from the model.

  - `text: string`

  - `type: "reasoning_text"`

    - `"reasoning_text"`

### Reasoning

- `Reasoning object { effort, generate_summary, summary }`

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

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

  - `effort: optional "none" or "minimal" or "low" or 3 more`

    - `"none"`

    - `"minimal"`

    - `"low"`

    - `"medium"`

    - `"high"`

    - `"xhigh"`

  - `generate_summary: optional "auto" or "concise" or "detailed"`

    - `"auto"`

    - `"concise"`

    - `"detailed"`

  - `summary: optional "auto" or "concise" or "detailed"`

    - `"auto"`

    - `"concise"`

    - `"detailed"`

### Response Apply Patch Tool Call

- `ResponseApplyPatchToolCall object { id, call_id, operation, 3 more }`

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

  - `id: string`

  - `call_id: string`

  - `operation: object { diff, path, type }  or object { path, type }  or object { diff, path, type }`

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

    - `OperationCreateFile object { diff, path, type }`

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

      - `diff: string`

      - `path: string`

      - `type: "create_file"`

        - `"create_file"`

    - `OperationDeleteFile object { path, type }`

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

      - `path: string`

      - `type: "delete_file"`

        - `"delete_file"`

    - `OperationUpdateFile object { diff, path, type }`

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

      - `diff: string`

      - `path: string`

      - `type: "update_file"`

        - `"update_file"`

  - `status: "in_progress" or "completed"`

    - `"in_progress"`

    - `"completed"`

  - `type: "apply_patch_call"`

    - `"apply_patch_call"`

  - `created_by: optional string`

### Response Apply Patch Tool Call Output

- `ResponseApplyPatchToolCallOutput object { id, call_id, status, 3 more }`

  The output emitted by an apply patch tool call.

  - `id: string`

  - `call_id: string`

  - `status: "completed" or "failed"`

    - `"completed"`

    - `"failed"`

  - `type: "apply_patch_call_output"`

    - `"apply_patch_call_output"`

  - `created_by: optional string`

  - `output: optional string`

### Response Compaction Item

- `ResponseCompactionItem object { id, encrypted_content, type, created_by }`

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

  - `id: string`

  - `encrypted_content: string`

  - `type: "compaction"`

    - `"compaction"`

  - `created_by: optional string`

### Response Compaction Item Param

- `ResponseCompactionItemParam object { encrypted_content, type, id }`

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

  - `encrypted_content: string`

  - `type: "compaction"`

    - `"compaction"`

  - `id: optional string`

### Response Computer Tool Call Output Screenshot

- `ResponseComputerToolCallOutputScreenshot object { type, file_id, image_url }`

  A computer screenshot image used with the computer use tool.

  - `type: "computer_screenshot"`

    - `"computer_screenshot"`

  - `file_id: optional string`

  - `image_url: optional string`

### Response Function Shell Tool Call

- `ResponseFunctionShellToolCall object { id, action, call_id, 4 more }`

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

  - `id: string`

  - `action: object { commands, max_output_length, timeout_ms }`

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

    - `commands: array of string`

    - `max_output_length: optional number`

    - `timeout_ms: optional number`

  - `call_id: string`

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

    - `"in_progress"`

    - `"completed"`

    - `"incomplete"`

  - `type: "shell_call"`

    - `"shell_call"`

  - `created_by: optional string`

  - `environment: optional object { type }  or object { container_id, type }`

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

    - `ResponseLocalEnvironment object { type }`

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

      - `type: "local"`

        - `"local"`

    - `ResponseContainerReference object { container_id, type }`

      Represents a container created with /v1/containers.

      - `container_id: string`

      - `type: "container_reference"`

        - `"container_reference"`

### Response Function Shell Tool Call Output

- `ResponseFunctionShellToolCallOutput object { id, call_id, output, 4 more }`

  The output of a shell tool call that was emitted.

  - `id: string`

  - `call_id: string`

  - `output: array of object { outcome, stderr, stdout, created_by }`

    - `outcome: object { type }  or object { exit_code, type }`

      Indicates that the shell call exceeded its configured time limit.

      - `OutputOutcomeTimeout object { type }`

        Indicates that the shell call exceeded its configured time limit.

        - `type: "timeout"`

          - `"timeout"`

      - `OutputOutcomeExit object { exit_code, type }`

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

        - `exit_code: number`

        - `type: "exit"`

          - `"exit"`

    - `stderr: string`

    - `stdout: string`

    - `created_by: optional string`

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

    - `"in_progress"`

    - `"completed"`

    - `"incomplete"`

  - `type: "shell_call_output"`

    - `"shell_call_output"`

  - `created_by: optional string`

  - `max_output_length: optional number`

### Shell Call

- `ShellCall object { action, call_id, type, 3 more }`

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

  - `action: object { commands, max_output_length, timeout_ms }`

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

    - `commands: array of string`

    - `max_output_length: optional number`

    - `timeout_ms: optional number`

  - `call_id: string`

  - `type: "shell_call"`

    - `"shell_call"`

  - `id: optional string`

  - `environment: optional LocalEnvironment or ContainerReference`

    - `LocalEnvironment object { type, skills }`

      - `type: "local"`

        - `"local"`

      - `skills: optional array of object { description, name, path }`

        - `description: string`

        - `name: string`

        - `path: string`

    - `ContainerReference object { container_id, type }`

      - `container_id: string`

      - `type: "container_reference"`

        - `"container_reference"`

  - `status: optional "in_progress" or "completed" or "incomplete"`

    - `"in_progress"`

    - `"completed"`

    - `"incomplete"`

### Shell Call Output

- `ShellCallOutput object { call_id, output, type, 3 more }`

  The streamed output items emitted by a shell tool call.

  - `call_id: string`

  - `output: array of object { outcome, stderr, stdout }`

    - `outcome: object { type }  or object { exit_code, type }`

      Indicates that the shell call exceeded its configured time limit.

      - `OutcomeTimeout object { type }`

        Indicates that the shell call exceeded its configured time limit.

        - `type: "timeout"`

          - `"timeout"`

      - `OutcomeExit object { exit_code, type }`

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

        - `exit_code: number`

        - `type: "exit"`

          - `"exit"`

    - `stderr: string`

    - `stdout: string`

  - `type: "shell_call_output"`

    - `"shell_call_output"`

  - `id: optional string`

  - `max_output_length: optional number`

  - `status: optional "in_progress" or "completed" or "incomplete"`

    - `"in_progress"`

    - `"completed"`

    - `"incomplete"`

### Tool Choice Allowed

- `ToolChoiceAllowed object { mode, tools, type }`

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

  - `mode: "auto" or "required"`

    - `"auto"`

    - `"required"`

  - `tools: array of map[unknown]`

  - `type: "allowed_tools"`

    - `"allowed_tools"`

### Tool Choice Apply Patch

- `ToolChoiceApplyPatch object { type }`

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

  - `type: "apply_patch"`

    - `"apply_patch"`

### Tool Choice Custom

- `ToolChoiceCustom object { name, type }`

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

  - `name: string`

  - `type: "custom"`

    - `"custom"`

### Tool Choice Function

- `ToolChoiceFunction object { name, type }`

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

  - `name: string`

  - `type: "function"`

    - `"function"`

### Tool Choice Mcp

- `ToolChoiceMcp object { server_label, type, name }`

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

  - `server_label: string`

  - `type: "mcp"`

    - `"mcp"`

  - `name: optional string`

### Tool Choice Shell

- `ToolChoiceShell object { type }`

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

  - `type: "shell"`

    - `"shell"`

### Tool Choice Types

- `ToolChoiceTypes object { type }`

  Indicates that the model should use a built-in tool to generate a response.
  [Learn more about built-in tools](https://platform.openai.com/docs/guides/tools).

  - `type: "file_search" or "web_search_preview" or "computer_use_preview" or 3 more`

    - `"file_search"`

    - `"web_search_preview"`

    - `"computer_use_preview"`

    - `"web_search_preview_2025_03_11"`

    - `"image_generation"`

    - `"code_interpreter"`

### Web Search Preview Tool

- `WebSearchPreviewTool object { type, search_context_size, user_location }`

  This tool searches the web for relevant results to use in a response.

  Learn more about the [web search tool](https://platform.openai.com/docs/guides/tools-web-search).

  - `type: "web_search_preview" or "web_search_preview_2025_03_11"`

    - `"web_search_preview"`

    - `"web_search_preview_2025_03_11"`

  - `search_context_size: optional "low" or "medium" or "high"`

    - `"low"`

    - `"medium"`

    - `"high"`

  - `user_location: optional object { type, city, country, 2 more }`

    The user's location.

    - `type: "approximate"`

      - `"approximate"`

    - `city: optional string`

    - `country: optional string`

    - `region: optional string`

    - `timezone: optional string`

### Web Search Tool

- `WebSearchTool object { type, filters, search_context_size, user_location }`

  Search the Internet for sources related to the prompt.

  Learn more about the
  [web search tool](https://platform.openai.com/docs/guides/tools-web-search).

  - `type: "web_search" or "web_search_2025_08_26"`

    - `"web_search"`

    - `"web_search_2025_08_26"`

  - `filters: optional object { allowed_domains }`

    Filters for the search.

    - `allowed_domains: optional array of string`

  - `search_context_size: optional "low" or "medium" or "high"`

    - `"low"`

    - `"medium"`

    - `"high"`

  - `user_location: optional object { city, country, region, 2 more }`

    The approximate location of the user.

    - `city: optional string`

    - `country: optional string`

    - `region: optional string`

    - `timezone: optional string`

    - `type: optional "approximate"`

      - `"approximate"`

### Response Create Response

- `ResponseCreateResponse = OpenAIResponse or object { delta, sequence_number, type }  or object { sequence_number, type }  or 52 more`

  Emitted when there is a partial audio response.

  - `OpenAIResponse object { id, created_at, model, 29 more }`

    - `id: string`

    - `created_at: number`

    - `model: "gpt-5.2" or "gpt-5.2-2025-12-11" or "gpt-5.2-chat-latest" or 83 more or string`

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

        - `"gpt-5.2"`

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

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

        - `"gpt-5.2-pro"`

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

        - `"gpt-5.1"`

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

        - `"gpt-5.1-codex"`

        - `"gpt-5.1-mini"`

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

        - `"gpt-5"`

        - `"gpt-5-mini"`

        - `"gpt-5-nano"`

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

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

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

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

        - `"gpt-4.1"`

        - `"gpt-4.1-mini"`

        - `"gpt-4.1-nano"`

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

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

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

        - `"o4-mini"`

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

        - `"o3"`

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

        - `"o3-mini"`

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

        - `"o1"`

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

        - `"o1-preview"`

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

        - `"o1-mini"`

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

        - `"gpt-4o"`

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

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

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

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

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

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

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

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

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

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

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

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

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

        - `"chatgpt-4o-latest"`

        - `"codex-mini-latest"`

        - `"gpt-4o-mini"`

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

        - `"gpt-4-turbo"`

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

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

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

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

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

        - `"gpt-4"`

        - `"gpt-4-0314"`

        - `"gpt-4-0613"`

        - `"gpt-4-32k"`

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

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

        - `"gpt-3.5-turbo"`

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

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

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

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

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

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

        - `"o1-pro"`

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

        - `"o3-pro"`

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

        - `"o3-deep-research"`

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

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

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

        - `"computer-use-preview"`

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

        - `"gpt-5-codex"`

        - `"gpt-5-pro"`

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

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

      - `string`

    - `object: "response"`

      - `"response"`

    - `output: array of OpenAIResponseOutputMessage or OpenAIResponseFileSearchToolCall or OpenAIResponseFunctionToolCall or 15 more`

      - `OpenAIResponseOutputMessage object { id, content, role, 3 more }`

        An output message from the model.

        - `id: string`

        - `content: array of OpenAIResponseOutputText or OpenAIResponseOutputRefusal`

          - `OpenAIResponseOutputText object { annotations, text, type, logprobs }`

            A text output from the model.

            - `annotations: array of object { file_id, filename, index, type }  or object { end_index, start_index, title, 2 more }  or object { container_id, end_index, file_id, 3 more }  or object { file_id, index, type }`

              - `AnnotationFileCitation object { file_id, filename, index, type }`

                A citation to a file.

                - `file_id: string`

                - `filename: string`

                - `index: number`

                - `type: "file_citation"`

                  - `"file_citation"`

              - `OpenAITypesResponsesResponseOutputTextAnnotationURLCitation object { end_index, start_index, title, 2 more }`

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

                - `end_index: number`

                - `start_index: number`

                - `title: string`

                - `type: "url_citation"`

                  - `"url_citation"`

                - `url: string`

              - `AnnotationContainerFileCitation object { container_id, end_index, file_id, 3 more }`

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

                - `container_id: string`

                - `end_index: number`

                - `file_id: string`

                - `filename: string`

                - `start_index: number`

                - `type: "container_file_citation"`

                  - `"container_file_citation"`

              - `AnnotationFilePath object { file_id, index, type }`

                A path to a file.

                - `file_id: string`

                - `index: number`

                - `type: "file_path"`

                  - `"file_path"`

            - `text: string`

            - `type: "output_text"`

              - `"output_text"`

            - `logprobs: optional array of object { token, bytes, logprob, top_logprobs }`

              - `token: string`

              - `bytes: array of number`

              - `logprob: number`

              - `top_logprobs: array of object { token, bytes, logprob }`

                - `token: string`

                - `bytes: array of number`

                - `logprob: number`

          - `OpenAIResponseOutputRefusal object { refusal, type }`

            A refusal from the model.

            - `refusal: string`

            - `type: "refusal"`

              - `"refusal"`

        - `role: "assistant"`

          - `"assistant"`

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

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

        - `type: "message"`

          - `"message"`

        - `phase: optional "commentary" or "final_answer"`

          - `"commentary"`

          - `"final_answer"`

      - `OpenAIResponseFileSearchToolCall object { id, queries, status, 2 more }`

        The results of a file search tool call.

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

        - `id: string`

        - `queries: array of string`

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

          - `"in_progress"`

          - `"searching"`

          - `"completed"`

          - `"incomplete"`

          - `"failed"`

        - `type: "file_search_call"`

          - `"file_search_call"`

        - `results: optional array of object { attributes, file_id, filename, 2 more }`

          - `attributes: optional map[string or number or boolean]`

            - `string`

            - `number`

            - `boolean`

          - `file_id: optional string`

          - `filename: optional string`

          - `score: optional number`

          - `text: optional string`

      - `OpenAIResponseFunctionToolCall object { arguments, call_id, name, 3 more }`

        A tool call to run a function.

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

        - `arguments: string`

        - `call_id: string`

        - `name: string`

        - `type: "function_call"`

          - `"function_call"`

        - `id: optional string`

        - `status: optional "in_progress" or "completed" or "incomplete"`

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

      - `OpenAIResponseFunctionWebSearch object { id, action, status, type }`

        The results of a web search tool call.

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

        - `id: string`

        - `action: object { query, type, queries, sources }  or object { type, url }  or object { pattern, type, url }`

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

          - `OpenAITypesResponsesResponseFunctionWebSearchActionSearch object { query, type, queries, sources }`

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

            - `query: string`

            - `type: "search"`

              - `"search"`

            - `queries: optional array of string`

            - `sources: optional array of object { type, url }`

              - `type: "url"`

                - `"url"`

              - `url: string`

          - `OpenAITypesResponsesResponseFunctionWebSearchActionOpenPage object { type, url }`

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

            - `type: "open_page"`

              - `"open_page"`

            - `url: optional string`

          - `ActionFind object { pattern, type, url }`

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

            - `pattern: string`

            - `type: "find_in_page"`

              - `"find_in_page"`

            - `url: string`

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

          - `"in_progress"`

          - `"searching"`

          - `"completed"`

          - `"failed"`

        - `type: "web_search_call"`

          - `"web_search_call"`

      - `OpenAIResponseComputerToolCall object { id, action, call_id, 3 more }`

        A tool call to a computer use tool.

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

        - `id: string`

        - `action: object { button, type, x, y }  or object { type, x, y }  or object { path, type }  or 6 more`

          A click action.

          - `ActionClick object { button, type, x, y }`

            A click action.

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

              - `"left"`

              - `"right"`

              - `"wheel"`

              - `"back"`

              - `"forward"`

            - `type: "click"`

              - `"click"`

            - `x: number`

            - `y: number`

          - `ActionDoubleClick object { type, x, y }`

            A double click action.

            - `type: "double_click"`

              - `"double_click"`

            - `x: number`

            - `y: number`

          - `ActionDrag object { path, type }`

            A drag action.

            - `path: array of object { x, y }`

              - `x: number`

              - `y: number`

            - `type: "drag"`

              - `"drag"`

          - `ActionKeypress object { keys, type }`

            A collection of keypresses the model would like to perform.

            - `keys: array of string`

            - `type: "keypress"`

              - `"keypress"`

          - `ActionMove object { type, x, y }`

            A mouse move action.

            - `type: "move"`

              - `"move"`

            - `x: number`

            - `y: number`

          - `ActionScreenshot object { type }`

            A screenshot action.

            - `type: "screenshot"`

              - `"screenshot"`

          - `ActionScroll object { scroll_x, scroll_y, type, 2 more }`

            A scroll action.

            - `scroll_x: number`

            - `scroll_y: number`

            - `type: "scroll"`

              - `"scroll"`

            - `x: number`

            - `y: number`

          - `ActionType object { text, type }`

            An action to type in text.

            - `text: string`

            - `type: "type"`

              - `"type"`

          - `ActionWait object { type }`

            A wait action.

            - `type: "wait"`

              - `"wait"`

        - `call_id: string`

        - `pending_safety_checks: array of object { id, code, message }`

          - `id: string`

          - `code: optional string`

          - `message: optional string`

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

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

        - `type: "computer_call"`

          - `"computer_call"`

      - `OpenAIResponseReasoningItem object { id, summary, type, 3 more }`

        A description of the chain of thought used by a reasoning model while generating
        a response. Be sure to include these items in your `input` to the Responses API
        for subsequent turns of a conversation if you are manually
        [managing context](https://platform.openai.com/docs/guides/conversation-state).

        - `id: string`

        - `summary: array of object { text, type }`

          - `text: string`

          - `type: "summary_text"`

            - `"summary_text"`

        - `type: "reasoning"`

          - `"reasoning"`

        - `content: optional array of object { text, type }`

          - `text: string`

          - `type: "reasoning_text"`

            - `"reasoning_text"`

        - `encrypted_content: optional string`

        - `status: optional "in_progress" or "completed" or "incomplete"`

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

      - `ResponseCompactionItem object { id, encrypted_content, type, created_by }`

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

        - `id: string`

        - `encrypted_content: string`

        - `type: "compaction"`

          - `"compaction"`

        - `created_by: optional string`

      - `OpenAITypesResponsesResponseOutputItemImageGenerationCall object { id, status, type, result }`

        An image generation request made by the model.

        - `id: string`

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

          - `"in_progress"`

          - `"completed"`

          - `"generating"`

          - `"failed"`

        - `type: "image_generation_call"`

          - `"image_generation_call"`

        - `result: optional string`

      - `OpenAIResponseCodeInterpreterToolCall object { id, container_id, status, 3 more }`

        A tool call to run code.

        - `id: string`

        - `container_id: string`

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

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

          - `"interpreting"`

          - `"failed"`

        - `type: "code_interpreter_call"`

          - `"code_interpreter_call"`

        - `code: optional string`

        - `outputs: optional array of object { logs, type }  or object { type, url }`

          - `OutputLogs object { logs, type }`

            The logs output from the code interpreter.

            - `logs: string`

            - `type: "logs"`

              - `"logs"`

          - `OutputImage object { type, url }`

            The image output from the code interpreter.

            - `type: "image"`

              - `"image"`

            - `url: string`

      - `OpenAITypesResponsesResponseOutputItemLocalShellCall object { id, action, call_id, 2 more }`

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

        - `id: string`

        - `action: object { command, env, type, 3 more }`

          Execute a shell command on the server.

          - `command: array of string`

          - `env: map[string]`

          - `type: "exec"`

            - `"exec"`

          - `timeout_ms: optional number`

          - `user: optional string`

          - `working_directory: optional string`

        - `call_id: string`

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

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

        - `type: "local_shell_call"`

          - `"local_shell_call"`

      - `ResponseFunctionShellToolCall object { id, action, call_id, 4 more }`

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

        - `id: string`

        - `action: object { commands, max_output_length, timeout_ms }`

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

          - `commands: array of string`

          - `max_output_length: optional number`

          - `timeout_ms: optional number`

        - `call_id: string`

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

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

        - `type: "shell_call"`

          - `"shell_call"`

        - `created_by: optional string`

        - `environment: optional object { type }  or object { container_id, type }`

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

          - `ResponseLocalEnvironment object { type }`

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

            - `type: "local"`

              - `"local"`

          - `ResponseContainerReference object { container_id, type }`

            Represents a container created with /v1/containers.

            - `container_id: string`

            - `type: "container_reference"`

              - `"container_reference"`

      - `ResponseFunctionShellToolCallOutput object { id, call_id, output, 4 more }`

        The output of a shell tool call that was emitted.

        - `id: string`

        - `call_id: string`

        - `output: array of object { outcome, stderr, stdout, created_by }`

          - `outcome: object { type }  or object { exit_code, type }`

            Indicates that the shell call exceeded its configured time limit.

            - `OutputOutcomeTimeout object { type }`

              Indicates that the shell call exceeded its configured time limit.

              - `type: "timeout"`

                - `"timeout"`

            - `OutputOutcomeExit object { exit_code, type }`

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

              - `exit_code: number`

              - `type: "exit"`

                - `"exit"`

          - `stderr: string`

          - `stdout: string`

          - `created_by: optional string`

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

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

        - `type: "shell_call_output"`

          - `"shell_call_output"`

        - `created_by: optional string`

        - `max_output_length: optional number`

      - `ResponseApplyPatchToolCall object { id, call_id, operation, 3 more }`

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

        - `id: string`

        - `call_id: string`

        - `operation: object { diff, path, type }  or object { path, type }  or object { diff, path, type }`

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

          - `OperationCreateFile object { diff, path, type }`

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

            - `diff: string`

            - `path: string`

            - `type: "create_file"`

              - `"create_file"`

          - `OperationDeleteFile object { path, type }`

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

            - `path: string`

            - `type: "delete_file"`

              - `"delete_file"`

          - `OperationUpdateFile object { diff, path, type }`

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

            - `diff: string`

            - `path: string`

            - `type: "update_file"`

              - `"update_file"`

        - `status: "in_progress" or "completed"`

          - `"in_progress"`

          - `"completed"`

        - `type: "apply_patch_call"`

          - `"apply_patch_call"`

        - `created_by: optional string`

      - `ResponseApplyPatchToolCallOutput object { id, call_id, status, 3 more }`

        The output emitted by an apply patch tool call.

        - `id: string`

        - `call_id: string`

        - `status: "completed" or "failed"`

          - `"completed"`

          - `"failed"`

        - `type: "apply_patch_call_output"`

          - `"apply_patch_call_output"`

        - `created_by: optional string`

        - `output: optional string`

      - `OpenAITypesResponsesResponseOutputItemMcpCall object { id, arguments, name, 6 more }`

        An invocation of a tool on an MCP server.

        - `id: string`

        - `arguments: string`

        - `name: string`

        - `server_label: string`

        - `type: "mcp_call"`

          - `"mcp_call"`

        - `approval_request_id: optional string`

        - `error: optional string`

        - `output: optional string`

        - `status: optional "in_progress" or "completed" or "incomplete" or 2 more`

          - `"in_progress"`

          - `"completed"`

          - `"incomplete"`

          - `"calling"`

          - `"failed"`

      - `OpenAITypesResponsesResponseOutputItemMcpListTools object { id, server_label, tools, 2 more }`

        A list of tools available on an MCP server.

        - `id: string`

        - `server_label: string`

        - `tools: array of object { input_schema, name, annotations, description }`

          - `input_schema: unknown`

          - `name: string`

          - `annotations: optional unknown`

          - `description: optional string`

        - `type: "mcp_list_tools"`

          - `"mcp_list_tools"`

        - `error: optional string`

      - `McpApprovalRequest object { id, arguments, name, 2 more }`

        A request for human approval of a tool invocation.

        - `id: string`

        - `arguments: string`

        - `name: string`

        - `server_label: string`

        - `type: "mcp_approval_request"`

          - `"mcp_approval_request"`

      - `OpenAIResponseCustomToolCall object { call_id, input, name, 2 more }`

        A call to a custom tool created by the model.

        - `call_id: string`

        - `input: string`

        - `name: string`

        - `type: "custom_tool_call"`

          - `"custom_tool_call"`

        - `id: optional string`

    - `parallel_tool_calls: boolean`

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

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

      - `"none" or "auto" or "required"`

        - `"none"`

        - `"auto"`

        - `"required"`

      - `ToolChoiceAllowed object { mode, tools, type }`

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

        - `mode: "auto" or "required"`

          - `"auto"`

          - `"required"`

        - `tools: array of map[unknown]`

        - `type: "allowed_tools"`

          - `"allowed_tools"`

      - `ToolChoiceTypes object { type }`

        Indicates that the model should use a built-in tool to generate a response.
        [Learn more about built-in tools](https://platform.openai.com/docs/guides/tools).

        - `type: "file_search" or "web_search_preview" or "computer_use_preview" or 3 more`

          - `"file_search"`

          - `"web_search_preview"`

          - `"computer_use_preview"`

          - `"web_search_preview_2025_03_11"`

          - `"image_generation"`

          - `"code_interpreter"`

      - `ToolChoiceFunction object { name, type }`

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

        - `name: string`

        - `type: "function"`

          - `"function"`

      - `ToolChoiceMcp object { server_label, type, name }`

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

        - `server_label: string`

        - `type: "mcp"`

          - `"mcp"`

        - `name: optional string`

      - `ToolChoiceCustom object { name, type }`

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

        - `name: string`

        - `type: "custom"`

          - `"custom"`

      - `ToolChoiceApplyPatch object { type }`

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

        - `type: "apply_patch"`

          - `"apply_patch"`

      - `ToolChoiceShell object { type }`

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

        - `type: "shell"`

          - `"shell"`

    - `tools: array of FunctionTool or FileSearchTool or ComputerTool or 9 more`

      - `FunctionTool object { name, type, description, 2 more }`

        Defines a function in your own code the model can choose to call.

        Learn more about [function calling](https://platform.openai.com/docs/guides/function-calling).

        - `name: string`

        - `type: "function"`

          - `"function"`

        - `description: optional string`

        - `parameters: optional map[unknown]`

        - `strict: optional boolean`

      - `FileSearchTool object { type, vector_store_ids, filters, 2 more }`

        A tool that searches for relevant content from uploaded files.

        Learn more about the [file search tool](https://platform.openai.com/docs/guides/tools-file-search).

        - `type: "file_search"`

          - `"file_search"`

        - `vector_store_ids: array of string`

        - `filters: optional object { key, type, value }  or object { filters, type }`

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

          - `ComparisonFilter object { key, type, value }`

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

            - `key: string`

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

              - `"eq"`

              - `"ne"`

              - `"gt"`

              - `"gte"`

              - `"lt"`

              - `"lte"`

            - `value: string or number or boolean or array of string or number`

              - `string`

              - `number`

              - `boolean`

              - `array of string or number`

                - `string`

                - `number`

          - `CompoundFilter object { filters, type }`

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

            - `filters: array of object { key, type, value }  or unknown`

              - `ComparisonFilter object { key, type, value }`

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

                - `key: string`

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

                  - `"eq"`

                  - `"ne"`

                  - `"gt"`

                  - `"gte"`

                  - `"lt"`

                  - `"lte"`

                - `value: string or number or boolean or array of string or number`

                  - `string`

                  - `number`

                  - `boolean`

                  - `array of string or number`

                    - `string`

                    - `number`

              - `unknown`

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

              - `"and"`

              - `"or"`

        - `max_num_results: optional number`

        - `ranking_options: optional object { hybrid_search, ranker, score_threshold }`

          Ranking options for search.

          - `hybrid_search: optional object { embedding_weight, text_weight }`

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

            - `embedding_weight: number`

            - `text_weight: number`

          - `ranker: optional "auto" or "default-2024-11-15"`

            - `"auto"`

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

          - `score_threshold: optional number`

      - `ComputerTool object { display_height, display_width, environment, type }`

        A tool that controls a virtual computer.

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

        - `display_height: number`

        - `display_width: number`

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

          - `"windows"`

          - `"mac"`

          - `"linux"`

          - `"ubuntu"`

          - `"browser"`

        - `type: "computer_use_preview"`

          - `"computer_use_preview"`

      - `WebSearchTool object { type, filters, search_context_size, user_location }`

        Search the Internet for sources related to the prompt.

        Learn more about the
        [web search tool](https://platform.openai.com/docs/guides/tools-web-search).

        - `type: "web_search" or "web_search_2025_08_26"`

          - `"web_search"`

          - `"web_search_2025_08_26"`

        - `filters: optional object { allowed_domains }`

          Filters for the search.

          - `allowed_domains: optional array of string`

        - `search_context_size: optional "low" or "medium" or "high"`

          - `"low"`

          - `"medium"`

          - `"high"`

        - `user_location: optional object { city, country, region, 2 more }`

          The approximate location of the user.

          - `city: optional string`

          - `country: optional string`

          - `region: optional string`

          - `timezone: optional string`

          - `type: optional "approximate"`

            - `"approximate"`

      - `Mcp object { server_label, type, allowed_tools, 6 more }`

        Give the model access to additional tools via remote Model Context Protocol
        (MCP) servers. [Learn more about MCP](https://platform.openai.com/docs/guides/tools-remote-mcp).

        - `server_label: string`

        - `type: "mcp"`

          - `"mcp"`

        - `allowed_tools: optional array of string or object { read_only, tool_names }`

          A filter object to specify which tools are allowed.

          - `array of string`

          - `McpAllowedToolsMcpToolFilter object { read_only, tool_names }`

            A filter object to specify which tools are allowed.

            - `read_only: optional boolean`

            - `tool_names: optional array of string`

        - `authorization: optional string`

        - `connector_id: optional "connector_dropbox" or "connector_gmail" or "connector_googlecalendar" or 5 more`

          - `"connector_dropbox"`

          - `"connector_gmail"`

          - `"connector_googlecalendar"`

          - `"connector_googledrive"`

          - `"connector_microsoftteams"`

          - `"connector_outlookcalendar"`

          - `"connector_outlookemail"`

          - `"connector_sharepoint"`

        - `headers: optional map[string]`

        - `require_approval: optional object { always, never }  or "always" or "never"`

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

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

          - `McpRequireApprovalMcpToolApprovalFilter object { always, never }`

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

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

            - `always: optional object { read_only, tool_names }`

              A filter object to specify which tools are allowed.

              - `read_only: optional boolean`

              - `tool_names: optional array of string`

            - `never: optional object { read_only, tool_names }`

              A filter object to specify which tools are allowed.

              - `read_only: optional boolean`

              - `tool_names: optional array of string`

          - `"always" or "never"`

            - `"always"`

            - `"never"`

        - `server_description: optional string`

        - `server_url: optional string`

      - `CodeInterpreter object { container, type }`

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

        - `container: string or object { type, file_ids, memory_limit, network_policy }`

          Configuration for a code interpreter container.

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

          - `string`

          - `CodeInterpreterContainerCodeInterpreterToolAuto object { type, file_ids, memory_limit, network_policy }`

            Configuration for a code interpreter container.

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

            - `type: "auto"`

              - `"auto"`

            - `file_ids: optional array of string`

            - `memory_limit: optional "1g" or "4g" or "16g" or "64g"`

              - `"1g"`

              - `"4g"`

              - `"16g"`

              - `"64g"`

            - `network_policy: optional ContainerNetworkPolicyDisabled or ContainerNetworkPolicyAllowlist`

              - `ContainerNetworkPolicyDisabled object { type }`

                - `type: "disabled"`

                  - `"disabled"`

              - `ContainerNetworkPolicyAllowlist object { allowed_domains, type, domain_secrets }`

                - `allowed_domains: array of string`

                - `type: "allowlist"`

                  - `"allowlist"`

                - `domain_secrets: optional array of object { domain, name, value }`

                  - `domain: string`

                  - `name: string`

                  - `value: string`

        - `type: "code_interpreter"`

          - `"code_interpreter"`

      - `ImageGeneration object { type, action, background, 9 more }`

        A tool that generates images using the GPT image models.

        - `type: "image_generation"`

          - `"image_generation"`

        - `action: optional "generate" or "edit" or "auto"`

          - `"generate"`

          - `"edit"`

          - `"auto"`

        - `background: optional "transparent" or "opaque" or "auto"`

          - `"transparent"`

          - `"opaque"`

          - `"auto"`

        - `input_fidelity: optional "high" or "low"`

          - `"high"`

          - `"low"`

        - `input_image_mask: optional object { file_id, image_url }`

          Optional mask for inpainting.

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

          - `file_id: optional string`

          - `image_url: optional string`

        - `model: optional string or "gpt-image-1" or "gpt-image-1-mini" or "gpt-image-1.5"`

          - `string`

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

            - `"gpt-image-1"`

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

            - `"gpt-image-1.5"`

        - `moderation: optional "auto" or "low"`

          - `"auto"`

          - `"low"`

        - `output_compression: optional number`

        - `output_format: optional "png" or "webp" or "jpeg"`

          - `"png"`

          - `"webp"`

          - `"jpeg"`

        - `partial_images: optional number`

        - `quality: optional "low" or "medium" or "high" or "auto"`

          - `"low"`

          - `"medium"`

          - `"high"`

          - `"auto"`

        - `size: optional "1024x1024" or "1024x1536" or "1536x1024" or "auto"`

          - `"1024x1024"`

          - `"1024x1536"`

          - `"1536x1024"`

          - `"auto"`

      - `LocalShell object { type }`

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

        - `type: "local_shell"`

          - `"local_shell"`

      - `FunctionShellTool object { type, environment }`

        A tool that allows the model to execute shell commands.

        - `type: "shell"`

          - `"shell"`

        - `environment: optional object { type, file_ids, memory_limit, 2 more }  or LocalEnvironment or ContainerReference`

          - `ContainerAuto object { type, file_ids, memory_limit, 2 more }`

            - `type: "container_auto"`

              - `"container_auto"`

            - `file_ids: optional array of string`

            - `memory_limit: optional "1g" or "4g" or "16g" or "64g"`

              - `"1g"`

              - `"4g"`

              - `"16g"`

              - `"64g"`

            - `network_policy: optional ContainerNetworkPolicyDisabled or ContainerNetworkPolicyAllowlist`

              - `ContainerNetworkPolicyDisabled object { type }`

              - `ContainerNetworkPolicyAllowlist object { allowed_domains, type, domain_secrets }`

            - `skills: optional array of object { skill_id, type, version }  or object { description, name, source, type }`

              - `SkillReference object { skill_id, type, version }`

                - `skill_id: string`

                - `type: "skill_reference"`

                  - `"skill_reference"`

                - `version: optional string`

              - `InlineSkill object { description, name, source, type }`

                - `description: string`

                - `name: string`

                - `source: object { data, media_type, type }`

                  Inline skill payload

                  - `data: string`

                  - `media_type: "application/zip"`

                    - `"application/zip"`

                  - `type: "base64"`

                    - `"base64"`

                - `type: "inline"`

                  - `"inline"`

          - `LocalEnvironment object { type, skills }`

            - `type: "local"`

              - `"local"`

            - `skills: optional array of object { description, name, path }`

              - `description: string`

              - `name: string`

              - `path: string`

          - `ContainerReference object { container_id, type }`

            - `container_id: string`

            - `type: "container_reference"`

              - `"container_reference"`

      - `CustomTool object { name, type, description, format }`

        A custom tool that processes input using a specified format.

        Learn more about   [custom tools](https://platform.openai.com/docs/guides/function-calling#custom-tools)

        - `name: string`

        - `type: "custom"`

          - `"custom"`

        - `description: optional string`

        - `format: optional object { type }  or object { definition, syntax, type }`

          Unconstrained free-form text.

          - `Text object { type }`

            Unconstrained free-form text.

            - `type: "text"`

              - `"text"`

          - `Grammar object { definition, syntax, type }`

            A grammar defined by the user.

            - `definition: string`

            - `syntax: "lark" or "regex"`

              - `"lark"`

              - `"regex"`

            - `type: "grammar"`

              - `"grammar"`

      - `WebSearchPreviewTool object { type, search_context_size, user_location }`

        This tool searches the web for relevant results to use in a response.

        Learn more about the [web search tool](https://platform.openai.com/docs/guides/tools-web-search).

        - `type: "web_search_preview" or "web_search_preview_2025_03_11"`

          - `"web_search_preview"`

          - `"web_search_preview_2025_03_11"`

        - `search_context_size: optional "low" or "medium" or "high"`

          - `"low"`

          - `"medium"`

          - `"high"`

        - `user_location: optional object { type, city, country, 2 more }`

          The user's location.

          - `type: "approximate"`

            - `"approximate"`

          - `city: optional string`

          - `country: optional string`

          - `region: optional string`

          - `timezone: optional string`

      - `ApplyPatchTool object { type }`

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

        - `type: "apply_patch"`

          - `"apply_patch"`

    - `background: optional boolean`

    - `completed_at: optional number`

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

    - `error: optional OpenAIResponseError`

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

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

        - `"server_error"`

        - `"rate_limit_exceeded"`

        - `"invalid_prompt"`

        - `"vector_store_timeout"`

        - `"invalid_image"`

        - `"invalid_image_format"`

        - `"invalid_base64_image"`

        - `"invalid_image_url"`

        - `"image_too_large"`

        - `"image_too_small"`

        - `"image_parse_error"`

        - `"image_content_policy_violation"`

        - `"invalid_image_mode"`

        - `"image_file_too_large"`

        - `"unsupported_image_media_type"`

        - `"empty_image_file"`

        - `"failed_to_download_image"`

        - `"image_file_not_found"`

      - `message: string`

    - `incomplete_details: optional IncompleteDetails`

      Details about why the response is incomplete.

      - `reason: optional "max_output_tokens" or "content_filter"`

        - `"max_output_tokens"`

        - `"content_filter"`

    - `instructions: optional string or array of EasyInputMessage or OpenAITypesResponsesResponseInputItemMessage or OpenAIResponseOutputMessage or 23 more`

      - `string`

      - `InputItems = array of EasyInputMessage or OpenAITypesResponsesResponseInputItemMessage or OpenAIResponseOutputMessage or 23 more`

        - `EasyInputMessage object { content, role, phase, type }`

          A message input to the model with a role indicating instruction following
          hierarchy. Instructions given with the `developer` or `system` role take
          precedence over instructions given with the `user` role. Messages with the
          `assistant` role are presumed to have been generated by the model in previous
          interactions.

          - `content: string or array of OpenAIResponseInputText or OpenAIResponseInputImage or OpenAIResponseInputFile`

            - `string`

            - `InputItems = array of OpenAIResponseInputText or OpenAIResponseInputImage or OpenAIResponseInputFile`

              - `OpenAIResponseInputText object { text, type }`

                A text input to the model.

                - `text: string`

                - `type: "input_text"`

                  - `"input_text"`

              - `OpenAIResponseInputImage object { detail, type, file_id, image_url }`

                An image input to the model.

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

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

                  - `"low"`

                  - `"high"`

                  - `"auto"`

                - `type: "input_image"`

                  - `"input_image"`

                - `file_id: optional string`

                - `image_url: optional string`

              - `OpenAIResponseInputFile object { type, file_data, file_id, 2 more }`

                A file input to the model.

                - `type: "input_file"`

                  - `"input_file"`

                - `file_data: optional string`

                - `file_id: optional string`

                - `file_url: optional string`

                - `filename: optional string`

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

            - `"user"`

            - `"assistant"`

            - `"system"`

            - `"developer"`

          - `phase: optional "commentary" or "final_answer"`

            - `"commentary"`

            - `"final_answer"`

          - `type: optional "message"`

            - `"message"`

        - `OpenAITypesResponsesResponseInputItemMessage object { content, role, status, type }`

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

          - `content: array of OpenAIResponseInputText or OpenAIResponseInputImage or OpenAIResponseInputFile`

            - `OpenAIResponseInputText object { text, type }`

              A text input to the model.

            - `OpenAIResponseInputImage object { detail, type, file_id, image_url }`

              An image input to the model.

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

            - `OpenAIResponseInputFile object { type, file_data, file_id, 2 more }`

              A file input to the model.

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

            - `"user"`

            - `"system"`

            - `"developer"`

          - `status: optional "in_progress" or "completed" or "incomplete"`

            - `"in_progress"`

            - `"completed"`

            - `"incomplete"`

          - `type: optional "message"`

            - `"message"`

        - `OpenAIResponseOutputMessage object { id, content, role, 3 more }`

          An output message from the model.

        - `OpenAIResponseFileSearchToolCall object { id, queries, status, 2 more }`

          The results of a file search tool call.

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

        - `OpenAIResponseComputerToolCall object { id, action, call_id, 3 more }`

          A tool call to a computer use tool.

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

        - `OpenAITypesResponsesResponseInputItemComputerCallOutput object { call_id, output, type, 3 more }`

          The output of a computer tool call.

          - `call_id: string`

          - `output: ResponseComputerToolCallOutputScreenshot`

            A computer screenshot image used with the computer use tool.

            - `type: "computer_screenshot"`

              - `"computer_screenshot"`

            - `file_id: optional string`

            - `image_url: optional string`

          - `type: "computer_call_output"`

            - `"computer_call_output"`

          - `id: optional string`

          - `acknowledged_safety_checks: optional array of object { id, code, message }`

            - `id: string`

            - `code: optional string`

            - `message: optional string`

          - `status: optional "in_progress" or "completed" or "incomplete"`

            - `"in_progress"`

            - `"completed"`

            - `"incomplete"`

        - `OpenAIResponseFunctionWebSearch object { id, action, status, type }`

          The results of a web search tool call.

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

        - `OpenAIResponseFunctionToolCall object { arguments, call_id, name, 3 more }`

          A tool call to run a function.

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

        - `OpenAITypesResponsesResponseInputItemFunctionCallOutput object { call_id, output, type, 2 more }`

          The output of a function tool call.

          - `call_id: string`

          - `output: string or array of object { text, type }  or object { type, detail, file_id, image_url }  or object { type, file_data, file_id, 2 more }`

            - `string`

            - `OutputContentList = array of object { text, type }  or object { type, detail, file_id, image_url }  or object { type, file_data, file_id, 2 more }`

              - `ResponseInputTextContent object { text, type }`

                A text input to the model.

                - `text: string`

                - `type: "input_text"`

                  - `"input_text"`

              - `ResponseInputImageContent object { type, detail, file_id, image_url }`

                An image input to the model.

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

                - `type: "input_image"`

                  - `"input_image"`

                - `detail: optional "low" or "high" or "auto"`

                  - `"low"`

                  - `"high"`

                  - `"auto"`

                - `file_id: optional string`

                - `image_url: optional string`

              - `ResponseInputFileContent object { type, file_data, file_id, 2 more }`

                A file input to the model.

                - `type: "input_file"`

                  - `"input_file"`

                - `file_data: optional string`

                - `file_id: optional string`

                - `file_url: optional string`

                - `filename: optional string`

          - `type: "function_call_output"`

            - `"function_call_output"`

          - `id: optional string`

          - `status: optional "in_progress" or "completed" or "incomplete"`

            - `"in_progress"`

            - `"completed"`

            - `"incomplete"`

        - `OpenAIResponseReasoningItem object { id, summary, type, 3 more }`

          A description of the chain of thought used by a reasoning model while generating
          a response. Be sure to include these items in your `input` to the Responses API
          for subsequent turns of a conversation if you are manually
          [managing context](https://platform.openai.com/docs/guides/conversation-state).

        - `ResponseCompactionItemParam object { encrypted_content, type, id }`

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

          - `encrypted_content: string`

          - `type: "compaction"`

            - `"compaction"`

          - `id: optional string`

        - `OpenAITypesResponsesResponseInputItemImageGenerationCall object { id, status, type, result }`

          An image generation request made by the model.

          - `id: string`

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

            - `"in_progress"`

            - `"completed"`

            - `"generating"`

            - `"failed"`

          - `type: "image_generation_call"`

            - `"image_generation_call"`

          - `result: optional string`

        - `OpenAIResponseCodeInterpreterToolCall object { id, container_id, status, 3 more }`

          A tool call to run code.

        - `OpenAITypesResponsesResponseInputItemLocalShellCall object { id, action, call_id, 2 more }`

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

          - `id: string`

          - `action: object { command, env, type, 3 more }`

            Execute a shell command on the server.

            - `command: array of string`

            - `env: map[string]`

            - `type: "exec"`

              - `"exec"`

            - `timeout_ms: optional number`

            - `user: optional string`

            - `working_directory: optional string`

          - `call_id: string`

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

            - `"in_progress"`

            - `"completed"`

            - `"incomplete"`

          - `type: "local_shell_call"`

            - `"local_shell_call"`

        - `OpenAITypesResponsesResponseInputItemLocalShellCallOutput object { id, output, type, status }`

          The output of a local shell tool call.

          - `id: string`

          - `output: string`

          - `type: "local_shell_call_output"`

            - `"local_shell_call_output"`

          - `status: optional "in_progress" or "completed" or "incomplete"`

            - `"in_progress"`

            - `"completed"`

            - `"incomplete"`

        - `ShellCall object { action, call_id, type, 3 more }`

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

          - `action: object { commands, max_output_length, timeout_ms }`

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

            - `commands: array of string`

            - `max_output_length: optional number`

            - `timeout_ms: optional number`

          - `call_id: string`

          - `type: "shell_call"`

            - `"shell_call"`

          - `id: optional string`

          - `environment: optional LocalEnvironment or ContainerReference`

            - `LocalEnvironment object { type, skills }`

            - `ContainerReference object { container_id, type }`

          - `status: optional "in_progress" or "completed" or "incomplete"`

            - `"in_progress"`

            - `"completed"`

            - `"incomplete"`

        - `ShellCallOutput object { call_id, output, type, 3 more }`

          The streamed output items emitted by a shell tool call.

          - `call_id: string`

          - `output: array of object { outcome, stderr, stdout }`

            - `outcome: object { type }  or object { exit_code, type }`

              Indicates that the shell call exceeded its configured time limit.

              - `OutcomeTimeout object { type }`

                Indicates that the shell call exceeded its configured time limit.

                - `type: "timeout"`

                  - `"timeout"`

              - `OutcomeExit object { exit_code, type }`

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

                - `exit_code: number`

                - `type: "exit"`

                  - `"exit"`

            - `stderr: string`

            - `stdout: string`

          - `type: "shell_call_output"`

            - `"shell_call_output"`

          - `id: optional string`

          - `max_output_length: optional number`

          - `status: optional "in_progress" or "completed" or "incomplete"`

            - `"in_progress"`

            - `"completed"`

            - `"incomplete"`

        - `ApplyPatchCall object { call_id, operation, status, 2 more }`

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

          - `call_id: string`

          - `operation: object { diff, path, type }  or object { path, type }  or object { diff, path, type }`

            Instruction for creating a new file via the apply_patch tool.

            - `ApplyPatchCallOperationCreateFile object { diff, path, type }`

              Instruction for creating a new file via the apply_patch tool.

              - `diff: string`

              - `path: string`

              - `type: "create_file"`

                - `"create_file"`

            - `ApplyPatchCallOperationDeleteFile object { path, type }`

              Instruction for deleting an existing file via the apply_patch tool.

              - `path: string`

              - `type: "delete_file"`

                - `"delete_file"`

            - `ApplyPatchCallOperationUpdateFile object { diff, path, type }`

              Instruction for updating an existing file via the apply_patch tool.

              - `diff: string`

              - `path: string`

              - `type: "update_file"`

                - `"update_file"`

          - `status: "in_progress" or "completed"`

            - `"in_progress"`

            - `"completed"`

          - `type: "apply_patch_call"`

            - `"apply_patch_call"`

          - `id: optional string`

        - `ApplyPatchCallOutput object { call_id, status, type, 2 more }`

          The streamed output emitted by an apply patch tool call.

          - `call_id: string`

          - `status: "completed" or "failed"`

            - `"completed"`

            - `"failed"`

          - `type: "apply_patch_call_output"`

            - `"apply_patch_call_output"`

          - `id: optional string`

          - `output: optional string`

        - `OpenAITypesResponsesResponseInputItemMcpListTools object { id, server_label, tools, 2 more }`

          A list of tools available on an MCP server.

          - `id: string`

          - `server_label: string`

          - `tools: array of object { input_schema, name, annotations, description }`

            - `input_schema: unknown`

            - `name: string`

            - `annotations: optional unknown`

            - `description: optional string`

          - `type: "mcp_list_tools"`

            - `"mcp_list_tools"`

          - `error: optional string`

        - `McpApprovalRequest object { id, arguments, name, 2 more }`

          A request for human approval of a tool invocation.

        - `OpenAITypesResponsesResponseInputItemMcpApprovalResponse object { approval_request_id, approve, type, 2 more }`

          A response to an MCP approval request.

          - `approval_request_id: string`

          - `approve: boolean`

          - `type: "mcp_approval_response"`

            - `"mcp_approval_response"`

          - `id: optional string`

          - `reason: optional string`

        - `OpenAITypesResponsesResponseInputItemMcpCall object { id, arguments, name, 6 more }`

          An invocation of a tool on an MCP server.

          - `id: string`

          - `arguments: string`

          - `name: string`

          - `server_label: string`

          - `type: "mcp_call"`

            - `"mcp_call"`

          - `approval_request_id: optional string`

          - `error: optional string`

          - `output: optional string`

          - `status: optional "in_progress" or "completed" or "incomplete" or 2 more`

            - `"in_progress"`

            - `"completed"`

            - `"incomplete"`

            - `"calling"`

            - `"failed"`

        - `OpenAIResponseCustomToolCallOutput object { call_id, output, type, id }`

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

          - `call_id: string`

          - `output: string or array of OpenAIResponseInputText or OpenAIResponseInputImage or OpenAIResponseInputFile`

            - `string`

            - `OutputContentList = array of OpenAIResponseInputText or OpenAIResponseInputImage or OpenAIResponseInputFile`

              - `OpenAIResponseInputText object { text, type }`

                A text input to the model.

              - `OpenAIResponseInputImage object { detail, type, file_id, image_url }`

                An image input to the model.

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

              - `OpenAIResponseInputFile object { type, file_data, file_id, 2 more }`

                A file input to the model.

          - `type: "custom_tool_call_output"`

            - `"custom_tool_call_output"`

          - `id: optional string`

        - `OpenAIResponseCustomToolCall object { call_id, input, name, 2 more }`

          A call to a custom tool created by the model.

        - `OpenAITypesResponsesResponseInputItemItemReference object { id, type }`

          An internal identifier for an item to reference.

          - `id: string`

          - `type: optional "item_reference"`

            - `"item_reference"`

    - `max_output_tokens: optional number`

    - `max_tool_calls: optional number`

    - `metadata: optional map[string]`

    - `previous_response_id: optional string`

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

      - `variables: optional map[string or OpenAIResponseInputText or OpenAIResponseInputImage or OpenAIResponseInputFile]`

        - `string`

        - `OpenAIResponseInputText object { text, type }`

          A text input to the model.

        - `OpenAIResponseInputImage object { detail, type, file_id, image_url }`

          An image input to the model.

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

        - `OpenAIResponseInputFile object { type, file_data, file_id, 2 more }`

          A file input to the model.

      - `version: optional string`

    - `prompt_cache_key: optional string`

    - `prompt_cache_retention: optional "in-memory" or "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 "none" or "minimal" or "low" or 3 more`

        - `"none"`

        - `"minimal"`

        - `"low"`

        - `"medium"`

        - `"high"`

        - `"xhigh"`

      - `generate_summary: optional "auto" or "concise" or "detailed"`

        - `"auto"`

        - `"concise"`

        - `"detailed"`

      - `summary: optional "auto" or "concise" or "detailed"`

        - `"auto"`

        - `"concise"`

        - `"detailed"`

    - `safety_identifier: optional string`

    - `service_tier: optional "auto" or "default" or "flex" or 2 more`

      - `"auto"`

      - `"default"`

      - `"flex"`

      - `"scale"`

      - `"priority"`

    - `status: optional "completed" or "failed" or "in_progress" or 3 more`

      - `"completed"`

      - `"failed"`

      - `"in_progress"`

      - `"cancelled"`

      - `"queued"`

      - `"incomplete"`

    - `temperature: optional number`

    - `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 object { type }  or object { name, schema, type, 2 more }  or object { type }`

        Default response format. Used to generate text responses.

        - `ResponseFormatText object { type }`

          Default response format. Used to generate text responses.

          - `type: "text"`

            - `"text"`

        - `ResponseFormatTextJsonSchemaConfig object { name, schema, type, 2 more }`

          JSON Schema response format.

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

          - `name: string`

          - `schema: map[unknown]`

          - `type: "json_schema"`

            - `"json_schema"`

          - `description: optional string`

          - `strict: optional boolean`

        - `ResponseFormatJsonObject object { type }`

          JSON object response format.

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

          - `type: "json_object"`

            - `"json_object"`

      - `verbosity: optional "low" or "medium" or "high"`

        - `"low"`

        - `"medium"`

        - `"high"`

    - `top_logprobs: optional number`

    - `top_p: optional number`

    - `truncation: optional "auto" or "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: number`

      - `input_tokens_details: object { cached_tokens }`

        A detailed breakdown of the input tokens.

        - `cached_tokens: number`

      - `output_tokens: number`

      - `output_tokens_details: object { reasoning_tokens }`

        A detailed breakdown of the output tokens.

        - `reasoning_tokens: number`

      - `total_tokens: number`

    - `user: optional string`

  - `ResponseAudioDeltaEvent object { delta, sequence_number, type }`

    Emitted when there is a partial audio response.

    - `delta: string`

    - `sequence_number: number`

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

      - `"response.audio.delta"`

  - `ResponseAudioDoneEvent object { sequence_number, type }`

    Emitted when the audio response is complete.

    - `sequence_number: number`

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

      - `"response.audio.done"`

  - `ResponseAudioTranscriptDeltaEvent object { delta, sequence_number, type }`

    Emitted when there is a partial transcript of audio.

    - `delta: string`

    - `sequence_number: number`

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

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

  - `ResponseAudioTranscriptDoneEvent object { sequence_number, type }`

    Emitted when the full audio transcript is completed.

    - `sequence_number: number`

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

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

  - `ResponseCodeInterpreterCallCodeDeltaEvent object { delta, item_id, output_index, 2 more }`

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

    - `delta: string`

    - `item_id: string`

    - `output_index: number`

    - `sequence_number: number`

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

      - `"response.code_interpreter_call_code.delta"`

  - `ResponseCodeInterpreterCallCodeDoneEvent object { code, item_id, output_index, 2 more }`

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

    - `code: string`

    - `item_id: string`

    - `output_index: number`

    - `sequence_number: number`

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

      - `"response.code_interpreter_call_code.done"`

  - `ResponseCodeInterpreterCallCompletedEvent object { item_id, output_index, sequence_number, type }`

    Emitted when the code interpreter call is completed.

    - `item_id: string`

    - `output_index: number`

    - `sequence_number: number`

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

      - `"response.code_interpreter_call.completed"`

  - `ResponseCodeInterpreterCallInProgressEvent object { item_id, output_index, sequence_number, type }`

    Emitted when a code interpreter call is in progress.

    - `item_id: string`

    - `output_index: number`

    - `sequence_number: number`

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

      - `"response.code_interpreter_call.in_progress"`

  - `ResponseCodeInterpreterCallInterpretingEvent object { item_id, output_index, sequence_number, type }`

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

    - `item_id: string`

    - `output_index: number`

    - `sequence_number: number`

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

      - `"response.code_interpreter_call.interpreting"`

  - `ResponseCompletedEvent object { response, sequence_number, type }`

    Emitted when the model response is complete.

    - `response: OpenAIResponse`

    - `sequence_number: number`

    - `type: "response.completed"`

      - `"response.completed"`

  - `ResponseContentPartAddedEvent object { content_index, item_id, output_index, 3 more }`

    Emitted when a new content part is added.

    - `content_index: number`

    - `item_id: string`

    - `output_index: number`

    - `part: OpenAIResponseOutputText or OpenAIResponseOutputRefusal or PartReasoningText`

      A text output from the model.

      - `OpenAIResponseOutputText object { annotations, text, type, logprobs }`

        A text output from the model.

      - `OpenAIResponseOutputRefusal object { refusal, type }`

        A refusal from the model.

      - `PartReasoningText object { text, type }`

        Reasoning text from the model.

        - `text: string`

        - `type: "reasoning_text"`

          - `"reasoning_text"`

    - `sequence_number: number`

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

      - `"response.content_part.added"`

  - `ResponseContentPartDoneEvent object { content_index, item_id, output_index, 3 more }`

    Emitted when a content part is done.

    - `content_index: number`

    - `item_id: string`

    - `output_index: number`

    - `part: OpenAIResponseOutputText or OpenAIResponseOutputRefusal or PartReasoningText`

      A text output from the model.

      - `OpenAIResponseOutputText object { annotations, text, type, logprobs }`

        A text output from the model.

      - `OpenAIResponseOutputRefusal object { refusal, type }`

        A refusal from the model.

      - `PartReasoningText object { text, type }`

        Reasoning text from the model.

    - `sequence_number: number`

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

      - `"response.content_part.done"`

  - `ResponseCreatedEvent object { response, sequence_number, type }`

    An event that is emitted when a response is created.

    - `response: OpenAIResponse`

    - `sequence_number: number`

    - `type: "response.created"`

      - `"response.created"`

  - `ResponseErrorEvent object { message, sequence_number, type, 2 more }`

    Emitted when an error occurs.

    - `message: string`

    - `sequence_number: number`

    - `type: "error"`

      - `"error"`

    - `code: optional string`

    - `param: optional string`

  - `ResponseFileSearchCallCompletedEvent object { item_id, output_index, sequence_number, type }`

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

    - `item_id: string`

    - `output_index: number`

    - `sequence_number: number`

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

      - `"response.file_search_call.completed"`

  - `ResponseFileSearchCallInProgressEvent object { item_id, output_index, sequence_number, type }`

    Emitted when a file search call is initiated.

    - `item_id: string`

    - `output_index: number`

    - `sequence_number: number`

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

      - `"response.file_search_call.in_progress"`

  - `ResponseFileSearchCallSearchingEvent object { item_id, output_index, sequence_number, type }`

    Emitted when a file search is currently searching.

    - `item_id: string`

    - `output_index: number`

    - `sequence_number: number`

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

      - `"response.file_search_call.searching"`

  - `ResponseFunctionCallArgumentsDeltaEvent object { delta, item_id, output_index, 2 more }`

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

    - `delta: string`

    - `item_id: string`

    - `output_index: number`

    - `sequence_number: number`

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

      - `"response.function_call_arguments.delta"`

  - `ResponseFunctionCallArgumentsDoneEvent object { arguments, item_id, name, 3 more }`

    Emitted when function-call arguments are finalized.

    - `arguments: string`

    - `item_id: string`

    - `name: string`

    - `output_index: number`

    - `sequence_number: number`

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

      - `"response.function_call_arguments.done"`

  - `ResponseInProgressEvent object { response, sequence_number, type }`

    Emitted when the response is in progress.

    - `response: OpenAIResponse`

    - `sequence_number: number`

    - `type: "response.in_progress"`

      - `"response.in_progress"`

  - `ResponseFailedEvent object { response, sequence_number, type }`

    An event that is emitted when a response fails.

    - `response: OpenAIResponse`

    - `sequence_number: number`

    - `type: "response.failed"`

      - `"response.failed"`

  - `ResponseIncompleteEvent object { response, sequence_number, type }`

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

    - `response: OpenAIResponse`

    - `sequence_number: number`

    - `type: "response.incomplete"`

      - `"response.incomplete"`

  - `ResponseOutputItemAddedEvent object { item, output_index, sequence_number, type }`

    Emitted when a new output item is added.

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

      An output message from the model.

      - `OpenAIResponseOutputMessage object { id, content, role, 3 more }`

        An output message from the model.

      - `OpenAIResponseFileSearchToolCall object { id, queries, status, 2 more }`

        The results of a file search tool call.

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

      - `OpenAIResponseFunctionToolCall object { arguments, call_id, name, 3 more }`

        A tool call to run a function.

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

      - `OpenAIResponseFunctionWebSearch object { id, action, status, type }`

        The results of a web search tool call.

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

      - `OpenAIResponseComputerToolCall object { id, action, call_id, 3 more }`

        A tool call to a computer use tool.

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

      - `OpenAIResponseReasoningItem object { id, summary, type, 3 more }`

        A description of the chain of thought used by a reasoning model while generating
        a response. Be sure to include these items in your `input` to the Responses API
        for subsequent turns of a conversation if you are manually
        [managing context](https://platform.openai.com/docs/guides/conversation-state).

      - `ResponseCompactionItem object { id, encrypted_content, type, created_by }`

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

      - `OpenAITypesResponsesResponseOutputItemImageGenerationCall object { id, status, type, result }`

        An image generation request made by the model.

      - `OpenAIResponseCodeInterpreterToolCall object { id, container_id, status, 3 more }`

        A tool call to run code.

      - `OpenAITypesResponsesResponseOutputItemLocalShellCall object { id, action, call_id, 2 more }`

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

      - `ResponseFunctionShellToolCall object { id, action, call_id, 4 more }`

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

      - `ResponseFunctionShellToolCallOutput object { id, call_id, output, 4 more }`

        The output of a shell tool call that was emitted.

      - `ResponseApplyPatchToolCall object { id, call_id, operation, 3 more }`

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

      - `ResponseApplyPatchToolCallOutput object { id, call_id, status, 3 more }`

        The output emitted by an apply patch tool call.

      - `OpenAITypesResponsesResponseOutputItemMcpCall object { id, arguments, name, 6 more }`

        An invocation of a tool on an MCP server.

      - `OpenAITypesResponsesResponseOutputItemMcpListTools object { id, server_label, tools, 2 more }`

        A list of tools available on an MCP server.

      - `McpApprovalRequest object { id, arguments, name, 2 more }`

        A request for human approval of a tool invocation.

      - `OpenAIResponseCustomToolCall object { call_id, input, name, 2 more }`

        A call to a custom tool created by the model.

    - `output_index: number`

    - `sequence_number: number`

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

      - `"response.output_item.added"`

  - `ResponseOutputItemDoneEvent object { item, output_index, sequence_number, type }`

    Emitted when an output item is marked done.

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

      An output message from the model.

      - `OpenAIResponseOutputMessage object { id, content, role, 3 more }`

        An output message from the model.

      - `OpenAIResponseFileSearchToolCall object { id, queries, status, 2 more }`

        The results of a file search tool call.

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

      - `OpenAIResponseFunctionToolCall object { arguments, call_id, name, 3 more }`

        A tool call to run a function.

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

      - `OpenAIResponseFunctionWebSearch object { id, action, status, type }`

        The results of a web search tool call.

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

      - `OpenAIResponseComputerToolCall object { id, action, call_id, 3 more }`

        A tool call to a computer use tool.

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

      - `OpenAIResponseReasoningItem object { id, summary, type, 3 more }`

        A description of the chain of thought used by a reasoning model while generating
        a response. Be sure to include these items in your `input` to the Responses API
        for subsequent turns of a conversation if you are manually
        [managing context](https://platform.openai.com/docs/guides/conversation-state).

      - `ResponseCompactionItem object { id, encrypted_content, type, created_by }`

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

      - `OpenAITypesResponsesResponseOutputItemImageGenerationCall object { id, status, type, result }`

        An image generation request made by the model.

      - `OpenAIResponseCodeInterpreterToolCall object { id, container_id, status, 3 more }`

        A tool call to run code.

      - `OpenAITypesResponsesResponseOutputItemLocalShellCall object { id, action, call_id, 2 more }`

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

      - `ResponseFunctionShellToolCall object { id, action, call_id, 4 more }`

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

      - `ResponseFunctionShellToolCallOutput object { id, call_id, output, 4 more }`

        The output of a shell tool call that was emitted.

      - `ResponseApplyPatchToolCall object { id, call_id, operation, 3 more }`

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

      - `ResponseApplyPatchToolCallOutput object { id, call_id, status, 3 more }`

        The output emitted by an apply patch tool call.

      - `OpenAITypesResponsesResponseOutputItemMcpCall object { id, arguments, name, 6 more }`

        An invocation of a tool on an MCP server.

      - `OpenAITypesResponsesResponseOutputItemMcpListTools object { id, server_label, tools, 2 more }`

        A list of tools available on an MCP server.

      - `McpApprovalRequest object { id, arguments, name, 2 more }`

        A request for human approval of a tool invocation.

      - `OpenAIResponseCustomToolCall object { call_id, input, name, 2 more }`

        A call to a custom tool created by the model.

    - `output_index: number`

    - `sequence_number: number`

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

      - `"response.output_item.done"`

  - `ResponseReasoningSummaryPartAddedEvent object { item_id, output_index, part, 3 more }`

    Emitted when a new reasoning summary part is added.

    - `item_id: string`

    - `output_index: number`

    - `part: object { text, type }`

      The summary part that was added.

      - `text: string`

      - `type: "summary_text"`

        - `"summary_text"`

    - `sequence_number: number`

    - `summary_index: number`

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

      - `"response.reasoning_summary_part.added"`

  - `ResponseReasoningSummaryPartDoneEvent object { item_id, output_index, part, 3 more }`

    Emitted when a reasoning summary part is completed.

    - `item_id: string`

    - `output_index: number`

    - `part: object { text, type }`

      The completed summary part.

      - `text: string`

      - `type: "summary_text"`

        - `"summary_text"`

    - `sequence_number: number`

    - `summary_index: number`

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

      - `"response.reasoning_summary_part.done"`

  - `ResponseReasoningSummaryTextDeltaEvent object { delta, item_id, output_index, 3 more }`

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

    - `delta: string`

    - `item_id: string`

    - `output_index: number`

    - `sequence_number: number`

    - `summary_index: number`

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

      - `"response.reasoning_summary_text.delta"`

  - `ResponseReasoningSummaryTextDoneEvent object { item_id, output_index, sequence_number, 3 more }`

    Emitted when a reasoning summary text is completed.

    - `item_id: string`

    - `output_index: number`

    - `sequence_number: number`

    - `summary_index: number`

    - `text: string`

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

      - `"response.reasoning_summary_text.done"`

  - `ResponseReasoningTextDeltaEvent object { content_index, delta, item_id, 3 more }`

    Emitted when a delta is added to a reasoning text.

    - `content_index: number`

    - `delta: string`

    - `item_id: string`

    - `output_index: number`

    - `sequence_number: number`

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

      - `"response.reasoning_text.delta"`

  - `ResponseReasoningTextDoneEvent object { content_index, item_id, output_index, 3 more }`

    Emitted when a reasoning text is completed.

    - `content_index: number`

    - `item_id: string`

    - `output_index: number`

    - `sequence_number: number`

    - `text: string`

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

      - `"response.reasoning_text.done"`

  - `ResponseRefusalDeltaEvent object { content_index, delta, item_id, 3 more }`

    Emitted when there is a partial refusal text.

    - `content_index: number`

    - `delta: string`

    - `item_id: string`

    - `output_index: number`

    - `sequence_number: number`

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

      - `"response.refusal.delta"`

  - `ResponseRefusalDoneEvent object { content_index, item_id, output_index, 3 more }`

    Emitted when refusal text is finalized.

    - `content_index: number`

    - `item_id: string`

    - `output_index: number`

    - `refusal: string`

    - `sequence_number: number`

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

      - `"response.refusal.done"`

  - `ResponseTextDeltaEvent object { content_index, delta, item_id, 4 more }`

    Emitted when there is an additional text delta.

    - `content_index: number`

    - `delta: string`

    - `item_id: string`

    - `logprobs: array of object { token, logprob, top_logprobs }`

      - `token: string`

      - `logprob: number`

      - `top_logprobs: optional array of object { token, logprob }`

        - `token: optional string`

        - `logprob: optional number`

    - `output_index: number`

    - `sequence_number: number`

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

      - `"response.output_text.delta"`

  - `ResponseTextDoneEvent object { content_index, item_id, logprobs, 4 more }`

    Emitted when text content is finalized.

    - `content_index: number`

    - `item_id: string`

    - `logprobs: array of object { token, logprob, top_logprobs }`

      - `token: string`

      - `logprob: number`

      - `top_logprobs: optional array of object { token, logprob }`

        - `token: optional string`

        - `logprob: optional number`

    - `output_index: number`

    - `sequence_number: number`

    - `text: string`

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

      - `"response.output_text.done"`

  - `ResponseWebSearchCallCompletedEvent object { item_id, output_index, sequence_number, type }`

    Emitted when a web search call is completed.

    - `item_id: string`

    - `output_index: number`

    - `sequence_number: number`

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

      - `"response.web_search_call.completed"`

  - `ResponseWebSearchCallInProgressEvent object { item_id, output_index, sequence_number, type }`

    Emitted when a web search call is initiated.

    - `item_id: string`

    - `output_index: number`

    - `sequence_number: number`

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

      - `"response.web_search_call.in_progress"`

  - `ResponseWebSearchCallSearchingEvent object { item_id, output_index, sequence_number, type }`

    Emitted when a web search call is executing.

    - `item_id: string`

    - `output_index: number`

    - `sequence_number: number`

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

      - `"response.web_search_call.searching"`

  - `ResponseImageGenCallCompletedEvent object { item_id, output_index, sequence_number, type }`

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

    - `item_id: string`

    - `output_index: number`

    - `sequence_number: number`

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

      - `"response.image_generation_call.completed"`

  - `ResponseImageGenCallGeneratingEvent object { item_id, output_index, sequence_number, type }`

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

    - `item_id: string`

    - `output_index: number`

    - `sequence_number: number`

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

      - `"response.image_generation_call.generating"`

  - `ResponseImageGenCallInProgressEvent object { item_id, output_index, sequence_number, type }`

    Emitted when an image generation tool call is in progress.

    - `item_id: string`

    - `output_index: number`

    - `sequence_number: number`

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

      - `"response.image_generation_call.in_progress"`

  - `ResponseImageGenCallPartialImageEvent object { item_id, output_index, partial_image_b64, 3 more }`

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

    - `item_id: string`

    - `output_index: number`

    - `partial_image_b64: string`

    - `partial_image_index: number`

    - `sequence_number: number`

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

      - `"response.image_generation_call.partial_image"`

  - `ResponseMcpCallArgumentsDeltaEvent object { delta, item_id, output_index, 2 more }`

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

    - `delta: string`

    - `item_id: string`

    - `output_index: number`

    - `sequence_number: number`

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

      - `"response.mcp_call_arguments.delta"`

  - `ResponseMcpCallArgumentsDoneEvent object { arguments, item_id, output_index, 2 more }`

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

    - `arguments: string`

    - `item_id: string`

    - `output_index: number`

    - `sequence_number: number`

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

      - `"response.mcp_call_arguments.done"`

  - `ResponseMcpCallCompletedEvent object { item_id, output_index, sequence_number, type }`

    Emitted when an MCP  tool call has completed successfully.

    - `item_id: string`

    - `output_index: number`

    - `sequence_number: number`

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

      - `"response.mcp_call.completed"`

  - `ResponseMcpCallFailedEvent object { item_id, output_index, sequence_number, type }`

    Emitted when an MCP  tool call has failed.

    - `item_id: string`

    - `output_index: number`

    - `sequence_number: number`

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

      - `"response.mcp_call.failed"`

  - `ResponseMcpCallInProgressEvent object { item_id, output_index, sequence_number, type }`

    Emitted when an MCP  tool call is in progress.

    - `item_id: string`

    - `output_index: number`

    - `sequence_number: number`

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

      - `"response.mcp_call.in_progress"`

  - `ResponseMcpListToolsCompletedEvent object { item_id, output_index, sequence_number, type }`

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

    - `item_id: string`

    - `output_index: number`

    - `sequence_number: number`

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

      - `"response.mcp_list_tools.completed"`

  - `ResponseMcpListToolsFailedEvent object { item_id, output_index, sequence_number, type }`

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

    - `item_id: string`

    - `output_index: number`

    - `sequence_number: number`

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

      - `"response.mcp_list_tools.failed"`

  - `ResponseMcpListToolsInProgressEvent object { item_id, output_index, sequence_number, type }`

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

    - `item_id: string`

    - `output_index: number`

    - `sequence_number: number`

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

      - `"response.mcp_list_tools.in_progress"`

  - `ResponseOutputTextAnnotationAddedEvent object { annotation, annotation_index, content_index, 4 more }`

    Emitted when an annotation is added to output text content.

    - `annotation: unknown`

    - `annotation_index: number`

    - `content_index: number`

    - `item_id: string`

    - `output_index: number`

    - `sequence_number: number`

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

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

  - `ResponseQueuedEvent object { response, sequence_number, type }`

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

    - `response: OpenAIResponse`

    - `sequence_number: number`

    - `type: "response.queued"`

      - `"response.queued"`

  - `ResponseCustomToolCallInputDeltaEvent object { delta, item_id, output_index, 2 more }`

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

    - `delta: string`

    - `item_id: string`

    - `output_index: number`

    - `sequence_number: number`

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

      - `"response.custom_tool_call_input.delta"`

  - `ResponseCustomToolCallInputDoneEvent object { input, item_id, output_index, 2 more }`

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

    - `input: string`

    - `item_id: string`

    - `output_index: number`

    - `sequence_number: number`

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

      - `"response.custom_tool_call_input.done"`

  - `GenericResponseEvent object { type }`

    - `type: string`
