Upload File
openai_upload_fileUpload a local file to OpenAI for assistants, batch, fine-tune, vision, user_data, or evals, and get a file ID to attach to vector stores.
Instructions
Upload a local file to OpenAI.
The file is uploaded using multipart/form-data. Once uploaded, you can attach the returned file ID to a vector store using openai_attach_file_to_vector_store.
Supported purposes:
assistants: Used in the Assistants API
batch: Used in the Batch API
fine-tune: Used for fine-tuning
vision: Images for vision fine-tuning
user_data: Flexible file type for any purpose
evals: Used for eval data sets
Individual files can be up to 512 MB.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| file_path | Yes | Absolute or relative path to the local file to upload. | |
| purpose | Yes | The intended purpose of the uploaded file. |