文件与批处理
列出批处理任务
列出当前工作区的批处理任务。
概览
返回当前工作区通过 POST /v1/batches 创建的批处理任务,默认按最新优先。Message Batches 请用列出 Message Batches。
查询参数
limitintegerquery默认值:
20返回的任务数量,1 到 100。
afterstringquery
批处理 ID 游标:返回该任务之后的任务。使用上一页的
last_id。不能与 before 同时使用。beforestringquery
批处理 ID 游标:返回该任务之前的任务。不能与
after 同时使用。orderstringquery默认值:
descasc 或 desc,按创建时间排序。请求
curl -X GET "https://api.tokenlab.sh/v1/batches?limit=20" \
-H "Authorization: Bearer sk-your-api-key"响应
{
"object": "list",
"data": [{ "id": "batch_abc123", "object": "batch", "status": "completed" }],
"first_id": "batch_abc123",
"last_id": "batch_abc123",
"has_more": false
}重要字段
objectstring
固定为
list。dataarray
批处理任务列表。
statusstring
每个批处理任务的状态。
has_moreboolean
has_more 为 true 时还有后续结果。授权
BearerAuth AuthorizationBearer <token>
API Key 身份验证。在 Dashboard > API > API Keys 中创建或管理 API Key。
位置: header
查询参数
limit?integer
返回的批处理数量。默认 20。
范围
1 <= value <= 100默认值
20after?string
批处理 ID 游标:返回此 ID 之后的批处理。不能与 before 组合使用。
before?string
批处理 ID 游标:返回此 ID 之前的批处理。不能与 after 组合使用。
order?string
按创建时间排序。
默认值
"desc"可选值
- "asc"
- "desc"
响应
application/json
application/json
application/json