Retrieve batch

GEThttps:/api.openai.com/v1/batches/{batch_id}

Retrieves a batch.

Path parameters

  • batch_id
    string
    Required
    The ID of the batch to retrieve.

Response

The Batch object matching the specified ID.

Example request
1
curl https://api.openai.com/v1/batches/batch_abc123 \
2
-H "Authorization: Bearer $OPENAI_API_KEY" \
3
-H "Content-Type: application/json" \
Example response
1
{
2
"id": "batch_abc123",
3
"object": "batch",
4
"endpoint": "/v1/completions",
5
"errors": null,
6
"input_file_id": "file-abc123",
7
"completion_window": "24h",
8
"status": "completed",
9
"output_file_id": "file-cvaTdG",
10
"error_file_id": "file-HOWS94",
11
"created_at": 1711471533,
12
"in_progress_at": 1711471538,
13
"expires_at": 1711557933,
14
"finalizing_at": 1711493133,
15
"completed_at": 1711493163,
16
"failed_at": null,
17
"expired_at": null,
18
"cancelling_at": null,
19
"cancelled_at": null,
20
"request_counts": {
21
"total": 100,
22
"completed": 95,
23
"failed": 5
24
},
25
"metadata": {
26
"customer_id": "user_123456789",
27
"batch_description": "Nightly eval job",
28
}
29
}
Built with