Skip to main content
POST
Creates a streaming or non-streaming response using the OpenAI Responses API format. Supports text, images, files, audio, video, function calling, web search, file search, code interpreter, reasoning, and more.

Authentication

string
required
Bearer token. Use your API key as the bearer token in the Authorization header.Format: Bearer <SUNRA_KEY>

Request

This endpoint expects an object.
string
required
Model ID used to generate the response. Browse available models at sunra.ai/models.
object
Optional provider routing preferences. Omit for automatic routing. See Provider routing for supported fields and provider discovery.
string | object[]
Input for the response request. Can be a string or an array of input items including messages, function calls, function call outputs, reasoning items, and output messages.
string | null
Inserts a system (or developer) message as the first item in the model’s context. When used with input, the instructions are inserted at the start of the input.
boolean
default:false
If set to true, the response will be streamed using server-sent events (SSE). Streams are subject to an idle timeout and a lifetime ceiling — see Output limits and stream lifetime.
number | null
An upper bound for the number of output tokens, including visible output tokens and reasoning tokens. A value above the model’s own ceiling is rejected with 400 rather than reduced. See Output limits.
number | null
Sampling temperature between 0 and 2. Higher values increase randomness.
number | null
Nucleus sampling parameter. An alternative to sampling with temperature.
number
Sample only from the top K options for each subsequent token. Used to remove “long tail” low-probability responses.
number | null
Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text.
number | null
Number between -2.0 and 2.0. Positive values penalize new tokens based on whether they already appear in the text.
integer | null
An integer specifying the number of most likely tokens to return at each token position.
integer | null
Maximum number of tool calls the model can make in a single response.
object[]
An array of tools the model may call.
string | object
Controls tool selection behavior. String values: none, auto, required. Can also specify a particular function or tool type.
boolean | null
Whether to allow the model to run tool calls in parallel.
object
Configuration for text response format.
object
Configuration for reasoning output.
string[]
Output modalities for the response. Supported values: text, image.
string | null
The ID of a previous response to use as context for this request.
string[]
Additional fields to include in the response. Supported values: file_search_call.results, message.input_image.image_url, computer_call_output.output.image_url, reasoning.encrypted_content, code_interpreter_call.outputs.
boolean
Whether to store the generated response for later retrieval.
string
The service tier to use for this request. Supported values: auto.
string
Truncation strategy. Supported values: auto, disabled.
boolean | null
Whether to run the request in the background.
object
Set of key-value pairs that can be attached to the response. Keys must be ≤64 characters. Values must be ≤512 characters. Maximum 16 pairs allowed.
string
A unique identifier representing your end-user. Maximum of 128 characters.

Response

Successful response object.
string
Unique response identifier.
string
The object type. Always response.
number
Unix timestamp (in seconds) of when the response was created.
number | null
Unix timestamp (in seconds) of when the response completed.
string
The status of the response. Possible values: completed, incomplete, in_progress, failed, cancelled, queued.
string
The model used for generating the response.
object[]
An array of output items generated by the model.
string
Convenience field containing the concatenated text output from all output messages.
object | null
Details about why the response is incomplete, if applicable.
object | null
An error object if the generation failed.
object
Token usage statistics for the response.
number | null
The sampling temperature used.
number | null
The nucleus sampling value used.
number | null
The max output tokens setting used.
number
The top logprobs setting used.
number | null
The max tool calls setting used.
number | null
The presence penalty used.
number | null
The frequency penalty used.
string | object[] | null
The instructions/system message used.
object
The metadata attached to the response.
object[]
The tools configuration used.
string | object
The tool choice configuration used.
boolean
Whether parallel tool calls was enabled.
object
The reasoning configuration used.
string
The service tier used. Possible values: auto, default, flex, priority, scale.
boolean
Whether the response was stored.
string
The truncation strategy used. Possible values: auto, disabled.
object
The text format configuration used.
string | null
The ID of the previous response used as context.
boolean | null
Whether the request ran in the background.