GET /api/v1/forward/batches/{batch_id}/tasks
Batch 内の各タスクのステータス、結果概要、エラー、成果物、使用量をページ単位で取得します。Batch がどの状態でも呼び出せます。現在の PAT ユーザーが所有する Batch のサブタスクのみを返します。
Headers
| Header | Required | Description |
|---|---|---|
Authorization | Yes | Bearer <PAT または SAT> |
Path parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
batch_id | string | Yes | Batch ID。 |
Query parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
status | string | No | - | タスクステータスで絞り込みます:pending、running、completed、failed、cancelled、expired。 |
custom_id | string | No | - | 呼び出し元が指定したタスク識別子による完全一致フィルター。単一値のみをサポートし、一致しない場合は空のリストを返します。 |
limit | integer | No | 20 | ページサイズ。最大 100。 |
after_id | string | No | - | 次ページのカーソル。前ページのレスポンスの last_id を渡します。カーソルは現在の Batch に属している必要があります。 |
Example request
Example response
HTTP 200 OK
Response fields
| Field | Type | Description |
|---|---|---|
object | string | 常に list。 |
data | array | 現在のページに含まれる Batch Task オブジェクト。 |
data[].custom_id | string | 呼び出し元が指定したタスク識別子。現在のバージョンでは公開ページネーションカーソルとしても使用します。 |
data[].status | string | タスクステータス。Batch の request_counts の明細ステータスと同じ定義です。 |
data[].started_at | string | 永続化された最終実行試行の開始時刻(RFC 3339 UTC)。未開始の場合は省略されます。 |
data[].completed_at | string | タスク完了時刻(RFC 3339 UTC)。未完了の場合は省略されます。 |
data[].output_summary | string | 最終レスポンステキスト。最大 500 Unicode 文字。結果がない場合は省略されます。 |
data[].error | object | failed タスクにのみ返され、code と message を含みます。 |
data[].artifacts | array | 配信済みの成果物。成果物がない場合は空配列を返します。 |
data[].usage | object | 最終または現在の CAS Session の使用量。CAS が有効な使用量を返していない場合は省略されます。 |
data[].usage.total_credits | number | CAS Session の累積 Credit 消費量。token 数や金額ではありません。明示的なゼロ値は保持されます。 |
first_id | string | 現在のページの最初のタスクの custom_id。 |
last_id | string | 現在のページの最後のタスクの custom_id。 |
has_more | boolean | さらにタスクがあるかどうか。 |
usage は最終または現在の Session のみを表し、置き換えられた過去の Session 使用量は加算されません。
Error codes
| HTTP | Type | Code | Trigger |
|---|---|---|---|
| 400 | invalid_request_error | invalid_request | status、limit、または after_id が不正です。 |
| 404 | not_found_error | batch_not_found | Batch が存在しない、他のユーザーに属している、または結果ファイルの 30 日間のクリーンアップが完了しています。 |
| 401 | authentication_error | authentication_required | PAT または SAT が無効または期限切れです。 |
Notes
has_more=trueの場合は、last_idをそのまま次のリクエストのafter_idとして渡します。- 成果物のダウンロードには Files API を再利用します。Batch 専用の成果物ダウンロードエンドポイントはありません。

