read a batch
batches_getRetrieve a sync batch by ID to check its status, metrics, output URL, and per-item results; poll until completion to follow a batch you created.
Instructions
Read one sync. batch by id: its status, metrics and outputUrl, and once it is COMPLETED or FAILED, one results row per item (requestId, generation status, generationId, and outputMediaUrl or error). Use it to follow a batch you created; to find a batch id or check which batches are running use batches_list, and for one item's full generation details pass its generationId to generations_get.
With wait: true it polls for up to about 50 seconds until the batch finishes, sending progress notifications when the client asks for them. Reading a finished batch's result file can add up to 30 seconds more. Batches can take hours, so call again while it runs and never create the batch again.
results: failed keeps only FAILED or REJECTED rows, and none skips reading the file. If the file cannot be read (for example too large or too slow), resultsError says why and the batch fields are still current; download outputUrl or find the generations with generations_list instead.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | The batch id batches_create or batches_list returned. | |
| wait | No | Poll until the batch is COMPLETED or FAILED or about 50 seconds pass, then return its latest state; reading a finished batch's result file can take up to 30 seconds more. If it is still running, call again with wait: true instead of sleeping. | |
| results | No | Once the batch finishes, which result rows to return: all (default), failed (FAILED or REJECTED only) or none. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||