A timeout describes the connection, not the job outcome
Your client may stop waiting after the server accepted the request. Without a saved identifier, a convenient Retry button can become a second purchase. The documented Idempotency-Key is 8–128 permitted characters and identifies one account-scoped intended request. Persist the approved normalized body and original endpoint with it. If the client asks for 768p during recovery of an approved 480p request, resolve the original request first. Then show the changed estimate and record a separate approval for 768p if it is still needed. The example below shows an application record for that recovery process.
What to do next
- 01
Persist intent before sending
Store the user, model, exact payload, approval and idempotency value in your database. Do not create the value only inside a temporary HTTP retry function.
- 02
Recover the existing submission
If the response was lost, resend the same body and identifier through the same model endpoint. Save the returned job and follow its poll_url rather than submitting again with a fresh value.
- 03
Escalate uncertainty clearly
If the existing task remains unknown, retain its ID and stop automatic creation retries. Show an uncertain state and investigate the durable record without promising a refund or a new file.
A concrete example
Illustrative failure: a browser loses connectivity after Generate. The backend's persisted identifier lets it recover the accepted job when the browser reconnects. Generating a new UUID on every browser retry would defeat that protection.
Illustrative application recovery record — not an API request
Illustrative integration code. No paid generation was executed for this guide. Review live availability, quotes and your own approval before running creation requests.
{
"internal_task_id": "example-task-001",
"idempotency_key": "example-image-task-001",
"endpoint": "Original documented creation endpoint",
"approved_payload_snapshot": "Exact normalized body retained by the application",
"quote_and_approval_record": "The actual reviewed quote and spending ceiling",
"remote_job_id": null,
"local_state": "send-attempted-response-unconfirmed"
}Timed-out POST recovery
| Saved evidence | What remains unchanged | What happens next |
|---|---|---|
| Original endpoint, body and Idempotency-Key | Model/input/settings and approved ceiling | Recover the original intended submission |
| Returned job found during recovery | Original task association | Persist and poll that existing job |
| Conflict or unresolved outcome | Original evidence stays available | Investigate before deliberately approving new spending |
Before you call it ready
- The identifier and exact approved request exist before dispatch.
- Recovery uses the original endpoint, unchanged body and original header value.
- A missing response is not automatically labeled failed or refunded.
When to stop or choose another method
If your app has already lost both the identifier and response, inspect recorded usage and task history before making another paid request. Do not assume no response means no charge.
