TsgcHTTP_API_OpenAIMethods › DeleteFineTuneModel

DeleteFineTuneModel Method

Deletes a fine-tuned model so it is no longer available for inference

Syntax

function DeleteFineTuneModel(const aModel: string) : TsgcOpenAIClass_Response_Delete;

Parameters

NameTypeDescription
aModelconst stringName of the fine-tuned model to delete (for example "ft:gpt-4o-mini:acme::abc123")

Return Value

Deletion result with the model name and a Deleted flag (TsgcOpenAIClass_Response_Delete)

Remarks

Calls the DELETE /v1/models/{model} endpoint. Only fine-tuned models owned by the authenticated organization can be deleted; attempting to delete a base OpenAI model fails. The operation is immediate and cannot be undone; any inference requests referencing the deleted model will return an error afterwards.

Example

oResponse := oAPI.DeleteFineTuneModel('ft:gpt-4o-mini:acme::abc123');
if oResponse.Deleted then
  ShowMessage('Model removed');

Back to Methods