Inference API

Responses

The Responses API is the primary interface for text generation, reasoning, and tool use. See the Text Generation guide for usage.


Create new response

/v1/responses

Generates a response based on text or image prompts. The response ID can be used to retrieve the response later or to continue the conversation without repeating prior context. New responses will be stored for 30 days and then permanently deleted.

Request Body

input

string | array

required

Content of the input passed to a /v1/response request.

Response Body

background

boolean

default: false

OpenResponses compatibility fields. Not used at the moment. Just for OpenResponses compatibility. Whether to process the response asynchronously in the background.

created_at

integer

The Unix timestamp (in seconds) for the response creation time.

error

An error object returned when the model fails to generate a response.

frequency_penalty

number

(NOT SUPPORTED in Responses API) Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim.

id

string

Unique ID of the response.

metadata

Only included for compatibility.

model

string

Model name used to generate the response.

object

string

The object type of this resource. Always set to response.

output

array

The response generated by the model.

parallel_tool_calls

boolean

Whether to allow the model to run parallel tool calls.

presence_penalty

number

(NOT SUPPORTED in Responses API) Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics.

service_tier

string

default: default

status

string

Status of the response. One of completed, in_progress or incomplete.

store

boolean

default: true

Whether to store the input message(s) and model response for later retrieval.

text

object

tool_choice

string | object

Parameter to control how model chooses the tools.

tools

array

A list of tools the model may call in JSON-schema. Currently, only functions and web search are supported as tools. A max of 128 tools are supported.

top_logprobs

integer

An integer between 0 and 8 specifying the number of most likely tokens to return at each token position.

truncation

string

default: disabled

The truncation strategy to use for the model response.


Retrieve previous response

/v1/responses/{response_id}

Retrieve a previously generated response.

Path parameters

response_id

string

required

The response id returned by a previous create response request.

Response Body

background

boolean

default: false

OpenResponses compatibility fields. Not used at the moment. Just for OpenResponses compatibility. Whether to process the response asynchronously in the background.

created_at

integer

The Unix timestamp (in seconds) for the response creation time.

error

An error object returned when the model fails to generate a response.

frequency_penalty

number

(NOT SUPPORTED in Responses API) Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim.

id

string

Unique ID of the response.

metadata

Only included for compatibility.

model

string

Model name used to generate the response.

object

string

The object type of this resource. Always set to response.

output

array

The response generated by the model.

parallel_tool_calls

boolean

Whether to allow the model to run parallel tool calls.

presence_penalty

number

(NOT SUPPORTED in Responses API) Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics.

service_tier

string

default: default

status

string

Status of the response. One of completed, in_progress or incomplete.

store

boolean

default: true

Whether to store the input message(s) and model response for later retrieval.

text

object

tool_choice

string | object

Parameter to control how model chooses the tools.

tools

array

A list of tools the model may call in JSON-schema. Currently, only functions and web search are supported as tools. A max of 128 tools are supported.

top_logprobs

integer

An integer between 0 and 8 specifying the number of most likely tokens to return at each token position.

truncation

string

default: disabled

The truncation strategy to use for the model response.


List input items

/v1/responses/{response_id}/input_items

List input items for a previously generated response.

Path parameters

response_id

string

required

The response id returned by a previous create response request.

Query parameters

limit

integer

Maximum number of items to return (1-100, default 20).

order

string

Sort order: asc or desc. Default asc.

after

string

Cursor for pagination. Returns items after this item ID.

Response Body

data

array

The list of input items.

has_more

boolean

Whether there are more items beyond this page.

object

string

The object type, always list.


Delete previous response

/v1/responses/{response_id}

Delete a previously generated response.

Path parameters

response_id

string

required

The response id returned by a previous create response request.

Response Body

deleted

boolean

Whether the response was successfully deleted.

id

string

The response_id to be deleted.

object

string

The deleted object type, which is always response.


Compact a conversation

/v1/responses/compact

Shrink a full context window into a compacted window that can be reused in follow-up /v1/responses calls. See Context Compaction for the full guide.

Compacts a full Responses API input window into a shorter canonical window.

Request Body

input

string | array

required

Content of the input passed to a /v1/response request.

model

string

required

Model to use for compaction summarization (required).

Response Body

created_at

integer

Unix timestamp (in seconds) when the compacted conversation was created.

id

string

Unique ID for this compaction (e.g. cmp_<uuid>).

model

string

Model used for the compaction summary.

object

string

Always "response.compaction".

output

array

Compacted output containing a single compaction item. Pass this verbatim as input to the next /v1/responses call.


Last updated: September 2, 2026