> ## Documentation Index
> Fetch the complete documentation index at: https://docs.tokenlab.sh/llms.txt
> Use this file to discover all available pages before exploring further.

# 列出批次

> 列出當前 API 金鑰組織的批次作業。

## 概述

此端點是 TokenLab 的 OpenAI 相容批次 API 的一部分。批次作業使用上傳的 JSONL 檔案，異步運行，並可以稍後返回輸出/錯誤檔案。

## 注意事項

* 批次輸入檔案必須使用 `purpose=batch`。
* `completion_window` 目前為 `24h`。
* 輸出順序不保證；始終根據 `custom_id` 匹配。
* 批次項目內不支援串流。

## 範例

<RequestExample>
  ```bash cURL theme={null}
  curl -X GET "https://api.tokenlab.sh/v1/batches?limit=20" \
    -H "Authorization: Bearer sk-your-api-key"
  ```
</RequestExample>

## 請求 / 回應

使用上方的互動式 OpenAPI 面板以獲取確切的架構。

## 操作提示

* 使用 `custom_id` 進行冪等的下游對帳。
* 只有在工作者完成批次後，才會期待 `output_file_id` 和 `error_file_id`。
* 批次定價可能與同步定價不同，因為適用 `isBatchRequest=true` 的折扣規則。

## 回應範例

<ResponseExample>
  ```json 200 OK theme={null}
  {
    "object": "list",
    "data": [{ "id": "batch_abc123", "object": "batch", "status": "completed" }]
  }
  ```
</ResponseExample>

## 重要欄位

<ResponseField name="object" type="string">回應物件類型。</ResponseField>
<ResponseField name="data" type="array">本次回應返回的列表或載荷。</ResponseField>
<ResponseField name="status" type="string">該資源目前的生命週期狀態。</ResponseField>
