> ## Documentation Index
> Fetch the complete documentation index at: https://mintlify.com/open-webui/open-webui/llms.txt
> Use this file to discover all available pages before exploring further.

# Delete Model

> Delete a model by its ID

## Body Parameters

<ParamField body="id" type="string" required>
  The unique identifier of the model to delete
</ParamField>

## Response

<ResponseField name="success" type="boolean">
  Returns `true` if the model was successfully deleted, `false` otherwise
</ResponseField>

## Example Request

```bash theme={null}
curl -X POST "https://api.example.com/api/models/model/delete" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "id": "my-custom-gpt4"
  }'
```

## Example Response

```json theme={null}
true
```

## Error Responses

<ResponseField name="401">
  Unauthorized - Model not found

  ```json theme={null}
  {
    "detail": "Model not found"
  }
  ```
</ResponseField>

<ResponseField name="401">
  Unauthorized - User does not have permission to delete this model

  ```json theme={null}
  {
    "detail": "Unauthorized"
  }
  ```
</ResponseField>

## Permissions

To delete a model, the user must:

* Be an admin user, OR
* Be the owner of the model (user\_id matches), OR
* Have write access granted through access\_grants

## Side Effects

Deleting a model will:

1. Remove all access grants associated with the model
2. Permanently delete the model from the database
3. The model ID will become available for reuse

This operation cannot be undone. Make sure to export the model configuration if you need to recreate it later.

## Alternative: Delete All Models

Admins can delete all models at once using:

```bash theme={null}
curl -X DELETE "https://api.example.com/api/models/delete/all" \
  -H "Authorization: Bearer YOUR_API_KEY"
```

This endpoint:

* Requires admin privileges
* Deletes all models in the database
* Revokes all associated access grants
* Returns `true` on success

**Warning:** This is a destructive operation that cannot be undone. Use with extreme caution.
