Files & Batches
Retrieve Batch
Retrieves the current status, counts, and result files for a batch.
Overview
Return the batch status, completed and failed counts, and result file IDs.
Request
curl -X GET "https://api.tokenlab.sh/v1/batches/batch_abc123" \
-H "Authorization: Bearer sk-your-api-key"Response
{
"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 }
}Important fields
request_countsobject
Counts of total, completed, failed, and cancelled requests.
output_file_idstring|null
Successful result file ID.
error_file_idstring|null
Failed result file ID.
Authorization
BearerAuth AuthorizationBearer <token>
API Key authentication. Create or manage API keys in Dashboard > API > API Keys.
In: header
Path Parameters
batch_id*string
Response
application/json
application/json