TsgcHTTP_API_OpenAI › Methods › RetrieveFileContent
Downloads the raw content of a file previously uploaded to OpenAI
function RetrieveFileContent(const aFileId: string): string;
| Name | Type | Description |
|---|---|---|
aFileId | const string | Identifier of the file whose content should be returned |
Raw file content as returned by the server (string)
Calls the GET /v1/files/{file_id}/content endpoint and returns the file bytes. This is typically used to fetch the output of a batch or fine-tuning job that wrote results to a file. Note that access to the content endpoint depends on the file's purpose; some purposes (such as fine-tune training inputs) are not downloadable.
vContent := oAPI.RetrieveFileContent('file-abc123');
Memo1.Lines.Text := vContent;