Upload batch input file

POST/v1/files

Upload a JSONL file that will be used as the input for POST /v1/batches. Set purpose=batch.

Authentication

Authorization Bearer

Request Body

multipart/form-data

filefilerequired

JSONL file. Max 200 MB. Extension must be .jsonl when purpose=batch.

purposestringrequired

Must be batch for batch input files.

asset_groupstring

Optional storage group. Console uploads often use library.

ttl_secondsinteger

Optional time-to-live for the stored file.

Response

idstring

File ID. Pass as input_file_id when creating a batch.

objectstring

file

bytesinteger

File size in bytes.

created_atinteger

Unix timestamp.

filenamestring

Original filename.

purposestring

batch

statusstring

e.g. processed

Request

Shell
1curl https://api.token360.ai/v1/files \
2  -H "Authorization: Bearer sk-your-api-key" \
3  -F purpose=batch \
4  -F file=@requests.jsonl

Response

JSON
1{
2  "id": "file_abc123",
3  "object": "file",
4  "bytes": 2048,
5  "created_at": 1710000000,
6  "filename": "requests.jsonl",
7  "purpose": "batch",
8  "status": "processed"
9}

Next step: Create batch with input_file_id set to this id.

Was this page helpful?