Create a Batch
/v1/batchesOverview
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.
Request Body
input_file_idstringRequiredendpointstringRequiredValues: "/v1/chat/completions""/v1/responses""/v1/messages""/v1/embeddings"
completion_windowstringRequiredmetadataobjectResponses
200The batch, in progress.
idstringRequiredExample: "batch_abc123"
objectstringRequiredendpointstringRequirederrorsnullinput_file_idstringRequiredcompletion_windowstringRequiredstatusstringRequiredValues: "in_progress""finalizing""completed""expired""cancelling""cancelled"
output_file_idstring | nullerror_file_idstring | nullcreated_atintegerRequiredin_progress_atinteger | nullexpires_atinteger | nullfinalizing_atinteger | nullcompleted_atinteger | nullfailed_atnullexpired_atinteger | nullcancelling_atinteger | nullcancelled_atinteger | nullrequest_countsobjectRequiredShow nested fields
totalintegerRequiredcompletedintegerRequiredfailedintegerRequiredmetadataobject | null