Skip to navigation

Create a response

Creates a model response using the Responses API. Supports streaming (stream: true, server-sent events) and background mode (background: true). When streaming, each frame carries a named event: and a JSON data: payload, and the stream ends on a terminal event, one of response.completed, response.failed or response.incomplete; there is no [DONE] sentinel. If the run stalls, the stream can instead end on a data: line holding an error object. Lines starting with : are keep-alive comments. OpenAI-compatible, so existing Responses API code runs unmodified. Unrecognized fields are rejected with a 400 (unknown_parameter).

Authentication

AuthorizationBearer

Your ASI:One API key, sent as Authorization: Bearer <api_key>.

Request

This endpoint expects an object.
modelstringRequired

The ASI:One model to use.

inputstring or list of objectsRequired

Text, or a list of input items, to generate a response for. Content parts are input_text, output_text and input_image. An input_image takes an image_url as a data: base64 URI or an https URL from a supported host (file_id is not supported), and a message takes up to 10 images.

instructionsstringOptional

System/developer instructions inserted ahead of the input.

streambooleanOptionalDefaults to false

If true, response events are streamed as server-sent events.

backgroundbooleanOptionalDefaults to false

If true, run the response as a background task; poll it with the retrieve endpoint or stop it with cancel. Requires store: true.

storebooleanOptionalDefaults to true

Whether to persist the response so it can be retrieved by id. With false, the retrieve, cancel, delete and input items endpoints return a 404 for it.

previous_response_idstringOptional
The id of a previous response to continue from.
max_output_tokensintegerOptional>=1
Upper bound on tokens generated for the response.
temperaturedoubleOptional0-2
Sampling temperature.
top_pdoubleOptional0-1
Nucleus sampling probability mass.
toolslist of objectsOptional

A list of tools the model may call. Function tools can use the flat Responses shape or the nested Chat Completions shape, and can be grouped in a namespace. A web_search tool lets the model search the web. Other tool types are rejected with a 400. See the Tool Calling guide.

tool_choiceenum or map from strings to anyOptional

Controls which (if any) tool is called.

parallel_tool_callsbooleanOptional
Whether the model may call several tools in one turn.
textobjectOptional

Output format configuration. text.format takes precedence over response_format.

reasoningobjectOptional

Reasoning configuration. See the Reasoning guide.

enable_thinkingbooleanOptional

ASI:One extension. Turns reasoning on or off on asi1-mini. The other models always reason; there an explicit false selects the shallowest depth. Used when reasoning.effort is absent. See the Reasoning guide.

thinking_budgetintegerOptional0-16384

ASI:One extension. The older way to size reasoning. On asi1 and asi1-ultra the value selects a depth rather than capping tokens. See the Reasoning guide.

metadatamap from strings to stringsOptional

Up to 16 key-value string pairs attached to the response.

Response headers

X-Request-IdstringOptional

Correlation id for this request, present on every response: the caller-supplied X-Request-Id when one was sent, otherwise minted by the API. Backends log it and traces key on it, so cite it when reporting an issue.

Response

A response object, or an SSE stream of response events when stream is true.

idstringOptional
objectstringOptional
statusenumOptional

Lifecycle status. queued and in_progress mean the run is still going; completed, failed, cancelled and incomplete are terminal.

modelstringOptional
outputlist of objectsOptional
usageobject or nullOptional
Token usage for the response. Null on a response cancelled before it finished.

Errors

400
Bad Request Error
401
Unauthorized Error
402
Payment Required Error
404
Not Found Error
409
Conflict Error
429
Too Many Requests Error
500
Internal Server Error
502
Bad Gateway Error
503
Service Unavailable Error
504
Gateway Timeout Error