Files

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

post/v1/files/upload

Request

  • Base URL
    https://api.together.ai
  • URL
    https://api.together.ai/v1/files/upload
  • Auth
    HTTP bearer

Request body multipart/form-data

purpose'fine-tune' | 'calibration' | 'eval' | 'batch-api' required

The purpose of the file

file_namestring required

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'csv' | 'jsonl' | 'parquet'

The type of the file

filestring binary required

The content of the file being uploaded

Example request

{
  "purpose": "fine-tune",
  "file_name": "dataset.csv",
  "file_type": "jsonl"
}

Response

File uploaded successfully

idstring required

ID of the file.

object'file' required

The object type, which is always file.

created_atinteger required

The timestamp when the file was created.

filenamestring required

The name of the file as it was uploaded.

bytesinteger required

The number of bytes in the file.

purpose'fine-tune' | 'calibration' | 'eval' | 'batch-api' required

The purpose of the file

FileType'csv' | 'jsonl' | 'parquet' required

The type of the file

processing_status'PENDING' | 'QUEUED' | 'RUNNING' | 'COMPLETED' | 'FAILED' | 'INVALID_FORMAT'

Lifecycle state of a file in the validation pipeline. The typical progression is PENDING → QUEUED → RUNNING → COMPLETED / FAILED. INVALID_FORMAT is a terminal state for files whose contents failed validation in a user-correctable way.

Example response

{
  "filename": "my_file.jsonl",
  "purpose": "fine-tune",
  "FileType": "jsonl"
}

Changes