409 idempotency_conflict vs idempotency_key_in_use: which one to retry
Both are 409s on a Sume Format run create. idempotency_key_in_use is a concurrent duplicate you resend; idempotency_conflict is a changed body you must fix.

Retry 409 idempotency_key_in_use and do not retry 409 idempotency_conflict. In Sume's docs the first means another request with the same key is still in flight, and the docs mark it retryable: true. The second means you reused a key with a different body, and nothing ran.
This follows the Sume Create a run and Format API errors docs, read 2026-09-29. The two codes are documented for Format run creates; the job submit table in Generation admission lists idempotency_conflict as well.
What does each 409 mean and what do I do?
| Code | Cause | Client action |
|---|---|---|
idempotency_conflict | That Idempotency-Key was already used with a different body | Fix your key derivation; do not retry as is |
idempotency_key_in_use | Another request with the same key is in flight | Wait about a second and resend |
What happens on each replay?
The create call documents four replay cases. A body counts as different even when only the instruction or the attachment list changed.
| Replay | Result |
|---|---|
| Same key, same body | 200 with the original receipt and idempotency_hit: true; no second run, no second charge |
| Same key, different body | 409 idempotency_conflict; nothing runs |
| Same key, two requests at the same moment | One wins; the other gets 409 idempotency_key_in_use |
Same key after a create that failed (402, 503) | The key was released; fix the cause and retry with the same key |
Why do I get idempotency_conflict on a retry?
Almost always because the key or the body is not stable. The docs say to derive the key from the thing being made, such as your order id plus a version you bump on purpose, and not from the moment of asking. A uuidgen per request makes the header decorative, and a body that embeds a timestamp or a reordered field list changes on every attempt.
Two more rules from the same pages: keys are scoped to one Format, so the same key sent to two Formats starts two runs, and a key is up to 255 characters.
How do I retry the in-use case?
Wait about a second, then resend the identical request. Once the first request has finished you receive the original run back as the 200 replay. Do not switch to a new key: that would start a second run.
for attempt in 1 2 3; do
code=$(curl -sS -o resp.json -w "%{http_code}" \
-X POST "https://api.sume.com/v1/formats/acme/live-commerce/runs" \
-H "Authorization: Bearer $SUME_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: order-8823-lc-v1" \
-d @body.json)
[ "$code" != "409" ] && break
grep -q idempotency_key_in_use resp.json || break
sleep 1
done
cat resp.jsonWhat about retrying a run that failed?
That is a different question. The errors page says to retry a failed run with a new Idempotency-Key, because the old one is bound to the receipt you already hold. When the failure left clips behind, it points you to continuing the run instead of starting a fresh one.
Sources
Related posts
More in Developers
- Ideogram character reference API: what Sume passes through
Ideogram's API has character reference. Sume lists ideogram/ideogram-v3 with input_references, low, medium, high quality; no character reference is documented.
- Image API provider.only and provider.order: which slug works?
Sume's image API takes provider.only and provider.order but lists one endpoint per model, slug sume. Which routing fields do anything, and the 400 for the rest.
- Image generation API streaming: partial images on Sume
Sume's image API does not stream partial images yet: stream true returns 400 streaming_not_supported. Submit async, read events, or use a webhook.
- image_not_fetchable error: what it means and how to fix it
image_not_fetchable means Sume could not fetch or mirror your input image. Check it is a public HTTPS image URL, then retry or send the request id to support.
Written by Sume