Skip to main content
GET
/
v1
/
batches
curl "https://gateway.bud.studio/v1/batches?limit=20" \
  -H "Authorization: Bearer YOUR_API_KEY"
{
  "object": "list",
  "data": [
    {
      "id": "batch_abc123",
      "object": "batch",
      "endpoint": "/v1/chat/completions",
      "status": "completed",
      "input_file_id": "file-abc123",
      "output_file_id": "file-xyz789",
      "created_at": 1699123456,
      "completed_at": 1699130000,
      "request_counts": {
        "total": 100,
        "completed": 98,
        "failed": 2
      }
    },
    {
      "id": "batch_def456",
      "object": "batch",
      "endpoint": "/v1/embeddings",
      "status": "in_progress",
      "input_file_id": "file-def456",
      "output_file_id": null,
      "created_at": 1699140000,
      "request_counts": {
        "total": 500,
        "completed": 250,
        "failed": 0
      }
    }
  ],
  "first_id": "batch_abc123",
  "last_id": "batch_def456",
  "has_more": true
}
curl "https://gateway.bud.studio/v1/batches?limit=20" \
  -H "Authorization: Bearer YOUR_API_KEY"
{
  "object": "list",
  "data": [
    {
      "id": "batch_abc123",
      "object": "batch",
      "endpoint": "/v1/chat/completions",
      "status": "completed",
      "input_file_id": "file-abc123",
      "output_file_id": "file-xyz789",
      "created_at": 1699123456,
      "completed_at": 1699130000,
      "request_counts": {
        "total": 100,
        "completed": 98,
        "failed": 2
      }
    },
    {
      "id": "batch_def456",
      "object": "batch",
      "endpoint": "/v1/embeddings",
      "status": "in_progress",
      "input_file_id": "file-def456",
      "output_file_id": null,
      "created_at": 1699140000,
      "request_counts": {
        "total": 500,
        "completed": 250,
        "failed": 0
      }
    }
  ],
  "first_id": "batch_abc123",
  "last_id": "batch_def456",
  "has_more": true
}

Headers

ParameterTypeRequiredDescription
AuthorizationstringYesBearer authentication header

Query Parameters

ParameterTypeRequiredDescription
afterstringNoCursor for pagination (batch ID to start after)
limitintegerNoNumber of results per page (default: 20, max: 100)

Response Fields

FieldTypeDescription
objectstringAlways "list"
dataarrayArray of batch objects
first_idstringID of the first batch in the list
last_idstringID of the last batch in the list
has_morebooleanWhether more results are available

Pagination Example

import requests

API_KEY = "YOUR_API_KEY"
BASE_URL = "https://gateway.bud.studio"

all_batches = []
after = None

while True:
    params = {"limit": 100}
    if after:
        params["after"] = after

    response = requests.get(
        f"{BASE_URL}/v1/batches",
        headers={"Authorization": f"Bearer {API_KEY}"},
        params=params
    )
    result = response.json()

    all_batches.extend(result["data"])

    if not result["has_more"]:
        break

    after = result["last_id"]

print(f"Total batches: {len(all_batches)}")
For complete Batch API documentation including file upload, JSONL format, and usage examples, see Create Batch.