v1

latestOpenAPI 3.1.02026-07-2675394318.9 KB
inference

Create a response

Creates a model response for a given input

post/v1/responses

Query parameters

ai_project_idstring nullable

current project ID

current project ID

Request body

backgroundboolean nullable

Whether to run the model response in the background.

includestring[] nullable

Specify additional output data to include in the model response.

instructionsstring nullable

A system (or developer) message inserted into the model's context.

max_output_tokensinteger nullable

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

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

metadataobject nullable

Set of 16 key-value pairs that can be attached to an object.

modelstring required

The model used for the chat completion.

parallel_tool_callsboolean nullable

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

previous_response_idstring nullable

The unique ID of the previous response to the model.

service_tier'auto' | 'default' | 'over-limit' | 'flex' | 'no-limit'

Represents the service tier for requests.

Attributes: Auto: Automatically choose the best available tier for the request (Default or OverLimit). Analyze response to determine which tier was used. Default: Return 429 errors on hitting the rate limit, do not exceed to the OverLimit tier. OverLimit: Indicate that the request was over the user limit. This tier cannot be set by user in the request, but us used in a response for tier=Auto. Flex: Do not consume rate-limit credits, but run with lower priority. May still result in 429 errors in case of if there is no resources to process.

storeboolean nullable

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

streamboolean nullable

If set to true, the model response data will be streamed to the client as it is generated using server-sent events.

temperaturenumber 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_logprobsinteger nullable

A non-negative integer specifying the number of most likely tokens to return at each token position, each with an associated log probability. logprobs must be set to true if this parameter is used.

top_pnumber nullable

An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered.

We generally recommend altering this or temperature but not both.

truncation'auto' | 'disabled'

The truncation strategy to use for the model response.

userstring nullable

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

prompt_cache_keystring nullable

Used by OpenAI to cache responses for similar requests to optimize your cache hit rates. Replaces the user field.

Response

Successful Response

idstring required
created_atinteger required
instructionsstring nullable
metadataobject nullable
modelstring required
object'response'
parallel_tool_callsboolean required
temperaturenumber required
top_pnumber required
backgroundboolean required
max_output_tokensinteger required
max_tool_callsinteger nullable
previous_response_idstring nullable
service_tier'auto' | 'default' | 'over-limit' | 'flex' | 'no-limit' required

Represents the service tier for requests.

Attributes: Auto: Automatically choose the best available tier for the request (Default or OverLimit). Analyze response to determine which tier was used. Default: Return 429 errors on hitting the rate limit, do not exceed to the OverLimit tier. OverLimit: Indicate that the request was over the user limit. This tier cannot be set by user in the request, but us used in a response for tier=Auto. Flex: Do not consume rate-limit credits, but run with lower priority. May still result in 429 errors in case of if there is no resources to process.

status'completed' | 'failed' | 'in_progress' | 'cancelled' | 'queued' | 'incomplete' required
top_logprobsinteger nullable
truncation'auto' | 'disabled' required
userstring nullable