上传 batch 输入文件

POST/v1/files

上传将用于 POST /v1/batches 的 JSONL 输入文件。须设置 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.

Example: "batch"

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

请求

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

响应

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.

此页面对您有帮助吗?