Create a batch
Start processing a previously uploaded JSONL file of requests. Upload the file first with Upload a file using purpose: batch. Each line of the file is one request:
{"custom_id": "req-1", "method": "POST", "url": "/v1/chat/completions", "body": {"model": "zai-org/GLM-5.2", "messages": [{"role": "user", "content": "Hello!"}]}}
A batch holds up to 10,000 requests, and each line can be up to 28 MiB — enough for a maximum-size 20 MB image, which takes about 26.7 MiB once base64-encoded. The line size is a transport limit; each request must also fit the context window of the model it names, which is a separate and often much tighter bound — read context_length from List supported models and size your requests against it. A request over the window is accepted with the file and fails when it runs. A file with more than 10,000 requests fails the whole batch after creation (status: failed). A line that fails validation is rejected on its own and counted in request_counts.failed; the rest of the batch keeps running.
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
The ID of an uploaded purpose: batch JSONL file holding the requests.
The API endpoint every request in the batch targets. Must match the url on each line.
/v1/chat/completions, /v1/responses Pass 24h, the OpenAI-compatible value. Valar schedules the batch against its own promised SLAs.
24h Optional key-value metadata stored on the batch, echoed back on every read.
Response
The batch was created and is validating.
The batch's unique ID.
batch The API endpoint every request in the batch targets.
/v1/chat/completions, /v1/responses The uploaded JSONL file the batch was created from.
The completion window the batch was submitted with. 24h is the OpenAI-compatible value; Valar processes batches against its own promised SLAs.
Where the batch currently stands. A new batch starts in validating, moves to in_progress while its requests run, and settles in a terminal state.
validating, in_progress, finalizing, completed, failed, expired When the batch was created, as a Unix timestamp.
Once the batch completes, the file holding one JSONL result line per request. Download it with Get file content.
When any line failed, the file holding one JSONL error line per failed request - validation rejections included. Absent when every request succeeded.
The metadata you attached at create time, if any.