v1

latestOpenAPI 3.0.2MIT2026-07-24141061.6 KB
Batch

Create batch

Creates and executes a batch.

post/batches

Request body

endpointstring required

The endpoint to be used for all requests in the batch. The supported endpoints are: <code>v1/embeddings</code>, <code>v1/contextualizedembeddings</code>, and <code>v1/rerank</code>.

input_file_idstring required

The ID of file that contains requests for the new batch. See the Files API for how to list existing files or upload a new file. Your input file must be formatted as a JSONL file, and must be uploaded with the purpose batch.

completion_windowstring required

The time frame within which the batch should be processed. Currently only <code>12h</code> is supported.

metadataobject

Optional set of 16 key-value pairs that can be useful for storing additional metadata about the batch in a structured format. Keys can be a maximum of 64 characters long and values can be a maximum of 512 characters long.

Response

Success. The created Batch object.

idstring

The batch identifier.

objectstring

The object type, which is always batch.

endpointstring

The endpoint used by the batch.

input_file_idstring

The ID of the input file for the batch.

completion_windowstring

The time frame within which the batch should be processed.

modelstring

The model used by the endpoint.

statusstring

The current status of the batch.

output_file_idstring

The ID of the file containing the outputs of successfully executed requests.

error_file_idstring

The ID of the file containing the outputs of requests with errors.

metadataobject

Set of key-value pairs attached to batch. This can be useful for storing additional information about the batch in a structured format.

created_atstring

RFC 3339 datetime string for when the batch was created.

in_progress_atstring

RFC 3339 datetime string for when the batch started processing.

finalizing_atstring

RFC 3339 datetime string for when the batch started finalizing.

completed_atstring

RFC 3339 datetime string for when the batch was completed.

failed_atstring

RFC 3339 datetime string for when the batch failed.

expected_completion_atstring

RFC 3339 datetime string for when the batch is expected to complete.

cancelling_atstring

RFC 3339 datetime string for when the batch started canceling.

cancelled_atstring

RFC 3339 datetime string for when the batch was canceled.