PRODUCTION SCENARIO
A data engineering team submits 6,500 product-manual translations with the Message Batches API and gets back a batch object with an ID and a processing_status of in_progress.
How should the pipeline collect the translations?
Answering here is anonymous. Nothing is saved unless you sign in.
Show answer and explanation
Answer: Poll the batch until processing_status is ended, then stream the results_url JSONL
processing_status starts at in_progress and moves to ended once every request has finished, at which point results_url points at a JSONL file the client streams back. Holding the create connection open reads nothing, because batches process asynchronously and the call returns immediately. custom_id matches a result line to its request inside that file; it is not addressable on the Messages API. The batch object carries results_url, null until the end, and never inlines the results themselves.