Skip to main content

Overview

Deletes a fine-tuned model. You must have the Owner role in your organization to delete a model.
This action is permanent and cannot be undone. The model will be immediately removed and can no longer be used for inference.

Method

Parameters

string
required
The ID of the fine-tuned model to delete. Must be a model you own.Only fine-tuned models can be deleted. Base OpenAI models (like gpt-4 or gpt-3.5-turbo) cannot be deleted.
dict
Send extra headers with the request
dict
Add additional query parameters to the request
float
Override the client-level default timeout for this request, in seconds

Response

Returns a ModelDeleted object confirming the deletion.
string
The ID of the deleted model
boolean
Confirmation that the model was deleted (always true on success)
string
The object type (typically “model”)

Examples

Delete a Fine-Tuned Model

Safe Deletion with Confirmation

List and Delete Old Models

Error Handling

Async Usage

Notes

  • Requires Owner role: You must have the Owner role in your organization to delete models
  • Fine-tuned models only: Base OpenAI models cannot be deleted
  • Permanent action: Deletion is immediate and cannot be undone
  • Active usage: Ensure the model is not actively being used in production before deletion
  • Returns an error if:
    • The model doesn’t exist
    • You don’t have permission to delete the model
    • The model is not a fine-tuned model