A 5xx on a Sume paid submit never proves no job: retry with the key
On Sume, only a validation, authorization or balance error proves a paid create was refused. A 5xx does not, so retry with the same Idempotency-Key.

On Sume, a failed paid create proves the work was refused only when the error names a validation, authorization or balance reason. A 5xx never does. Treat a 5xx on a submit as unknown, and retry with the same Idempotency-Key, so the retry adopts whatever the first call created instead of paying for it twice.
What each failure tells you
This is the rule in the OpenAPI text for the Idempotency-Key header, plus the status classes the SDK treats as retryable.
| Response | Job created? | Next step |
|---|---|---|
400 validation | No | Fix the request |
401 or 403 | No | Fix the key or scope |
402 balance | No | Add funds, then submit |
429 | No (rate limited) | Wait retry-after, resend with the same key |
5xx or no response | Unknown | Resend with the same key |
The same key on the retry
The first call may have created a job before the error. With the key, the second call returns that job with idempotency_hit: true. Without a key, you may pay twice. The payload must stay the same, or you get 409 idempotency_conflict.
curl -X POST https://api.sume.com/v1/image-1.0/generate \
-H "Authorization: Bearer $SUME_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: hero-shot-2026-10-06-001" \
-d '{"prompt":"Product hero shot of a matte black bottle on marble","mode":"async"}'
# Got a 502 or a timeout? Run the exact same command again.In the SDK
createSumeClient retries 408, 429 and 5xx, and transport failures, but replays a POST only when it carries an Idempotency-Key.
Sources
Related posts
More in Developers
- sume/auto 400 unsupported_capability: 11 s, 2 s, 480p and silent audio
sume/auto fails closed on 2 s, 11 s, 480p, 768p and generate_audio false. The request is rejected before any provider call. Here is what to send instead.
- AI video client timeout: the Sume job still runs and still bills
A timeout on your HTTP client does not cancel a Sume job. Save the job id, poll the polling_url, and cancel only before generation starts. Python example.
- Sume mode webhook without a webhook_url: no delivery is armed
On a Sume Format run, communication.mode is descriptive; only a webhook_url arms delivery. Send the URL, then keep status_url as your backup.
- Sume idempotency: JSON key order is ignored, array order is not
Resending a Sume job with the same fields in a different JSON key order still returns the original job. Changing an array's order or a value gives a 409.
Written by Sume