Upload File
POST
Upload File
Upload a file that can be used for batch processing, assistants, or fine-tuning purposes.
file
required
The file to upload. Must be a valid file object.
string
required
The intended purpose of the uploaded file. Must be one of:
batch- For batch processing (requires JSONL format)assistants- For use with assistantsfine-tune- For fine-tuning models
File Requirements
- Maximum file size: 100MB
- For
batchpurpose: File must be in valid JSONL format - Supported content types:
text/jsonland others depending on purpose
Returns
string
A unique identifier for the uploaded file (e.g.,
file-abc123).string
The object type, which is always
file.integer
The size of the file in bytes.
integer
The Unix timestamp (in seconds) of when the file was created.
string
The name of the uploaded file.
string
The purpose of the file as specified during upload.
string
The current status of the file. Will be
uploaded for newly uploaded files.string or null
Additional details about the file status, if any.
Return Examples
Response 200
Error 400 - Missing File
Error 400 - Invalid Purpose
Error 400 - File Too Large
Last modified on December 7, 2025
Upload File