TokenLab

檔案與批次

檢索批次 (Retrieve Batch)

檢索批次的當前狀態、計數以及結果檔案。

GET
/v1/batches/{batch_id}

概覽

回傳批次狀態、已完成與失敗的計數,以及結果檔案的 ID。

範例

請求

cURL
curl -X GET "https://api.tokenlab.sh/v1/batches/batch_abc123" \
  -H "Authorization: Bearer sk-your-api-key"

回應範例

回應

200 OK
{
  "id": "batch_abc123",
  "object": "batch",
  "status": "completed",
  "input_file_id": "file_abc123",
  "output_file_id": "file_out123",
  "error_file_id": "file_err123",
  "request_counts": { "total": 100, "completed": 98, "failed": 2 }
}

重要欄位

request_countsobject
請求的總數、已完成數、失敗數與已取消數的計數。
output_file_idstring|null
成功結果的檔案 ID。
error_file_idstring|null
失敗結果的檔案 ID。

授權

BearerAuth
AuthorizationBearer <token>

API Key 驗證。請在 Dashboard > API > API Keys 建立或管理 API 金鑰。

位置: header

路徑參數

batch_id*string

回應

application/json

application/json