Skip to main content
POST /v1/files Upload a file for use across various endpoints.
  • Maximum file size: 200 MB
  • Minimum file size: 1 byte
  • Supported types: Any file type

Request Body

FieldTypeRequiredDescription
filefile (binary)YesThe file to upload.
purposestringYesThe intended purpose of the file. Must be one of: batch, batch_output, fine-tune, vision, user_data, evals.
expires_afterinteger (seconds)NoExpiration time in seconds. If provided, the file will be automatically deleted after this duration.

Example Request

curl -X POST https://api.gravixlayer.com/v1/files \
  -H "Authorization: Bearer $GRAVIXLAYER_API_KEY" \
  -F "file=@/path/to/your/file.jsonl" \
  -F "purpose=fine-tune" \
  -F "expires_after=86400"

Response

{
  "file_name": "Test_POST.pdf",
  "message": "file uploaded",
  "purpose": "fine-tune"
}