proposit-core
    Preparing search index...

    Function cancelResponse

    • 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.

      Parameters

      • id: string

        The OpenAI response id to cancel.

      • options: { apiKey: string; baseUrl?: string; fetch?: TOpenAiFetch; signal?: AbortSignal }

        apiKey, optional baseUrl, fetch, and signal.

      Returns Promise<TRetrievedResponse>