GET /api/v1/forward/batches/{batch_id}
Returns the full batch object, including the current task counters and, once terminal, the output file IDs.
Headers
| Header | Required | Description |
|---|---|---|
Authorization | Yes | Bearer <PAT or SAT> |
Path parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
batch_id | string | Yes | Batch ID. |
Example request
Example response
HTTP 200 OK
Response fields
| Field | Type | Description |
|---|---|---|
id | string | Batch ID with prefix batch_. |
object | string | Always batch. |
status | string | Batch status. |
input_file_id | string | Input JSONL file ID. |
output_file_id | string | Result file ID for successful lines. Omitted before generation. |
error_file_id | string | Result file ID for failed lines. Omitted when there are no failed lines. |
completion_window | string | Completion window. |
created_at | string | Creation time, RFC 3339. |
expires_at | string | Expiration time. |
request_counts | object | Aggregate task counters. |
usage | object/null | Current aggregate usage for persisted subtasks. null when no valid usage is available. A non-terminal batch returns the current partial aggregate; a terminal batch returns the final aggregate. |
usage.total_credits | number | Sum of the final or current CAS Session total_credits for all subtasks. The unit is CAS Credit, not tokens or currency. Explicit zero values are preserved. |
metadata | object | Caller-supplied metadata. |
error_message | string | Batch-level error description. Present only when status is failed. |
Error codes
| HTTP | Type | Code | Trigger |
|---|---|---|---|
| 404 | not_found_error | batch_not_found | Batch does not exist or belongs to another user. |
| 401 | authentication_error | authentication_required | PAT is invalid or expired. |
Notes
- Cross-user access returns
404 batch_not_found. - Clients should poll this endpoint to observe the batch reaching a terminal state (
completed,failed,cancelled, orexpired).