---
title: "List batches, newest first"
method: GET
path: "/v1/batches"
tags: ["Batches"]
---

# List batches, newest first

`GET /v1/batches`

## Query parameters

- `limit` integer
- `after` string

## Response `200`

OK

- BatchList — One page of batches, newest first (OpenAI list envelope).
  - `data` BatchObject[], required
    - `cancelled_at` integer
    - `completed_at` integer
    - `completion_window` '24h', required
    - `created_at` integer, required — Unix timestamp (seconds).
    - `endpoint` string, required — The API family every record in the batch calls.
    - `error_file_id` string — Present once results are written; fetch its content for failed records.
    - `expired_at` integer
    - `expires_at` integer — When the completion window closes (created_at + 24h).
    - `failed_at` integer
    - `id` string, required — Batch id (batch_…).
    - `input_file_id` string, required
    - `metadata` object — Your key-value pairs, echoed back unchanged.
    - `model` string — Model id, settled from the input file during validation.
    - `object` 'batch', required
    - `output_file_id` string — Present once results are written; fetch its content for successful records.
    - `request_counts` BatchRequestCounts, required — Progress counters, settled as the batch validates and shards complete.
      - `completed` integer, required
      - `failed` integer, required
      - `total` integer, required
    - `status` 'validating' | 'in_progress' | 'finalizing' | 'completed' | 'failed' | 'expired' | 'cancelling' | 'cancelled', required — Lifecycle state. validating → in_progress → finalizing → completed | failed | expired; cancelling → cancelled.
    - `usage` BatchUsage — Rolled-up token and cost totals, present once any progress is recorded. cost_nano_usd is the price you pay (batch discount applied), in nano-USD so sub-cent batches stay exact.
      - `cost_nano_usd` integer, required
      - `input_tokens` integer, required
      - `output_tokens` integer, required
  - `first_id` string — Id of the first batch on this page.
  - `has_more` boolean, required
  - `last_id` string — Id of the last batch on this page; pass it as `after` to fetch the next page.
  - `object` 'list', required

## Other responses

- `400` — The request is invalid
- `401` — Missing or invalid API key
- `404` — Not found (also returned when the organization does not have Batch API access)

---

[API](https://skmtc.net/openrelay/apis/openrelay-api.md) · [All operations](https://skmtc.net/openrelay/apis/openrelay-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/openrelay/openrelay-api/versions/32905b8f44f8/schema)
