v4

latestOpenAPI 3.1.02026-07-31155218294.8 KB
Files & Batches

Create Openai Batch

post/v1/batches

Headers

xi-api-keystring nullable
x-api-keystring nullable

Request body

input_file_idstring required

The ID of an uploaded file that contains requests for the new batch.

endpoint'/v1/chat/completions' | '/v1/completions' | '/v1/embeddings' required

The endpoint to be used for all requests in the batch. Currently /v1/chat/completions, /v1/completions, /v1/embeddings are supported.

completion_window'24h' required

The time frame within which the batch should be processed. Currently only 24h is supported.

metadataobject nullable

Optional metadata to be stored with the batch.

Response

Successful Response

idstring required

The batch ID.

object'batch'

The object type, which is always batch.

endpointstring required

The API endpoint used for the batch.

input_file_idstring required

The ID of the input file for the batch.

completion_windowstring required

The time frame within which the batch should be processed.

statusstring required

The current status of the batch.

output_file_idstring nullable

The ID of the output file.

error_file_idstring nullable

The ID of the error file.

created_atinteger required

The Unix timestamp of when the batch was created.

in_progress_atinteger nullable

The Unix timestamp of when the batch started processing.

expires_atinteger required

The Unix timestamp of when the batch will expire.

finalizing_atinteger nullable

The Unix timestamp of when the batch started finalizing.

completed_atinteger nullable

The Unix timestamp of when the batch completed.

failed_atinteger nullable

The Unix timestamp of when the batch failed.

expired_atinteger nullable

The Unix timestamp of when the batch expired.

cancelling_atinteger nullable

The Unix timestamp of when the batch started cancelling.

cancelled_atinteger nullable

The Unix timestamp of when the batch was cancelled.

metadataobject nullable

Metadata associated with the batch.

modelstring nullable

The model used for the batch.