Skip to main content
POST
Create a batch

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
input_file_id
string
required

The ID of an uploaded purpose: batch JSONL file holding the requests.

endpoint
enum<string>
required

The API endpoint every request in the batch targets. Must match the url on each line.

Available options:
/v1/chat/completions,
/v1/responses
completion_window
enum<string>
required

Pass 24h, the OpenAI-compatible value. Valar schedules the batch against its own promised SLAs.

Available options:
24h
metadata
object

Optional key-value metadata stored on the batch, echoed back on every read.

Response

The batch was created and is validating.

id
string
required

The batch's unique ID.

object
enum<string>
required
Available options:
batch
endpoint
enum<string>
required

The API endpoint every request in the batch targets.

Available options:
/v1/chat/completions,
/v1/responses
input_file_id
string
required

The uploaded JSONL file the batch was created from.

completion_window
string
required

The completion window the batch was submitted with. 24h is the OpenAI-compatible value; Valar processes batches against its own promised SLAs.

status
enum<string>
required

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.

Available options:
validating,
in_progress,
finalizing,
completed,
failed,
expired
request_counts
object
required
created_at
integer
required

When the batch was created, as a Unix timestamp.

output_file_id
string

Once the batch completes, the file holding one JSONL result line per request. Download it with Get file content.

error_file_id
string

When any line failed, the file holding one JSONL error line per failed request - validation rejections included. Absent when every request succeeded.

metadata
object

The metadata you attached at create time, if any.