Cancel a stored, in-flight OpenAI response. Issues
POST /responses/{id}/cancel and returns the resulting
TRetrievedResponse (typically status: "cancelled").
Cancel is idempotent per the Responses API: cancelling twice, or
cancelling an already-terminal response, simply returns the final
Response object rather than erroring — so callers do not need to
guard against double-cancel.
Throws ResponseNotFoundError when the response is not found
(HTTP 404 — typically the ~10-minute retention window elapsed).
Honors signal (an abort propagates as an AbortError).
Use this to stop an in-flight background response when a stage is
abandoned (resync timeout) or an import is cancelled, so generation
does not keep running (and billing) server-side after the consumer
has given up on it.
Cancel a stored, in-flight OpenAI response. Issues
POST /responses/{id}/canceland returns the resulting TRetrievedResponse (typicallystatus: "cancelled").Cancel is idempotent per the Responses API: cancelling twice, or cancelling an already-terminal response, simply returns the final
Responseobject rather than erroring — so callers do not need to guard against double-cancel.Throws ResponseNotFoundError when the response is not found (HTTP 404 — typically the ~10-minute retention window elapsed). Honors
signal(an abort propagates as anAbortError).Use this to stop an in-flight background response when a stage is abandoned (resync timeout) or an import is cancelled, so generation does not keep running (and billing) server-side after the consumer has given up on it.