删除自定义模型接入点
更新时间:2026-11-24
接口说明
- 本接口用于删除一个自定义模型接入点,返回被删除记录的 serviceId 与 modelName。
- 模型仍被 Agent 引用时返回 409 ModelServiceInUse,需先在这些 Agent 里换用其他模型。
- 星点模型由平台预置、只读,不能通过本接口删除。
请求结构
Plain Text
1POST /v1/agents/deleteModelService HTTP/1.1
2Host: aw-harness.bj.baidubce.com
3Authorization: authorization string
4
5{
6 "serviceId": "ms-3f8a1c2d"
7}
请求头域
除公共头域外,无其它特殊头域。
请求参数
| 参数名称 | 类型 | 是否必需 | 参数位置 | 描述 |
|---|---|---|---|---|
| serviceId | String | 是 | RequestBody参数 | 自建模型资源 ID(ms- 前缀)。 |
返回头域
除公共头域,无其它特殊头域。
返回参数
| 参数名称 | 类型 | 描述 |
|---|---|---|
| serviceId | String | 被删除的自建模型资源 ID。 |
| modelName | String | 被删除的模型名称。 |
错误码
| 错误码 | 错误描述 | HTTP状态码 | 中文解释 |
|---|---|---|---|
| InvalidArgument | The request parameters are invalid. | 400 | serviceId 缺失或请求体含未识别字段。 |
| Forbidden | Operation requires an admin caller. | 403 | 缺少鉴权账号、跨账号访问他人资源,或携带 Actor 头调用仅限管理员的写接口。 |
| ModelServiceNotFound | Model service not found. | 404 | 模型服务不存在。 |
| ModelServiceInUse | Model service is in use. | 409 | 模型仍被 Agent 引用,需先解除引用。 |
| PersistFailed | Failed to delete the model service. | 500 | 服务端存储写失败,可重试。 |
| Internal | Internal server error. | 500 | 服务端内部错误,保留 requestId 联系维护方。 |
请求示例
Plain Text
1POST http://aw-harness.bj.baidubce.com/v1/agents/deleteModelService
2Host: aw-harness.bj.baidubce.com
3Authorization: bce-auth-v1/f81d3b34e48048fbb2634dc7882d7e21/2015-08-11T04:17:29Z/3600/host/74c506f68c65e26c633bfa104c863fffac5190fdec1ec24b7c03eb5d67d2e1de
4Content-Type: application/json
5
6{
7 "serviceId": "ms-3f8a1c2d"
8}
返回示例
Plain Text
1HTTP/1.1 200 OK
2Content-Type: application/json;charset=UTF-8
3x-bce-request-id: 9f3d0e6a-1c2b-4d5e-8a7f-0b1c2d3e4f5a
4Server: BWS
5
6{
7 "result": {
8 "serviceId": "ms-3f8a1c2d",
9 "modelName": "glm-5"
10 },
11 "requestId": "9f3d0e6a-1c2b-4d5e-8a7f-0b1c2d3e4f5a"
12}
评价此篇文章
