YBX.

Products · · 简体中文

OpenAI Batch API expired: which requests should you retry?

Recover completed results by custom_id before preparing a retry file. The batch status alone cannot tell you which individual outputs you already paid for.

Reconcile the files by ID

A batch can expire at the end of its completion window with some requests already complete. OpenAI returns the completed work and charges for it. Read the output and error files referenced by the batch when present. Match records to the original JSONL via custom_id: output order can differ from input order.

A four-row recovery example

Suppose the manifest contains A, B, C and D. The output file lists D then A as successful. B has an expiration error and C has an invalid-input error. Store A and D, requeue B, and repair C before resubmitting it. Replaying all four would ask for two successful operations twice. This is a worked example, without a paid API run.

Make a partial retry traceable

Keep the original batch ID and business record key alongside each custom_id. Mark a row delivered only after its response has been stored. If an ID appears in neither file, check that you fetched the final files for the correct batch before deciding to requeue it. Use the recovered IDs to build a smaller second batch.

Sources

Related reading