Create a batch
Create a batch from an uploaded input file. Requests are processed asynchronously within the completion window. Each line bills at its model’s list price less the model’s batch_discount_pct (0 when the model runs batch at list price). Only batch-eligible models may be used (check batch_supported on /v1/models). A line of the input file that names a url or a method must name the batch endpoint and POST. An /v1/embeddings line can set encoding_format to base64, as on the real-time endpoint. The window is 24h, and the batch expires at expires_at if it has not finished.
When the batch ends, output_file_id holds the requests that succeeded and error_file_id the ones that did not; download them with GET /v1/files/{file_id}/content. An input file past its expires_at returns 404 with the code file_expired; upload it again.
Authentication
Pass your EmpirioLabs API key as a bearer token. The Anthropic-style
x-api-key header is also accepted on every endpoint.
Request
API path every line of the file calls, for example /v1/chat/completions.
Time window for the batch to finish. Only 24h is accepted.
Your own labels for the batch: up to 16 pairs, each key up to 64 characters and each value a string of up to 512 characters. Anything else returns 400 with param metadata.
Response
Why the batch failed, when status is failed, for example input_file_unavailable when the input file could no longer be read. Null otherwise.
completed counts the lines of the output file and failed the lines of the error file.
