POST
/
files
/
multipart
/
initiate
Together AI SDK (Python)
from together import Together
import os

client = Together(
    api_key=os.environ.get("TOGETHER_API_KEY"),
)

response = client.files.multipart.initiate(
    filename="large_dataset.jsonl",
    file_size=7516192768,  # 7GB
    num_parts=75,
    purpose="fine-tune",
    file_type="jsonl"
)

print(response.upload_id)
{
  "upload_id": "upload-abc123",
  "file_id": "file-def456",
  "parts": [
    {
      "PartNumber": 1,
      "URL": "https://s3.amazonaws.com/...",
      "Headers": {
        "Authorization": "Bearer token"
      }
    }
  ]
}

Authorizations

Authorization
string
header
default:default
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
filename
string
required

The name of the file being uploaded

Example:

"large_dataset.jsonl"

file_size
integer
required

Total size of the file in bytes

Example:

7516192768

num_parts
integer
required

Number of parts to split the file into (1-250)

Required range: 1 <= x <= 250
Example:

75

purpose
enum<string>
required

The purpose of the file

Available options:
fine-tune,
eval,
eval-sample,
eval-output,
eval-summary,
batch-generated,
batch-api
Example:

"fine-tune"

file_type
enum<string>
default:jsonl
required

The type of the file

Available options:
csv,
jsonl,
parquet
Example:

"jsonl"

Response

Multipart upload initiated successfully

upload_id
string
required

Unique identifier for this multipart upload session

Example:

"upload-abc123"

file_id
string
required

File ID for the upload

Example:

"file-def456"

parts
object[]
required

Presigned URLs and headers for each part