Skip to main content
GET
/
v1
/
batches
from openai import OpenAI
client = OpenAI()

batches = client.batches.list(limit=10)
for batch in batches:
    print(batch.id, batch.status)
{
  "object": "list",
  "data": [
    {
      "id": "batch_abc123",
      "object": "batch",
      "endpoint": "/v1/chat/completions",
      "status": "completed",
      "created_at": 1711073447
    },
    {
      "id": "batch_abc124",
      "object": "batch",
      "endpoint": "/v1/embeddings",
      "status": "in_progress",
      "created_at": 1711073450
    }
  ],
  "has_more": false
}
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 batch_foo, your subsequent call can include after=batch_foo in order to fetch the next page of the list.
limit
integer
default:"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.
from openai import OpenAI
client = OpenAI()

batches = client.batches.list(limit=10)
for batch in batches:
    print(batch.id, batch.status)
{
  "object": "list",
  "data": [
    {
      "id": "batch_abc123",
      "object": "batch",
      "endpoint": "/v1/chat/completions",
      "status": "completed",
      "created_at": 1711073447
    },
    {
      "id": "batch_abc124",
      "object": "batch",
      "endpoint": "/v1/embeddings",
      "status": "in_progress",
      "created_at": 1711073450
    }
  ],
  "has_more": false
}

Build docs developers (and LLMs) love