Upload a file for use across various endpoints
.pdf, .txt, .md, .docx
Perfect for document processing and RAG.json, .jsonl, .csv
Structured data for training and batch processing.jpg, .jpeg, .png, .webp
Visual content for vision models.py, .js, .ts, .html, .css
Source code for analysis and generation| Field | Type | Required | Description |
|---|---|---|---|
file | file (binary) | Yes | The file to upload. Maximum size: 200MB. |
purpose | string | Yes | The intended purpose of the file. Must be one of: batch, batch_output, fine-tune, vision, user_data, evals. |
expires_after | integer (seconds) | No | Expiration time in seconds. If provided, the file will be automatically deleted after this duration. |
| Status Code | Error Type | Description |
|---|---|---|
400 | invalid_request_error | Invalid file format or missing required fields |
413 | file_too_large | File exceeds 200MB limit |
429 | rate_limit_exceeded | Too many upload requests |
500 | api_error | Internal server error |
API key authentication. Get your API key from the Gravix Layer Dashboard.
File uploaded successfully