AI Help

How do I retry only failed requests from an AI Batch API job?

Build the retry set from failed or unresolved custom_ids after reconciling all output and error files.

Steps to follow

  1. Store the original input map and classify every submitted ID as succeeded, failed or unresolved.
  2. Inspect each failure's code and fix permanent input problems before retrying. Create a new batch containing only eligible unfinished requests.
  3. Keep the original business ID and attempt history and reconcile any downstream effects before applying retry results.

Example in practice

Illustrative example. A 1,000-item job with 980 successes creates a retry batch for the eligible failed items instead of resubmitting all 1,000.

Related AI help

Official guidance

OpenAI documentation