Retrieve batch
/v1/batches/{batch_id}Retrieve the current state of a batch job, including request_counts and output/error file IDs when available.
Poll until status is a terminal state: completed, failed, expired, or cancelled.
Authentication
Authorization Bearer
Path Parameters
batch_idstringrequiredBatch ID returned by POST /v1/batches.
Response
idstringBatch ID.
objectstringbatch
endpointstring/v1/chat/completions
statusenum<string>input_file_idstringInput file ID.
output_file_idstringOutput JSONL file when completed.
error_file_idstringError JSONL file when present.
request_countsobjectrequest_counts.totalintegerrequest_counts.completedintegerrequest_counts.failedintegercreated_atintegerUnix timestamp.
in_progress_atintegerUnix timestamp when upstream started.
completed_atintegerUnix timestamp when completed.
failed_atintegerUnix timestamp when failed.
expired_atintegerUnix timestamp when expired.
cancelled_atintegerUnix timestamp when cancelled.
expires_atintegerUnix timestamp deadline.
metadataobjectStored metadata.
errorsobjectValidation or platform errors when failed.
errors.messagestringHuman-readable error message.
errors.codestringMachine-readable error code.
errors.typestringError category when returned.
errors.stagestringProcessing stage where the error occurred.
errors.upstream_http_statusintegerProvider HTTP status when the error came from upstream.
errors.upstream_messagestringProvider error message when available.
Polling guidance
- Non-terminal: poll every 30–60 seconds, or use webhooks.
completed: downloadoutput_file_id(anderror_file_idif set).failed/expired: inspecterrorsand error file.