POST /responses

Servers

Request headers

Name Type Required Description
Content-Type String Yes The media type of the request body.

Default value: "application/json"

Request body fields

Name Type Required Description
stream Boolean No

If set to true, the model response data will be streamed to the client as it is generated using server-sent events. See the Streaming section below for more information.

Default value: false

input Object Yes

Text, image, or file inputs to the model, used to generate a response.

Learn more:

  • Text inputs and outputs
  • Image inputs
  • File inputs
  • Conversation state
  • Function calling
temperature Number No

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.

Default value: 1

previous_response_id String No

The unique ID of the previous response to the model. Use this to create multi-turn conversations. Learn more about conversation state.

tools[] Array No

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 or file search. Learn more about built-in tools.
  • Function calls (custom tools): Functions that are defined by you, enabling the model to call your own code. Learn more about function calling.
metadata Object No

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.

parallel_tool_calls Boolean No

Whether to allow the model to run tool calls in parallel.

Default value: true

reasoning Object No

o-series models only

Configuration options for reasoning models.

reasoning.generate_summary String No

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.

Possible values:

  • "concise"
  • "auto"
  • "detailed"
reasoning.effort String No

o-series models only

Constrains effort on reasoning for reasoning models. 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.

Possible values:

  • "medium"
  • "low"
  • "high"

Default value: "medium"

reasoning.summary String No

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.

Possible values:

  • "concise"
  • "auto"
  • "detailed"
truncation String No

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.

Possible values:

  • "auto"
  • "disabled"

Default value: "disabled"

tool_choice Object No

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.

top_p Number No

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.

Default value: 1

model Object Yes
max_output_tokens Integer No

An upper bound for the number of tokens that can be generated for a response, including visible output tokens and reasoning tokens.

text Object No

Configuration options for a text response from the model. Can be plain text or structured JSON data. Learn more:

  • Text inputs and outputs
  • Structured Outputs
text.format No

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.

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.

include[] Array No

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.
user String No

A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. Learn more.

service_tier String No

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.
  • When not set, the default behavior is 'auto'.

When this parameter is set, the response body will include the service_tier utilized.

Possible values:

  • "auto"
  • "flex"
  • "default"

Default value: "auto"

store Boolean No

Whether to store the generated model response for later retrieval via API.

Default value: true

instructions String No

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.

How to start integrating

  1. Add HTTP Task to your workflow definition.
  2. Search for the API you want to integrate with and click on the name.
    • This loads the API reference documentation and prepares the Http request settings.
  3. Click Test request to test run your request to the API and see the API's response.