---
title: "Creates a model response. Provide [text](/docs/guides/text) or
[image](/docs/guides/images) inputs to generate [text](/docs/guides/text)
or [JSON](/docs/guides/structured-outputs) outputs. Have the model call
your own [custom code](/docs/guides/function-calling) or use built-in
[tools](/docs/guides/tools) like [web search](/docs/guides/tools-web-search)
or [file search](/docs/guides/tools-file-search) to use your own data
as input for the model's response."
method: POST
path: "/responses"
tags: ["Responses"]
---

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

`POST /responses`

## 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.
  - `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 — A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. [Learn more](/docs/guides/safety-best-practices#end-user-ids).
  - `service_tier` 'auto' | 'default' | 'flex', nullable — Specifies the latency tier to use for processing the request. This parameter is relevant for customers subscribed to the scale tier service: - If set to 'auto', and the Project is Scale tier enabled, the system will utilize scale tier credits until they are exhausted. - If set to 'auto', and the Project is not Scale tier enabled, the request will be processed using the default service tier with a lower uptime SLA and no latency guarentee. - If set to 'default', the request will be processed using the default service tier with a lower uptime SLA and no latency guarentee. - If set to 'flex', the request will be processed with the Flex Processing service tier. [Learn more](/docs/guides/flex-processing). - When not set, the default behavior is 'auto'. When this parameter is set, the response body will include the `service_tier` utilized.
  - `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](/docs/guides/conversation-state).
  - `model` union, required
    - union
      - string
      - '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-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' | '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' | 'computer-use-preview' | 'computer-use-preview-2025-03-11'
  - `reasoning` Reasoning — **o-series models only** Configuration options for [reasoning models](https://platform.openai.com/docs/guides/reasoning).
    - `effort` 'low' | 'medium' | 'high', nullable — **o-series models only** Constrains effort on reasoning for [reasoning models](https://platform.openai.com/docs/guides/reasoning). Currently supported values are `low`, `medium`, and `high`. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response.
    - `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`.
    - `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`.
  - `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](/docs/guides/reasoning).
  - `instructions` string, nullable — Inserts a system (or developer) message as the first item in 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.
  - `text` object — Configuration options for a text response from the model. Can be plain text or structured JSON data. Learn more: - [Text inputs and outputs](/docs/guides/text) - [Structured Outputs](/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](/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.
      - ResponseFormatText — Default response format. Used to generate text responses.
        - `type` 'text', required — The type of response format being defined. Always `text`.
      - TextResponseFormatJsonSchema — JSON Schema response format. Used to generate structured JSON responses. Learn more about [Structured Outputs](/docs/guides/structured-outputs).
        - `type` 'json_schema', required — The type of response format being defined. Always `json_schema`.
        - `description` string — A description of what the response format is for, used by the model to determine how to respond in the format.
        - `name` string, required — The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64.
        - `schema` ResponseFormatJsonSchemaSchema, required — The schema for the response format, described as a JSON Schema object. Learn how to build JSON schemas [here](https://json-schema.org/).
        - `strict` boolean, nullable — Whether to enable strict schema adherence when generating the output. If set to true, the model will always follow the exact schema defined in the `schema` field. Only a subset of JSON Schema is supported when `strict` is `true`. To learn more, read the [Structured Outputs guide](/docs/guides/structured-outputs).
      - 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 — The type of response format being defined. Always `json_object`.
  - `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. The two categories of tools you can provide the model are: - **Built-in tools**: Tools that are provided by OpenAI that extend the model's capabilities, like [web search](/docs/guides/tools-web-search) or [file search](/docs/guides/tools-file-search). Learn more about [built-in tools](/docs/guides/tools). - **Function calls (custom tools)**: Functions that are defined by you, enabling the model to call your own code. Learn more about [function calling](/docs/guides/function-calling).
    - union
      - 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 — The type of the file search tool. Always `file_search`.
        - `vector_store_ids` string[], required — The IDs of the vector stores to search.
        - `max_num_results` integer — The maximum number of results to return. This number should be between 1 and 50 inclusive.
        - `ranking_options` RankingOptions
          - `ranker` 'auto' | 'default-2024-11-15' — The ranker to use for the file search.
          - `score_threshold` number — The score threshold for the file search, a number between 0 and 1. Numbers closer to 1 will attempt to return only the most relevant results, but may return fewer results.
        - `filters` union
          - ComparisonFilter — A filter used to compare a specified attribute key to a given value using a defined comparison operation.
            - `type` 'eq' | 'ne' | 'gt' | 'gte' | 'lt' | 'lte', required — Specifies the comparison operator: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`. - `eq`: equals - `ne`: not equal - `gt`: greater than - `gte`: greater than or equal - `lt`: less than - `lte`: less than or equal
            - `key` string, required — The key to compare against the value.
            - `value` union, required — The value to compare against the attribute key; supports string, number, or boolean types.
              - …
          - CompoundFilter — Combine multiple filters using `and` or `or`.
            - `type` 'and' | 'or', required — Type of operation: `and` or `or`.
            - `filters` union[], required — Array of filters to combine. Items can be `ComparisonFilter` or `CompoundFilter`.
              - …
      - 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).
        - `type` 'function', required — The type of the function tool. Always `function`.
        - `name` string, required — The name of the function to call.
        - `description` string — A description of the function. Used by the model to determine whether or not to call the function.
        - `parameters` object, required — A JSON schema object describing the parameters of the function.
        - `strict` boolean, required — Whether to enforce strict parameter validation. Default `true`.
      - 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 — The type of the web search tool. One of `web_search_preview` or `web_search_preview_2025_03_11`.
        - `user_location` ApproximateLocation
          - `type` 'approximate', required — The type of location approximation. Always `approximate`.
          - `country` string — The two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of the user, e.g. `US`.
          - `region` string — Free text input for the region of the user, e.g. `California`.
          - `city` string — Free text input for the city of the user, e.g. `San Francisco`.
          - `timezone` string — The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of the user, e.g. `America/Los_Angeles`.
        - `search_context_size` 'low' | 'medium' | 'high' — High level guidance for the amount of context window space to use for the search. One of `low`, `medium`, or `high`. `medium` is the default.
      - ComputerUsePreviewTool — A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use).
        - `type` 'computer_use_preview', required — The type of the computer use tool. Always `computer_use_preview`.
        - `environment` 'windows' | 'mac' | 'linux' | 'ubuntu' | 'browser', required — The type of computer environment to control.
        - `display_width` integer, required — The width of the computer display.
        - `display_height` integer, required — The height of the computer display.
  - `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.
    - ToolChoiceTypes — Indicates that the model should use a built-in tool to generate a response. [Learn more about built-in tools](/docs/guides/tools).
      - `type` 'file_search' | 'web_search_preview' | 'computer_use_preview' | 'web_search_preview_2025_03_11', required — The type of hosted tool the model should to use. Learn more about [built-in tools](/docs/guides/tools). Allowed values are: - `file_search` - `web_search_preview` - `computer_use_preview`
    - ToolChoiceFunction — Use this option to force the model to call a specific function.
      - `type` 'function', required — For function calling, the type is always `function`.
      - `name` string, required — The name of the function to call.
  - `truncation` 'auto' | 'disabled', nullable — The truncation strategy to use for the model response. - `auto`: If the context of this response and previous ones exceeds the model's context window size, the model will truncate the response to fit the context window by dropping input items in the middle of the conversation. - `disabled` (default): If a model response will exceed the context window size for a model, the request will fail with a 400 error.
  - `input` union, required — Text, image, or file inputs to the model, used to generate a response. Learn more: - [Text inputs and outputs](/docs/guides/text) - [Image inputs](/docs/guides/images) - [File inputs](/docs/guides/pdf-files) - [Conversation state](/docs/guides/conversation-state) - [Function calling](/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
        - 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.
          - `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.
            - InputContent[] — A list of one or many input items to the model, containing different content types.
              - …
          - `type` 'message' — The type of the message input. Always `message`.
        - union — Content item used to generate a response.
          - 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.
            - `type` 'message' — The type of the message input. Always set to `message`.
            - `role` 'user' | 'system' | 'developer', required — The role of the message input. One of `user`, `system`, or `developer`.
            - `status` 'in_progress' | 'completed' | 'incomplete' — The status of item. One of `in_progress`, `completed`, or `incomplete`. Populated when items are returned via API.
            - `content` InputContent[], required — A list of one or many input items to the model, containing different content types.
              - …
          - 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` OutputContent[], required — The content of the output message.
              - …
            - `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](/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.
              - …
          - object — A tool call to a computer use tool. See the [computer use guide](/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` union, required
              - …
            - `pending_safety_checks` ComputerToolCallSafetyCheck[], required — The pending safety checks for the computer call.
              - …
            - `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 — The output of a computer tool call.
            - `id` string — The ID of the computer tool call output.
            - `call_id` string, required — The ID of the computer tool call that produced the output.
            - `type` 'computer_call_output', required — The type of the computer tool call output. Always `computer_call_output`.
            - `output` ComputerScreenshotImage, required — A computer screenshot image used with the computer use tool.
              - …
            - `acknowledged_safety_checks` ComputerCallSafetyCheckParam[] — The safety checks reported by the API that have been acknowledged by the developer.
              - …
            - `status` 'in_progress' | 'completed' | 'incomplete' — 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 web search tool call. See the [web search guide](/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.
          - object — A tool call to run a function. See the [function calling guide](/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.
            - `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 — The output of a function tool call.
            - `id` string — The unique ID of the function tool call output. Populated when this item is returned via API.
            - `call_id` string, required — The unique ID of the function tool call generated by the model.
            - `type` 'function_call_output', required — The type of the function tool call output. Always `function_call_output`.
            - `output` string, required — A JSON string of the output of the function tool call.
            - `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 — A description of the chain of thought used by a reasoning model while generating a response.
            - `type` 'reasoning', required — The type of the object. Always `reasoning`.
            - `id` string, required — The unique identifier of the reasoning content.
            - `summary` object[], required — Reasoning text contents.
              - …
            - `status` 'in_progress' | 'completed' | 'incomplete' — The status of the item. One of `in_progress`, `completed`, or `incomplete`. Populated when items are returned via API.
        - ItemReferenceParam — An internal identifier for an item to reference.
          - `type` 'item_reference' — The type of item to reference. Always `item_reference`.
          - `id` string, required — The ID of the item to reference.
  - `include` Includable[], nullable — Specify additional output data to include in the model response. Currently supported values are: - `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. - `computer_call_output.output.image_url`: Include image urls from the computer call output.
  - `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.
  - `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](/docs/api-reference/responses-streaming) for more information.

## Response `200`

OK

- Response
  - `metadata` Metadata, nullable, required — 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.
  - `temperature` number, nullable, required — 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, required — 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 — A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. [Learn more](/docs/guides/safety-best-practices#end-user-ids).
  - `service_tier` 'auto' | 'default' | 'flex', nullable — Specifies the latency tier to use for processing the request. This parameter is relevant for customers subscribed to the scale tier service: - If set to 'auto', and the Project is Scale tier enabled, the system will utilize scale tier credits until they are exhausted. - If set to 'auto', and the Project is not Scale tier enabled, the request will be processed using the default service tier with a lower uptime SLA and no latency guarentee. - If set to 'default', the request will be processed using the default service tier with a lower uptime SLA and no latency guarentee. - If set to 'flex', the request will be processed with the Flex Processing service tier. [Learn more](/docs/guides/flex-processing). - When not set, the default behavior is 'auto'. When this parameter is set, the response body will include the `service_tier` utilized.
  - `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](/docs/guides/conversation-state).
  - `model` union, required
    - union
      - string
      - '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-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' | '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' | 'computer-use-preview' | 'computer-use-preview-2025-03-11'
  - `reasoning` Reasoning — **o-series models only** Configuration options for [reasoning models](https://platform.openai.com/docs/guides/reasoning).
    - `effort` 'low' | 'medium' | 'high', nullable — **o-series models only** Constrains effort on reasoning for [reasoning models](https://platform.openai.com/docs/guides/reasoning). Currently supported values are `low`, `medium`, and `high`. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response.
    - `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`.
    - `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`.
  - `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](/docs/guides/reasoning).
  - `instructions` string, nullable, required — Inserts a system (or developer) message as the first item in 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.
  - `text` object — Configuration options for a text response from the model. Can be plain text or structured JSON data. Learn more: - [Text inputs and outputs](/docs/guides/text) - [Structured Outputs](/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](/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.
      - ResponseFormatText — Default response format. Used to generate text responses.
        - `type` 'text', required — The type of response format being defined. Always `text`.
      - TextResponseFormatJsonSchema — JSON Schema response format. Used to generate structured JSON responses. Learn more about [Structured Outputs](/docs/guides/structured-outputs).
        - `type` 'json_schema', required — The type of response format being defined. Always `json_schema`.
        - `description` string — A description of what the response format is for, used by the model to determine how to respond in the format.
        - `name` string, required — The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64.
        - `schema` ResponseFormatJsonSchemaSchema, required — The schema for the response format, described as a JSON Schema object. Learn how to build JSON schemas [here](https://json-schema.org/).
        - `strict` boolean, nullable — Whether to enable strict schema adherence when generating the output. If set to true, the model will always follow the exact schema defined in the `schema` field. Only a subset of JSON Schema is supported when `strict` is `true`. To learn more, read the [Structured Outputs guide](/docs/guides/structured-outputs).
      - 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 — The type of response format being defined. Always `json_object`.
  - `tools` Tool[], required — 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. The two categories of tools you can provide the model are: - **Built-in tools**: Tools that are provided by OpenAI that extend the model's capabilities, like [web search](/docs/guides/tools-web-search) or [file search](/docs/guides/tools-file-search). Learn more about [built-in tools](/docs/guides/tools). - **Function calls (custom tools)**: Functions that are defined by you, enabling the model to call your own code. Learn more about [function calling](/docs/guides/function-calling).
    - union
      - 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 — The type of the file search tool. Always `file_search`.
        - `vector_store_ids` string[], required — The IDs of the vector stores to search.
        - `max_num_results` integer — The maximum number of results to return. This number should be between 1 and 50 inclusive.
        - `ranking_options` RankingOptions
          - `ranker` 'auto' | 'default-2024-11-15' — The ranker to use for the file search.
          - `score_threshold` number — The score threshold for the file search, a number between 0 and 1. Numbers closer to 1 will attempt to return only the most relevant results, but may return fewer results.
        - `filters` union
          - ComparisonFilter — A filter used to compare a specified attribute key to a given value using a defined comparison operation.
            - `type` 'eq' | 'ne' | 'gt' | 'gte' | 'lt' | 'lte', required — Specifies the comparison operator: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`. - `eq`: equals - `ne`: not equal - `gt`: greater than - `gte`: greater than or equal - `lt`: less than - `lte`: less than or equal
            - `key` string, required — The key to compare against the value.
            - `value` union, required — The value to compare against the attribute key; supports string, number, or boolean types.
              - …
          - CompoundFilter — Combine multiple filters using `and` or `or`.
            - `type` 'and' | 'or', required — Type of operation: `and` or `or`.
            - `filters` union[], required — Array of filters to combine. Items can be `ComparisonFilter` or `CompoundFilter`.
              - …
      - 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).
        - `type` 'function', required — The type of the function tool. Always `function`.
        - `name` string, required — The name of the function to call.
        - `description` string — A description of the function. Used by the model to determine whether or not to call the function.
        - `parameters` object, required — A JSON schema object describing the parameters of the function.
        - `strict` boolean, required — Whether to enforce strict parameter validation. Default `true`.
      - 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 — The type of the web search tool. One of `web_search_preview` or `web_search_preview_2025_03_11`.
        - `user_location` ApproximateLocation
          - `type` 'approximate', required — The type of location approximation. Always `approximate`.
          - `country` string — The two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of the user, e.g. `US`.
          - `region` string — Free text input for the region of the user, e.g. `California`.
          - `city` string — Free text input for the city of the user, e.g. `San Francisco`.
          - `timezone` string — The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of the user, e.g. `America/Los_Angeles`.
        - `search_context_size` 'low' | 'medium' | 'high' — High level guidance for the amount of context window space to use for the search. One of `low`, `medium`, or `high`. `medium` is the default.
      - ComputerUsePreviewTool — A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use).
        - `type` 'computer_use_preview', required — The type of the computer use tool. Always `computer_use_preview`.
        - `environment` 'windows' | 'mac' | 'linux' | 'ubuntu' | 'browser', required — The type of computer environment to control.
        - `display_width` integer, required — The width of the computer display.
        - `display_height` integer, required — The height of the computer display.
  - `tool_choice` union, required — 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.
    - ToolChoiceTypes — Indicates that the model should use a built-in tool to generate a response. [Learn more about built-in tools](/docs/guides/tools).
      - `type` 'file_search' | 'web_search_preview' | 'computer_use_preview' | 'web_search_preview_2025_03_11', required — The type of hosted tool the model should to use. Learn more about [built-in tools](/docs/guides/tools). Allowed values are: - `file_search` - `web_search_preview` - `computer_use_preview`
    - ToolChoiceFunction — Use this option to force the model to call a specific function.
      - `type` 'function', required — For function calling, the type is always `function`.
      - `name` string, required — The name of the function to call.
  - `truncation` 'auto' | 'disabled', nullable — The truncation strategy to use for the model response. - `auto`: If the context of this response and previous ones exceeds the model's context window size, the model will truncate the response to fit the context window by dropping input items in the middle of the conversation. - `disabled` (default): If a model response 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' | 'incomplete' — The status of the response generation. One of `completed`, `failed`, `in_progress`, or `incomplete`.
  - `created_at` number, required — Unix timestamp (in seconds) of when this Response was created.
  - `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
      - 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` OutputContent[], required — The content of the output message.
          - union
            - OutputTextContent — A text output from the model.
              - …
            - RefusalContent — A refusal from the model.
              - …
        - `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](/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` VectorStoreFileAttributes, 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, booleans, or numbers.
          - `score` number, float — The relevance score of the file - a value between 0 and 1.
      - FunctionToolCall — A tool call to run a function. See the [function calling guide](/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.
        - `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.
      - WebSearchToolCall — The results of a web search tool call. See the [web search guide](/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.
      - ComputerToolCall — A tool call to a computer use tool. See the [computer use guide](/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` union, required
          - Click — A click action.
            - `type` 'click', required — Specifies the event type. For a click action, this property is always set to `click`.
            - `button` 'left' | 'right' | 'wheel' | 'back' | 'forward', required — Indicates which mouse button was pressed during the click. One of `left`, `right`, `wheel`, `back`, or `forward`.
            - `x` integer, required — The x-coordinate where the click occurred.
            - `y` integer, required — The y-coordinate where the click occurred.
          - DoubleClick — A double click action.
            - `type` 'double_click', required — Specifies the event type. For a double click action, this property is always set to `double_click`.
            - `x` integer, required — The x-coordinate where the double click occurred.
            - `y` integer, required — The y-coordinate where the double click occurred.
          - Drag — A drag action.
            - `type` 'drag', required — Specifies the event type. For a drag action, this property is always set to `drag`.
            - `path` Coordinate[], required — An array of coordinates representing the path of the drag action. Coordinates will appear as an array of objects, eg ``` [ { x: 100, y: 200 }, { x: 200, y: 300 } ] ```
              - …
          - KeyPress — A collection of keypresses the model would like to perform.
            - `type` 'keypress', required — Specifies the event type. For a keypress action, this property is always set to `keypress`.
            - `keys` string[], required — The combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key.
          - Move — A mouse move action.
            - `type` 'move', required — Specifies the event type. For a move action, this property is always set to `move`.
            - `x` integer, required — The x-coordinate to move to.
            - `y` integer, required — The y-coordinate to move to.
          - Screenshot — A screenshot action.
            - `type` 'screenshot', required — Specifies the event type. For a screenshot action, this property is always set to `screenshot`.
          - Scroll — A scroll action.
            - `type` 'scroll', required — Specifies the event type. For a scroll action, this property is always set to `scroll`.
            - `x` integer, required — The x-coordinate where the scroll occurred.
            - `y` integer, required — The y-coordinate where the scroll occurred.
            - `scroll_x` integer, required — The horizontal scroll distance.
            - `scroll_y` integer, required — The vertical scroll distance.
          - Type — An action to type in text.
            - `type` 'type', required — Specifies the event type. For a type action, this property is always set to `type`.
            - `text` string, required — The text to type.
          - Wait — A wait action.
            - `type` 'wait', required — Specifies the event type. For a wait action, this property is always set to `wait`.
        - `pending_safety_checks` ComputerToolCallSafetyCheck[], required — The pending safety checks for the computer call.
          - `id` string, required — The ID of the pending safety check.
          - `code` string, required — The type of the pending safety check.
          - `message` string, required — Details about the pending safety check.
        - `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.
      - ReasoningItem — A description of the chain of thought used by a reasoning model while generating a response.
        - `type` 'reasoning', required — The type of the object. Always `reasoning`.
        - `id` string, required — The unique identifier of the reasoning content.
        - `summary` object[], required — Reasoning text contents.
          - `type` 'summary_text', required — The type of the object. Always `summary_text`.
          - `text` string, required — A short summary of the reasoning used by the model when generating the response.
        - `status` 'in_progress' | 'completed' | 'incomplete' — The status of the item. One of `in_progress`, `completed`, or `incomplete`. Populated when items are returned via API.
  - `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](/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.

## Changes

- **2025-04-29** `6a6c681b1820` — 46 breaking, 66 warning, 135 info
  - removed `subschema #2` from the `allOf[#/components/schemas/ResponseProperties]/model` request property `anyOf` list
  - the request property `allOf[#/components/schemas/ResponseProperties]/tools/items/oneOf[subschema #2: Function]/description` became not nullable
  - the request property `allOf[#/components/schemas/ResponseProperties]/text/format/oneOf[subschema #2: JSON schema]/name` became required
  - removed `#/components/schemas/ComparisonFilter, #/components/schemas/CompoundFilter` from the `allOf[#/components/schemas/ResponseProperties]/tools/items/oneOf[subschema #1: File search]/filters` request property `oneOf` list
  - …243 more
- …earlier changes not shown

[Full history](https://skmtc.dev/openai/apis/openapi/changes/responses/post.md)

---

[API](https://skmtc.dev/openai/apis/openapi.md) · [All operations](https://skmtc.dev/openai/apis/openapi/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/openai/openapi/revisions/6a6c681b1820/schema)
