ListFiles

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
using var api = GetAuthenticatedClient();

int count = 0;

ListFilesResponse files = await api.Files.ListFilesAsync(purpose: CreateFileRequestPurpose.Assistants.ToValueString());
foreach (OpenAIFile file in files.Data)
{
    Console.WriteLine($"[{count,3}] {file.Id} {file.CreatedAt:s} {file.Filename}");

    count++;

    //_ = await api.Files.DeleteFileAsync(file.Id);
}