Sample - OpenAI API
GET/files/{file_id}

Retrieve a file

Retrieves information about a specific uploaded file. Use file_id to identify the file whose metadata you want to inspect.

  • RetriesRetries up to 2×, 500ms backoff, 30s timeout.

1 parameter
file_idstringrequired
The identifier of the file to retrieve.

1 status code
200Returns the file object, including its identifier, size, creation time, filename, purpose, and status.
idstringrequired
The file identifier, which can be referenced in the API endpoints.
bytesintegerrequired
The size of the file, in bytes.
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.
filenamestringrequired
The name of the file.
objectstringrequired
The object type, which is always `file`.
Allowed: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`.
Allowed:assistantsassistants_outputbatchbatch_outputfine-tunefine-tune-resultsvisionuser_data
statusstringdeprecatedrequired
Deprecated. The current status of the file, which can be either `uploaded`, `processed`, or `error`.
Allowed:uploadedprocessederror
status_detailsstringdeprecatedoptional
Deprecated. For details on why a fine-tuning training file failed validation, see the `error` field on `fine_tuning.job`.

Error handling

file_id must identify the file to retrieve. Provide the file identifier rather than the filename.