Delete Model
curl --request POST \
--url https://api.example.com/api/models/model/delete \
--header 'Content-Type: application/json' \
--data '
{
"id": "<string>"
}
'{
"success": true
}Models
Delete Model
Delete a model by its ID
POST
/
api
/
models
/
model
/
delete
Delete Model
curl --request POST \
--url https://api.example.com/api/models/model/delete \
--header 'Content-Type: application/json' \
--data '
{
"id": "<string>"
}
'{
"success": true
}Body Parameters
The unique identifier of the model to delete
Response
Returns
true if the model was successfully deleted, false otherwiseExample Request
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
true
Error Responses
401
Unauthorized - Model not found
{
"detail": "Model not found"
}
401
Unauthorized - User does not have permission to delete this model
{
"detail": "Unauthorized"
}
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:- Remove all access grants associated with the model
- Permanently delete the model from the database
- The model ID will become available for reuse
Alternative: Delete All Models
Admins can delete all models at once using:curl -X DELETE "https://api.example.com/api/models/delete/all" \
-H "Authorization: Bearer YOUR_API_KEY"
- Requires admin privileges
- Deletes all models in the database
- Revokes all associated access grants
- Returns
trueon success
⌘I