---
title: "Create a batch"
method: POST
path: "/batches"
tags: ["Batches API"]
---

# Create a batch

`POST /batches`

Submit a batch of requests for asynchronous processing.

## Headers

- `Idempotency-Key` string

## Request body

- CreateBatchRequest
  - `endpoint` '/v1/responses', required — The API endpoint to use for all requests in the batch. Currently only /v1/responses is supported.
  - `requests` BatchRequestItem[], required — The list of requests in the batch. Min 1, max 100,000 requests. Total request body must not exceed 256 MB.
    - `custom_id` string, required — A unique identifier for this request within the batch. Must be lowercase alphanumeric and can include hyphens and underscores. Min 1 character, max 64 characters.
    - `params` object, required — The request parameters (same fields as a Responses API request body).
  - `label` string — An optional label for the batch. Must be alphanumeric (hyphens and underscores allowed), max 128 characters.

## Response `200`

Batch created.

- object
  - `id` string, required — Unique identifier for the batch.
  - `request_counts` integer, required — Total number of requests in the batch.
  - `created_at` integer, required — Unix timestamp of when the batch was created.
  - `label` string — The label for the batch, if provided.

## Other responses

- `400` — Invalid request.
- `401` — Authentication error.
- `500` — Server error.

---

[API](https://skmtc.dev/sailresearch/apis/sail-api.md) · [All operations](https://skmtc.dev/sailresearch/apis/sail-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/sailresearch/sail-api/revisions/c2a783d507f9/schema)
