SiliconFlow
API手册

获取batch任务列表

列出您组织的批量任务。

GET
/batches
AuthorizationBearer <token>required

添加 Header 'Authorization: Bearer {账户 API Key}' 进行鉴权

In: header

Query Parameters

limitinteger

返回对象数量的限制。

Range1 <= value
afterstring

分页使用的游标。after 是一个对象 ID,用于定义您在列表中的位置。例如,如果您发起列表请求并收到 100 个对象,最后一个为 obj_foo,则后续调用可以包含 after=obj_foo 以获取列表的下一页。

Response Body

成功响应

TypeScript Definitions

Use the response body type in TypeScript.

objectstring
Example"list"
dataarray<object>
first_idstring
Example"first_batch_id"
last_idstring
Example"last_batch_id"
has_moreboolean

curl --request GET \
  --url https://api.siliconflow.cn/v1/batches \
  --header 'Authorization: Bearer <token>'
import requests

url = "https://api.siliconflow.cn/v1/batches"

headers = {"Authorization": "Bearer <token>"}

response = requests.request("GET", url, headers=headers)

print(response.text)
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

fetch('https://api.siliconflow.cn/v1/batches', options)
  .then(response => response.json())
  .then(response => console.log(response))
  .catch(err => console.error(err));     
{
  "object": "list",
  "data": [
    {
      "id": "batch_id",
      "object": "batch",
      "endpoint": "/v1/chat/completions",
      "errors": null,
      "input_file_id": "file-id",
      "completion_window": "24h",
      "status": "in_queue",
      "output_file_id": null,
      "error_file_id": null,
      "created_at": 1749023566,
      "in_progress_at": null,
      "expires_at": 1749109966,
      "finalizing_at": null,
      "completed_at": null,
      "failed_at": null,
      "expired_at": null,
      "cancelling_at": null,
      "cancelled_at": null,
      "request_counts": null,
      "metadata": {
        "batch_description": "",
        "name": "batch"
      },
      "file_name": "requests_name.json"
    }
  ],
  "first_id": "first_batch_id",
  "last_id": "last_batch_id",
  "has_more": false
}
{
  "code": 20012,
  "message": "string",
  "data": "string"
}
"Invalid token"
"Forbidden"
"404 page not found"
{
  "code": 50505,
  "message": "Model service overloaded. Please try again later.",
  "data": "string"
}
"string"
获取batch任务列表