Delete AI Model
Used to delete an AI model and all its configurations. This permanently removes the model from your project.
API Endpoint
| Property | Value |
|---|---|
| Request Method | DELETE |
| Request URL | https://api.seliseblocks.com/models/{model_id} |
Request
Request Example
curl -X DELETE 'https://api.seliseblocks.com/models/{model_id}?project_key=YOUR_PROJECT_KEY' \
-H 'accept: application/json'
Path Parameters
| Field | Type | Required | Description |
|---|---|---|---|
| model_id | string | Yes | The unique identifier of the model to delete. |
Query Parameters
| Field | Type | Required | Description |
|---|---|---|---|
| project_key | string | No | The project key for your project. |
Request Headers
| Field | Type | Required | Description |
|---|---|---|---|
| accept | string | Yes | Accepted response format. Use application/json |
warning
Permanent Deletion Warning
- This operation permanently deletes the model and cannot be undone
- All model configurations, credentials, and settings will be removed
- AI agents using this model will no longer be able to access it
- Conversation history using this model is retained but marked as using a deleted model
- Usage statistics and metrics for this model will be preserved for audit purposes
tip
Before deleting a model:
- Check which AI agents are currently using this model
- Identify conversations that depend on this model
- Export or backup model configuration if you may need it later
- Consider deactivating the model instead of deleting (set IsActive to false)
- Notify team members who may be using the model
- Update documentation to reflect the removal
- Ensure you have alternative models configured for agents
After successful deletion:
- Update AI agents to use different models
- Remove references to the model from agent configurations
- Update any scripts or automations that reference the model
- Clear cached model data in your applications
- Document the deletion for audit purposes
- Monitor affected agents for proper operation
Response
Success Response (200 OK)
Returns an object containing the deletion status.
{
"is_success": true,
"item_id": "model_123",
"detail": "AI model deleted successfully",
"error": {}
}
Response Fields
| Field | Type | Description |
|---|---|---|
| is_success | boolean | Indicates whether the deletion was successful. |
| item_id | string | The identifier of the deleted model. |
| detail | string | Success or failure message with additional context. |
| error | object | Error details if the operation failed (empty if successful). |
Error Response (422 Unprocessable Entity)
Returns validation error details when the request parameters are invalid.
{
"detail": [
{
"loc": [
"path",
"model_id"
],
"msg": "model not found or already deleted",
"type": "value_error.notfound"
}
]
}
Error Response Fields
| Field | Type | Description |
|---|---|---|
| detail | array | Array of validation error objects. |
| loc | array | Location of the error in the request (e.g., path, query). |
| msg | string | Human-readable error message. |
| type | string | Error type identifier. |
Common Error Scenarios
| Error Type | Description | Resolution |
|---|---|---|
| Model Not Found | Model ID doesn't exist or was already deleted | Verify the model_id is correct |
| Permission Denied | User lacks permission to delete the model | Check user permissions in project settings |
| Model In Use | Model is currently being used by active agents or conversations | Stop agent executions or switch agents to different models first |
| Invalid Model ID | Model ID format is invalid | Ensure model_id matches the expected format |
| Last Model | Cannot delete the only model in the project | Add another model before deleting this one |
Error Codes
| Status Code | Description | Response Type |
|---|---|---|
| 200 | Successful Response | Success |
| 400 | Bad Request - Invalid request | Bad Request |
| 403 | Forbidden - Insufficient permissions | Forbidden |
| 404 | Not Found - Model does not exist | Not Found |
| 409 | Conflict - Model is in use and cannot be deleted | Conflict |
| 422 | Validation Error - Invalid request parameters | Unprocessable Entity |