GET
/files/{file_id}Retrieve file metadata
Retrieves metadata for a specific uploaded file. Use file_id to identify the file whose purpose, size, status, and timestamps you need.
file_idstringrequired
The unique identifier of the file to retrieve.
200Returns the file object, including its ID, filename, size, purpose, status, and timestamps.
idstringrequired
The file identifier, which can be referenced in the API endpoints.
bytesintegerrequired
The size of the file, in bytes. In a completed file upload response, this can
be null when the file size is not yet available.
created_atintegerrequired
The Unix timestamp (in seconds) for when the file was created.
expires_atintegeroptional
The Unix timestamp (in seconds) for when the file will expire. In a
completed file upload response, this can be null when no expiry is set.
filenamestringrequired
The name of the file.
objectstringrequired
The object type, which is always `file`.
purposestringrequired
The intended purpose of the file. Supported values are `assistants`, `assistants_output`, `batch`, `batch_output`, `fine-tune`, `fine-tune-results`, `vision`, and `user_data`.
statusstringdeprecatedrequired
Deprecated. The current status of the file, which can be either `uploaded`, `processed`, or `error`.
status_detailsstringdeprecatedoptional
Deprecated. For details on why a fine-tuning training file failed validation, see the `error` field on `fine_tuning.job`. Completed file upload responses can return null when these details are unset.
404Returned when the file is not found.
errorobjectrequired
429Returned when too many file requests are made; reduce the request rate and try again later.
errorobjectrequired
Error handling
A 404 is returned when the file identified by the file_id path parameter is not found. A 429 is returned when too many file requests are made.