Skip to main content
POST
Create a batch
Create a batch job from a JSONL file you already uploaded.
  1. Upload input JSONL on Upload file or via Quickstart (purpose=batch).
  2. Paste the returned file-… id into input_file_id below.
  3. Set endpoint to /v1/chat/completions (must match every line in your JSONL).
Full reference: Batches API.

Authorizations

x-api-key
string
header
required

Headers

x-project-id
string

Optional project identifier. Scopes the request to a specific project when provided.

Body

application/json
input_file_id
string
required

ID from POST /v1/files with purpose=batch.

endpoint
enum<string>
default:/v1/chat/completions
required

Must match the url on every JSONL line.

Available options:
/v1/chat/completions
completion_window
enum<string>
default:24h
Available options:
24h
metadata
object

Optional tags echoed back on retrieve.

Response

Batch accepted

id
string
object
enum<string>
Available options:
batch
endpoint
string
status
enum<string>
Available options:
validating,
in_progress,
finalizing,
completed,
failed,
expired,
cancelling,
cancelled
input_file_id
string
output_file_id
string | null
error_file_id
string | null
completion_window
string
created_at
integer
expires_at
integer
request_counts
object
metadata
object