
Inject connection failures into a local fake transport and verify that your client preserves one logical generation identity. The dangerous boundary is acceptance without a response: the server may have started paid work even though your client saw a timeout. Retrying that operation must keep its original idempotency key and parameters.
Key Takeaways
- A lost response is not proof that no task exists.
- Test crashes before and after durable task-ID storage separately.
- Recovery should preserve completed work and avoid automatic replacement generations.
Map the failure boundary before choosing recovery
The Imagild API guide describes asynchronous submission and idempotency. Your application should store its operation identity and intended payload before sending a generation.
Stripe's advanced error guide distinguishes request-content, network and server failures. That classification is useful, but Stripe's payment rules and replay behavior are not the Imagild contract.
A retry decision needs the application's durable record and the observed failure stage. The exception message “network error” alone cannot establish whether remote acceptance happened.
Rehearse a boundary-specific matrix
Use local fixtures to exercise these cases without sending paid work:
| Injected point | Evidence available | Expected recovery |
|---|---|---|
| Before dispatch | Saved operation, no request sent | Dispatch that operation when permitted |
| After remote acceptance, before response | Saved key, acceptance uncertain | Retry identical key and parameters |
| After response, before task-ID save | Task may exist remotely | Recover using original operation identity |
| After task-ID save | Known accepted task | Resume status checks |
| During content download | Known completed task | Retry authorized retrieval, not generation |
These are application failure scenarios, not a claim that you can control the production provider's internal execution.
Keep the durable record through a crash
Store operation ID, idempotency key, submitted payload and known task ID separately from transient request state. A worker restart must read that record rather than regenerate keys from scratch.
An illustrative local event trace might look like this:
operation-planned: stable key and payload saved
submission-started: first transport attempt
response-lost: no final client acknowledgement
worker-restarted: existing operation recovered
submission-retried: identical key and payload
task-id-saved: acceptance linked to the original item
The trace is a proposed rehearsal sequence, not an actual customer incident or a proof of globally exactly-once execution. Check that no event quietly changes the model, resolution, prompt or source reference.
Distinguish replacement work from an identical retry
If a request body must change after a validation correction or a deliberate retake, represent it as a new operation. Do not reuse an accepted operation key with changed parameters; that produces a conflict.
Conversely, selecting another model and generating a new key does not reconcile an uncertain old submission. It can create another paid task while the earlier one still exists.
If a task reports unknown, preserve its identity and route the case to reconciliation. Use the failed-job next-action guide before offering another candidate.
Verify the media and accounting boundaries independently
A download interruption should leave the successful task intact. Verify that your recovery path retries its content route and does not invoke the generation route. The HTML-instead-of-image guide helps distinguish a valid partial or retried retrieval from a saved error page.
Inspect usage.state in each fixture: reserved, consumed and released are different observations. Do not manufacture a refund confirmation when the outcome remains unresolved.
Pass the rehearsal when every injected failure produces a specific recovery action, accepted IDs survive restarts and the fake transport catches unexpected extra generation sends. This validates your client design without spending points or claiming a new production reliability benchmark.
Related tasks
- What Should You Check Before Retrying a Failed Image or Video Job?
- Why Does My Downloaded Image Open as a Web Page?
Sources and scope
- Imagild API console: Actual request and task envelopes, strict parameters, references, membership, points usage and authenticated result retrieval.
- Stripe advanced error handling: General distinction between content, network and server errors; Stripe-specific payment and replay rules are not transferred.
Product instructions were checked against the current Imagild API contract and the public model catalog. Code, budgets and acceptance checks are illustrative; this article does not claim a new paid generation test, an uptime measurement, a search-volume study or a ranking of AI citations.
Prepared by Imagild Editorial, the company editorial team responsible for these guides. AI assisted research and drafting. This is documentation-based guidance with proposed examples, not a claim of hands-on testing or an independent product review. Report a correction.
Cover: Original Imagild product screenshot captured on 28 October 2026; model availability and prices may change. This image is not an API response or a performance benchmark.