Responses

Post Responses Endpoint

Handle POST /v1/responses - with history reconstruction and storage.

If previous_response_id is provided, reconstructs the conversation history and includes it in the request to the backend. Stores the request-response pair for future history reconstruction.

Instructions resolution priority:

  1. prompt.id (render template with variables)
  2. explicit instructions field
  3. inherited from previous_response_id
  4. default_system_prompt from config

Supports both streaming (stream=true) and non-streaming modes. Supports background mode (background=true) returning 202.

post/v1/responses

Request

Request body

modelstring required

The model to use for this request.

instructionsstring nullable

Additional instructions to guide the model for this request.

previous_response_idstring nullable

The ID of the response to use as the prior turn.

temperaturenumber nullable

Sampling temperature between 0 and 2.

top_pnumber nullable

Nucleus sampling parameter, between 0 and 1.

max_output_tokensinteger nullable

The maximum number of tokens the model may generate.

streamboolean

Whether to stream response events as server-sent events.

stopstring[] nullable
modify_requestboolean
parallel_tool_callsboolean

Whether the model may call multiple tools in parallel.

includestring[] nullable
storeboolean

Whether to store the response so it can be retrieved later.

metadataobject nullable

Key-value pairs for storing additional information about the object.

truncationstring nullable

Controls how the service truncates input exceeding the context window.

textobject nullable

Configuration options for text output.

presence_penaltynumber nullable

Penalizes new tokens based on whether they appear in the text so far.

frequency_penaltynumber nullable

Penalizes new tokens based on their frequency in the text so far.

top_logprobsinteger nullable

Number of most likely tokens to return at each position.

max_tool_callsinteger nullable

The maximum number of tool calls the model may make.

service_tierstring nullable

The service tier to use for this request.

backgroundboolean

Whether to run the request in the background and return immediately.

reasoningobject nullable

Configuration options for reasoning behavior.

Response

When stream=false (default), returns a JSON response. When stream=true, returns Server-Sent Events.

idstring required

The unique ID of the response.

objectstring

The object type.

created_atinteger required

The Unix timestamp (in seconds) for when the response was created.

completed_atinteger nullable

The Unix timestamp (in seconds) for when the response was completed.

statusstring

The status of the response.

incomplete_detailsobject nullable

Details about why the response was incomplete, if applicable.

modelstring required

The model that generated this response.

previous_response_idstring nullable

The ID of the previous response in the conversation chain, if any.

instructionsstring nullable

Additional instructions used to guide the model for this response.

errorobject nullable

The error that occurred, if the response failed.

truncationstring nullable

How the input was truncated when it exceeded the model context window.

parallel_tool_callsboolean

Whether the model was allowed to call multiple tools in parallel.

textobject nullable

Configuration options for text output.

top_pnumber nullable

The nucleus sampling parameter used for this response.

temperaturenumber nullable

The sampling temperature used for this response.

presence_penaltynumber nullable

Penalizes new tokens based on whether they appear in the text so far.

frequency_penaltynumber nullable

Penalizes new tokens based on their frequency in the text so far.

top_logprobsinteger nullable

Number of most likely tokens returned at each position.

reasoningobject nullable

Reasoning configuration and outputs produced for this response.

max_output_tokensinteger nullable

The maximum number of tokens the model was allowed to generate.

max_tool_callsinteger nullable

The maximum number of tool calls the model was allowed to make.

storeboolean

Whether this response was stored for later retrieval.

backgroundboolean

Whether this request was run in the background.

service_tierstring nullable

The service tier used for this response.

metadataobject nullable

Key-value pairs for storing additional information about the response.

prompt_cache_keystring nullable

A key used to read from or write to the prompt cache.

safety_identifierstring nullable

A stable identifier used for safety monitoring and abuse detection.

trace_idstring nullable

32-character lowercase hex OpenTelemetry trace ID for the generation request. Server-populated from the active span when the generated response is completed. Null on incomplete, failed, cancelled, in-progress, synthetic, historical, and tracing-disabled responses.

Changes

No recorded changes to this operation across all 1 revision of this API.