TsgcHTTP_API_Anthropic › Methods › DeleteFile
Deletes a previously uploaded file from the Anthropic Files API
function DeleteFile(const aFileId: string) : TsgcAnthropicClass_Response_File_Deleted;
| Name | Type | Description |
|---|---|---|
aFileId | const string | Identifier of the file to delete, as returned by UploadFile or ListFiles. |
Response confirming the deletion with the file Id and Deleted flag (TsgcAnthropicClass_Response_File_Deleted)
Sends a DELETE /v1/files/{file_id} request to the Anthropic Files API. Once deleted the file id can no longer be referenced from new messages, although existing message histories that already included the file content are unaffected. The anthropic-version header from AnthropicOptions is included automatically. The returned object must be freed by the caller.
oResponse := oAPI.DeleteFile('file_01ABCxyz');
try
if oResponse.Deleted then ShowMessage('file removed');
finally
oResponse.Free;
end;