Create Batch
POST
Create Batch
Save 50% on Batch Processing
Batch API offers 50% cost savings compared to standard API calls. Perfect for processing large volumes of requests asynchronously.
string
required
The ID of an uploaded file that contains the requests for this batch. The file must be uploaded with
purpose="batch" and be in valid JSONL format.string
required
The endpoint to be used for all requests in the batch. Currently supported endpoints:
/v1/chat/completions- For chat completion requests/v1/embeddings- For embedding generation/v1/responses- For response generation
string
default:"24h"
The time frame within which the batch should be processed. Currently only
24h is supported.object
Optional custom metadata for the batch. Can contain any key-value pairs for tracking purposes.
Returns
string
A unique identifier for the batch job (e.g.,
batch-abc123).string
The object type, which is always
batch.string
The API endpoint that will be used for all requests in the batch.
object or null
Any errors encountered during batch processing. Will be
null if no errors.string
The ID of the input file containing batch requests.
string
The time window for batch completion.
string
The current status of the batch. Possible values:
validating- The input file is being validatedin_progress- The batch is being processedfinalizing- The batch is being finalizedcompleted- The batch has completed successfullyfailed- The batch has failedexpired- The batch has expiredcanceled- The batch was canceled
string or null
The ID of the file containing successful batch results. Available when status is
completed.string or null
The ID of the file containing failed requests. Available when there are errors.
integer
The Unix timestamp (in seconds) of when the batch was created.
integer or null
The Unix timestamp when the batch started processing.
integer
The Unix timestamp when the batch will expire.
integer or null
The Unix timestamp when the batch started finalizing.
integer or null
The Unix timestamp when the batch completed.
integer or null
The Unix timestamp when the batch failed.
integer or null
The Unix timestamp when the batch expired.
integer or null
The Unix timestamp when cancellation was initiated.
integer or null
The Unix timestamp when the batch was cancelled.
object
Statistics about the requests in the batch.
object
Custom metadata associated with the batch.
Last modified on December 7, 2025
Create Batch