TsgcHTTP_API_OpenAIMethods › RetrieveFileContent

RetrieveFileContent Method

Downloads the raw content of a file previously uploaded to OpenAI

Syntax

function RetrieveFileContent(const aFileId: string): string;

Parameters

NameTypeDescription
aFileIdconst stringIdentifier of the file whose content should be returned

Return Value

Raw file content as returned by the server (string)

Remarks

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.

Example

vContent := oAPI.RetrieveFileContent('file-abc123');
Memo1.Lines.Text := vContent;

Back to Methods