Skip to content
For the complete documentation index, see llms.txt. Markdown versions of documentation pages are available by appending .md to the page URL.
Primary navigation

Files

Files are used to upload documents that can be used with features like Assistants and Fine-tuning.

Retrieve file content
$ openai files content
GET/files/{file_id}/content
Upload file
$ openai files create
POST/files
Delete file
$ openai files delete
DELETE/files/{file_id}
List files
$ openai files list
GET/files
Retrieve file
$ openai files retrieve
GET/files/{file_id}
ModelsExpand Collapse
file_content: string
file_deleted: object { id, deleted, object }
file_object: object { id, bytes, created_at, 6 more }

The File object represents a document that has been uploaded to OpenAI.

file_purpose: "assistants" or "batch" or "fine-tune" or 3 more

The intended purpose of the uploaded file. One of:

  • assistants: Used in the Assistants API
  • batch: Used in the Batch API
  • fine-tune: Used for fine-tuning
  • vision: Images used for vision fine-tuning
  • user_data: Flexible file type for any purpose
  • evals: Used for eval data sets