TsgcHTTP_API_OpenAI › Methods › DeleteFile
Permanently deletes a file previously uploaded to OpenAI
function DeleteFile(const aFileId: string): TsgcOpenAIClass_Response_Delete;
| Name | Type | Description |
|---|---|---|
aFileId | const string | Identifier of the file to delete |
Deletion result containing the target id and a Deleted flag (TsgcOpenAIClass_Response_Delete)
Calls the DELETE /v1/files/{file_id} endpoint. Once deleted, the file can no longer be referenced by assistants, batches, fine-tuning jobs or other features. The operation is immediate and cannot be undone; consider listing and verifying the file before deleting.
oResponse := oAPI.DeleteFile('file-abc123');
if oResponse.Deleted then
ShowMessage('File ' + oResponse.Id + ' deleted');