列出 batch

GET/v1/batches

列出当前用户的 batch 作业,按创建时间倒序。支持通过 after 游标分页。

Authentication

Authorization Bearer

Query Parameters

limitinteger

Maximum items to return (default 20, max 100).

afterstring

Cursor: batch ID from a previous page (last_id).

Response

objectstring

list

dataarray

Array of batch objects (same shape as GET /v1/batches/{id}).

data.idstring

Batch ID.

data.objectstring

Always batch.

data.endpointstring

Target endpoint for batch requests.

data.statusstring

Batch status.

data.input_file_idstring

Uploaded input JSONL file ID.

data.output_file_idstring | null

Output file ID when available.

data.error_file_idstring | null

Error file ID when available.

data.request_countsobject

Request counts when available.

data.errorsobject | null

Validation or platform errors when failed.

has_moreboolean

Whether more pages exist.

first_idstring

First batch ID in this page.

last_idstring

Last batch ID; pass as after for next page.

请求

1curl "https://api.token360.ai/v1/batches?limit=20" \
2  -H "Authorization: Bearer sk-your-api-key"

响应

JSON
1{
2  "object": "list",
3  "data": [
4    {
5      "id": "batch_01abc",
6      "object": "batch",
7      "endpoint": "/v1/chat/completions",
8      "status": "completed",
9      "execution": "platform",
10      "execution_preference": "platform",
11      "input_file_id": "file_abc123",
12      "output_file_id": "file_output_xyz",
13      "error_file_id": null,
14      "completion_window": "24h",
15      "request_counts": {
16        "total": 2,
17        "completed": 2,
18        "failed": 0
19      },
20      "usage_billing": {
21        "status": "recorded"
22      },
23      "created_at": 1710000000,
24      "expires_at": 1710086400,
25      "metadata": {
26        "job": "nightly"
27      }
28    }
29  ],
30  "has_more": false,
31  "first_id": "batch_01abc",
32  "last_id": "batch_01abc"
33}
此页面对您有帮助吗?