Create batch
Submit a batch of requests that run asynchronously on one model at batch rates.
Authentication
AuthorizationBearer
Your production key sent as a bearer token.
Request
This endpoint expects an object.
endpoint
Request shape of every line: /v1/chat/completions, /v1/embeddings, /v1/messages, or /v1/responses.
model
Model every line runs on.
requests
Batch lines, each with a unique custom_id.
metadata
Your metadata, echoed back unchanged.
provider
Vendor restrictions for the batch, for example {"only": ["anthropic"]}.
Response
The created batch.
id
Batch ID.
endpoint
Request shape of the batch lines.
model
Model the batch runs on.
status
One of validating, in_progress, finalizing, cancelling, completed, failed, expired, or cancelled.
request_counts
Line counts by outcome.
created_at
Unix timestamp in seconds.
expires_at
Unix timestamp in seconds after which an unfinished batch expires.
object
completed_at
Unix timestamp in seconds when the batch finished.
usage
Aggregate usage and cost, once known.
metadata
Metadata you sent at creation.
Errors
422
Unprocessable Entity Error