删除模型响应
更新时间:2025-12-11
DELETE
https://qianfan.baidubce.com/v2/responses/{response_id}
本文介绍如何删除指定 ID 的模型请求。
权限说明
调用本文API,需使用API Key鉴权方式。使用API Key鉴权调用API流程,具体调用流程,请查看 认证鉴权。
请求参数
Headers 参数
除公共头域外,无其它特殊头域
URL 参数
response_id
string
待删除请求的id。
必选
请求结构
DELETE /v2/responses/{response_id} HTTP/1.1
Host: qianfan.baidubce.com
Authorization: Bearer <API Key>
Content-Type: application/json
示例代码
请求示例
curl -X DELETE https://qianfan.baidubce.com/v2/responses/resp-abc123 \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <API Key>"
返回响应
Headers 参数
除公共头域外,无其它特殊头域
返回参数
id
string
需要删除的响应 id。
可选
object
string
资源对象类型,固定为response。
可选
deleted
boolean
取值范围:
true:删除成功。false:删除失败。
可选
JSON
{
"id": "resp-abc123",
"object": "response",
"deleted": true
}
JSON
{
"error": {
"code": "invalid_request",
"message": "response id resp-abc123 not found",
"param": "response_id",
"type": "invalid_request_error"
},
"id": "as-***62b4q"
}
错误码
如果请求错误,服务器返回的JSON文本包含以下参数。
| 名称 | 描述 |
|---|---|
| code | 错误码 |
| message | 错误描述信息,帮助理解和解决发生的错误 |
| type | 错误类型 |
更多相关错误码,请查看模型错误码说明。
