---
title: "Create a response"
method: POST
path: "/v1/responses"
tags: ["inference"]
---

# Create a response

`POST /v1/responses`

Creates a model response for a given input

## Query parameters

- `ai_project_id` string, nullable — current project ID

## Request body

- CreateResponseRequest
  - `background` boolean, nullable — Whether to run the model response in the background.
  - `include` string[], nullable — Specify additional output data to include in the model response.
  - `input` union, required — Text, image, or file inputs to the model, used to generate a response.
    - string
    - union[]
      - union
        - EasyInputMessage — A message input to the model with a role indicating instruction following hierarchy. Instructions given with the `developer` or `system` role take precedence over instructions given with the `user` role. Messages with the `assistant` role are presumed to have been generated by the model in previous interactions.
          - `content` union, required
            - string
            - union[]
              - …
          - `role` 'user' | 'assistant' | 'system' | 'developer', required
          - `phase` 'commentary' | 'final_answer', nullable
          - `type` 'message', nullable
        - Message — A message input to the model with a role indicating instruction following hierarchy. Instructions given with the `developer` or `system` role take precedence over instructions given with the `user` role.
          - `content` union[], required
            - union
              - …
          - `role` 'user' | 'system' | 'developer', required
          - `status` 'in_progress' | 'completed' | 'incomplete', nullable
          - `type` 'message', nullable
        - ResponseOutputMessage — An output message from the model.
          - `id` string, required
          - `content` union[], required
            - union
              - …
          - `role` 'assistant', required
          - `status` 'in_progress' | 'completed' | 'incomplete', required
          - `type` 'message', required
          - `phase` 'commentary' | 'final_answer', nullable
        - ResponseFileSearchToolCall — 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, required
          - `queries` string[], required
          - `status` 'in_progress' | 'searching' | 'completed' | 'incomplete' | 'failed', required
          - `type` 'file_search_call', required
          - `results` Result[], nullable
            - `attributes` object, nullable
            - `file_id` string, nullable
            - `filename` string, nullable
            - `score` number, nullable
            - `text` string, nullable
        - ResponseComputerToolCall — 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, required
          - `call_id` string, required
          - `pending_safety_checks` PendingSafetyCheck[], required
            - `id` string, required
            - `code` string, nullable
            - `message` string, nullable
          - `status` 'in_progress' | 'completed' | 'incomplete', required
          - `type` 'computer_call', required
          - `action` union
            - ActionClick — A click action.
              - …
            - ActionDoubleClick — A double click action.
              - …
            - ActionDrag — A drag action.
              - …
            - ActionKeypress — A collection of keypresses the model would like to perform.
              - …
            - ActionMove — A mouse move action.
              - …
            - ActionScreenshot — A screenshot action.
              - …
            - ActionScroll — A scroll action.
              - …
            - ActionType — An action to type in text.
              - …
            - ActionWait — A wait action.
              - …
          - `actions` union[], nullable
            - union
              - …
        - ComputerCallOutput — The output of a computer tool call.
          - `call_id` string, required
          - `output` ResponseComputerToolCallOutputScreenshot, required — A computer screenshot image used with the computer use tool.
            - `type` 'computer_screenshot', required
            - `file_id` string, nullable
            - `image_url` string, nullable
          - `type` 'computer_call_output', required
          - `id` string, nullable
          - `acknowledged_safety_checks` ComputerCallOutputAcknowledgedSafetyCheck[], nullable
            - `id` string, required
            - `code` string, nullable
            - `message` string, nullable
          - `status` 'in_progress' | 'completed' | 'incomplete', nullable
        - ResponseFunctionWebSearch — 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, required
          - `action` union, required
            - ActionSearch — Action type "search" - Performs a web search query.
              - …
            - ActionOpenPage — Action type "open_page" - Opens a specific URL from search results.
              - …
            - ActionFind — Action type "find_in_page": Searches for a pattern within a loaded page.
              - …
          - `status` 'in_progress' | 'searching' | 'completed' | 'failed', required
          - `type` 'web_search_call', required
        - ResponseFunctionToolCall — 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, required
          - `call_id` string, required
          - `name` string, required
          - `type` 'function_call', required
          - `id` string, nullable
          - `namespace` string, nullable
          - `status` 'in_progress' | 'completed' | 'incomplete', nullable
        - FunctionCallOutput — The output of a function tool call.
          - `call_id` string, required
          - `output` union, required
            - string
            - union[]
              - …
          - `type` 'function_call_output', required
          - `id` string, nullable
          - `status` 'in_progress' | 'completed' | 'incomplete', nullable
        - ToolSearchCall
          - `arguments` unknown, required
          - `type` 'tool_search_call', required
          - `id` string, nullable
          - `call_id` string, nullable
          - `execution` 'server' | 'client', nullable
          - `status` 'in_progress' | 'completed' | 'incomplete', nullable
        - ResponseToolSearchOutputItemParam
          - `tools` union[], required
            - union
              - …
          - `type` 'tool_search_output', required
          - `id` string, nullable
          - `call_id` string, nullable
          - `execution` 'server' | 'client', nullable
          - `status` 'in_progress' | 'completed' | 'incomplete', nullable
        - OpenaiTypesResponsesResponseInputItemAdditionalTools
          - `role` 'developer', required
          - `tools` union[], required
            - union
              - …
          - `type` 'additional_tools', required
          - `id` string, nullable
        - ResponseReasoningItem — 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, required
          - `summary` Summary[], required
            - `text` string, required
            - `type` 'summary_text', required
          - `type` 'reasoning', required
          - `content` Content[], nullable
            - `text` string, required
            - `type` 'reasoning_text', required
          - `encrypted_content` string, nullable
          - `status` 'in_progress' | 'completed' | 'incomplete', nullable
        - ResponseCompactionItemParam — A compaction item generated by the [`v1/responses/compact` API](https://platform.openai.com/docs/api-reference/responses/compact).
          - `encrypted_content` string, required
          - `type` 'compaction', required
          - `id` string, nullable
        - ImageGenerationCall — An image generation request made by the model.
          - `id` string, required
          - `result` string, nullable
          - `status` 'in_progress' | 'completed' | 'generating' | 'failed', required
          - `type` 'image_generation_call', required
        - ResponseCodeInterpreterToolCall — A tool call to run code.
          - `id` string, required
          - `code` string, nullable
          - `container_id` string, required
          - `outputs` union[], nullable
            - union
              - …
          - `status` 'in_progress' | 'completed' | 'incomplete' | 'interpreting' | 'failed', required
          - `type` 'code_interpreter_call', required
        - LocalShellCall — A tool call to run a command on the local shell.
          - `id` string, required
          - `action` LocalShellCallAction, required — Execute a shell command on the server.
            - `command` string[], required
            - `env` object, required
            - `type` 'exec', required
            - `timeout_ms` integer, nullable
            - `user` string, nullable
            - `working_directory` string, nullable
          - `call_id` string, required
          - `status` 'in_progress' | 'completed' | 'incomplete', required
          - `type` 'local_shell_call', required
        - LocalShellCallOutput — The output of a local shell tool call.
          - `id` string, required
          - `output` string, required
          - `type` 'local_shell_call_output', required
          - `status` 'in_progress' | 'completed' | 'incomplete', nullable
        - ShellCall — A tool representing a request to execute one or more shell commands.
          - `action` ShellCallAction, required — The shell commands and limits that describe how to run the tool call.
            - `commands` string[], required
            - `max_output_length` integer, nullable
            - `timeout_ms` integer, nullable
          - `call_id` string, required
          - `type` 'shell_call', required
          - `id` string, nullable
          - `environment` union
            - LocalEnvironment
              - …
            - ContainerReference
              - …
          - `status` 'in_progress' | 'completed' | 'incomplete', nullable
        - ShellCallOutput — The streamed output items emitted by a shell tool call.
          - `call_id` string, required
          - `output` ResponseFunctionShellCallOutputContent[], required
            - `outcome` union, required
              - …
            - `stderr` string, required
            - `stdout` string, required
          - `type` 'shell_call_output', required
          - `id` string, nullable
          - `max_output_length` integer, nullable
          - `status` 'in_progress' | 'completed' | 'incomplete', nullable
        - ApplyPatchCall — A tool call representing a request to create, delete, or update files using diff patches.
          - `call_id` string, required
          - `operation` union, required
            - ApplyPatchCallOperationCreateFile — Instruction for creating a new file via the apply_patch tool.
              - …
            - ApplyPatchCallOperationDeleteFile — Instruction for deleting an existing file via the apply_patch tool.
              - …
            - ApplyPatchCallOperationUpdateFile — Instruction for updating an existing file via the apply_patch tool.
              - …
          - `status` 'in_progress' | 'completed', required
          - `type` 'apply_patch_call', required
          - `id` string, nullable
        - ApplyPatchCallOutput — The streamed output emitted by an apply patch tool call.
          - `call_id` string, required
          - `status` 'completed' | 'failed', required
          - `type` 'apply_patch_call_output', required
          - `id` string, nullable
          - `output` string, nullable
        - McpListTools — A list of tools available on an MCP server.
          - `id` string, required
          - `server_label` string, required
          - `tools` McpListToolsTool[], required
            - `input_schema` unknown, required
            - `name` string, required
            - `annotations` unknown
            - `description` string, nullable
          - `type` 'mcp_list_tools', required
          - `error` string, nullable
        - McpApprovalRequest — A request for human approval of a tool invocation.
          - `id` string, required
          - `arguments` string, required
          - `name` string, required
          - `server_label` string, required
          - `type` 'mcp_approval_request', required
        - OpenaiTypesResponsesResponseInputItemMcpApprovalResponse — A response to an MCP approval request.
          - `approval_request_id` string, required
          - `approve` boolean, required
          - `type` 'mcp_approval_response', required
          - `id` string, nullable
          - `reason` string, nullable
        - McpCall — An invocation of a tool on an MCP server.
          - `id` string, required
          - `arguments` string, required
          - `name` string, required
          - `server_label` string, required
          - `type` 'mcp_call', required
          - `approval_request_id` string, nullable
          - `error` string, nullable
          - `output` string, nullable
          - `status` 'in_progress' | 'completed' | 'incomplete' | 'calling' | 'failed', nullable
        - ResponseCustomToolCallOutput — The output of a custom tool call from your code, being sent back to the model.
          - `call_id` string, required
          - `output` union, required
            - string
            - union[]
              - …
          - `type` 'custom_tool_call_output', required
          - `id` string, nullable
        - ResponseCustomToolCall — A call to a custom tool created by the model.
          - `call_id` string, required
          - `input` string, required
          - `name` string, required
          - `type` 'custom_tool_call', required
          - `id` string, nullable
          - `namespace` string, nullable
        - CompactionTrigger — Compacts the current context. Must be the final input item.
          - `type` 'compaction_trigger', required
        - ItemReference — An internal identifier for an item to reference.
          - `id` string, required
          - `type` 'item_reference', nullable
        - ResponseFunctionToolCallOutputItem
          - `id` string, required
          - `call_id` string, required
          - `output` union, required
            - string
            - union[]
              - …
          - `status` 'in_progress' | 'completed' | 'incomplete', required
          - `type` 'function_call_output', required
          - `created_by` string, nullable
        - ResponseComputerToolCallOutputItem
          - `id` string, required
          - `call_id` string, required
          - `output` ResponseComputerToolCallOutputScreenshot, required — A computer screenshot image used with the computer use tool.
            - `type` 'computer_screenshot', required
            - `file_id` string, nullable
            - `image_url` string, nullable
          - `status` 'completed' | 'incomplete' | 'failed' | 'in_progress', required
          - `type` 'computer_call_output', required
          - `acknowledged_safety_checks` AcknowledgedSafetyCheck[], nullable
            - `id` string, required
            - `code` string, nullable
            - `message` string, nullable
          - `created_by` string, nullable
        - ResponseToolSearchCall
          - `id` string, required
          - `arguments` unknown, required
          - `call_id` string, nullable
          - `execution` 'server' | 'client', required
          - `status` 'in_progress' | 'completed' | 'incomplete', required
          - `type` 'tool_search_call', required
          - `created_by` string, nullable
        - ResponseToolSearchOutputItem
          - `id` string, required
          - `call_id` string, nullable
          - `execution` 'server' | 'client', required
          - `status` 'in_progress' | 'completed' | 'incomplete', required
          - `tools` union[], required
            - union
              - …
          - `type` 'tool_search_output', required
          - `created_by` string, nullable
        - OpenaiTypesResponsesResponseOutputItemAdditionalTools
          - `id` string, required
          - `role` 'unknown' | 'user' | 'assistant' | 'system' | 'critic' | 'discriminator' | 'developer' | 'tool', required
          - `tools` union[], required
            - union
              - …
          - `type` 'additional_tools', required
        - ResponseCompactionItem — A compaction item generated by the [`v1/responses/compact` API](https://platform.openai.com/docs/api-reference/responses/compact).
          - `id` string, required
          - `encrypted_content` string, required
          - `type` 'compaction', required
          - `created_by` string, nullable
        - ImageGenerationCall — An image generation request made by the model.
          - `id` string, required
          - `result` string, nullable
          - `status` 'in_progress' | 'completed' | 'generating' | 'failed', required
          - `type` 'image_generation_call', required
        - LocalShellCall — A tool call to run a command on the local shell.
          - `id` string, required
          - `action` LocalShellCallAction, required — Execute a shell command on the server.
            - `command` string[], required
            - `env` object, required
            - `type` 'exec', required
            - `timeout_ms` integer, nullable
            - `user` string, nullable
            - `working_directory` string, nullable
          - `call_id` string, required
          - `status` 'in_progress' | 'completed' | 'incomplete', required
          - `type` 'local_shell_call', required
        - LocalShellCallOutput — The output of a local shell tool call.
          - `id` string, required
          - `output` string, required
          - `type` 'local_shell_call_output', required
          - `status` 'in_progress' | 'completed' | 'incomplete', nullable
        - ResponseFunctionShellToolCall — A tool call that executes one or more shell commands in a managed environment.
          - `id` string, required
          - `action` Action, required — The shell commands and limits that describe how to run the tool call.
            - `commands` string[], required
            - `max_output_length` integer, nullable
            - `timeout_ms` integer, nullable
          - `call_id` string, required
          - `environment` union
            - ResponseLocalEnvironment — Represents the use of a local environment to perform shell actions.
              - …
            - ResponseContainerReference — Represents a container created with /v1/containers.
              - …
          - `status` 'in_progress' | 'completed' | 'incomplete', required
          - `type` 'shell_call', required
          - `created_by` string, nullable
        - ResponseFunctionShellToolCallOutput — The output of a shell tool call that was emitted.
          - `id` string, required
          - `call_id` string, required
          - `max_output_length` integer, nullable
          - `output` Output[], required
            - `outcome` union, required
              - …
            - `stderr` string, required
            - `stdout` string, required
            - `created_by` string, nullable
          - `status` 'in_progress' | 'completed' | 'incomplete', required
          - `type` 'shell_call_output', required
          - `created_by` string, nullable
        - ResponseApplyPatchToolCall — A tool call that applies file diffs by creating, deleting, or updating files.
          - `id` string, required
          - `call_id` string, required
          - `operation` union, required
            - OperationCreateFile — Instruction describing how to create a file via the apply_patch tool.
              - …
            - OperationDeleteFile — Instruction describing how to delete a file via the apply_patch tool.
              - …
            - OperationUpdateFile — Instruction describing how to update a file via the apply_patch tool.
              - …
          - `status` 'in_progress' | 'completed', required
          - `type` 'apply_patch_call', required
          - `created_by` string, nullable
        - ResponseApplyPatchToolCallOutput — The output emitted by an apply patch tool call.
          - `id` string, required
          - `call_id` string, required
          - `status` 'completed' | 'failed', required
          - `type` 'apply_patch_call_output', required
          - `created_by` string, nullable
          - `output` string, nullable
        - McpCall — An invocation of a tool on an MCP server.
          - `id` string, required
          - `arguments` string, required
          - `name` string, required
          - `server_label` string, required
          - `type` 'mcp_call', required
          - `approval_request_id` string, nullable
          - `error` string, nullable
          - `output` string, nullable
          - `status` 'in_progress' | 'completed' | 'incomplete' | 'calling' | 'failed', nullable
        - McpListTools — A list of tools available on an MCP server.
          - `id` string, required
          - `server_label` string, required
          - `tools` McpListToolsTool[], required
            - `input_schema` unknown, required
            - `name` string, required
            - `annotations` unknown
            - `description` string, nullable
          - `type` 'mcp_list_tools', required
          - `error` string, nullable
        - McpApprovalRequest — A request for human approval of a tool invocation.
          - `id` string, required
          - `arguments` string, required
          - `name` string, required
          - `server_label` string, required
          - `type` 'mcp_approval_request', required
        - OpenaiTypesResponsesResponseOutputItemMcpApprovalResponse — A response to an MCP approval request.
          - `id` string, required
          - `approval_request_id` string, required
          - `approve` boolean, required
          - `type` 'mcp_approval_response', required
          - `reason` string, nullable
        - ResponseCustomToolCallOutputItem — The output of a custom tool call from your code, being sent back to the model.
          - `call_id` string, required
          - `output` union, required
            - string
            - union[]
              - …
          - `type` 'custom_tool_call_output', required
          - `id` string, required
          - `status` 'in_progress' | 'completed' | 'incomplete', required
          - `created_by` string, nullable
  - `instructions` string, nullable — A system (or developer) message inserted into the model's context.
  - `max_output_tokens` integer, nullable — An upper bound for the number of tokens that can be generated for a response, including visible output tokens and reasoning tokens.
  - `max_tool_calls` integer, nullable — The maximum number of total calls to built-in tools that can be processed in a response. This maximum number applies across all built-in tool calls, not per individual tool. Any further attempts to call a tool by the model will be ignored.
  - `metadata` object, nullable — Set of 16 key-value pairs that can be attached to an object.
  - `model` string, required — The model used for the chat completion.
  - `parallel_tool_calls` boolean, nullable — Whether to allow the model to run tool calls in parallel.
  - `previous_response_id` string, nullable — The unique ID of the previous response to the model.
  - `prompt` ResponsePrompt — Reference to a prompt template and its variables. [Learn more](https://platform.openai.com/docs/guides/text?api-mode=responses#reusable-prompts).
    - `id` string, required
    - `variables` object, nullable
    - `version` string, nullable
  - `reasoning` Reasoning — **gpt-5 and o-series models only** Configuration options for [reasoning models](https://platform.openai.com/docs/guides/reasoning).
    - `effort` 'none' | 'minimal' | 'low' | 'medium' | 'high' | 'xhigh', nullable
    - `generate_summary` 'auto' | 'concise' | 'detailed', nullable
    - `summary` 'auto' | 'concise' | 'detailed', nullable
  - `service_tier` 'auto' | 'default' | 'over-limit' | 'flex' | 'no-limit' — Represents the service tier for requests. Attributes: Auto: Automatically choose the best available tier for the request (Default or OverLimit). Analyze response to determine which tier was used. Default: Return 429 errors on hitting the rate limit, do not exceed to the OverLimit tier. OverLimit: Indicate that the request was over the user limit. This tier cannot be set by user in the request, but us used in a response for tier=Auto. Flex: Do not consume rate-limit credits, but run with lower priority. May still result in 429 errors in case of if there is no resources to process.
  - `store` boolean, nullable — Whether to store the generated model response for later retrieval via API.
  - `stream` boolean, nullable — If set to true, the model response data will be streamed to the client as it is generated using server-sent events.
  - `temperature` number, nullable — What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or `top_p` but not both.
  - `text` ResponseTextConfig — Configuration options for a text response from the model. Can be plain text or structured JSON data. Learn more: - [Text inputs and outputs](https://platform.openai.com/docs/guides/text) - [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs)
    - `format` union
      - ResponseFormatText — Default response format. Used to generate text responses.
        - `type` 'text', required
      - ResponseFormatTextJSONSchemaConfig — JSON Schema response format. Used to generate structured JSON responses. Learn more about [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs).
        - `name` string, required
        - `schema` object, required
        - `type` 'json_schema', required
        - `description` string, nullable
        - `strict` boolean, nullable
      - ResponseFormatJSONObject — JSON object response format. An older method of generating JSON responses. Using `json_schema` is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so.
        - `type` 'json_object', required
    - `verbosity` 'low' | 'medium' | 'high', nullable
  - `tool_choice` union — How the model should select which tool (or tools) to use when generating a response.
    - 'none' | 'auto' | 'required'
    - ToolChoiceAllowed — Constrains the tools available to the model to a pre-defined set.
      - `mode` 'auto' | 'required', required
      - `tools` object[], required
      - `type` 'allowed_tools', required
    - ToolChoiceTypes — Indicates that the model should use a built-in tool to generate a response. [Learn more about built-in tools](https://platform.openai.com/docs/guides/tools).
      - `type` 'file_search' | 'web_search_preview' | 'computer' | 'computer_use_preview' | 'computer_use' | 'web_search_preview_2025_03_11' | 'image_generation' | 'code_interpreter', required
    - ToolChoiceFunction — Use this option to force the model to call a specific function.
      - `name` string, required
      - `type` 'function', required
    - ToolChoiceMcp — Use this option to force the model to call a specific tool on a remote MCP server.
      - `server_label` string, required
      - `type` 'mcp', required
      - `name` string, nullable
    - ToolChoiceCustom — Use this option to force the model to call a specific custom tool.
      - `name` string, required
      - `type` 'custom', required
    - ToolChoiceApplyPatch — Forces the model to call the apply_patch tool when executing a tool call.
      - `type` 'apply_patch', required
    - ToolChoiceShell — Forces the model to call the shell tool when a tool call is required.
      - `type` 'shell', required
  - `tools` union[] — An array of tools the model may call while generating a response.
    - union
      - FunctionTool — Defines a function in your own code the model can choose to call. Learn more about [function calling](https://platform.openai.com/docs/guides/function-calling).
        - `name` string, required
        - `parameters` object, nullable
        - `strict` boolean, nullable
        - `type` 'function', required
        - `defer_loading` boolean, nullable
        - `description` string, nullable
      - FileSearchTool — A tool that searches for relevant content from uploaded files. Learn more about the [file search tool](https://platform.openai.com/docs/guides/tools-file-search).
        - `type` 'file_search', required
        - `vector_store_ids` string[], required
        - `filters` union
          - ComparisonFilter — A filter used to compare a specified attribute key to a given value using a defined comparison operation.
            - `key` string, required
            - `type` 'eq' | 'ne' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'nin', required
            - `value` union, required
              - …
          - CompoundFilter — Combine multiple filters using `and` or `or`.
            - `filters` union[], required
              - …
            - `type` 'and' | 'or', required
        - `max_num_results` integer, nullable
        - `ranking_options` RankingOptions — Ranking options for search.
          - `hybrid_search` RankingOptionsHybridSearch — Weights that control how reciprocal rank fusion balances semantic embedding matches versus sparse keyword matches when hybrid search is enabled.
            - `embedding_weight` number, required
            - `text_weight` number, required
          - `ranker` 'auto' | 'default-2024-11-15', nullable
          - `score_threshold` number, nullable
      - ComputerTool — A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use).
        - `type` 'computer', required
      - ComputerUsePreviewTool — A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use).
        - `display_height` integer, required
        - `display_width` integer, required
        - `environment` 'windows' | 'mac' | 'linux' | 'ubuntu' | 'browser', required
        - `type` 'computer_use_preview', required
      - WebSearchTool — Search the Internet for sources related to the prompt. Learn more about the [web search tool](https://platform.openai.com/docs/guides/tools-web-search).
        - `type` 'web_search' | 'web_search_2025_08_26', required
        - `filters` Filters — Filters for the search.
          - `allowed_domains` string[], nullable
        - `search_context_size` 'low' | 'medium' | 'high', nullable
        - `user_location` OpenaiTypesResponsesWebSearchToolUserLocation — The approximate location of the user.
          - `city` string, nullable
          - `country` string, nullable
          - `region` string, nullable
          - `timezone` string, nullable
          - `type` 'approximate', nullable
      - Mcp — Give the model access to additional tools via remote Model Context Protocol (MCP) servers. [Learn more about MCP](https://platform.openai.com/docs/guides/tools-remote-mcp).
        - `server_label` string, required
        - `type` 'mcp', required
        - `allowed_tools` union
          - string[]
          - McpAllowedToolsMcpToolFilter — A filter object to specify which tools are allowed.
            - `read_only` boolean, nullable
            - `tool_names` string[], nullable
        - `authorization` string, nullable
        - `connector_id` 'connector_dropbox' | 'connector_gmail' | 'connector_googlecalendar' | 'connector_googledrive' | 'connector_microsoftteams' | 'connector_outlookcalendar' | 'connector_outlookemail' | 'connector_sharepoint', nullable
        - `defer_loading` boolean, nullable
        - `headers` object, nullable
        - `require_approval` union
          - McpRequireApprovalMcpToolApprovalFilter — Specify which of the MCP server's tools require approval. Can be `always`, `never`, or a filter object associated with tools that require approval.
            - `always` McpRequireApprovalMcpToolApprovalFilterAlways — A filter object to specify which tools are allowed.
              - …
            - `never` McpRequireApprovalMcpToolApprovalFilterNever — A filter object to specify which tools are allowed.
              - …
          - 'always' | 'never'
        - `server_description` string, nullable
        - `server_url` string, nullable
      - CodeInterpreter — A tool that runs Python code to help generate a response to a prompt.
        - `container` union, required
          - string
          - CodeInterpreterContainerCodeInterpreterToolAuto — Configuration for a code interpreter container. Optionally specify the IDs of the files to run the code on.
            - `type` 'auto', required
            - `file_ids` string[], nullable
            - `memory_limit` '1g' | '4g' | '16g' | '64g', nullable
            - `network_policy` union
              - …
        - `type` 'code_interpreter', required
      - ImageGeneration — A tool that generates images using the GPT image models.
        - `type` 'image_generation', required
        - `action` 'generate' | 'edit' | 'auto', nullable
        - `background` 'transparent' | 'opaque' | 'auto', nullable
        - `input_fidelity` 'high' | 'low', nullable
        - `input_image_mask` ImageGenerationInputImageMask — Optional mask for inpainting. Contains `image_url` (string, optional) and `file_id` (string, optional).
          - `file_id` string, nullable
          - `image_url` string, nullable
        - `model` union
          - string
          - 'gpt-image-1' | 'gpt-image-1-mini' | 'gpt-image-2' | 'gpt-image-2-2026-04-21' | 'gpt-image-1.5' | 'chatgpt-image-latest'
        - `moderation` 'auto' | 'low', nullable
        - `output_compression` integer, nullable
        - `output_format` 'png' | 'webp' | 'jpeg', nullable
        - `partial_images` integer, nullable
        - `quality` 'low' | 'medium' | 'high' | 'auto', nullable
        - `size` union
          - string
          - '1024x1024' | '1024x1536' | '1536x1024' | 'auto'
      - LocalShell — A tool that allows the model to execute shell commands in a local environment.
        - `type` 'local_shell', required
      - FunctionShellTool — A tool that allows the model to execute shell commands.
        - `type` 'shell', required
        - `environment` union
          - ContainerAuto
            - `type` 'container_auto', required
            - `file_ids` string[], nullable
            - `memory_limit` '1g' | '4g' | '16g' | '64g', nullable
            - `network_policy` union
              - …
            - `skills` union[], nullable
              - …
          - LocalEnvironment
            - `type` 'local', required
            - `skills` LocalSkill[], nullable
              - …
          - ContainerReference
            - `container_id` string, required
            - `type` 'container_reference', required
      - CustomTool — A custom tool that processes input using a specified format. Learn more about [custom tools](https://platform.openai.com/docs/guides/function-calling#custom-tools)
        - `name` string, required
        - `type` 'custom', required
        - `defer_loading` boolean, nullable
        - `description` string, nullable
        - `format` union
          - Text — Unconstrained free-form text.
            - `type` 'text', required
          - Grammar — A grammar defined by the user.
            - `definition` string, required
            - `syntax` 'lark' | 'regex', required
            - `type` 'grammar', required
      - NamespaceTool — Groups function/custom tools under a shared namespace.
        - `description` string, required
        - `name` string, required
        - `tools` union[], required
          - union
            - ToolFunction
              - …
            - CustomTool — A custom tool that processes input using a specified format. Learn more about [custom tools](https://platform.openai.com/docs/guides/function-calling#custom-tools)
              - …
        - `type` 'namespace', required
      - ToolSearchTool — Hosted or BYOT tool search configuration for deferred tools.
        - `type` 'tool_search', required
        - `description` string, nullable
        - `execution` 'server' | 'client', nullable
        - `parameters` unknown
      - WebSearchPreviewTool — This tool searches the web for relevant results to use in a response. Learn more about the [web search tool](https://platform.openai.com/docs/guides/tools-web-search).
        - `type` 'web_search_preview' | 'web_search_preview_2025_03_11', required
        - `search_content_types` string[], nullable
        - `search_context_size` 'low' | 'medium' | 'high', nullable
        - `user_location` OpenaiTypesResponsesWebSearchPreviewToolUserLocation — The user's location.
          - `type` 'approximate', required
          - `city` string, nullable
          - `country` string, nullable
          - `region` string, nullable
          - `timezone` string, nullable
      - ApplyPatchTool — Allows the assistant to create, delete, or update files using unified diffs.
        - `type` 'apply_patch', required
  - `top_logprobs` integer, nullable — A non-negative integer specifying the number of most likely tokens to return at each token position, each with an associated log probability. `logprobs` must be set to `true` if this parameter is used.
  - `top_p` number, nullable — An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. We generally recommend altering this or `temperature` but not both.
  - `truncation` 'auto' | 'disabled' — The truncation strategy to use for the model response.
  - `user` string, nullable — A unique identifier representing your end-user, which can help us to monitor and detect abuse. [Learn more](https://platform.openai.com/docs/guides/safety-best-practices/end-user-ids).
  - `prompt_cache_key` string, nullable — Used by OpenAI to cache responses for similar requests to optimize your cache hit rates. Replaces the user field.

## Response `200`

Successful Response

- ResponsesResponse
  - `id` string, required
  - `created_at` integer, required
  - `error` ResponseError — An error object returned when the model fails to generate a Response.
    - `code` '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', required
    - `message` string, required
  - `incomplete_details` IncompleteDetails — Details about why the response is incomplete.
    - `reason` 'max_output_tokens' | 'content_filter', nullable
  - `instructions` string, nullable
  - `metadata` object, nullable
  - `model` string, required
  - `object` 'response'
  - `output` union[], required
    - union
      - ResponseOutputMessage — An output message from the model.
        - `id` string, required
        - `content` union[], required
          - union
            - ResponseOutputText — A text output from the model.
              - …
            - ResponseOutputRefusal — A refusal from the model.
              - …
        - `role` 'assistant', required
        - `status` 'in_progress' | 'completed' | 'incomplete', required
        - `type` 'message', required
        - `phase` 'commentary' | 'final_answer', nullable
      - ResponseFileSearchToolCall — 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, required
        - `queries` string[], required
        - `status` 'in_progress' | 'searching' | 'completed' | 'incomplete' | 'failed', required
        - `type` 'file_search_call', required
        - `results` Result[], nullable
          - `attributes` object, nullable
          - `file_id` string, nullable
          - `filename` string, nullable
          - `score` number, nullable
          - `text` string, nullable
      - ResponseFunctionToolCall — 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, required
        - `call_id` string, required
        - `name` string, required
        - `type` 'function_call', required
        - `id` string, nullable
        - `namespace` string, nullable
        - `status` 'in_progress' | 'completed' | 'incomplete', nullable
      - ResponseFunctionToolCallOutputItem
        - `id` string, required
        - `call_id` string, required
        - `output` union, required
          - string
          - union[]
            - union
              - …
        - `status` 'in_progress' | 'completed' | 'incomplete', required
        - `type` 'function_call_output', required
        - `created_by` string, nullable
      - ResponseFunctionWebSearch — 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, required
        - `action` union, required
          - ActionSearch — Action type "search" - Performs a web search query.
            - `type` 'search', required
            - `queries` string[], nullable
            - `query` string, nullable
            - `sources` ActionSearchSource[], nullable
              - …
          - ActionOpenPage — Action type "open_page" - Opens a specific URL from search results.
            - `type` 'open_page', required
            - `url` string, nullable
          - ActionFind — Action type "find_in_page": Searches for a pattern within a loaded page.
            - `pattern` string, required
            - `type` 'find_in_page', required
            - `url` string, required
        - `status` 'in_progress' | 'searching' | 'completed' | 'failed', required
        - `type` 'web_search_call', required
      - ResponseComputerToolCall — 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, required
        - `call_id` string, required
        - `pending_safety_checks` PendingSafetyCheck[], required
          - `id` string, required
          - `code` string, nullable
          - `message` string, nullable
        - `status` 'in_progress' | 'completed' | 'incomplete', required
        - `type` 'computer_call', required
        - `action` union
          - ActionClick — A click action.
            - `button` 'left' | 'right' | 'wheel' | 'back' | 'forward', required
            - `type` 'click', required
            - `x` integer, required
            - `y` integer, required
            - `keys` string[], nullable
          - ActionDoubleClick — A double click action.
            - `keys` string[], nullable
            - `type` 'double_click', required
            - `x` integer, required
            - `y` integer, required
          - ActionDrag — A drag action.
            - `path` ActionDragPath[], required
              - …
            - `type` 'drag', required
            - `keys` string[], nullable
          - ActionKeypress — A collection of keypresses the model would like to perform.
            - `keys` string[], required
            - `type` 'keypress', required
          - ActionMove — A mouse move action.
            - `type` 'move', required
            - `x` integer, required
            - `y` integer, required
            - `keys` string[], nullable
          - ActionScreenshot — A screenshot action.
            - `type` 'screenshot', required
          - ActionScroll — A scroll action.
            - `scroll_x` integer, required
            - `scroll_y` integer, required
            - `type` 'scroll', required
            - `x` integer, required
            - `y` integer, required
            - `keys` string[], nullable
          - ActionType — An action to type in text.
            - `text` string, required
            - `type` 'type', required
          - ActionWait — A wait action.
            - `type` 'wait', required
        - `actions` union[], nullable
          - union
            - Click — A click action.
              - …
            - DoubleClick — A double click action.
              - …
            - Drag — A drag action.
              - …
            - Keypress — A collection of keypresses the model would like to perform.
              - …
            - Move — A mouse move action.
              - …
            - Screenshot — A screenshot action.
              - …
            - Scroll — A scroll action.
              - …
            - Type — An action to type in text.
              - …
            - Wait — A wait action.
              - …
      - ResponseComputerToolCallOutputItem
        - `id` string, required
        - `call_id` string, required
        - `output` ResponseComputerToolCallOutputScreenshot, required — A computer screenshot image used with the computer use tool.
          - `type` 'computer_screenshot', required
          - `file_id` string, nullable
          - `image_url` string, nullable
        - `status` 'completed' | 'incomplete' | 'failed' | 'in_progress', required
        - `type` 'computer_call_output', required
        - `acknowledged_safety_checks` AcknowledgedSafetyCheck[], nullable
          - `id` string, required
          - `code` string, nullable
          - `message` string, nullable
        - `created_by` string, nullable
      - ResponseReasoningItem — 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, required
        - `summary` Summary[], required
          - `text` string, required
          - `type` 'summary_text', required
        - `type` 'reasoning', required
        - `content` Content[], nullable
          - `text` string, required
          - `type` 'reasoning_text', required
        - `encrypted_content` string, nullable
        - `status` 'in_progress' | 'completed' | 'incomplete', nullable
      - ResponseToolSearchCall
        - `id` string, required
        - `arguments` unknown, required
        - `call_id` string, nullable
        - `execution` 'server' | 'client', required
        - `status` 'in_progress' | 'completed' | 'incomplete', required
        - `type` 'tool_search_call', required
        - `created_by` string, nullable
      - ResponseToolSearchOutputItem
        - `id` string, required
        - `call_id` string, nullable
        - `execution` 'server' | 'client', required
        - `status` 'in_progress' | 'completed' | 'incomplete', required
        - `tools` union[], required
          - union
            - FunctionTool — Defines a function in your own code the model can choose to call. Learn more about [function calling](https://platform.openai.com/docs/guides/function-calling).
              - …
            - FileSearchTool — A tool that searches for relevant content from uploaded files. Learn more about the [file search tool](https://platform.openai.com/docs/guides/tools-file-search).
              - …
            - ComputerTool — A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use).
              - …
            - ComputerUsePreviewTool — A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use).
              - …
            - WebSearchTool — Search the Internet for sources related to the prompt. Learn more about the [web search tool](https://platform.openai.com/docs/guides/tools-web-search).
              - …
            - Mcp — Give the model access to additional tools via remote Model Context Protocol (MCP) servers. [Learn more about MCP](https://platform.openai.com/docs/guides/tools-remote-mcp).
              - …
            - CodeInterpreter — A tool that runs Python code to help generate a response to a prompt.
              - …
            - ImageGeneration — A tool that generates images using the GPT image models.
              - …
            - LocalShell — A tool that allows the model to execute shell commands in a local environment.
              - …
            - FunctionShellTool — A tool that allows the model to execute shell commands.
              - …
            - CustomTool — A custom tool that processes input using a specified format. Learn more about [custom tools](https://platform.openai.com/docs/guides/function-calling#custom-tools)
              - …
            - NamespaceTool — Groups function/custom tools under a shared namespace.
              - …
            - ToolSearchTool — Hosted or BYOT tool search configuration for deferred tools.
              - …
            - WebSearchPreviewTool — This tool searches the web for relevant results to use in a response. Learn more about the [web search tool](https://platform.openai.com/docs/guides/tools-web-search).
              - …
            - ApplyPatchTool — Allows the assistant to create, delete, or update files using unified diffs.
              - …
        - `type` 'tool_search_output', required
        - `created_by` string, nullable
      - AdditionalToolsOutput
        - `id` string, required
        - `role` 'unknown' | 'user' | 'assistant' | 'system' | 'critic' | 'discriminator' | 'developer' | 'tool', required
        - `tools` union[], required
          - union
            - FunctionTool — Defines a function in your own code the model can choose to call. Learn more about [function calling](https://platform.openai.com/docs/guides/function-calling).
              - …
            - FileSearchTool — A tool that searches for relevant content from uploaded files. Learn more about the [file search tool](https://platform.openai.com/docs/guides/tools-file-search).
              - …
            - ComputerTool — A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use).
              - …
            - ComputerUsePreviewTool — A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use).
              - …
            - WebSearchTool — Search the Internet for sources related to the prompt. Learn more about the [web search tool](https://platform.openai.com/docs/guides/tools-web-search).
              - …
            - Mcp — Give the model access to additional tools via remote Model Context Protocol (MCP) servers. [Learn more about MCP](https://platform.openai.com/docs/guides/tools-remote-mcp).
              - …
            - CodeInterpreter — A tool that runs Python code to help generate a response to a prompt.
              - …
            - ImageGeneration — A tool that generates images using the GPT image models.
              - …
            - LocalShell — A tool that allows the model to execute shell commands in a local environment.
              - …
            - FunctionShellTool — A tool that allows the model to execute shell commands.
              - …
            - CustomTool — A custom tool that processes input using a specified format. Learn more about [custom tools](https://platform.openai.com/docs/guides/function-calling#custom-tools)
              - …
            - NamespaceTool — Groups function/custom tools under a shared namespace.
              - …
            - ToolSearchTool — Hosted or BYOT tool search configuration for deferred tools.
              - …
            - WebSearchPreviewTool — This tool searches the web for relevant results to use in a response. Learn more about the [web search tool](https://platform.openai.com/docs/guides/tools-web-search).
              - …
            - ApplyPatchTool — Allows the assistant to create, delete, or update files using unified diffs.
              - …
        - `type` 'additional_tools', required
      - ResponseCompactionItem — A compaction item generated by the [`v1/responses/compact` API](https://platform.openai.com/docs/api-reference/responses/compact).
        - `id` string, required
        - `encrypted_content` string, required
        - `type` 'compaction', required
        - `created_by` string, nullable
      - ImageGenerationCall — An image generation request made by the model.
        - `id` string, required
        - `result` string, nullable
        - `status` 'in_progress' | 'completed' | 'generating' | 'failed', required
        - `type` 'image_generation_call', required
      - ResponseCodeInterpreterToolCall — A tool call to run code.
        - `id` string, required
        - `code` string, nullable
        - `container_id` string, required
        - `outputs` union[], nullable
          - union
            - OutputLogs — The logs output from the code interpreter.
              - …
            - OutputImage — The image output from the code interpreter.
              - …
        - `status` 'in_progress' | 'completed' | 'incomplete' | 'interpreting' | 'failed', required
        - `type` 'code_interpreter_call', required
      - LocalShellCall — A tool call to run a command on the local shell.
        - `id` string, required
        - `action` LocalShellCallAction, required — Execute a shell command on the server.
          - `command` string[], required
          - `env` object, required
          - `type` 'exec', required
          - `timeout_ms` integer, nullable
          - `user` string, nullable
          - `working_directory` string, nullable
        - `call_id` string, required
        - `status` 'in_progress' | 'completed' | 'incomplete', required
        - `type` 'local_shell_call', required
      - LocalShellCallOutput — The output of a local shell tool call.
        - `id` string, required
        - `output` string, required
        - `type` 'local_shell_call_output', required
        - `status` 'in_progress' | 'completed' | 'incomplete', nullable
      - ResponseFunctionShellToolCall — A tool call that executes one or more shell commands in a managed environment.
        - `id` string, required
        - `action` Action, required — The shell commands and limits that describe how to run the tool call.
          - `commands` string[], required
          - `max_output_length` integer, nullable
          - `timeout_ms` integer, nullable
        - `call_id` string, required
        - `environment` union
          - ResponseLocalEnvironment — Represents the use of a local environment to perform shell actions.
            - `type` 'local', required
          - ResponseContainerReference — Represents a container created with /v1/containers.
            - `container_id` string, required
            - `type` 'container_reference', required
        - `status` 'in_progress' | 'completed' | 'incomplete', required
        - `type` 'shell_call', required
        - `created_by` string, nullable
      - ResponseFunctionShellToolCallOutput — The output of a shell tool call that was emitted.
        - `id` string, required
        - `call_id` string, required
        - `max_output_length` integer, nullable
        - `output` Output[], required
          - `outcome` union, required
            - OutputOutcomeTimeout — Indicates that the shell call exceeded its configured time limit.
              - …
            - OutputOutcomeExit — Indicates that the shell commands finished and returned an exit code.
              - …
          - `stderr` string, required
          - `stdout` string, required
          - `created_by` string, nullable
        - `status` 'in_progress' | 'completed' | 'incomplete', required
        - `type` 'shell_call_output', required
        - `created_by` string, nullable
      - ResponseApplyPatchToolCall — A tool call that applies file diffs by creating, deleting, or updating files.
        - `id` string, required
        - `call_id` string, required
        - `operation` union, required
          - OperationCreateFile — Instruction describing how to create a file via the apply_patch tool.
            - `diff` string, required
            - `path` string, required
            - `type` 'create_file', required
          - OperationDeleteFile — Instruction describing how to delete a file via the apply_patch tool.
            - `path` string, required
            - `type` 'delete_file', required
          - OperationUpdateFile — Instruction describing how to update a file via the apply_patch tool.
            - `diff` string, required
            - `path` string, required
            - `type` 'update_file', required
        - `status` 'in_progress' | 'completed', required
        - `type` 'apply_patch_call', required
        - `created_by` string, nullable
      - ResponseApplyPatchToolCallOutput — The output emitted by an apply patch tool call.
        - `id` string, required
        - `call_id` string, required
        - `status` 'completed' | 'failed', required
        - `type` 'apply_patch_call_output', required
        - `created_by` string, nullable
        - `output` string, nullable
      - McpCall — An invocation of a tool on an MCP server.
        - `id` string, required
        - `arguments` string, required
        - `name` string, required
        - `server_label` string, required
        - `type` 'mcp_call', required
        - `approval_request_id` string, nullable
        - `error` string, nullable
        - `output` string, nullable
        - `status` 'in_progress' | 'completed' | 'incomplete' | 'calling' | 'failed', nullable
      - McpListTools — A list of tools available on an MCP server.
        - `id` string, required
        - `server_label` string, required
        - `tools` McpListToolsTool[], required
          - `input_schema` unknown, required
          - `name` string, required
          - `annotations` unknown
          - `description` string, nullable
        - `type` 'mcp_list_tools', required
        - `error` string, nullable
      - McpApprovalRequest — A request for human approval of a tool invocation.
        - `id` string, required
        - `arguments` string, required
        - `name` string, required
        - `server_label` string, required
        - `type` 'mcp_approval_request', required
      - McpApprovalResponseOutput — A response to an MCP approval request.
        - `id` string, required
        - `approval_request_id` string, required
        - `approve` boolean, required
        - `type` 'mcp_approval_response', required
        - `reason` string, nullable
      - ResponseCustomToolCall — A call to a custom tool created by the model.
        - `call_id` string, required
        - `input` string, required
        - `name` string, required
        - `type` 'custom_tool_call', required
        - `id` string, nullable
        - `namespace` string, nullable
      - ResponseCustomToolCallOutputItem — The output of a custom tool call from your code, being sent back to the model.
        - `call_id` string, required
        - `output` union, required
          - string
          - union[]
            - union
              - …
        - `type` 'custom_tool_call_output', required
        - `id` string, required
        - `status` 'in_progress' | 'completed' | 'incomplete', required
        - `created_by` string, nullable
  - `parallel_tool_calls` boolean, required
  - `temperature` number, required
  - `tool_choice` union, required
    - 'none' | 'auto' | 'required'
    - ToolChoiceAllowed — Constrains the tools available to the model to a pre-defined set.
      - `mode` 'auto' | 'required', required
      - `tools` object[], required
      - `type` 'allowed_tools', required
    - ToolChoiceTypes — Indicates that the model should use a built-in tool to generate a response. [Learn more about built-in tools](https://platform.openai.com/docs/guides/tools).
      - `type` 'file_search' | 'web_search_preview' | 'computer' | 'computer_use_preview' | 'computer_use' | 'web_search_preview_2025_03_11' | 'image_generation' | 'code_interpreter', required
    - ToolChoiceFunction — Use this option to force the model to call a specific function.
      - `name` string, required
      - `type` 'function', required
    - ToolChoiceMcp — Use this option to force the model to call a specific tool on a remote MCP server.
      - `server_label` string, required
      - `type` 'mcp', required
      - `name` string, nullable
    - ToolChoiceCustom — Use this option to force the model to call a specific custom tool.
      - `name` string, required
      - `type` 'custom', required
    - ToolChoiceApplyPatch — Forces the model to call the apply_patch tool when executing a tool call.
      - `type` 'apply_patch', required
    - ToolChoiceShell — Forces the model to call the shell tool when a tool call is required.
      - `type` 'shell', required
  - `tools` union[], required
    - union
      - FunctionTool — Defines a function in your own code the model can choose to call. Learn more about [function calling](https://platform.openai.com/docs/guides/function-calling).
        - `name` string, required
        - `parameters` object, nullable
        - `strict` boolean, nullable
        - `type` 'function', required
        - `defer_loading` boolean, nullable
        - `description` string, nullable
      - FileSearchTool — A tool that searches for relevant content from uploaded files. Learn more about the [file search tool](https://platform.openai.com/docs/guides/tools-file-search).
        - `type` 'file_search', required
        - `vector_store_ids` string[], required
        - `filters` union
          - ComparisonFilter — A filter used to compare a specified attribute key to a given value using a defined comparison operation.
            - `key` string, required
            - `type` 'eq' | 'ne' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'nin', required
            - `value` union, required
              - …
          - CompoundFilter — Combine multiple filters using `and` or `or`.
            - `filters` union[], required
              - …
            - `type` 'and' | 'or', required
        - `max_num_results` integer, nullable
        - `ranking_options` RankingOptions — Ranking options for search.
          - `hybrid_search` RankingOptionsHybridSearch — Weights that control how reciprocal rank fusion balances semantic embedding matches versus sparse keyword matches when hybrid search is enabled.
            - `embedding_weight` number, required
            - `text_weight` number, required
          - `ranker` 'auto' | 'default-2024-11-15', nullable
          - `score_threshold` number, nullable
      - ComputerTool — A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use).
        - `type` 'computer', required
      - ComputerUsePreviewTool — A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use).
        - `display_height` integer, required
        - `display_width` integer, required
        - `environment` 'windows' | 'mac' | 'linux' | 'ubuntu' | 'browser', required
        - `type` 'computer_use_preview', required
      - WebSearchTool — Search the Internet for sources related to the prompt. Learn more about the [web search tool](https://platform.openai.com/docs/guides/tools-web-search).
        - `type` 'web_search' | 'web_search_2025_08_26', required
        - `filters` Filters — Filters for the search.
          - `allowed_domains` string[], nullable
        - `search_context_size` 'low' | 'medium' | 'high', nullable
        - `user_location` OpenaiTypesResponsesWebSearchToolUserLocation — The approximate location of the user.
          - `city` string, nullable
          - `country` string, nullable
          - `region` string, nullable
          - `timezone` string, nullable
          - `type` 'approximate', nullable
      - Mcp — Give the model access to additional tools via remote Model Context Protocol (MCP) servers. [Learn more about MCP](https://platform.openai.com/docs/guides/tools-remote-mcp).
        - `server_label` string, required
        - `type` 'mcp', required
        - `allowed_tools` union
          - string[]
          - McpAllowedToolsMcpToolFilter — A filter object to specify which tools are allowed.
            - `read_only` boolean, nullable
            - `tool_names` string[], nullable
        - `authorization` string, nullable
        - `connector_id` 'connector_dropbox' | 'connector_gmail' | 'connector_googlecalendar' | 'connector_googledrive' | 'connector_microsoftteams' | 'connector_outlookcalendar' | 'connector_outlookemail' | 'connector_sharepoint', nullable
        - `defer_loading` boolean, nullable
        - `headers` object, nullable
        - `require_approval` union
          - McpRequireApprovalMcpToolApprovalFilter — Specify which of the MCP server's tools require approval. Can be `always`, `never`, or a filter object associated with tools that require approval.
            - `always` McpRequireApprovalMcpToolApprovalFilterAlways — A filter object to specify which tools are allowed.
              - …
            - `never` McpRequireApprovalMcpToolApprovalFilterNever — A filter object to specify which tools are allowed.
              - …
          - 'always' | 'never'
        - `server_description` string, nullable
        - `server_url` string, nullable
      - CodeInterpreter — A tool that runs Python code to help generate a response to a prompt.
        - `container` union, required
          - string
          - CodeInterpreterContainerCodeInterpreterToolAuto — Configuration for a code interpreter container. Optionally specify the IDs of the files to run the code on.
            - `type` 'auto', required
            - `file_ids` string[], nullable
            - `memory_limit` '1g' | '4g' | '16g' | '64g', nullable
            - `network_policy` union
              - …
        - `type` 'code_interpreter', required
      - ImageGeneration — A tool that generates images using the GPT image models.
        - `type` 'image_generation', required
        - `action` 'generate' | 'edit' | 'auto', nullable
        - `background` 'transparent' | 'opaque' | 'auto', nullable
        - `input_fidelity` 'high' | 'low', nullable
        - `input_image_mask` ImageGenerationInputImageMask — Optional mask for inpainting. Contains `image_url` (string, optional) and `file_id` (string, optional).
          - `file_id` string, nullable
          - `image_url` string, nullable
        - `model` union
          - string
          - 'gpt-image-1' | 'gpt-image-1-mini' | 'gpt-image-2' | 'gpt-image-2-2026-04-21' | 'gpt-image-1.5' | 'chatgpt-image-latest'
        - `moderation` 'auto' | 'low', nullable
        - `output_compression` integer, nullable
        - `output_format` 'png' | 'webp' | 'jpeg', nullable
        - `partial_images` integer, nullable
        - `quality` 'low' | 'medium' | 'high' | 'auto', nullable
        - `size` union
          - string
          - '1024x1024' | '1024x1536' | '1536x1024' | 'auto'
      - LocalShell — A tool that allows the model to execute shell commands in a local environment.
        - `type` 'local_shell', required
      - FunctionShellTool — A tool that allows the model to execute shell commands.
        - `type` 'shell', required
        - `environment` union
          - ContainerAuto
            - `type` 'container_auto', required
            - `file_ids` string[], nullable
            - `memory_limit` '1g' | '4g' | '16g' | '64g', nullable
            - `network_policy` union
              - …
            - `skills` union[], nullable
              - …
          - LocalEnvironment
            - `type` 'local', required
            - `skills` LocalSkill[], nullable
              - …
          - ContainerReference
            - `container_id` string, required
            - `type` 'container_reference', required
      - CustomTool — A custom tool that processes input using a specified format. Learn more about [custom tools](https://platform.openai.com/docs/guides/function-calling#custom-tools)
        - `name` string, required
        - `type` 'custom', required
        - `defer_loading` boolean, nullable
        - `description` string, nullable
        - `format` union
          - Text — Unconstrained free-form text.
            - `type` 'text', required
          - Grammar — A grammar defined by the user.
            - `definition` string, required
            - `syntax` 'lark' | 'regex', required
            - `type` 'grammar', required
      - NamespaceTool — Groups function/custom tools under a shared namespace.
        - `description` string, required
        - `name` string, required
        - `tools` union[], required
          - union
            - ToolFunction
              - …
            - CustomTool — A custom tool that processes input using a specified format. Learn more about [custom tools](https://platform.openai.com/docs/guides/function-calling#custom-tools)
              - …
        - `type` 'namespace', required
      - ToolSearchTool — Hosted or BYOT tool search configuration for deferred tools.
        - `type` 'tool_search', required
        - `description` string, nullable
        - `execution` 'server' | 'client', nullable
        - `parameters` unknown
      - WebSearchPreviewTool — This tool searches the web for relevant results to use in a response. Learn more about the [web search tool](https://platform.openai.com/docs/guides/tools-web-search).
        - `type` 'web_search_preview' | 'web_search_preview_2025_03_11', required
        - `search_content_types` string[], nullable
        - `search_context_size` 'low' | 'medium' | 'high', nullable
        - `user_location` OpenaiTypesResponsesWebSearchPreviewToolUserLocation — The user's location.
          - `type` 'approximate', required
          - `city` string, nullable
          - `country` string, nullable
          - `region` string, nullable
          - `timezone` string, nullable
      - ApplyPatchTool — Allows the assistant to create, delete, or update files using unified diffs.
        - `type` 'apply_patch', required
  - `top_p` number, required
  - `background` boolean, required
  - `max_output_tokens` integer, required
  - `max_tool_calls` integer, nullable
  - `previous_response_id` string, nullable
  - `prompt` ResponsePrompt — Reference to a prompt template and its variables. [Learn more](https://platform.openai.com/docs/guides/text?api-mode=responses#reusable-prompts).
    - `id` string, required
    - `variables` object, nullable
    - `version` string, nullable
  - `reasoning` Reasoning — **gpt-5 and o-series models only** Configuration options for [reasoning models](https://platform.openai.com/docs/guides/reasoning).
    - `effort` 'none' | 'minimal' | 'low' | 'medium' | 'high' | 'xhigh', nullable
    - `generate_summary` 'auto' | 'concise' | 'detailed', nullable
    - `summary` 'auto' | 'concise' | 'detailed', nullable
  - `service_tier` 'auto' | 'default' | 'over-limit' | 'flex' | 'no-limit', required — Represents the service tier for requests. Attributes: Auto: Automatically choose the best available tier for the request (Default or OverLimit). Analyze response to determine which tier was used. Default: Return 429 errors on hitting the rate limit, do not exceed to the OverLimit tier. OverLimit: Indicate that the request was over the user limit. This tier cannot be set by user in the request, but us used in a response for tier=Auto. Flex: Do not consume rate-limit credits, but run with lower priority. May still result in 429 errors in case of if there is no resources to process.
  - `status` 'completed' | 'failed' | 'in_progress' | 'cancelled' | 'queued' | 'incomplete', required
  - `text` ResponseTextConfig — Configuration options for a text response from the model. Can be plain text or structured JSON data. Learn more: - [Text inputs and outputs](https://platform.openai.com/docs/guides/text) - [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs)
    - `format` union
      - ResponseFormatText — Default response format. Used to generate text responses.
        - `type` 'text', required
      - ResponseFormatTextJSONSchemaConfig — JSON Schema response format. Used to generate structured JSON responses. Learn more about [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs).
        - `name` string, required
        - `schema` object, required
        - `type` 'json_schema', required
        - `description` string, nullable
        - `strict` boolean, nullable
      - ResponseFormatJSONObject — JSON object response format. An older method of generating JSON responses. Using `json_schema` is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so.
        - `type` 'json_object', required
    - `verbosity` 'low' | 'medium' | 'high', nullable
  - `top_logprobs` integer, nullable
  - `truncation` 'auto' | 'disabled', required
  - `usage` ResponseUsage
    - `input_tokens` integer, required
    - `input_tokens_details` InputTokensDetails, required
      - `cached_tokens` integer, required
      - `input_tokens_per_turn` integer[]
      - `cached_tokens_per_turn` integer[]
    - `output_tokens` integer, required
    - `output_tokens_details` OutputTokensDetails, required
      - `reasoning_tokens` integer
      - `tool_output_tokens` integer
      - `output_tokens_per_turn` integer[]
      - `tool_output_tokens_per_turn` integer[]
    - `total_tokens` integer, required
  - `user` string, nullable

## Other responses

- `422` — Validation Error

---

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