v27

latestOpenAPI 3.1.0raw.githubusercontent.com2026-07-2193427579.9 KB
Files

Upload file

Upload a file.

post/v1/files

Response

The uploaded file.

object'file'

The object type, which is always 'file'.

idstring required

The file identifier, which can be referenced in the API endpoints.

bytesinteger required

The size of the file, in bytes.

created_atinteger required

The Unix timestamp (in seconds) for when the file was created.

expires_atinteger

The Unix timestamp (in seconds) for when the file will expire.

filenamestring required

The name of the file.

purpose'assistants' | 'assistants_output' | 'batch' | 'batch_output' | 'evals' | 'fine-tune' | 'fine-tune-results' | 'vision' | 'user_data' required

Valid purpose values on the OpenAI File response object.

status'uploaded' | 'processed' | 'error' required

Deprecated. The current status of the file.

status_detailsstring

Deprecated. For details on why a fine-tuning training file failed validation, see the error field on fine_tuning.job.