TsgcHTTP_API_OpenAI › Methods › RetrieveFile
Retrieves metadata for a single file previously uploaded to OpenAI
function RetrieveFile(const aFileId: string): TsgcOpenAIClass_Response_File;
| Name | Type | Description |
|---|---|---|
aFileId | const string | Identifier of the file, typically starting with "file-" |
File metadata record with id, filename, size, purpose and timestamps (TsgcOpenAIClass_Response_File)
Calls the GET /v1/files/{file_id} endpoint. Returns descriptive information about a file but not its binary content; use RetrieveFileContent to download the bytes. Common use cases include verifying that an upload succeeded and inspecting a file's purpose before referencing it.
oResponse := oAPI.RetrieveFile('file-abc123');
ShowMessage(Format('%s (%d bytes, purpose=%s)',
[oResponse.Filename, oResponse.Bytes, oResponse.Purpose]));