---
title: "Create a Model Response"
method: POST
path: "/v1/responses"
tags: ["OpenAI Compatible"]
---

# Create a Model Response

`POST /v1/responses`

Creates a model response. Provide [text](https://developers.openai.com/api/docs/guides/text) or
[image](https://developers.openai.com/api/docs/guides/images) inputs to generate [text](https://developers.openai.com/api/docs/guides/text)
or [JSON](https://developers.openai.com/api/docs/guides/structured-outputs) outputs. Have the model call
your own [custom code](https://developers.openai.com/api/docs/guides/function-calling) or use built-in
[tools](https://developers.openai.com/api/docs/guides/tools) like [web search](https://developers.openai.com/api/docs/guides/tools-web-search)
or [file search](https://developers.openai.com/api/docs/guides/tools-file-search) to use your own data
as input for the model's response.

## Request body

- CreateResponse
  - `metadata` Metadata, nullable — Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format, and querying for objects via API or the dashboard. Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters.
  - `top_logprobs` integer — An integer between 0 and 20 specifying the maximum number of most likely tokens to return at each token position, each with an associated log probability. In some cases, the number of returned tokens may be fewer than requested.
  - `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.
  - `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.
  - `user` string — This field is being replaced by `safety_identifier` and `prompt_cache_key`. Use `prompt_cache_key` instead to maintain caching optimizations. A stable identifier for your end-users. Used to boost cache hit rates by better bucketing similar requests and to help OpenAI detect and prevent abuse. [Learn more](https://developers.openai.com/api/docs/guides/safety-best-practices#safety-identifiers).
  - `safety_identifier` string — A stable identifier used to help detect users of your application that may be violating OpenAI's usage policies. The IDs should be a string that uniquely identifies each user, with a maximum length of 64 characters. We recommend hashing their username or email address, in order to avoid sending us any identifying information. [Learn more](https://developers.openai.com/api/docs/guides/safety-best-practices#safety-identifiers).
  - `prompt_cache_key` string — Used by OpenAI to cache responses for similar requests to optimize your cache hit rates. Replaces the `user` field. [Learn more](https://developers.openai.com/api/docs/guides/prompt-caching).
  - `service_tier` 'auto' | 'default' | 'flex' | 'scale' | 'priority', nullable — Specifies the processing type used for serving the request. - If set to 'auto', then the request will be processed with the service tier configured in the Project settings. Unless otherwise configured, the Project will use 'default'. - If set to 'default', then the request will be processed with the standard pricing and performance for the selected model. - If set to '[flex](https://developers.openai.com/api/docs/guides/flex-processing)' or '[priority](https://openai.com/api-priority-processing/)', then the request will be processed with the corresponding service tier. - When not set, the default behavior is 'auto'. When the `service_tier` parameter is set, the response body will include the `service_tier` value based on the processing mode actually used to serve the request. This response value may be different from the value set in the parameter.
  - `prompt_cache_retention` 'in_memory' | '24h', nullable — The retention policy for the prompt cache. Set to `24h` to enable extended prompt caching, which keeps cached prefixes active for longer, up to a maximum of 24 hours. [Learn more](https://developers.openai.com/api/docs/guides/prompt-caching#prompt-cache-retention).
  - `previous_response_id` string, nullable — The unique ID of the previous response to the model. Use this to create multi-turn conversations. Learn more about [conversation state](https://developers.openai.com/api/docs/guides/conversation-state). Cannot be used in conjunction with `conversation`.
  - `model` union
    - string
    - 'gpt-5.4' | 'gpt-5.4-mini' | 'gpt-5.4-nano' | 'gpt-5.4-mini-2026-03-17' | 'gpt-5.4-nano-2026-03-17' | 'gpt-5.3-chat-latest' | 'gpt-5.2' | 'gpt-5.2-2025-12-11' | 'gpt-5.2-chat-latest' | 'gpt-5.2-pro' | 'gpt-5.2-pro-2025-12-11' | 'gpt-5.1' | 'gpt-5.1-2025-11-13' | 'gpt-5.1-codex' | 'gpt-5.1-mini' | 'gpt-5.1-chat-latest' | 'gpt-5' | 'gpt-5-mini' | 'gpt-5-nano' | 'gpt-5-2025-08-07' | 'gpt-5-mini-2025-08-07' | 'gpt-5-nano-2025-08-07' | 'gpt-5-chat-latest' | 'gpt-4.1' | 'gpt-4.1-mini' | 'gpt-4.1-nano' | 'gpt-4.1-2025-04-14' | 'gpt-4.1-mini-2025-04-14' | 'gpt-4.1-nano-2025-04-14' | 'o4-mini' | 'o4-mini-2025-04-16' | 'o3' | 'o3-2025-04-16' | 'o3-mini' | 'o3-mini-2025-01-31' | 'o1' | 'o1-2024-12-17' | 'o1-preview' | 'o1-preview-2024-09-12' | 'o1-mini' | 'o1-mini-2024-09-12' | 'gpt-4o' | 'gpt-4o-2024-11-20' | 'gpt-4o-2024-08-06' | 'gpt-4o-2024-05-13' | 'gpt-4o-audio-preview' | 'gpt-4o-audio-preview-2024-10-01' | 'gpt-4o-audio-preview-2024-12-17' | 'gpt-4o-audio-preview-2025-06-03' | 'gpt-4o-mini-audio-preview' | 'gpt-4o-mini-audio-preview-2024-12-17' | 'gpt-4o-search-preview' | 'gpt-4o-mini-search-preview' | 'gpt-4o-search-preview-2025-03-11' | 'gpt-4o-mini-search-preview-2025-03-11' | 'chatgpt-4o-latest' | 'codex-mini-latest' | 'gpt-4o-mini' | 'gpt-4o-mini-2024-07-18' | 'gpt-4-turbo' | 'gpt-4-turbo-2024-04-09' | 'gpt-4-0125-preview' | 'gpt-4-turbo-preview' | 'gpt-4-1106-preview' | 'gpt-4-vision-preview' | 'gpt-4' | 'gpt-4-0314' | 'gpt-4-0613' | 'gpt-4-32k' | 'gpt-4-32k-0314' | 'gpt-4-32k-0613' | 'gpt-3.5-turbo' | 'gpt-3.5-turbo-16k' | 'gpt-3.5-turbo-0301' | 'gpt-3.5-turbo-0613' | 'gpt-3.5-turbo-1106' | 'gpt-3.5-turbo-0125' | 'gpt-3.5-turbo-16k-0613'
    - 'o1-pro' | 'o1-pro-2025-03-19' | 'o3-pro' | 'o3-pro-2025-06-10' | 'o3-deep-research' | 'o3-deep-research-2025-06-26' | 'o4-mini-deep-research' | 'o4-mini-deep-research-2025-06-26' | 'computer-use-preview' | 'computer-use-preview-2025-03-11' | 'gpt-5-codex' | 'gpt-5-pro' | 'gpt-5-pro-2025-10-06' | 'gpt-5.1-codex-max'
  - `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 — Constrains effort on reasoning for [reasoning models](https://platform.openai.com/docs/guides/reasoning). Currently supported values are `none`, `minimal`, `low`, `medium`, `high`, and `xhigh`. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response. - `gpt-5.1` defaults to `none`, which does not perform reasoning. The supported reasoning values for `gpt-5.1` are `none`, `low`, `medium`, and `high`. Tool calls are supported for all reasoning values in gpt-5.1. - All models before `gpt-5.1` default to `medium` reasoning effort, and do not support `none`. - The `gpt-5-pro` model defaults to (and only supports) `high` reasoning effort. - `xhigh` is supported for all models after `gpt-5.1-codex-max`.
    - `summary` 'auto' | 'concise' | 'detailed', nullable — A summary of the reasoning performed by the model. This can be useful for debugging and understanding the model's reasoning process. One of `auto`, `concise`, or `detailed`. `concise` is supported for `computer-use-preview` models and all reasoning models after `gpt-5`.
    - `generate_summary` 'auto' | 'concise' | 'detailed', nullable — **Deprecated:** use `summary` instead. A summary of the reasoning performed by the model. This can be useful for debugging and understanding the model's reasoning process. One of `auto`, `concise`, or `detailed`.
  - `background` boolean, nullable — Whether to run the model response in the background. [Learn more](https://developers.openai.com/api/docs/guides/background).
  - `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.
  - `text` ResponseTextParam — Configuration options for a text response from the model. Can be plain text or structured JSON data. Learn more: - [Text inputs and outputs](https://developers.openai.com/api/docs/guides/text) - [Structured Outputs](https://developers.openai.com/api/docs/guides/structured-outputs)
    - `format` union — An object specifying the format that the model must output. Configuring `{ "type": "json_schema" }` enables Structured Outputs, which ensures the model will match your supplied JSON schema. Learn more in the [Structured Outputs guide](https://developers.openai.com/api/docs/guides/structured-outputs). The default format is `{ "type": "text" }` with no additional options. **Not recommended for gpt-4o and newer models:** Setting to `{ "type": "json_object" }` enables the older JSON mode, which ensures the message the model generates is valid JSON. Using `json_schema` is preferred for models that support it.
      - object — Default response format. Used to generate text responses.
        - `type` 'text', required — The type of response format being defined. Always `text`.
      - unknown
      - object — 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 — The type of response format being defined. Always `json_object`.
    - `verbosity` 'low' | 'medium' | 'high', nullable — Constrains the verbosity of the model's response. Lower values will result in more concise responses, while higher values will result in more verbose responses. Currently supported values are `low`, `medium`, and `high`.
  - `tools` Tool[] — An array of tools the model may call while generating a response. You can specify which tool to use by setting the `tool_choice` parameter. We support the following categories of tools: - **Built-in tools**: Tools that are provided by OpenAI that extend the model's capabilities, like [web search](https://developers.openai.com/api/docs/guides/tools-web-search) or [file search](https://developers.openai.com/api/docs/guides/tools-file-search). Learn more about [built-in tools](https://developers.openai.com/api/docs/guides/tools). - **MCP Tools**: Integrations with third-party systems via custom MCP servers or predefined connectors such as Google Drive and SharePoint. Learn more about [MCP Tools](https://developers.openai.com/api/docs/guides/tools-connectors-mcp). - **Function calls (custom tools)**: Functions that are defined by you, enabling the model to call your own code with strongly typed arguments and outputs. Learn more about [function calling](https://developers.openai.com/api/docs/guides/function-calling). You can also use custom tools to call your own code.
    - union — A tool that can be used to generate a response.
      - unknown
      - unknown
      - unknown
      - unknown
      - unknown
      - unknown
      - unknown
      - unknown
      - unknown
      - unknown
      - unknown
      - unknown
      - unknown
      - unknown
      - unknown
  - `tool_choice` union — How the model should select which tool (or tools) to use when generating a response. See the `tools` parameter to see how to specify which tools the model can call.
    - 'none' | 'auto' | 'required' — Controls which (if any) tool is called by the model. `none` means the model will not call any tool and instead generates a message. `auto` means the model can pick between generating a message or calling one or more tools. `required` means the model must call one or more tools.
    - object — Constrains the tools available to the model to a pre-defined set.
      - `type` 'allowed_tools' — Allowed tool configuration type. Always `allowed_tools`.
      - `mode` 'auto' | 'required' — Constrains the tools available to the model to a pre-defined set. `auto` allows the model to pick from among the allowed tools and generate a message. `required` requires the model to call one or more of the allowed tools.
      - `tools` unknown[] — A list of tool definitions that the model should be allowed to call. For the Responses API, the list of tool definitions might look like:
        - unknown
    - unknown
    - unknown
    - unknown
    - unknown
    - unknown
    - unknown
  - `prompt` Prompt, nullable — Reference to a prompt template and its variables. [Learn more](https://developers.openai.com/api/docs/guides/text?api-mode=responses#reusable-prompts).
    - `id` string, required — The unique identifier of the prompt template to use.
    - `version` string, nullable — Optional version of the prompt template.
    - `variables` unknown
  - `truncation` 'auto' | 'disabled', nullable — The truncation strategy to use for the model response. - `auto`: If the input to this Response exceeds the model's context window size, the model will truncate the response to fit the context window by dropping items from the beginning of the conversation. - `disabled` (default): If the input size will exceed the context window size for a model, the request will fail with a 400 error.
  - `input` union — Text, image, or file inputs to the model, used to generate a response. Learn more: - [Text inputs and outputs](https://developers.openai.com/api/docs/guides/text) - [Image inputs](https://developers.openai.com/api/docs/guides/images) - [File inputs](https://developers.openai.com/api/docs/guides/pdf-files) - [Conversation state](https://developers.openai.com/api/docs/guides/conversation-state) - [Function calling](https://developers.openai.com/api/docs/guides/function-calling)
    - string — A text input to the model, equivalent to a text input with the `user` role.
    - InputItem[] — A list of one or many input items to the model, containing different content types.
      - union
        - object — 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.
          - `role` 'user' | 'assistant' | 'system' | 'developer', required — The role of the message input. One of `user`, `assistant`, `system`, or `developer`.
          - `content` union, required — Text, image, or audio input to the model, used to generate a response. Can also contain previous assistant responses.
            - string — A text input to the model.
            - unknown
          - `phase` unknown
          - `type` 'message' — The type of the message input. Always `message`.
        - unknown
        - OutputMessage — An output message from the model.
          - `id` string, required — The unique ID of the output message.
          - `type` 'message', required — The type of the output message. Always `message`.
          - `role` 'assistant', required — The role of the output message. Always `assistant`.
          - `content` OutputMessageContent[], required — The content of the output message.
            - unknown
          - `phase` unknown
          - `status` 'in_progress' | 'completed' | 'incomplete', required — The status of the message input. One of `in_progress`, `completed`, or `incomplete`. Populated when input items are returned via API.
        - FileSearchToolCall — The results of a file search tool call. See the [file search guide](https://developers.openai.com/api/docs/guides/tools-file-search) for more information.
          - `id` string, required — The unique ID of the file search tool call.
          - `type` 'file_search_call', required — The type of the file search tool call. Always `file_search_call`.
          - `status` 'in_progress' | 'searching' | 'completed' | 'incomplete' | 'failed', required — The status of the file search tool call. One of `in_progress`, `searching`, `incomplete` or `failed`,
          - `queries` string[], required — The queries used to search for files.
          - `results` object[], nullable — The results of the file search tool call.
            - `file_id` string — The unique ID of the file.
            - `text` string — The text that was retrieved from the file.
            - `filename` string — The name of the file.
            - `attributes` unknown
            - `score` number, float — The relevance score of the file - a value between 0 and 1.
        - ComputerToolCall — A tool call to a computer use tool. See the [computer use guide](https://developers.openai.com/api/docs/guides/tools-computer-use) for more information.
          - `type` 'computer_call', required — The type of the computer call. Always `computer_call`.
          - `id` string, required — The unique ID of the computer call.
          - `call_id` string, required — An identifier used when responding to the tool call with output.
          - `action` unknown
          - `actions` unknown
          - `pending_safety_checks` ComputerCallSafetyCheckParam[], required — The pending safety checks for the computer call.
            - unknown
          - `status` 'in_progress' | 'completed' | 'incomplete', required — The status of the item. One of `in_progress`, `completed`, or `incomplete`. Populated when items are returned via API.
        - unknown
        - WebSearchToolCall — The results of a web search tool call. See the [web search guide](https://developers.openai.com/api/docs/guides/tools-web-search) for more information.
          - `id` string, required — The unique ID of the web search tool call.
          - `type` 'web_search_call', required — The type of the web search tool call. Always `web_search_call`.
          - `status` 'in_progress' | 'searching' | 'completed' | 'failed', required — The status of the web search tool call.
          - `action` union, required — An object describing the specific action taken in this web search call. Includes details on how the model used the web (search, open_page, find_in_page).
            - unknown
            - unknown
            - unknown
        - FunctionToolCall — A tool call to run a function. See the [function calling guide](https://developers.openai.com/api/docs/guides/function-calling) for more information.
          - `id` string — The unique ID of the function tool call.
          - `type` 'function_call', required — The type of the function tool call. Always `function_call`.
          - `call_id` string, required — The unique ID of the function tool call generated by the model.
          - `namespace` string — The namespace of the function to run.
          - `name` string, required — The name of the function to run.
          - `arguments` string, required — A JSON string of the arguments to pass to the function.
          - `status` 'in_progress' | 'completed' | 'incomplete' — The status of the item. One of `in_progress`, `completed`, or `incomplete`. Populated when items are returned via API.
        - unknown
        - unknown
        - unknown
        - ReasoningItem — 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://developers.openai.com/api/docs/guides/conversation-state).
          - `type` 'reasoning', required — The type of the object. Always `reasoning`.
          - `id` string, required — The unique identifier of the reasoning content.
          - `encrypted_content` string, nullable — The encrypted content of the reasoning item - populated when a response is generated with `reasoning.encrypted_content` in the `include` parameter.
          - `summary` SummaryTextContent[], required — Reasoning summary content.
            - unknown
          - `content` ReasoningTextContent[] — Reasoning text content.
            - unknown
          - `status` 'in_progress' | 'completed' | 'incomplete' — The status of the item. One of `in_progress`, `completed`, or `incomplete`. Populated when items are returned via API.
        - unknown
        - ImageGenToolCall — An image generation request made by the model.
          - `type` 'image_generation_call', required — The type of the image generation call. Always `image_generation_call`.
          - `id` string, required — The unique ID of the image generation call.
          - `status` 'in_progress' | 'completed' | 'generating' | 'failed', required — The status of the image generation call.
          - `result` string, nullable, required — The generated image encoded in base64.
        - CodeInterpreterToolCall — A tool call to run code.
          - `type` 'code_interpreter_call', required — The type of the code interpreter tool call. Always `code_interpreter_call`.
          - `id` string, required — The unique ID of the code interpreter tool call.
          - `status` 'in_progress' | 'completed' | 'incomplete' | 'interpreting' | 'failed', required — The status of the code interpreter tool call. Valid values are `in_progress`, `completed`, `incomplete`, `interpreting`, and `failed`.
          - `container_id` string, required — The ID of the container used to run the code.
          - `code` string, nullable, required — The code to run, or null if not available.
          - `outputs` union[], nullable, required — The outputs generated by the code interpreter, such as logs or images. Can be null if no outputs are available.
            - union
              - …
        - LocalShellToolCall — A tool call to run a command on the local shell.
          - `type` 'local_shell_call', required — The type of the local shell call. Always `local_shell_call`.
          - `id` string, required — The unique ID of the local shell call.
          - `call_id` string, required — The unique ID of the local shell tool call generated by the model.
          - `action` unknown, required
          - `status` 'in_progress' | 'completed' | 'incomplete', required — The status of the local shell call.
        - LocalShellToolCallOutput — The output of a local shell tool call.
          - `type` 'local_shell_call_output', required — The type of the local shell tool call output. Always `local_shell_call_output`.
          - `id` string, required — The unique ID of the local shell tool call generated by the model.
          - `output` string, required — A JSON string of the output of the local shell tool call.
          - `status` 'in_progress' | 'completed' | 'incomplete', nullable — The status of the item. One of `in_progress`, `completed`, or `incomplete`.
        - unknown
        - unknown
        - unknown
        - unknown
        - MCPListTools — A list of tools available on an MCP server.
          - `type` 'mcp_list_tools', required — The type of the item. Always `mcp_list_tools`.
          - `id` string, required — The unique ID of the list.
          - `server_label` string, required — The label of the MCP server.
          - `tools` MCPListToolsTool[], required — The tools available on the server.
            - unknown
          - `error` string, nullable — Error message if the server could not list tools.
        - MCPApprovalRequest — A request for human approval of a tool invocation.
          - `type` 'mcp_approval_request', required — The type of the item. Always `mcp_approval_request`.
          - `id` string, required — The unique ID of the approval request.
          - `server_label` string, required — The label of the MCP server making the request.
          - `name` string, required — The name of the tool to run.
          - `arguments` string, required — A JSON string of arguments for the tool.
        - unknown
        - MCPToolCall — An invocation of a tool on an MCP server.
          - `type` 'mcp_call', required — The type of the item. Always `mcp_call`.
          - `id` string, required — The unique ID of the tool call.
          - `server_label` string, required — The label of the MCP server running the tool.
          - `name` string, required — The name of the tool that was run.
          - `arguments` string, required — A JSON string of the arguments passed to the tool.
          - `output` string, nullable — The output from the tool call.
          - `error` string, nullable — The error from the tool call, if any.
          - `status` unknown
          - `approval_request_id` string, nullable — Unique identifier for the MCP tool call approval request. Include this value in a subsequent `mcp_approval_response` input to approve or reject the corresponding tool call.
        - unknown
        - CustomToolCall — A call to a custom tool created by the model.
          - `type` 'custom_tool_call', required — The type of the custom tool call. Always `custom_tool_call`.
          - `id` string — The unique ID of the custom tool call in the OpenAI platform.
          - `call_id` string, required — An identifier used to map this custom tool call to a tool call output.
          - `namespace` string — The namespace of the custom tool being called.
          - `name` string, required — The name of the custom tool being called.
          - `input` string, required — The input for the custom tool call generated by the model.
        - object — Compacts the current context. Must be the final input item.
          - `type` 'compaction_trigger', required — The type of the item. Always `compaction_trigger`.
        - object — An internal identifier for an item to reference.
          - `type` 'item_reference', nullable — The type of item to reference. Always `item_reference`.
          - `id` string, required — The ID of the item to reference.
  - `include` IncludeEnum[], nullable — Specify additional output data to include in the model response. Currently supported values are: - `web_search_call.action.sources`: Include the sources of the web search tool call. - `code_interpreter_call.outputs`: Includes the outputs of python code execution in code interpreter tool call items. - `computer_call_output.output.image_url`: Include image urls from the computer call output. - `file_search_call.results`: Include the search results of the file search tool call. - `message.input_image.image_url`: Include image urls from the input message. - `message.output_text.logprobs`: Include logprobs with assistant messages. - `reasoning.encrypted_content`: Includes an encrypted version of reasoning tokens in reasoning item outputs. This enables reasoning items to be used in multi-turn conversations when using the Responses API statelessly (like when the `store` parameter is set to `false`, or when an organization is enrolled in the zero data retention program).
  - `parallel_tool_calls` boolean, nullable — Whether to allow the model to run tool calls in parallel.
  - `store` boolean, nullable — Whether to store the generated model response for later retrieval via API.
  - `instructions` string, nullable — A system (or developer) message inserted into the model's context. When using along with `previous_response_id`, the instructions from a previous response will not be carried over to the next response. This makes it simple to swap out system (or developer) messages in new responses.
  - `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](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events#Event_stream_format). See the [Streaming section below](https://developers.openai.com/api/docs/api-reference/responses-streaming) for more information.
  - `stream_options` ResponseStreamOptions, nullable — Options for streaming responses. Only set this when you set `stream: true`.
    - `include_obfuscation` boolean — When true, stream obfuscation will be enabled. Stream obfuscation adds random characters to an `obfuscation` field on streaming delta events to normalize payload sizes as a mitigation to certain side-channel attacks. These obfuscation fields are included by default, but add a small amount of overhead to the data stream. You can set `include_obfuscation` to false to optimize for bandwidth if you trust the network links between your application and the OpenAI API.
  - `conversation` union — The conversation that this response belongs to. Items from this conversation are prepended to `input_items` for this response request. Input items and output items from this response are automatically added to this conversation after this response completes.
    - string — The unique ID of the conversation.
    - object — The conversation that this response belongs to.
      - `id` string, required — The unique ID of the conversation.
  - `context_management` ContextManagementParam[], nullable — Context management configuration for this request.
    - `type` string, required — The context management entry type. Currently only 'compaction' is supported.
    - `compact_threshold` integer, nullable — Token threshold at which compaction should be triggered for this entry.
  - `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](https://developers.openai.com/api/docs/guides/reasoning).
  - `top_k` integer — Top-K sampling — only the K highest-probability tokens are considered. Passed through to Anthropic (pre-Claude-Opus-4.6) / Gemini / Vertex / Cohere. Ignored by OpenAI / Azure.

## Response `200`

OK

- Response
  - `metadata` Metadata, nullable — Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format, and querying for objects via API or the dashboard. Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters.
  - `top_logprobs` integer, nullable — An integer between 0 and 20 specifying the maximum number of most likely tokens to return at each token position, each with an associated log probability. In some cases, the number of returned tokens may be fewer than requested.
  - `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.
  - `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.
  - `user` string — This field is being replaced by `safety_identifier` and `prompt_cache_key`. Use `prompt_cache_key` instead to maintain caching optimizations. A stable identifier for your end-users. Used to boost cache hit rates by better bucketing similar requests and to help OpenAI detect and prevent abuse. [Learn more](https://developers.openai.com/api/docs/guides/safety-best-practices#safety-identifiers).
  - `safety_identifier` string — A stable identifier used to help detect users of your application that may be violating OpenAI's usage policies. The IDs should be a string that uniquely identifies each user, with a maximum length of 64 characters. We recommend hashing their username or email address, in order to avoid sending us any identifying information. [Learn more](https://developers.openai.com/api/docs/guides/safety-best-practices#safety-identifiers).
  - `prompt_cache_key` string — Used by OpenAI to cache responses for similar requests to optimize your cache hit rates. Replaces the `user` field. [Learn more](https://developers.openai.com/api/docs/guides/prompt-caching).
  - `service_tier` 'auto' | 'default' | 'flex' | 'scale' | 'priority', nullable — Specifies the processing type used for serving the request. - If set to 'auto', then the request will be processed with the service tier configured in the Project settings. Unless otherwise configured, the Project will use 'default'. - If set to 'default', then the request will be processed with the standard pricing and performance for the selected model. - If set to '[flex](https://developers.openai.com/api/docs/guides/flex-processing)' or '[priority](https://openai.com/api-priority-processing/)', then the request will be processed with the corresponding service tier. - When not set, the default behavior is 'auto'. When the `service_tier` parameter is set, the response body will include the `service_tier` value based on the processing mode actually used to serve the request. This response value may be different from the value set in the parameter.
  - `prompt_cache_retention` 'in_memory' | '24h', nullable — The retention policy for the prompt cache. Set to `24h` to enable extended prompt caching, which keeps cached prefixes active for longer, up to a maximum of 24 hours. [Learn more](https://developers.openai.com/api/docs/guides/prompt-caching#prompt-cache-retention).
  - `previous_response_id` string, nullable — The unique ID of the previous response to the model. Use this to create multi-turn conversations. Learn more about [conversation state](https://developers.openai.com/api/docs/guides/conversation-state). Cannot be used in conjunction with `conversation`.
  - `model` union
    - string
    - 'gpt-5.4' | 'gpt-5.4-mini' | 'gpt-5.4-nano' | 'gpt-5.4-mini-2026-03-17' | 'gpt-5.4-nano-2026-03-17' | 'gpt-5.3-chat-latest' | 'gpt-5.2' | 'gpt-5.2-2025-12-11' | 'gpt-5.2-chat-latest' | 'gpt-5.2-pro' | 'gpt-5.2-pro-2025-12-11' | 'gpt-5.1' | 'gpt-5.1-2025-11-13' | 'gpt-5.1-codex' | 'gpt-5.1-mini' | 'gpt-5.1-chat-latest' | 'gpt-5' | 'gpt-5-mini' | 'gpt-5-nano' | 'gpt-5-2025-08-07' | 'gpt-5-mini-2025-08-07' | 'gpt-5-nano-2025-08-07' | 'gpt-5-chat-latest' | 'gpt-4.1' | 'gpt-4.1-mini' | 'gpt-4.1-nano' | 'gpt-4.1-2025-04-14' | 'gpt-4.1-mini-2025-04-14' | 'gpt-4.1-nano-2025-04-14' | 'o4-mini' | 'o4-mini-2025-04-16' | 'o3' | 'o3-2025-04-16' | 'o3-mini' | 'o3-mini-2025-01-31' | 'o1' | 'o1-2024-12-17' | 'o1-preview' | 'o1-preview-2024-09-12' | 'o1-mini' | 'o1-mini-2024-09-12' | 'gpt-4o' | 'gpt-4o-2024-11-20' | 'gpt-4o-2024-08-06' | 'gpt-4o-2024-05-13' | 'gpt-4o-audio-preview' | 'gpt-4o-audio-preview-2024-10-01' | 'gpt-4o-audio-preview-2024-12-17' | 'gpt-4o-audio-preview-2025-06-03' | 'gpt-4o-mini-audio-preview' | 'gpt-4o-mini-audio-preview-2024-12-17' | 'gpt-4o-search-preview' | 'gpt-4o-mini-search-preview' | 'gpt-4o-search-preview-2025-03-11' | 'gpt-4o-mini-search-preview-2025-03-11' | 'chatgpt-4o-latest' | 'codex-mini-latest' | 'gpt-4o-mini' | 'gpt-4o-mini-2024-07-18' | 'gpt-4-turbo' | 'gpt-4-turbo-2024-04-09' | 'gpt-4-0125-preview' | 'gpt-4-turbo-preview' | 'gpt-4-1106-preview' | 'gpt-4-vision-preview' | 'gpt-4' | 'gpt-4-0314' | 'gpt-4-0613' | 'gpt-4-32k' | 'gpt-4-32k-0314' | 'gpt-4-32k-0613' | 'gpt-3.5-turbo' | 'gpt-3.5-turbo-16k' | 'gpt-3.5-turbo-0301' | 'gpt-3.5-turbo-0613' | 'gpt-3.5-turbo-1106' | 'gpt-3.5-turbo-0125' | 'gpt-3.5-turbo-16k-0613'
    - 'o1-pro' | 'o1-pro-2025-03-19' | 'o3-pro' | 'o3-pro-2025-06-10' | 'o3-deep-research' | 'o3-deep-research-2025-06-26' | 'o4-mini-deep-research' | 'o4-mini-deep-research-2025-06-26' | 'computer-use-preview' | 'computer-use-preview-2025-03-11' | 'gpt-5-codex' | 'gpt-5-pro' | 'gpt-5-pro-2025-10-06' | 'gpt-5.1-codex-max'
  - `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 — Constrains effort on reasoning for [reasoning models](https://platform.openai.com/docs/guides/reasoning). Currently supported values are `none`, `minimal`, `low`, `medium`, `high`, and `xhigh`. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response. - `gpt-5.1` defaults to `none`, which does not perform reasoning. The supported reasoning values for `gpt-5.1` are `none`, `low`, `medium`, and `high`. Tool calls are supported for all reasoning values in gpt-5.1. - All models before `gpt-5.1` default to `medium` reasoning effort, and do not support `none`. - The `gpt-5-pro` model defaults to (and only supports) `high` reasoning effort. - `xhigh` is supported for all models after `gpt-5.1-codex-max`.
    - `summary` 'auto' | 'concise' | 'detailed', nullable — A summary of the reasoning performed by the model. This can be useful for debugging and understanding the model's reasoning process. One of `auto`, `concise`, or `detailed`. `concise` is supported for `computer-use-preview` models and all reasoning models after `gpt-5`.
    - `generate_summary` 'auto' | 'concise' | 'detailed', nullable — **Deprecated:** use `summary` instead. A summary of the reasoning performed by the model. This can be useful for debugging and understanding the model's reasoning process. One of `auto`, `concise`, or `detailed`.
  - `background` boolean, nullable — Whether to run the model response in the background. [Learn more](https://developers.openai.com/api/docs/guides/background).
  - `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.
  - `text` ResponseTextParam — Configuration options for a text response from the model. Can be plain text or structured JSON data. Learn more: - [Text inputs and outputs](https://developers.openai.com/api/docs/guides/text) - [Structured Outputs](https://developers.openai.com/api/docs/guides/structured-outputs)
    - `format` union — An object specifying the format that the model must output. Configuring `{ "type": "json_schema" }` enables Structured Outputs, which ensures the model will match your supplied JSON schema. Learn more in the [Structured Outputs guide](https://developers.openai.com/api/docs/guides/structured-outputs). The default format is `{ "type": "text" }` with no additional options. **Not recommended for gpt-4o and newer models:** Setting to `{ "type": "json_object" }` enables the older JSON mode, which ensures the message the model generates is valid JSON. Using `json_schema` is preferred for models that support it.
      - object — Default response format. Used to generate text responses.
        - `type` 'text', required — The type of response format being defined. Always `text`.
      - unknown
      - object — 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 — The type of response format being defined. Always `json_object`.
    - `verbosity` 'low' | 'medium' | 'high', nullable — Constrains the verbosity of the model's response. Lower values will result in more concise responses, while higher values will result in more verbose responses. Currently supported values are `low`, `medium`, and `high`.
  - `tools` Tool[] — An array of tools the model may call while generating a response. You can specify which tool to use by setting the `tool_choice` parameter. We support the following categories of tools: - **Built-in tools**: Tools that are provided by OpenAI that extend the model's capabilities, like [web search](https://developers.openai.com/api/docs/guides/tools-web-search) or [file search](https://developers.openai.com/api/docs/guides/tools-file-search). Learn more about [built-in tools](https://developers.openai.com/api/docs/guides/tools). - **MCP Tools**: Integrations with third-party systems via custom MCP servers or predefined connectors such as Google Drive and SharePoint. Learn more about [MCP Tools](https://developers.openai.com/api/docs/guides/tools-connectors-mcp). - **Function calls (custom tools)**: Functions that are defined by you, enabling the model to call your own code with strongly typed arguments and outputs. Learn more about [function calling](https://developers.openai.com/api/docs/guides/function-calling). You can also use custom tools to call your own code.
    - union — A tool that can be used to generate a response.
      - unknown
      - unknown
      - unknown
      - unknown
      - unknown
      - unknown
      - unknown
      - unknown
      - unknown
      - unknown
      - unknown
      - unknown
      - unknown
      - unknown
      - unknown
  - `tool_choice` union — How the model should select which tool (or tools) to use when generating a response. See the `tools` parameter to see how to specify which tools the model can call.
    - 'none' | 'auto' | 'required' — Controls which (if any) tool is called by the model. `none` means the model will not call any tool and instead generates a message. `auto` means the model can pick between generating a message or calling one or more tools. `required` means the model must call one or more tools.
    - object — Constrains the tools available to the model to a pre-defined set.
      - `type` 'allowed_tools' — Allowed tool configuration type. Always `allowed_tools`.
      - `mode` 'auto' | 'required' — Constrains the tools available to the model to a pre-defined set. `auto` allows the model to pick from among the allowed tools and generate a message. `required` requires the model to call one or more of the allowed tools.
      - `tools` unknown[] — A list of tool definitions that the model should be allowed to call. For the Responses API, the list of tool definitions might look like:
        - unknown
    - unknown
    - unknown
    - unknown
    - unknown
    - unknown
    - unknown
  - `prompt` Prompt, nullable — Reference to a prompt template and its variables. [Learn more](https://developers.openai.com/api/docs/guides/text?api-mode=responses#reusable-prompts).
    - `id` string, required — The unique identifier of the prompt template to use.
    - `version` string, nullable — Optional version of the prompt template.
    - `variables` unknown
  - `truncation` 'auto' | 'disabled', nullable — The truncation strategy to use for the model response. - `auto`: If the input to this Response exceeds the model's context window size, the model will truncate the response to fit the context window by dropping items from the beginning of the conversation. - `disabled` (default): If the input size will exceed the context window size for a model, the request will fail with a 400 error.
  - `id` string, required — Unique identifier for this Response.
  - `object` 'response', required — The object type of this resource - always set to `response`.
  - `status` 'completed' | 'failed' | 'in_progress' | 'cancelled' | 'queued' | 'incomplete' — The status of the response generation. One of `completed`, `failed`, `in_progress`, `cancelled`, `queued`, or `incomplete`.
  - `created_at` number, required — Unix timestamp (in seconds) of when this Response was created.
  - `completed_at` number, nullable — Unix timestamp (in seconds) of when this Response was completed. Only present when the status is `completed`.
  - `error` ResponseError, nullable, required — 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 — The error code for the response.
    - `message` string, required — A human-readable description of the error.
  - `incomplete_details` object, nullable, required — Details about why the response is incomplete.
    - `reason` 'max_output_tokens' | 'content_filter' — The reason why the response is incomplete.
  - `output` OutputItem[], required — An array of content items generated by the model. - The length and order of items in the `output` array is dependent on the model's response. - Rather than accessing the first item in the `output` array and assuming it's an `assistant` message with the content generated by the model, you might consider using the `output_text` property where supported in SDKs.
    - union
      - object — An output message from the model.
        - `id` string, required — The unique ID of the output message.
        - `type` 'message', required — The type of the output message. Always `message`.
        - `role` 'assistant', required — The role of the output message. Always `assistant`.
        - `content` OutputMessageContent[], required — The content of the output message.
          - unknown
        - `phase` unknown
        - `status` 'in_progress' | 'completed' | 'incomplete', required — The status of the message input. One of `in_progress`, `completed`, or `incomplete`. Populated when input items are returned via API.
      - object — The results of a file search tool call. See the [file search guide](https://developers.openai.com/api/docs/guides/tools-file-search) for more information.
        - `id` string, required — The unique ID of the file search tool call.
        - `type` 'file_search_call', required — The type of the file search tool call. Always `file_search_call`.
        - `status` 'in_progress' | 'searching' | 'completed' | 'incomplete' | 'failed', required — The status of the file search tool call. One of `in_progress`, `searching`, `incomplete` or `failed`,
        - `queries` string[], required — The queries used to search for files.
        - `results` object[], nullable — The results of the file search tool call.
          - `file_id` string — The unique ID of the file.
          - `text` string — The text that was retrieved from the file.
          - `filename` string — The name of the file.
          - `attributes` unknown
          - `score` number, float — The relevance score of the file - a value between 0 and 1.
      - object — A tool call to run a function. See the [function calling guide](https://developers.openai.com/api/docs/guides/function-calling) for more information.
        - `id` string — The unique ID of the function tool call.
        - `type` 'function_call', required — The type of the function tool call. Always `function_call`.
        - `call_id` string, required — The unique ID of the function tool call generated by the model.
        - `namespace` string — The namespace of the function to run.
        - `name` string, required — The name of the function to run.
        - `arguments` string, required — A JSON string of the arguments to pass to the function.
        - `status` 'in_progress' | 'completed' | 'incomplete' — The status of the item. One of `in_progress`, `completed`, or `incomplete`. Populated when items are returned via API.
      - object — Referenced by this API but not published in the vendor's docs pages.
        - `id` string, required — The unique ID of the function call tool output.
        - `status` unknown, required
        - `created_by` string — The identifier of the actor that created the item.
      - object — The results of a web search tool call. See the [web search guide](https://developers.openai.com/api/docs/guides/tools-web-search) for more information.
        - `id` string, required — The unique ID of the web search tool call.
        - `type` 'web_search_call', required — The type of the web search tool call. Always `web_search_call`.
        - `status` 'in_progress' | 'searching' | 'completed' | 'failed', required — The status of the web search tool call.
        - `action` union, required — An object describing the specific action taken in this web search call. Includes details on how the model used the web (search, open_page, find_in_page).
          - unknown
          - unknown
          - unknown
      - object — A tool call to a computer use tool. See the [computer use guide](https://developers.openai.com/api/docs/guides/tools-computer-use) for more information.
        - `type` 'computer_call', required — The type of the computer call. Always `computer_call`.
        - `id` string, required — The unique ID of the computer call.
        - `call_id` string, required — An identifier used when responding to the tool call with output.
        - `action` unknown
        - `actions` unknown
        - `pending_safety_checks` ComputerCallSafetyCheckParam[], required — The pending safety checks for the computer call.
          - unknown
        - `status` 'in_progress' | 'completed' | 'incomplete', required — The status of the item. One of `in_progress`, `completed`, or `incomplete`. Populated when items are returned via API.
      - object — Referenced by this API but not published in the vendor's docs pages.
        - `id` string, required — The unique ID of the computer call tool output.
        - `status` unknown, required
        - `created_by` string — The identifier of the actor that created the item.
      - object — 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://developers.openai.com/api/docs/guides/conversation-state).
        - `type` 'reasoning', required — The type of the object. Always `reasoning`.
        - `id` string, required — The unique identifier of the reasoning content.
        - `encrypted_content` string, nullable — The encrypted content of the reasoning item - populated when a response is generated with `reasoning.encrypted_content` in the `include` parameter.
        - `summary` SummaryTextContent[], required — Reasoning summary content.
          - unknown
        - `content` ReasoningTextContent[] — Reasoning text content.
          - unknown
        - `status` 'in_progress' | 'completed' | 'incomplete' — The status of the item. One of `in_progress`, `completed`, or `incomplete`. Populated when items are returned via API.
      - object
        - `type` 'tool_search_call', required — The type of the item. Always `tool_search_call`.
        - `id` string, required — The unique ID of the tool search call item.
        - `call_id` string, nullable, required — The unique ID of the tool search call generated by the model.
        - `execution` unknown, required
        - `arguments` unknown, required
        - `status` unknown, required
        - `created_by` string — The identifier of the actor that created the item.
      - object
        - `type` 'tool_search_output', required — The type of the item. Always `tool_search_output`.
        - `id` string, required — The unique ID of the tool search output item.
        - `call_id` string, nullable, required — The unique ID of the tool search call generated by the model.
        - `execution` unknown, required
        - `tools` Tool[], required — The loaded tool definitions returned by tool search.
          - union — A tool that can be used to generate a response.
            - unknown
            - unknown
            - unknown
            - unknown
            - unknown
            - unknown
            - unknown
            - unknown
            - unknown
            - unknown
            - unknown
            - unknown
            - unknown
            - unknown
            - unknown
        - `status` unknown, required
        - `created_by` string — The identifier of the actor that created the item.
      - object — A compaction item generated by the [`v1/responses/compact` API](https://developers.openai.com/api/docs/api-reference/responses/compact).
        - `type` 'compaction', required — The type of the item. Always `compaction`.
        - `id` string, required — The unique ID of the compaction item.
        - `encrypted_content` string, required — The encrypted content that was produced by compaction.
        - `created_by` string — The identifier of the actor that created the item.
      - object — An image generation request made by the model.
        - `type` 'image_generation_call', required — The type of the image generation call. Always `image_generation_call`.
        - `id` string, required — The unique ID of the image generation call.
        - `status` 'in_progress' | 'completed' | 'generating' | 'failed', required — The status of the image generation call.
        - `result` string, nullable, required — The generated image encoded in base64.
      - object — A tool call to run code.
        - `type` 'code_interpreter_call', required — The type of the code interpreter tool call. Always `code_interpreter_call`.
        - `id` string, required — The unique ID of the code interpreter tool call.
        - `status` 'in_progress' | 'completed' | 'incomplete' | 'interpreting' | 'failed', required — The status of the code interpreter tool call. Valid values are `in_progress`, `completed`, `incomplete`, `interpreting`, and `failed`.
        - `container_id` string, required — The ID of the container used to run the code.
        - `code` string, nullable, required — The code to run, or null if not available.
        - `outputs` union[], nullable, required — The outputs generated by the code interpreter, such as logs or images. Can be null if no outputs are available.
          - union
            - unknown
            - unknown
      - object — A tool call to run a command on the local shell.
        - `type` 'local_shell_call', required — The type of the local shell call. Always `local_shell_call`.
        - `id` string, required — The unique ID of the local shell call.
        - `call_id` string, required — The unique ID of the local shell tool call generated by the model.
        - `action` unknown, required
        - `status` 'in_progress' | 'completed' | 'incomplete', required — The status of the local shell call.
      - object — The output of a local shell tool call.
        - `type` 'local_shell_call_output', required — The type of the local shell tool call output. Always `local_shell_call_output`.
        - `id` string, required — The unique ID of the local shell tool call generated by the model.
        - `output` string, required — A JSON string of the output of the local shell tool call.
        - `status` 'in_progress' | 'completed' | 'incomplete', nullable — The status of the item. One of `in_progress`, `completed`, or `incomplete`.
      - object — A tool call that executes one or more shell commands in a managed environment.
        - `type` 'shell_call', required — The type of the item. Always `shell_call`.
        - `id` string, required — The unique ID of the shell tool call. Populated when this item is returned via API.
        - `call_id` string, required — The unique ID of the shell tool call generated by the model.
        - `action` unknown, required
        - `status` unknown, required
        - `environment` union, required
          - unknown
          - unknown
        - `created_by` string — The ID of the entity that created this tool call.
      - object — The output of a shell tool call that was emitted.
        - `type` 'shell_call_output', required — The type of the shell call output. Always `shell_call_output`.
        - `id` string, required — The unique ID of the shell call output. Populated when this item is returned via API.
        - `call_id` string, required — The unique ID of the shell tool call generated by the model.
        - `status` unknown, required
        - `output` FunctionShellCallOutputContent[], required — An array of shell call output contents
          - unknown
        - `max_output_length` integer, nullable, required — The maximum length of the shell command output. This is generated by the model and should be passed back with the raw output.
        - `created_by` string — The identifier of the actor that created the item.
      - object — A tool call that applies file diffs by creating, deleting, or updating files.
        - `type` 'apply_patch_call', required — The type of the item. Always `apply_patch_call`.
        - `id` string, required — The unique ID of the apply patch tool call. Populated when this item is returned via API.
        - `call_id` string, required — The unique ID of the apply patch tool call generated by the model.
        - `status` unknown, required
        - `operation` union, required — One of the create_file, delete_file, or update_file operations applied via apply_patch.
          - unknown
          - unknown
          - unknown
        - `created_by` string — The ID of the entity that created this tool call.
      - object — The output emitted by an apply patch tool call.
        - `type` 'apply_patch_call_output', required — The type of the item. Always `apply_patch_call_output`.
        - `id` string, required — The unique ID of the apply patch tool call output. Populated when this item is returned via API.
        - `call_id` string, required — The unique ID of the apply patch tool call generated by the model.
        - `status` unknown, required
        - `output` string, nullable — Optional textual output returned by the apply patch tool.
        - `created_by` string — The ID of the entity that created this tool call output.
      - object — An invocation of a tool on an MCP server.
        - `type` 'mcp_call', required — The type of the item. Always `mcp_call`.
        - `id` string, required — The unique ID of the tool call.
        - `server_label` string, required — The label of the MCP server running the tool.
        - `name` string, required — The name of the tool that was run.
        - `arguments` string, required — A JSON string of the arguments passed to the tool.
        - `output` string, nullable — The output from the tool call.
        - `error` string, nullable — The error from the tool call, if any.
        - `status` unknown
        - `approval_request_id` string, nullable — Unique identifier for the MCP tool call approval request. Include this value in a subsequent `mcp_approval_response` input to approve or reject the corresponding tool call.
      - object — A list of tools available on an MCP server.
        - `type` 'mcp_list_tools', required — The type of the item. Always `mcp_list_tools`.
        - `id` string, required — The unique ID of the list.
        - `server_label` string, required — The label of the MCP server.
        - `tools` MCPListToolsTool[], required — The tools available on the server.
          - unknown
        - `error` string, nullable — Error message if the server could not list tools.
      - object — A request for human approval of a tool invocation.
        - `type` 'mcp_approval_request', required — The type of the item. Always `mcp_approval_request`.
        - `id` string, required — The unique ID of the approval request.
        - `server_label` string, required — The label of the MCP server making the request.
        - `name` string, required — The name of the tool to run.
        - `arguments` string, required — A JSON string of arguments for the tool.
      - object — A response to an MCP approval request.
        - `type` 'mcp_approval_response', required — The type of the item. Always `mcp_approval_response`.
        - `id` string, required — The unique ID of the approval response
        - `approval_request_id` string, required — The ID of the approval request being answered.
        - `approve` boolean, required — Whether the request was approved.
        - `reason` string, nullable — Optional reason for the decision.
      - object — A call to a custom tool created by the model.
        - `type` 'custom_tool_call', required — The type of the custom tool call. Always `custom_tool_call`.
        - `id` string — The unique ID of the custom tool call in the OpenAI platform.
        - `call_id` string, required — An identifier used to map this custom tool call to a tool call output.
        - `namespace` string — The namespace of the custom tool being called.
        - `name` string, required — The name of the custom tool being called.
        - `input` string, required — The input for the custom tool call generated by the model.
      - object — Referenced by this API but not published in the vendor's docs pages.
        - `id` string, required — The unique ID of the custom tool call output item.
        - `status` unknown, required
        - `created_by` string — The identifier of the actor that created the item.
  - `instructions` union, required
    - string — A text input to the model, equivalent to a text input with the `developer` role.
    - InputItem[] — A list of one or many input items to the model, containing different content types.
      - union
        - object — 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.
          - `role` 'user' | 'assistant' | 'system' | 'developer', required — The role of the message input. One of `user`, `assistant`, `system`, or `developer`.
          - `content` union, required — Text, image, or audio input to the model, used to generate a response. Can also contain previous assistant responses.
            - string — A text input to the model.
            - unknown
          - `phase` unknown
          - `type` 'message' — The type of the message input. Always `message`.
        - unknown
        - OutputMessage — An output message from the model.
          - `id` string, required — The unique ID of the output message.
          - `type` 'message', required — The type of the output message. Always `message`.
          - `role` 'assistant', required — The role of the output message. Always `assistant`.
          - `content` OutputMessageContent[], required — The content of the output message.
            - unknown
          - `phase` unknown
          - `status` 'in_progress' | 'completed' | 'incomplete', required — The status of the message input. One of `in_progress`, `completed`, or `incomplete`. Populated when input items are returned via API.
        - FileSearchToolCall — The results of a file search tool call. See the [file search guide](https://developers.openai.com/api/docs/guides/tools-file-search) for more information.
          - `id` string, required — The unique ID of the file search tool call.
          - `type` 'file_search_call', required — The type of the file search tool call. Always `file_search_call`.
          - `status` 'in_progress' | 'searching' | 'completed' | 'incomplete' | 'failed', required — The status of the file search tool call. One of `in_progress`, `searching`, `incomplete` or `failed`,
          - `queries` string[], required — The queries used to search for files.
          - `results` object[], nullable — The results of the file search tool call.
            - `file_id` string — The unique ID of the file.
            - `text` string — The text that was retrieved from the file.
            - `filename` string — The name of the file.
            - `attributes` unknown
            - `score` number, float — The relevance score of the file - a value between 0 and 1.
        - ComputerToolCall — A tool call to a computer use tool. See the [computer use guide](https://developers.openai.com/api/docs/guides/tools-computer-use) for more information.
          - `type` 'computer_call', required — The type of the computer call. Always `computer_call`.
          - `id` string, required — The unique ID of the computer call.
          - `call_id` string, required — An identifier used when responding to the tool call with output.
          - `action` unknown
          - `actions` unknown
          - `pending_safety_checks` ComputerCallSafetyCheckParam[], required — The pending safety checks for the computer call.
            - unknown
          - `status` 'in_progress' | 'completed' | 'incomplete', required — The status of the item. One of `in_progress`, `completed`, or `incomplete`. Populated when items are returned via API.
        - unknown
        - WebSearchToolCall — The results of a web search tool call. See the [web search guide](https://developers.openai.com/api/docs/guides/tools-web-search) for more information.
          - `id` string, required — The unique ID of the web search tool call.
          - `type` 'web_search_call', required — The type of the web search tool call. Always `web_search_call`.
          - `status` 'in_progress' | 'searching' | 'completed' | 'failed', required — The status of the web search tool call.
          - `action` union, required — An object describing the specific action taken in this web search call. Includes details on how the model used the web (search, open_page, find_in_page).
            - unknown
            - unknown
            - unknown
        - FunctionToolCall — A tool call to run a function. See the [function calling guide](https://developers.openai.com/api/docs/guides/function-calling) for more information.
          - `id` string — The unique ID of the function tool call.
          - `type` 'function_call', required — The type of the function tool call. Always `function_call`.
          - `call_id` string, required — The unique ID of the function tool call generated by the model.
          - `namespace` string — The namespace of the function to run.
          - `name` string, required — The name of the function to run.
          - `arguments` string, required — A JSON string of the arguments to pass to the function.
          - `status` 'in_progress' | 'completed' | 'incomplete' — The status of the item. One of `in_progress`, `completed`, or `incomplete`. Populated when items are returned via API.
        - unknown
        - unknown
        - unknown
        - ReasoningItem — 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://developers.openai.com/api/docs/guides/conversation-state).
          - `type` 'reasoning', required — The type of the object. Always `reasoning`.
          - `id` string, required — The unique identifier of the reasoning content.
          - `encrypted_content` string, nullable — The encrypted content of the reasoning item - populated when a response is generated with `reasoning.encrypted_content` in the `include` parameter.
          - `summary` SummaryTextContent[], required — Reasoning summary content.
            - unknown
          - `content` ReasoningTextContent[] — Reasoning text content.
            - unknown
          - `status` 'in_progress' | 'completed' | 'incomplete' — The status of the item. One of `in_progress`, `completed`, or `incomplete`. Populated when items are returned via API.
        - unknown
        - ImageGenToolCall — An image generation request made by the model.
          - `type` 'image_generation_call', required — The type of the image generation call. Always `image_generation_call`.
          - `id` string, required — The unique ID of the image generation call.
          - `status` 'in_progress' | 'completed' | 'generating' | 'failed', required — The status of the image generation call.
          - `result` string, nullable, required — The generated image encoded in base64.
        - CodeInterpreterToolCall — A tool call to run code.
          - `type` 'code_interpreter_call', required — The type of the code interpreter tool call. Always `code_interpreter_call`.
          - `id` string, required — The unique ID of the code interpreter tool call.
          - `status` 'in_progress' | 'completed' | 'incomplete' | 'interpreting' | 'failed', required — The status of the code interpreter tool call. Valid values are `in_progress`, `completed`, `incomplete`, `interpreting`, and `failed`.
          - `container_id` string, required — The ID of the container used to run the code.
          - `code` string, nullable, required — The code to run, or null if not available.
          - `outputs` union[], nullable, required — The outputs generated by the code interpreter, such as logs or images. Can be null if no outputs are available.
            - union
              - …
        - LocalShellToolCall — A tool call to run a command on the local shell.
          - `type` 'local_shell_call', required — The type of the local shell call. Always `local_shell_call`.
          - `id` string, required — The unique ID of the local shell call.
          - `call_id` string, required — The unique ID of the local shell tool call generated by the model.
          - `action` unknown, required
          - `status` 'in_progress' | 'completed' | 'incomplete', required — The status of the local shell call.
        - LocalShellToolCallOutput — The output of a local shell tool call.
          - `type` 'local_shell_call_output', required — The type of the local shell tool call output. Always `local_shell_call_output`.
          - `id` string, required — The unique ID of the local shell tool call generated by the model.
          - `output` string, required — A JSON string of the output of the local shell tool call.
          - `status` 'in_progress' | 'completed' | 'incomplete', nullable — The status of the item. One of `in_progress`, `completed`, or `incomplete`.
        - unknown
        - unknown
        - unknown
        - unknown
        - MCPListTools — A list of tools available on an MCP server.
          - `type` 'mcp_list_tools', required — The type of the item. Always `mcp_list_tools`.
          - `id` string, required — The unique ID of the list.
          - `server_label` string, required — The label of the MCP server.
          - `tools` MCPListToolsTool[], required — The tools available on the server.
            - unknown
          - `error` string, nullable — Error message if the server could not list tools.
        - MCPApprovalRequest — A request for human approval of a tool invocation.
          - `type` 'mcp_approval_request', required — The type of the item. Always `mcp_approval_request`.
          - `id` string, required — The unique ID of the approval request.
          - `server_label` string, required — The label of the MCP server making the request.
          - `name` string, required — The name of the tool to run.
          - `arguments` string, required — A JSON string of arguments for the tool.
        - unknown
        - MCPToolCall — An invocation of a tool on an MCP server.
          - `type` 'mcp_call', required — The type of the item. Always `mcp_call`.
          - `id` string, required — The unique ID of the tool call.
          - `server_label` string, required — The label of the MCP server running the tool.
          - `name` string, required — The name of the tool that was run.
          - `arguments` string, required — A JSON string of the arguments passed to the tool.
          - `output` string, nullable — The output from the tool call.
          - `error` string, nullable — The error from the tool call, if any.
          - `status` unknown
          - `approval_request_id` string, nullable — Unique identifier for the MCP tool call approval request. Include this value in a subsequent `mcp_approval_response` input to approve or reject the corresponding tool call.
        - unknown
        - CustomToolCall — A call to a custom tool created by the model.
          - `type` 'custom_tool_call', required — The type of the custom tool call. Always `custom_tool_call`.
          - `id` string — The unique ID of the custom tool call in the OpenAI platform.
          - `call_id` string, required — An identifier used to map this custom tool call to a tool call output.
          - `namespace` string — The namespace of the custom tool being called.
          - `name` string, required — The name of the custom tool being called.
          - `input` string, required — The input for the custom tool call generated by the model.
        - object — Compacts the current context. Must be the final input item.
          - `type` 'compaction_trigger', required — The type of the item. Always `compaction_trigger`.
        - object — An internal identifier for an item to reference.
          - `type` 'item_reference', nullable — The type of item to reference. Always `item_reference`.
          - `id` string, required — The ID of the item to reference.
  - `output_text` string, nullable — SDK-only convenience property that contains the aggregated text output from all `output_text` items in the `output` array, if any are present. Supported in the Python and JavaScript SDKs.
  - `usage` ResponseUsage — Represents token usage details including input tokens, output tokens, a breakdown of output tokens, and the total tokens used.
    - `input_tokens` integer, required — The number of input tokens.
    - `input_tokens_details` object, required — A detailed breakdown of the input tokens.
      - `cached_tokens` integer, required — The number of tokens that were retrieved from the cache. [More on prompt caching](https://developers.openai.com/api/docs/guides/prompt-caching).
    - `output_tokens` integer, required — The number of output tokens.
    - `output_tokens_details` object, required — A detailed breakdown of the output tokens.
      - `reasoning_tokens` integer, required — The number of reasoning tokens.
    - `total_tokens` integer, required — The total number of tokens used.
  - `parallel_tool_calls` boolean, required — Whether to allow the model to run tool calls in parallel.
  - `conversation` Conversation2 — The conversation that this response belonged to. Input items and output items from this response were automatically added to this conversation.
    - `id` string, required — The unique ID of the conversation that this response was associated with.
  - `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](https://developers.openai.com/api/docs/guides/reasoning).

## Other responses

- `400` — Invalid request
- `401` — Authentication failed
- `403` — Permission denied
- `404` — Not found
- `429` — Rate limited
- `5XX` — Server / upstream error

---

[API](https://skmtc.net/aihubmix/apis/aihubmix-gateway-api.md) · [All operations](https://skmtc.net/aihubmix/apis/aihubmix-gateway-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/aihubmix/aihubmix-gateway-api/revisions/e7e1a5d99ac2/schema)
