Skip to content

Create a Batch

POST/v1/batches

Overview

Run every request in an uploaded file within 24 hours.

Routing and provider details

Requires llm.write and a funded workspace. Also available under /api/v1. A file holds at most 10,000 requests of up to 1 MB each, all for one endpoint, each naming one model: routers, fallback models, plugins, web search and streaming are refused.

Each request is its own funded request with its own hold, run as the key that created the batch. Chat Completions requests for OpenAI, Gemini and Anthropic models with a reviewed batch price run as provider batches and are charged at that provider's batch price (half the standard price); every other request runs like a live call at its normal price. Usage and cost appear on each result. A batch whose requests could not all be held at once is refused with 402 before anything runs. Requests a provider errors, cancels or expires are not charged.

Refused under zero data retention: a batch stores its requests and results.

Authorization

Authorizationstring · headerRequired

AudioLab API key sent as Bearer <token>. Authentication guide

Request Body

application/json
input_file_idstringRequired
endpointstringRequired

Values: "/v1/chat/completions""/v1/responses""/v1/messages""/v1/embeddings"

completion_windowstringRequired
metadataobject

Responses

200The batch, in progress.
application/json
idstringRequired

Example: "batch_abc123"

objectstringRequired
endpointstringRequired
errorsnull
input_file_idstringRequired
completion_windowstringRequired
statusstringRequired

Values: "in_progress""finalizing""completed""expired""cancelling""cancelled"

output_file_idstring | null
error_file_idstring | null
created_atintegerRequired
in_progress_atinteger | null
expires_atinteger | null
finalizing_atinteger | null
completed_atinteger | null
failed_atnull
expired_atinteger | null
cancelling_atinteger | null
cancelled_atinteger | null
request_countsobjectRequired
Show nested fields
totalintegerRequired
completedintegerRequired
failedintegerRequired
metadataobject | null
400Invalid file line, named with its line number, or an unsupported model or endpoint.
401Invalid API key.
402The workspace or key cannot hold every request at once.
403Missing llm.write scope, or zero data retention is on.
404Input file not found.