Skip to content
Get started

Cancel Response

v1.omni_ai.responses.cancel_response(strresponse_id, ResponseCancelResponseParams**kwargs) -> ResponseCancelResponseResponse
DELETE/v1/omni-ai/responses/{response_id}

Cancel a response.

Requests cancellation of a queued or running response. If the response has already reached a terminal status, this is an idempotent success. A canceled turn still produces a final assistant message with outcome canceled in the thread history.

ParametersExpand Collapse
response_id: str
account_id: int

Account ID for the request

formatint64
ReturnsExpand Collapse
class ResponseCancelResponseResponse:
canceled: bool

Cancel Response

from clear_street import ClearStreet

client = ClearStreet(
    api_key="My API Key",
)
response = client.v1.omni_ai.responses.cancel_response(
    response_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
    account_id=0,
)
print(response)
{
  "data": {
    "canceled": false
  },
  "metadata": {
    "request_id": "fa26a786-f5d3-48b0-80eb-778e17af4964"
  }
}
{
  "error": {
    "code": 400,
    "message": "Failed to deserialize query string: missing field `account_id`"
  },
  "metadata": {
    "request_id": "10f877f8-130b-4f02-b40a-1b6ab5d8acdf"
  }
}
{
  "error": {
    "code": 403,
    "message": "The caller does not have permission to execute the specified operation"
  },
  "metadata": {
    "request_id": "1c610eec-b873-4092-93aa-f14b6f501e4b"
  }
}
{
  "error": {
    "code": 404,
    "message": "Response not found"
  },
  "metadata": {
    "request_id": "a5bc6ea6-1b72-4f31-bb7d-2bd57151decc"
  }
}
Returns Examples
{
  "data": {
    "canceled": false
  },
  "metadata": {
    "request_id": "fa26a786-f5d3-48b0-80eb-778e17af4964"
  }
}
{
  "error": {
    "code": 400,
    "message": "Failed to deserialize query string: missing field `account_id`"
  },
  "metadata": {
    "request_id": "10f877f8-130b-4f02-b40a-1b6ab5d8acdf"
  }
}
{
  "error": {
    "code": 403,
    "message": "The caller does not have permission to execute the specified operation"
  },
  "metadata": {
    "request_id": "1c610eec-b873-4092-93aa-f14b6f501e4b"
  }
}
{
  "error": {
    "code": 404,
    "message": "Response not found"
  },
  "metadata": {
    "request_id": "a5bc6ea6-1b72-4f31-bb7d-2bd57151decc"
  }
}