Batches
List Batches
GET
/
v1
/
batches
from openai import OpenAI
client = OpenAI()
batches = client.batches.list(limit=10)
for batch in batches:
print(batch.id, batch.status)
import OpenAI from "openai";
const openai = new OpenAI();
const batches = await openai.batches.list({ limit: 10 });
for (const batch of batches.data) {
console.log(batch.id, batch.status);
}
curl https://api.openai.com/v1/batches?limit=10 \\
-H "Authorization: Bearer $OPENAI_API_KEY" \\
-H "Content-Type: application/json"
{
"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
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.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 paginatedBatch objects.
from openai import OpenAI
client = OpenAI()
batches = client.batches.list(limit=10)
for batch in batches:
print(batch.id, batch.status)
import OpenAI from "openai";
const openai = new OpenAI();
const batches = await openai.batches.list({ limit: 10 });
for (const batch of batches.data) {
console.log(batch.id, batch.status);
}
curl https://api.openai.com/v1/batches?limit=10 \\
-H "Authorization: Bearer $OPENAI_API_KEY" \\
-H "Content-Type: application/json"
{
"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
}
from openai import OpenAI
client = OpenAI()
batches = client.batches.list(limit=10)
for batch in batches:
print(batch.id, batch.status)
import OpenAI from "openai";
const openai = new OpenAI();
const batches = await openai.batches.list({ limit: 10 });
for (const batch of batches.data) {
console.log(batch.id, batch.status);
}
curl https://api.openai.com/v1/batches?limit=10 \\
-H "Authorization: Bearer $OPENAI_API_KEY" \\
-H "Content-Type: application/json"
{
"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
}