OpenAI

Retrieve file

Return details of a single file.

Upload a file first, then replace the example file ID with its returned ID.

GET /openai/v1/files/{file_id}● Supported

Official OpenAI docs ↗

Request parameters

  • file_idstring必填

    path: The ID of the file to use for this request.

Returns

200 file

Errors follow the OpenAI format — see error codes

Response

HTTP 200

OK

application/json

NameTypeDescription
idstringThe file identifier, which can be referenced in the API endpoints.
bytesintegerThe size of the file, in bytes.
created_atintegerThe Unix timestamp (in seconds) for when the file was created.
expires_atintegerThe Unix timestamp (in seconds) for when the file will expire.
filenamestringThe name of the file.
objectstringThe object type, which is always `file`.
purposestringThe intended purpose of the file. Supported values are `assistants`, `assistants_output`, `batch`, `batch_output`, `fine-tune`, `fine-tune-results`, `vision`, and `user_data`.
statusstringDeprecated. The current status of the file, which can be either `uploaded`, `processed`, or `error`.
status_detailsstringDeprecated. For details on why a fine-tuning training file failed validation, see the `error` field on `fine_tuning.job`.