> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.labric.co/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.labric.co/_mcp/server.

# Delete a model

DELETE https://platform.labric.co/api/v1/ml-models/{ml_model_id}

Delete a model and all its versions.

Pending or running training is cancelled first, which stops its cloud training
jobs. The response lists the deleted versions in affected_objects.

Requires an API key with the `write` scope.

Reference: https://docs.labric.co/api-reference/labric-api/models/delete

## Authentication

- `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer <token>`, where token is your auth token.

## Request

### Path parameters

- `ml_model_id` (string, required)

## Response

### 200

OK

- `deleted` (boolean, required)
- `affected_objects_count` (integer, required)
- `affected_objects` (list of AffectedObjectSchema, required)

## Errors

### 400 Bad Request Error

Bad Request

- `detail` (string, required)

### 401 Unauthorized Error

Unauthorized

- `detail` (string, required)

### 403 Forbidden Error

Forbidden

- `detail` (string, required)

### 404 Not Found Error

Not Found

- `detail` (string, required)

### 422 Unprocessable Entity Error

Unprocessable Content

- `detail` (list of map from string to any, required)

### 500 Internal Server Error

Internal Server Error

- `detail` (string, required)

## Types

### AffectedObjectSchema

- `id` (string, required)
- `display_name` (string, required)

## Examples

**Response**

```json
{
  "deleted": true,
  "affected_objects_count": 1,
  "affected_objects": [
    {
      "id": "string",
      "display_name": "string"
    }
  ]
}
```

**SDK Code**

```python
import requests

url = "https://platform.labric.co/api/v1/ml-models/ml_model_id"

headers = {"Authorization": "Bearer <api_key>"}

response = requests.delete(url, headers=headers)

print(response.json())
```