---
title: "Create a new batch for processing multiple API requests."
method: POST
path: "/v1/batches"
tags: ["Batches"]
---

# Create a new batch for processing multiple API requests.

`POST /v1/batches`

Create a new batch for processing multiple API requests.

## Request body

- CreateBatchRequest — Request model for creating a batch.
  - `input_file_id` string, required — The ID of an uploaded file containing requests for the batch.
  - `endpoint` string, required — The endpoint to be used for all requests in the batch.
  - `completion_window` '24h', required — The time window within which the batch should be processed.
  - `metadata` object, nullable — Optional metadata for the batch.
  - `idempotency_key` string, nullable — Optional idempotency key. When provided, enables idempotent behavior.

## Response `200`

The created batch object.

- Batch
  - `id` string, required
  - `completion_window` string, required
  - `created_at` integer, required
  - `endpoint` string, required
  - `input_file_id` string, required
  - `object` 'batch', required
  - `status` 'validating' | 'failed' | 'in_progress' | 'finalizing' | 'completed' | 'expired' | 'cancelling' | 'cancelled', required
  - `cancelled_at` integer, nullable
  - `cancelling_at` integer, nullable
  - `completed_at` integer, nullable
  - `error_file_id` string, nullable
  - `errors` Errors
    - `data` BatchError[], nullable
      - `code` string, nullable
      - `line` integer, nullable
      - `message` string, nullable
      - `param` string, nullable
    - `object` string, nullable
  - `expired_at` integer, nullable
  - `expires_at` integer, nullable
  - `failed_at` integer, nullable
  - `finalizing_at` integer, nullable
  - `in_progress_at` integer, nullable
  - `metadata` object, nullable
  - `model` string, nullable
  - `output_file_id` string, nullable
  - `request_counts` BatchRequestCounts — The request counts for different statuses within the batch.
    - `completed` integer, required
    - `failed` integer, required
    - `total` integer, required
  - `usage` BatchUsage — Represents token usage details including input tokens, output tokens, a breakdown of output tokens, and the total tokens used. Only populated on batches created after September 7, 2025.
    - `input_tokens` integer, required
    - `input_tokens_details` InputTokensDetails, required — A detailed breakdown of the input tokens.
      - `cached_tokens` integer, required
    - `output_tokens` integer, required
    - `output_tokens_details` OutputTokensDetails, required — A detailed breakdown of the output tokens.
      - `reasoning_tokens` integer, required
    - `total_tokens` integer, required

## Other responses

- `400` — The request was invalid or malformed
- `409` — Conflict: The idempotency key was previously used with different parameters.
- `429` — The client has sent too many requests in a given amount of time
- `500` — The server encountered an unexpected error
- `default` — An error occurred

---

[API](https://skmtc.net/ogx-ai/apis/ogx-specification-stable-experimental-apis.md) · [All operations](https://skmtc.net/ogx-ai/apis/ogx-specification-stable-experimental-apis/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/ogx-ai/ogx-specification-stable-experimental-apis/versions/f3f783962256/schema)
