Skip to navigation

Cancel a response

Cancels a response that is still queued or in progress, and returns it with status cancelled. Cancelling a response that has already finished returns it unchanged. A cancelled response’s event stream ends with response.incomplete.

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.

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 cancelled 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