Skip to main content
POST

Guide: Direct Responses

Request and response format, reasoning across turns, images, and pricing.

Error Reference: Direct Responses

Common errors: unknown model, context window exceeded, provider rate limit, provider timeout, provider unavailable.

Authorizations

Authorization
string
header
default:Bearer <api-key>
required

Bearer authentication header of the form Bearer <api-key>, where <api-key> is your API key.

Headers

X-Cache-TTL
string | null

Body

application/json

Request body for the Responses API (POST /ai/v2/direct/responses).

input
required

String prompt or array of input items

model
string
required
frequency_penalty
number | null
image_generation
Image Generation · object | null

Image generation options (quality, size) mapped onto OpenAI's image_generation tool; ignored by providers without quality controls.

instructions
string | null
max_output_tokens
integer | null

Maximum output, in tokens. On a reasoning model it holds the reasoning as well as the answer, and it is sent as you set it, so leave room for both. With no value, most reasoning models get their full output allowance (up to 65,536). A response that reached the limit has status: "incomplete". See Set your output limit for reasoning models.

parallel_tool_calls
boolean | null
presence_penalty
number | null
prompt_cache_key
string | null

Optional prompt cache key for OpenAI models. Requests that share the key and a common prompt prefix are more likely to reuse the cache, reducing cost and latency. Ignored for other providers. See Prompt Caching.

reasoning
Reasoning Config · object | null

Reasoning controls for a Responses request. On the Responses endpoints, a summary comes back only when summary is set. See the Reasoning guide (/api-guides/reasoning).

response_format
Response Format · object | null
stop
unknown
stream
boolean
default:false
temperature
number | null

Sampling temperature. A model that does not take one (Claude 5 models, and OpenAI GPT-5 and later models while they reason) does not get it, and it is listed in ignored_params (X-Ignored-Params on a stream). See Sampling parameters.

tool_choice
unknown
tools
Tools · object[] | null

Tool definitions, such as custom function tools. OpenAI's hosted image_generation tool draws images on the OpenAI GPT-5 and GPT-6 models that support it. Its optional model picks the image model: gpt-image-2 (the default when model is omitted), gpt-image-2.5-flare or gpt-image-2.5-sunburst. gpt-image-1.5, chatgpt-image-latest and gpt-image-1-mini still work and retire on December 1, 2026. gpt-image-1 was retired on October 23, 2026: a tool that names it runs on gpt-image-2, and the response carries the X-Gloo-Model-Redirected-From, Deprecation and Sunset headers. An image model that doesn't exist returns 400. See Image models.

top_p
number | null

Nucleus sampling parameter. A model that does not take it is not sent it, and it is listed in ignored_params (X-Ignored-Params on a stream). See Sampling parameters.

Response

Successful Responses API result. If stream is false or omitted, the response is JSON. If stream=true, the response is a named Server-Sent Events stream.

A non-streaming Responses API result.

id
string
required
object
string
default:response
required
Allowed value: "response"
created_at
integer
required

Unix timestamp when the response was created.

model
string
required
status
enum<string>
required
Available options:
completed,
failed,
in_progress,
incomplete
output
(Message · object | Image Generation · object | Function Call · object | Reasoning · object)[]
required

Items generated by the model, such as assistant messages, images, function calls, or reasoning summaries.

An assistant message produced by the model.

usage
Usage · object

Token usage for the response.

instructions
string
max_output_tokens
integer
metadata
object
parallel_tool_calls
boolean
prompt_cache_key
string
reasoning
object
temperature
number
text
object
tool_choice
any
tools
object[]
top_p
number
ignored_params
Ignored Parameters · object

Parameters that were ignored or not applied as sent. The request still succeeds. Entries are name=value: sampling parameters the selected model does not accept and, on Direct Responses, reasoning removed from input (input.reasoning=<n> reasoning items, input.reasoning_paired=<n> other items removed with them) and stateful parameters that have no effect (previous_response_id, conversation, store=True, background=True). On a stream, the parameter names are in the X-Ignored-Params header instead.

Example:
reasoning_carryover
Reasoning Carry-over Report · object

What happened to the reasoning items in the request's input. Present only when input contained at least one reasoning item, or the request asked for include: ["reasoning.encrypted_content"]; otherwise absent. Gloo does not carry reasoning from one request to the next: reasoning state sent back in input is removed before any model is called, and the request still succeeds. Returned by the guarded Responses and Grounded Responses endpoints. On a stream, the counts are in the X-Gloo-Reasoning-Carryover header and this object is a top-level field of the final response.completed or response.incomplete event's data; a stream that fails before either event ends without it. Direct Responses does not return this object or the header: it reports removed reasoning as input.reasoning=<n> and input.reasoning_paired=<n> in ignored_params (X-Ignored-Params on a stream).

Example: