Skip to main content
The /v1/responses endpoint implements OpenAI’s Responses API — a newer request format that replaces the messages array with an input field accepting either a plain string or a structured content array. It returns a richer response object that includes the model’s output items directly. A companion endpoint, /v1/responses/compact, returns only the output text, which is useful when you need a lightweight response without the full response envelope.

POST /v1/responses

Request parameters

string
required
The ID of the model to use. Use the list models endpoint to retrieve available model IDs.
string | array
required
The input prompt. Pass a plain string for simple text prompts, or an array of content objects for multi-modal or structured inputs.
boolean
default:"false"
When true, the response streams as server-sent events. The stream ends with a response.completed event.
string
System-level instructions for the model, equivalent to a system message in the Chat Completions API.
number
default:"1"
Sampling temperature between 0 and 2.
integer
Maximum number of tokens to generate in the response.

Example

Response


POST /v1/responses/compact

The compact variant accepts the same request body as /v1/responses but returns only the generated output text as a plain string, without the full response envelope. Use this endpoint when you only need the model’s reply and want to avoid parsing nested response objects.

Example

Response