Python
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.
Delete a stored model response by its response ID
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"
}DashScope API key.
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.
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"
}