Skip to main content
POST
Create Response

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
input
required

Input content - either a string or array of input items

instructions
string

System instructions for the model

language_preference
string

ISO 639-1 language code for response language

max_output_tokens
integer<int32>

Maximum tokens to generate

Required range: x >= 1
max_steps
integer<int32>

Maximum number of research loop steps. If provided, overrides the preset's max_steps value. Must be >= 1 if specified. Maximum allowed is 10.

Required range: 1 <= x <= 10
model
string

Model ID in provider/model format (e.g., "xai/grok-4-1", "openai/gpt-4o"). If models is also provided, models takes precedence. Required if neither models nor preset is provided.

models
string[]

Model fallback chain. Each model is in provider/model format. Models are tried in order until one succeeds. Max 5 models allowed. If set, takes precedence over single model field. The response.model will reflect the model that actually succeeded.

Required array length: 1 - 5 elements
preset
string

Preset configuration name (e.g., "fast-search", "pro-search", "deep-research"). Pre-configured model with system prompt and search parameters. Required if model is not provided.

reasoning
ReasoningConfig · object
response_format
ResponseFormat · object

Specifies the desired output format for the model response

stream
boolean

If true, returns SSE stream instead of JSON

tools
(WebSearchTool · object | FetchUrlTool · object | FunctionTool · object)[]

Tools available to the model

Response

Successful response. Content type depends on stream parameter:

  • stream: false (default): application/json with Response
  • stream: true: text/event-stream with SSE events

Non-streaming response returned when stream is false

created_at
integer<int64>
required
id
string
required
model
string
required
object
enum<string>
required

Object type in API responses

Available options:
response
output
(MessageOutputItem · object | SearchResultsOutputItem · object | FetchUrlResultsOutputItem · object | FunctionCallOutputItem · object)[]
required
status
enum<string>
required

Status of a response or output item

Available options:
completed,
failed,
in_progress,
requires_action
error
ErrorInfo · object
usage
ResponsesUsage · object