GET/v1/batches/{batch_id}

Retrieve a Batch Inference Job

Returns the current state of a batch job. Poll until status reaches a terminal value (completed, failed, expired, or cancelled).

1 parameter
batch_idstringrequired
The batch job identifier.

7 status codes
200The batch job.
batch_idstringrequired
Unique identifier for the batch job.
statusstringrequired
Lifecycle status. Terminal states: `completed`, `failed`, `expired`, `cancelled`.
Allowed:validatingin_progressfinalizingcompletedfailedexpiredcancellingcancelled
providerstringrequired
Allowed:openaianthropic
endpointstringoptional
Inference endpoint each request is dispatched to.
completion_windowstringrequired
Allowed:24h
input_file_idstringrequired
The uploaded JSONL input file.
output_file_idstringoptional
Output JSONL file. Populated once the job completes.
error_file_idstringoptional
Error sidecar file. Null when no errors were produced.
request_countsobjectoptional
Aggregate request counts.
request_idstringoptional
The idempotency key supplied at creation.
metadataobjectoptional
Metadata attached at creation.
errorsarray<object>optional
Top-level errors that prevented the batch from completing.
created_atstringrequired
in_progress_atstringoptional
finalizing_atstringoptional
completed_atstringoptional
expires_atstringoptional
Derived from `created_at` plus `completion_window`.
cancelled_atstringoptional
failed_atstringoptional
401Authentication failed due to invalid credentials.
idstringrequired
A short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
messagestringrequired
A message providing additional information about the error, including details to help resolve it when possible.
request_idstringoptional
Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
403The authenticated principal does not have permission to perform this action on the requested resource.
idstringrequired
A short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
messagestringrequired
A message providing additional information about the error, including details to help resolve it when possible.
request_idstringoptional
Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
404The resource was not found.
idstringrequired
A short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
messagestringrequired
A message providing additional information about the error, including details to help resolve it when possible.
request_idstringoptional
Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
429The API rate limit has been exceeded.
idstringrequired
A short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
messagestringrequired
A message providing additional information about the error, including details to help resolve it when possible.
request_idstringoptional
Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
500There was a server error.
idstringrequired
A short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
messagestringrequired
A message providing additional information about the error, including details to help resolve it when possible.
request_idstringoptional
Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
defaultThere was an unexpected error.
idstringrequired
A short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
messagestringrequired
A message providing additional information about the error, including details to help resolve it when possible.
request_idstringoptional
Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.

Error handling

A 401 is returned: Authentication failed due to invalid credentials. A 403 is returned: The authenticated principal does not have permission to perform this action on the requested resource. A 404 is returned: The resource was not found. A 429 is returned: The API rate limit has been exceeded. A 500 is returned: There was a server error. Any other status is an error: There was an unexpected error.