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

# Create a batch

`POST /v1/batches`

Submit a batch from an uploaded JSONL input file. Returns immediately with `status: in_progress`.

## Headers

- `x-project-id` string

## Request body

- CreateBatchRequest
  - `input_file_id` string, required — ID from `POST /v1/files` with `purpose=batch`.
  - `endpoint` '/v1/chat/completions', required — Must match the `url` on every JSONL line.
  - `completion_window` '24h'
  - `metadata` object — Optional tags echoed back on retrieve.

## Response `200`

Batch accepted

- Batch
  - `id` string
  - `object` 'batch'
  - `endpoint` string
  - `status` 'validating' | 'in_progress' | 'finalizing' | 'completed' | 'failed' | 'expired' | 'cancelling' | 'cancelled'
  - `input_file_id` string
  - `output_file_id` string, nullable
  - `error_file_id` string, nullable
  - `completion_window` string
  - `created_at` integer
  - `expires_at` integer
  - `request_counts` object
    - `total` integer
    - `completed` integer
    - `failed` integer
  - `metadata` object

## Other responses

- `400` — Invalid request or JSONL validation failed
- `401` — Missing authentication headers
- `403` — Invalid credentials
- `404` — Input file not found
- `429` — Insufficient quota
- `500` — Internal server error

---

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