Skip to navigation

Retrieve a response

Returns a previously created response by id. With stream=true the response is delivered as server-sent events instead of a single JSON body, replaying the run from the beginning and continuing live if it is still going. Streaming a retrieve requires a response created with background: true; on any other response it returns a 400.

Authentication

AuthorizationBearer

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

Path parameters

response_idstringRequiredformat: "^resp_[a-f0-9]{32}$"

The id of the response, as returned when it was created. A malformed id returns a 400; an id that does not exist returns a 404.

Query parameters

streambooleanOptionalDefaults to false

If true, replay the response as server-sent events. Requires a response created with background: true.

starting_afterintegerOptional

When streaming, replay only the events after this sequence_number.

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

The response object.
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
404
Not Found Error
500
Internal Server Error
502
Bad Gateway Error
504
Gateway Timeout Error