A queue you can resume
Create one request JSON per image using the runnable examples. For edits, upload each reference once and store its input asset ID in that file. Use the Python queue below withagent_client.py in the same directory:
Recover partial failures
A retryable HTTP error is not proof that a job failed. Keep uncertainty separate from terminal failure. Never rerun an entire group with fresh keys because one item failed.