Upload a file
POST/v1/files
Upload a file as multipart/form-data, then name it by file_id in a request. user_data takes PDF, text, Markdown, CSV, JSON and images, up to 50 MB; vision takes images, up to 50 MB; batch takes a .jsonl file up to 200 MB. Files are visible only to the user who uploaded them.
Request
Responses
- 200
- 400
- 401
- 404
- 413
- 422
- 503
The uploaded file.
An invalid parameter (invalid_value), an unsupported type (unsupported_file_type), or a batch input that is not a .jsonl file (invalid_file).
Missing or invalid Authorization: Bearer mdb_… (invalid_credentials).
No file with this id, or it has expired or belongs to someone else (file_not_found).
Larger than the purpose's limit (file_too_large).
Validation Error
The Files API is unavailable (files_api_unavailable).