Skip to main content
OpenAI Responses

Delete a response

Delete a stored model response by its response ID

DELETE
https://ap-southeast-1.maas.qwencloudapi.com/compatible-mode/v1/responses/{response_id}
Python
import os
from openai import OpenAI

client = OpenAI(
    api_key=os.getenv("DASHSCOPE_API_KEY"),
    # Singapore (ap-southeast-1). For another region, replace ap-southeast-1 in the URL.
    # API keys are region-specific. See https://docs.qwencloud.com/developer-guides/getting-started/regions
    base_url="https://ap-southeast-1.maas.qwencloudapi.com/compatible-mode/v1",
)

response = client.responses.delete("resp_xxx")
print(response)
{
  "deleted": true,
  "id": "resp_4ca7fa5e-6ff5-9787-bc18-af6ca5eff36c"
}

Authorizations

string
header
required

DashScope API key.

Path Parameters

string
required

The ID of the response to delete, in the format resp_xxx. Only response IDs returned by requests created with store=true can be deleted.

Response

200-application/json
string

The ID of the deleted response.

boolean

Whether the deletion succeeded. true on success.