Skip to main content
Batches

Get Batch Details

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

HeaderRequiredDescription
AuthorizationYesBearer <PAT or SAT>

Path parameters

ParameterTypeRequiredDescription
batch_idstringYesBatch ID.

Example request

curl -s -X GET 'https://api.qoder.com.cn/api/v1/forward/batches/batch_completed001' \
  -H "Authorization: Bearer $QODER_ACCESS_TOKEN"

Example response

HTTP 200 OK
{
  "id": "batch_completed001",
  "object": "batch",
  "status": "completed",
  "input_file_id": "file_input001",
  "output_file_id": "file_output001",
  "completion_window": "24h",
  "created_at": "2026-07-07T07:25:01Z",
  "expires_at": "2026-07-08T07:25:01Z",
  "request_counts": {
    "total": 30,
    "pending": 0,
    "running": 0,
    "completed": 30,
    "failed": 0,
    "cancelled": 0,
    "expired": 0
  },
  "usage": {
    "total_credits": 5.28
  }
}

Response fields

FieldTypeDescription
idstringBatch ID with prefix batch_.
objectstringAlways batch.
statusstringBatch status.
input_file_idstringInput JSONL file ID.
output_file_idstringResult file ID for successful lines. Omitted before generation.
error_file_idstringResult file ID for failed lines. Omitted when there are no failed lines.
completion_windowstringCompletion window.
created_atstringCreation time, RFC 3339.
expires_atstringExpiration time.
request_countsobjectAggregate task counters.
usageobject/nullCurrent 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_creditsnumberSum 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.
metadataobjectCaller-supplied metadata.
error_messagestringBatch-level error description. Present only when status is failed.

Error codes

HTTPTypeCodeTrigger
404not_found_errorbatch_not_foundBatch does not exist or belongs to another user.
401authentication_errorauthentication_requiredPAT 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, or expired).