---
title: "Retrieve a batch"
method: GET
path: "/api/v1/batches/{batch_id}"
tags: ["openAiBatch"]
---

# Retrieve a batch

`GET /api/v1/batches/{batch_id}`

Retrieve an OpenAI-compatible batch job by ID.

## Path parameters

- `batch_id` string, required

## Query parameters

- `provider_id` string, required

## Headers

- `Authorization` string, required
- `X-Data-Respan-Params` string

## Response `200`

Batch details.

- OpenAIBatchRetrieveBatchResponse200
  - `id` string, required — Batch ID.
  - `object` string
  - `endpoint` string
  - `input_file_id` string
  - `output_file_id` string, nullable — Output file ID, available when the batch completes.
  - `error_file_id` string, nullable — Error file ID, when provider errors are available.
  - `completion_window` string
  - `status` 'validating' | 'pending' | 'in_progress' | 'finalizing' | 'completed' | 'failed' | 'expired' | 'cancelling' | 'cancelled', required
  - `created_at` integer — Unix timestamp.
  - `in_progress_at` integer, nullable
  - `expires_at` integer, nullable
  - `finalizing_at` integer, nullable
  - `completed_at` integer, nullable
  - `failed_at` integer, nullable
  - `expired_at` integer, nullable
  - `cancelling_at` integer, nullable
  - `cancelled_at` integer, nullable
  - `request_counts` ApiV1BatchesBatchIdGetResponsesContentApplicationJsonSchemaRequestCounts
    - `total` integer
    - `completed` integer
    - `failed` integer
  - `metadata` object
  - `errors` unknown

## Other responses

- `401` — Unauthorized - Missing or invalid authentication
- `404` — Not Found

---

[API](https://skmtc.net/keywordsai/apis/api-reference.md) · [All operations](https://skmtc.net/keywordsai/apis/api-reference/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/keywordsai/api-reference/revisions/4e064cf81dae/schema)
