List batch

GEThttps:/api.openai.com/v1/batches

List your organization's batches.

Query parameters

  • after
    string

    A cursor for use in pagination. after is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list.

  • limit
    integer
    Defaults: 20
    A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.

Response

A list of paginated Batch objects.

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