BATCHES

List Batches

List batches belonging to the current organization. Results are ordered by creation date descending.

GET/v1/batches

Authorization

Authorizationstringheaderrequired

Bearer token — your API key. Example: Bearer sk-...

Response

object"list"required

Object type — always "list".

dataobject[]required

Array of batch objects.

first_idstringrequired

The ID of the first batch in the list.

last_idstringrequired

The ID of the last batch in the list.

has_morebooleanrequired

Whether there are more results available.

Request

import OpenAI from "openai";

const client = new OpenAI({
  apiKey: "your-scx-api-key",
  baseURL: "https://api.scx.ai/v1",
});

const list = await client.batches.list({ limit: 20 });

for (const batch of list.data) {
  console.log(batch.id, batch.status);
}

Response

{
  "object": "list",
  "data": [
    {
      "id": "batch_abc123def456",
      "object": "batch",
      "endpoint": "/v1/chat/completions",
      "errors": null,
      "input_file_id": "file-a1b2c3d4-e5f6-7890-abcd-ef1234567890",
      "completion_window": "24h",
      "status": "completed",
      "output_file_id": "file-b2c3d4e5-f6a7-8901-bcde-f12345678901",
      "error_file_id": "file-c3d4e5f6-a7b8-9012-cdef-012345678901",
      "created_at": 1711756800,
      "in_progress_at": 1711756810,
      "expires_at": 1711843200,
      "finalizing_at": 1711760400,
      "completed_at": 1711760410,
      "failed_at": null,
      "expired_at": null,
      "cancelling_at": null,
      "cancelled_at": null,
      "request_counts": {
        "total": 100,
        "completed": 98,
        "failed": 2
      },
      "metadata": {
        "description": "evaluation run"
      }
    }
  ],
  "first_id": "batch_abc123def456",
  "last_id": "batch_abc123def456",
  "has_more": false
}