Batches
Create Batch
POST
Creates and executes a batch from an uploaded file of requests.
Request Body
string
required
The time frame within which the batch should be processed. Currently only
24h is supported.string
required
The endpoint to be used for all requests in the batch. Currently supported:
/v1/responses/v1/chat/completions/v1/embeddings/v1/completions/v1/moderations/v1/images/generations/v1/images/edits
/v1/embeddings batches are restricted to a maximum of 50,000 embedding inputs.string
required
The ID of an uploaded file that contains requests for the new batch.Your input file must be:
- Formatted as a JSONL file
- Uploaded with the purpose
batch - Up to 50,000 requests
- Up to 200 MB in size
object
Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format.Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters.
object
The expiration policy for the output and/or error file that are generated for a batch.
Response
Returns aBatch object.
string
The batch ID.
string
The object type, always
batch.string
The OpenAI API endpoint used by the batch.
string
The ID of the input file for the batch.
string
The time frame within which the batch should be processed.
string
The current status of the batch. One of:
validatingfailedin_progressfinalizingcompletedexpiredcancellingcancelled
string
The ID of the file containing the outputs of successfully executed requests.
string
The ID of the file containing the outputs of requests with errors.
integer
The Unix timestamp (in seconds) for when the batch was created.
object
Set of 16 key-value pairs attached to the object.