Docs / Jobs

Idempotency

Send an Idempotency-Key with a submit, and a retry never starts a second job or charges twice.

Send a key

Make a new key for each job, a UUID for example, and send it in the Idempotency-Key header. If the network drops before you get the answer, send the same request with the same key again.

cURL
curl -X POST "https://api.minicut.ai/v1/queue/seedance-2.5" \
  -H "Authorization: Key $MINIAPI_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: 6c0d6a0e-3f0b-4f39-9d8f-1b2b8e0e7a11" \
  -d '{"prompt": "a paper boat on a lake", "resolution": "720p", "duration": 5}'

What happens on a repeat

You sendYou get
The same key and the same body, within 24 hoursThe first answer again, the same request_id, with Idempotent-Replayed: true. Nothing new starts and nothing more is charged.
The same key with a different body409 idempotency_conflict
A key first used more than 24 hours ago409 idempotency_conflict. Use a new key.
Two submits with one key at the same momentOne job. Both get its request_id.

Keys belong to your account, not to one API key, and are 1 to 255 characters. Without the header every submit is a new job.