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.

Headers

Idempotency-Key
string

Unique key for this create; a repeat returns the original batch

Maximum string length: 200

Body

application/json
input_file_id
string
required

Id of a file uploaded with purpose=batch

endpoint
enum<string>
required

Endpoint every line in the input file targets

Available options:
/v1/responses
completion_window
enum<string>

Target completion time; 24h is the only value and the default

Available options:
24h
metadata
object | null

Up to 16 key value pairs; keys up to 64 characters, values up to 512

Response

The created batch

id
string
required
object
enum<string>
required
Available options:
batch
endpoint
string
required
input_file_id
string
required
completion_window
string
required
status
enum<string>
required
Available options:
validating,
in_progress,
finalizing,
completed,
expired,
cancelling,
cancelled,
failed
created_at
integer<int64>
required

Unix seconds

request_counts
object
required
usage
object
required
errors
object | null
output_file_id
string | null
error_file_id
string | null
in_progress_at
integer<int64> | null
expires_at
integer<int64> | null
finalizing_at
integer<int64> | null
completed_at
integer<int64> | null
failed_at
integer<int64> | null
expired_at
integer<int64> | null
cancelling_at
integer<int64> | null
cancelled_at
integer<int64> | null
metadata
object | null