TsgcHTTP_API_OpenAI › Methods › ListFiles
Lists all files previously uploaded to the authenticated OpenAI organization
function ListFiles: TsgcOpenAIClass_Response_Files;
Collection of file metadata records with id, size, purpose and creation timestamp (TsgcOpenAIClass_Response_Files)
Calls the GET /v1/files endpoint and returns every file available to the current API key. Each entry exposes the file id used by the assistants, batch, fine-tuning and vision endpoints. Use this method to locate existing uploads before referencing them in downstream requests.
oResponse := oAPI.ListFiles;
for i := 0 to oResponse.Data.Count - 1 do
Memo1.Lines.Add(oResponse.Data[i].Id + ' - ' + oResponse.Data[i].Filename);