I would like to report a critical gap in the OpenAI API batch documentation and behavior that affects the reliability of automated systems managing batch processing.
Observed behavior
- Until a few months ago, the
POST /v1/batches
endpoint would return abatch_object
including theoutput_file_id
(if the batch was valid and successfully accepted). - As of now, this is no longer the case:
- The creation response includes only the batch
id
(e.g."id": "batch_xyz123"
). - The
output_file_id
, or any indication of a failure, is not included in the initial response. - Any error (e.g. invalid input format, token over-limit) is not returned in the POST response.
- The only way to determine whether the batch was accepted, rejected, failed, or validated is to explicitly query the batch again using
GET /v1/batches/{id}
.
Why this is problematic
- The official documentation does not explain this required follow-up step.
- This creates confusion and breaks systems expecting either:
- An immediate
output_file_id
on successful creation - An error in the POST response when the batch is invalid
- An immediate
- Without polling
GET /v1/batches/{id}
, there is no way to:- Detect validation errors
- Know if the batch failed to start
- Obtain the
error_file_id
to inspect what went wrong
Expected behavior or documentation fix
One of the following should be done:
- The
POST /v1/batches
response should immediately reflect the true status of the batch (even if just âvalidatingâ with a reference to future errors), or - The documentation should explicitly state that:
- The
output_file_id
will not be present in the creation response - The batch must be polled with
GET /v1/batches/{id}
to detect completion or failure - The
error_file_id
is only retrievable via this second query
Tested conditions
- Multiple batches submitted with invalid JSONL (or excessive tokens)
- Files manually deleted during validation phase
POST
always succeeds with a new batchid
, but the batch silently fails, only visible after polling
Conclusion
This undocumented behavior may lead to misleading assumptions and failure to capture critical errors in batch processing automation. Clarifying this in the documentation (and ideally improving the POST
response) would significantly enhance developer experience and reliability.
Sergio Bonfiglio