Idempotency

Every POST takes an Idempotency-Key header, so a retried request never creates a second job or a second charge.

Send a unique Idempotency-Key (1 to 255 printable ASCII characters, for example a UUID) on every POST. Without it the request fails with 400 idempotency_key_required. Keys are remembered for 24 hours per mode.

You sendYou get
The same key and the same body againThe stored response, with Idempotent-Replayed: true.
The same key with a different body or path422 idempotency_key_reused.
The same key while the first request is still running409 idempotency_key_in_use; retry shortly.
A body that fails validationThe error; the key is not used up, so fix the body and reuse it.
A retry after a 5xx or a timeoutThe object the first attempt created — never a second job or hold.
A retry after 403, 409, 429 or 503 refusals that changed nothingA fresh attempt: the key is released for you.

A 402 insufficient_balance is stored like any final answer: top up, then retry with a new key.