---
title: "Upload a file"
method: POST
path: "/v1/files/upload"
tags: ["Files"]
---

# Upload a file

`POST /v1/files/upload`

## Request

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

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

## Request body `multipart/form-data`

- object
  - `purpose` 'fine-tune' | 'calibration' | 'eval' | 'batch-api', required: The purpose of the file
  - `file_name` string, 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
  - `file` string, binary, required: The content of the file being uploaded

## Response `200`

File uploaded successfully

- FileResponse: Structured information describing a file uploaded to Together.
  - `id` string, required: ID of the file.
  - `object` 'file', required: The object type, which is always `file`.
  - `created_at` integer, required: The timestamp when the file was created.
  - `filename` string, required: The name of the file as it was uploaded.
  - `bytes` integer, 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.
  - `validation_report` FileValidationReport: Validation outcome for a fine-tune or calibration file, produced by the file validation pipeline.
    - `valid` boolean, required: Whether the file passed validation.
    - `dataset_format` string: Detected dataset format (e.g. `CONVERSATION`, `INSTRUCTION`).
    - `dataset_has_sample_weights` boolean: Whether the dataset carries per-sample weights.
    - `dataset_has_message_weights` boolean: Whether the dataset carries per-message weights (only possible for `CONVERSATION` format).
    - `dataset_is_multimodal` boolean: Whether the dataset contains multimodal content.
    - `dataset_has_tools` boolean: Whether the dataset contains tool-use messages.
    - `dataset_has_parallel_tool_calls` boolean: Whether the dataset contains parallel tool-use messages.
    - `dataset_has_reasoning` boolean: Whether the dataset contains reasoning content.
    - `nlines` integer: Number of lines (records) in the dataset.
    - `file_id` string: ID of the file this report describes.
    - `error_type` 'INVALID_FORMAT': Category of validation failure.
    - `error` string: Human-readable validation error message. Only present when `error_type` is set (i.e. user-correctable failures).

## Other responses

- `400`: Bad Request
- `401`: Unauthorized
- `500`: Internal Server Error

## Changes

- **2026-10-22** `bb5257b3173a`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/together/apis/together-apis/changes/v1/files/upload/post.md)

---

[API](https://skmtc.dev/together/apis/together-apis.md) - [All operations](https://skmtc.dev/together/apis/together-apis/llms.txt) - [OpenAPI document](https://skmtc.dev/together/apis/together-apis/revisions/93438ddac711?raw)
