One identifier represents one approved request
The idempotency record is not a reusable session name or a permanent user ID. Reusing a string such as image-request for every submission will collide. Conversely, silently changing the identifier to suppress a conflict can spend again when your app accidentally altered the saved task during recovery. Compare normalized values, including omitted versus defaulted settings and the approved ceiling, while keeping credentials out of diagnostics.
What to do next
- 01
Compare saved and current bodies
Inspect the approved payload fields, including max_credits, after your application's normalization. Remove secrets from diagnostics, but retain enough data to identify which field changed.
- 02
Classify the user action
A timeout retry should restore the saved original body. An intentional revision should receive a fresh quote and approval rather than altering the durable record behind an existing identifier.
- 03
Assign a new task only deliberately
Create a new internal record and unique identifier for a new generation. Keep a link to the previous attempt so the user can distinguish revision spending from technical recovery.
A concrete example
Illustrative conflict: a client retries an image job with the same identifier but changes size from 1K to 4K. The service refuses the mismatch instead of silently upgrading the existing task. Quote and approve the 4K request separately.
409 conflict decision
| Difference found | Interpretation | Action |
|---|---|---|
| Retry body accidentally changed | Recovery bug, not user-approved new work | Restore the saved original and original identifier |
| User intentionally revised size, prompt or other input | A distinct intended task | Obtain the new quote/approval and assign a new identity |
| No understood difference | Unresolved conflict | Retain safe request evidence; stop random-suffix retries |
Before you call it ready
- Each identifier has one immutable request body.
- Creative revision and network recovery use different paths.
- Conflicts are investigated before another charge.
When to stop or choose another method
Do not append random suffixes automatically whenever a 409 appears. Determine whether the original request should be recovered or the user truly approved a new attempt.
