Get a batch's output
/v1/batches/{id}/outputGet a batch's output.
Downloads the results file of a batch (application/octet-stream, JSONL: one line per request). A batch with no output file yet is a 409 naming its status. With a virtual key, only batches that key created are reachable; any other batch id is a 404.
Authenticate with a BYOK virtual key or with x-provider and x-api-key; a PLATFORM virtual key is a 400. OpenAI credentials only; any other provider is a 422. Without x-retry-count a failed call is retried up to 3 times on 429 and 5xx.
Authorization
AuthorizationBearer <slug>.<secret>A virtual key's API key (
vk-....<secret>), asAuthorization: Bearer. What the OpenAI SDK sends from itsapi_key. Used by the inference endpoints.- or
x-virtual-keyheaderA virtual key's API key in the
x-virtual-keyheader, for clients that keepAuthorizationfor something else. - or
x-api-keyheaderDirect credentials: the provider's own API key in
x-api-key, with the provider named inx-provider(for exampleopenai). On/v1/messagesa virtual key is accepted inx-api-keytoo, which is what the Claude SDK sends.
Path parameters
idstringrequiredthe provider's batch id, for example
batch_...
Headers
x-providerstringWith direct credentials: the provider
x-api-keybelongs to, for exampleopenaioranthropic(case and dashes are normalised). Not used with a virtual key.x-retry-countinteger<int32>How many times to retry a failed provider call, 0 to 5. Without the header, chat completions, Claude Messages and prompt completions do not retry, and the other endpoints retry up to 3 times. Retries back off exponentially from 1 second and honour a numeric
Retry-After. The number made is in thex-retry-countresponse header.x-retry-status-codesstringComma-separated provider status codes to retry on. Default
429,500,502,503,504,529.
Responses
The batch's output file: one JSON result per line.
string<binary>