Skip to main content
POST
Create a response (OpenAI Responses API)

Authorizations

Authorization
string
header
required

Gateway API key (imp-rt-...) from POST /v1/accounts or /v1/keys.

Body

application/json
model
string
required
Example:

"anthropic/claude-sonnet-4-5"

input
required
instructions
string
stream
boolean
default:false
temperature
number
top_p
number
max_output_tokens
integer
reasoning
object

Stateless reasoning controls. Send full conversation history in input; previous_response_id chaining and stored-response retrieval are not implemented.

parallel_tool_calls
boolean

Forwarded where the serving provider supports parallel function-tool controls.

service_tier
enum<string> | null

Processing tier. Omitted, null, auto and default are standard processing at the model's normal rates. ultrafast is OpenAI's low-latency tier, available only for openai/gpt-6-astra and openai/gpt-6.1-sol: it is served only by OpenAI's own API (never another host, never a silent fallback to standard) and billed at Ultrafast rates. fast uses native Anthropic only for anthropic/claude-opus-5-5 at Fast rates. priority and flex return 400. Same contract as on ChatCompletionRequest.

Available options:
auto,
default,
ultrafast,
fast
tools
object[]

Function tools are relayed to your application. Native web_search and x_search execute only on supported xAI routes and are filtered out on other providers. Gateway-paid searches add $0.005 per invocation. A required tool choice with no executable tools returns 400.

tool_choice

auto, none, required, or { type: function, name }.

Available options:
auto,
none,
required
cache_control
object

Request-level breakpoint; same contract as on ChatCompletionRequest. A per-part cache_control anywhere takes precedence and this is ignored.

Response

A response object. When stream: true, the body is instead an SSE stream of response.* semantic events ending with response.completed, or response.incomplete when generation stopped short (see status).

Responses API object (response).

id
string
Example:

"resp_..."

object
string
Allowed value: "response"
created_at
integer
status
enum<string>
Available options:
in_progress,
completed,
incomplete,
failed
incomplete_details
object

Why generation stopped short. Present only when status is incomplete.

model
string
output_text
string

Convenience aggregation of the assistant text.

output
object[]

Output items — a reasoning item first when the model reasoned, assistant message items and, on tool calls, function_call items.

usage
object
service_tier
string | null

Present only when the request set service_tier, on a completed or incomplete response (in a stream: the response.completed / response.incomplete event). Same contract as on ChatCompletion, including unknown reported strings and null.