> ## Documentation Index
> Fetch the complete documentation index at: https://docs.memorylake.cn/llms.txt
> Use this file to discover all available pages before exploring further.

# 删除分析模型

> 删除一个没有数据库记忆在使用的分析模型

```
DELETE /openapi/memorylake/api/v3/workspaces/{workspaceId}/analysis-models/{modelId}
```

删除分析模型。只要还有数据库记忆在使用这个模型，请求就会以 `409` 和 `RESOURCE_IN_USE` 被拒绝。请先用[更新数据库记忆](https://docs.memorylake.cn/features/memorylake/api-reference/database/database-memories/update-database-memory.md)传入空的 `analysis_model_id`，把模型从这些记忆中解除，或者[删除这些记忆](https://docs.memorylake.cn/features/memorylake/api-reference/database/database-memories/delete-database-memory.md)。

从这个模型派生出的模型不受影响，它们的 `fork_from` 仍然指向被删除的模型。

删除不存在或已删除的分析模型同样返回 `200`，所以重复删除可以放心重试。

> [!NOTE]
>
> **所需权限：** `analysis_model:delete`

### 路径参数

**workspaceId** `string` *required*

工作空间 ID

**modelId** `string` *required*

分析模型 ID

```bash cURL theme={null}
curl -X DELETE 'https://app.memorylake.cn/openapi/memorylake/api/v3/workspaces/ws-8001856949ad4f6a5b6226f415ffa877/analysis-models/am-9d3f7b1e5a2c4d8f6b0e3a7c9d1f5b2e' \
  -H 'Authorization: Bearer sk_xxxxxx'
```

### 响应

**success** `boolean`

表示请求是否成功

**message** `string`

人类可读的状态消息

```json Success (200) theme={null}
{
  "success": true,
  "message": "Operation completed successfully"
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.