Batch API
Get Batch
Retrieve information about a specific batch job.
GET
/
v1
/
batches
/
{batch_id}
curl https://gateway.bud.studio/v1/batches/batch_abc123 \
-H "Authorization: Bearer YOUR_API_KEY"
{
"id": "batch_abc123",
"object": "batch",
"endpoint": "/v1/chat/completions",
"errors": null,
"input_file_id": "file-abc123",
"completion_window": "24h",
"status": "in_progress",
"output_file_id": null,
"error_file_id": null,
"created_at": 1699123456,
"in_progress_at": 1699123500,
"expires_at": 1699209856,
"finalizing_at": null,
"completed_at": null,
"failed_at": null,
"expired_at": null,
"cancelling_at": null,
"cancelled_at": null,
"request_counts": {
"total": 100,
"completed": 45,
"failed": 2
},
"metadata": {
"customer_id": "12345",
"batch_name": "product_descriptions"
}
}
curl https://gateway.bud.studio/v1/batches/batch_abc123 \
-H "Authorization: Bearer YOUR_API_KEY"
{
"id": "batch_abc123",
"object": "batch",
"endpoint": "/v1/chat/completions",
"errors": null,
"input_file_id": "file-abc123",
"completion_window": "24h",
"status": "in_progress",
"output_file_id": null,
"error_file_id": null,
"created_at": 1699123456,
"in_progress_at": 1699123500,
"expires_at": 1699209856,
"finalizing_at": null,
"completed_at": null,
"failed_at": null,
"expired_at": null,
"cancelling_at": null,
"cancelled_at": null,
"request_counts": {
"total": 100,
"completed": 45,
"failed": 2
},
"metadata": {
"customer_id": "12345",
"batch_name": "product_descriptions"
}
}
Headers
| Parameter | Type | Required | Description |
|---|---|---|---|
| Authorization | string | Yes | Bearer authentication header |
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| batch_id | string | Yes | The ID of the batch to retrieve |
Response Fields
| Field | Type | Description |
|---|---|---|
| id | string | Unique batch identifier |
| status | string | Current status: validating, failed, in_progress, finalizing, completed, expired, cancelling, cancelled |
| request_counts | object | Progress tracking with total, completed, and failed counts |
| output_file_id | string | ID of results file (available when completed) |
| error_file_id | string | ID of error file (if any errors occurred) |
Usage
Use this endpoint to monitor batch progress and retrieve output file IDs when processing completes.import requests
response = requests.get(
"https://gateway.bud.studio/v1/batches/batch_abc123",
headers={"Authorization": "Bearer YOUR_API_KEY"}
)
batch = response.json()
print(f"Status: {batch['status']}")
print(f"Progress: {batch['request_counts']['completed']}/{batch['request_counts']['total']}")
For complete Batch API documentation including file upload, JSONL format, and usage examples, see Create Batch.
⌘I
curl https://gateway.bud.studio/v1/batches/batch_abc123 \
-H "Authorization: Bearer YOUR_API_KEY"
{
"id": "batch_abc123",
"object": "batch",
"endpoint": "/v1/chat/completions",
"errors": null,
"input_file_id": "file-abc123",
"completion_window": "24h",
"status": "in_progress",
"output_file_id": null,
"error_file_id": null,
"created_at": 1699123456,
"in_progress_at": 1699123500,
"expires_at": 1699209856,
"finalizing_at": null,
"completed_at": null,
"failed_at": null,
"expired_at": null,
"cancelling_at": null,
"cancelled_at": null,
"request_counts": {
"total": 100,
"completed": 45,
"failed": 2
},
"metadata": {
"customer_id": "12345",
"batch_name": "product_descriptions"
}
}