Files

Upload a file

POST
/files/upload

Upload a file with specified purpose, file name, and file type.

Authorization

bearerAuth
AuthorizationBearer <token>

In: header

Request Body

multipart/form-data

purpose*FilePurpose

The purpose of the file

Value in

  • "fine-tune"
  • "eval"
  • "batch-api"
file_name*string

The name of the file being uploaded. Must be valid UTF-8, must not contain null characters, and must not exceed 128 bytes.

file_type?FileType

The type of the file

Default"jsonl"

Value in

  • "csv"
  • "jsonl"
  • "parquet"
file*file

The content of the file being uploaded

Formatbinary

Response Body

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/files/upload" \  -F purpose="fine-tune" \  -F file_name="string" \  -F file="string"
{  "id": "string",  "object": "file",  "created_at": 0,  "filename": "string",  "bytes": 0,  "purpose": "fine-tune",  "Processed": true,  "FileType": "csv",  "processing_status": "PENDING",  "validation_report": {    "valid": true,    "dataset_format": "string",    "dataset_has_sample_weights": true,    "dataset_has_message_weights": true,    "dataset_is_multimodal": true,    "dataset_has_tools": true,    "dataset_has_parallel_tool_calls": true,    "dataset_has_reasoning": true,    "nlines": 0,    "file_id": "string",    "error_type": "INVALID_FORMAT",    "error": "string"  }}