GPT IMAGE 2.5 | WAN 3.0 | SEEDANCE 2.5 IS NOW LIVE!

GENERATE YOUR VIDEOS WITH UNLIMITED SEEDANCE 2.5 TODAY.

NO EXTRA SUBSCRIPTION
Get API key
Browse API docs

Get started

Idempotency

Was this page helpful?

Retry a timed-out generation request without starting or charging for a duplicate job.

By  Founder, Reviral Last updated

Short answer

Send the same Idempotency-Key header with the exact same body when you retry a timed-out request to generate-media, image-ads or ugc-ad. You get the same job back, not a second job and not a second charge. Use an order ID as the key. A different body with a reused key returns HTTP 409.

SituationWithout the keyWith the key
A request times out and you send it againA second job can start, with a second chargeYou get the original job back, with no second charge
You check the job after a resendYou may have two jobs to trackThe replay shows the job's current status: queued, running, ready or failed
You change the request on purposeA new job startsUse a new key; the old key with a different body returns HTTP 409 idempotency_key_reuse

Safe retry

If a connection times out, resend the exact body with the same key. The API returns the original job instead of starting another one. A replay returns the job's current status (queued, running, ready or failed); fetch statusUrl for outputs.

curl -X POST "https://reviral.ai/api/v1/generate-media" \
  -H "Authorization: Bearer $REVIRAL_API_KEY" \
  -H "Idempotency-Key: first-generation" \
  -H "Content-Type: application/json" \
  --data '{"model":"seedance-2","prompt":"A slow camera move across a quiet lake at sunrise","durationSec":5,"resolution":"720p","aspectRatio":"16:9","maxCredits":106}'

Conflict behavior

Reusing a key with a different request body returns HTTP 409 idempotency_key_reuse. Generate a new key only when the intended request is genuinely different.