Skip to content

Can a reverse proxy send my paid generation request twice when my application only submits once?

An infrastructure layer can have its own retry behavior, so a single application call is not sufficient evidence of a single origin attempt. Inspect the proxy and gateway policy for non-idempotent requests, and preserve the same approved operation identity end to end. Do not enable paid-POST replay merely to hide transport failures. Reconcile an uncertain accepted task before authorizing another business action.

SHIP A RELIABLE INTEGRATIONAISwapLab team · Editorial methodPublished 3 min read
Open API documentationExplore 67 Image SkillsPrivate keys · Explicit credit approval
Editorial workflow: Draw the actual paid-request path → Review retries against the business operation → Rehearse with a fake origin before changing production.
Original editorial workflow diagram. It summarizes the guide's decisions; it is not a model output, interface screenshot or additional quality experiment.

Retry-layer audit

A browser request can pass through an application backend, load balancer, reverse proxy and HTTP client before reaching a generation endpoint. Each layer may observe a timeout from a different point in that chain. The existing idempotency guide explains how the application should reuse an approved request key; this guide addresses a replay the application did not explicitly issue. NGINX documents a separate non_idempotent option in upstream retry behavior. That example is a configuration distinction, not evidence that AISwapLab or your current host uses that setting, nor a recommendation to turn it on.

What to do next

  1. 01

    Draw the actual paid-request path

    Identify the components that handle a generation POST, including managed gateways whose defaults may be controlled outside your code repository. Record which layer terminates TLS, buffers the request body and handles upstream failure. Use safe request and operation identifiers for correlation; do not collect bearer keys or private prompts. A missing browser retry log does not show that a gateway never forwarded the body again.

  2. 02

    Review retries against the business operation

    Check the current vendor documentation and deployed configuration for method-specific retry rules, failure conditions and attempt limits. Avoid assuming a GET policy also applies safely to a generation POST. Ensure the application preserves the approved idempotency identity through any allowed retry, without changing the payload or manufacturing a new key. If the origin may already have accepted the task, prefer the documented reconciliation route instead of automatically treating the transport failure as no work done.

  3. 03

    Rehearse with a fake origin before changing production

    Use a local synthetic endpoint that records attempt identifiers and simulates a lost response after acceptance. Send no request to a real model route. Observe the application, proxy and origin logs to determine which layer repeats the body and whether the operation identity survives. Review the result before changing live retry settings. Include normal safe polling traffic separately so the test does not solve duplicate POSTs by making every read unreasonably fragile.

A concrete example

Illustrative incident: the application's log contains one call to create an image. A test gateway forwards it, loses the response and forwards the body again under its retry policy. The fake origin records two transport attempts for one approved operation. A correctly designed integration must not convert those into two independent creative purchases. The test isolates the infrastructure behavior; it does not assert that two real generations occurred, that every gateway retries POSTs by default, or that an idempotency key cures arbitrary payload changes.

Retry-layer audit

LayerEvidence to collectUnsafe assumption
Application clientApproved operation and attempted callOne log means one origin attempt
Proxy or gatewayMethod-specific replay configurationAll retries are harmless
Origin taskAccepted task identityA timeout means no task exists

Before you call it ready

  • Every component in the paid-request path has an identified retry policy.
  • Transport attempts and approved business actions have separate identifiers.
  • Allowed replays retain the same reviewed payload identity.
  • A fake origin, not a live paid route, is used for fault rehearsal.

When to stop or choose another method

Stop deploying retry changes that you cannot explain at the operation boundary. An HTTP timeout is not proof of zero supplier work, and changing keys to make the retry succeed can defeat deduplication. Follow the current AISwapLab recovery contract for the existing task. If a managed gateway's retry behavior cannot be controlled or observed, document that limitation before claiming exactly-once business effects.

Sources

One task. A recoverable workflow.

Check the contract, approve the quote and retain the job.

Open API documentation