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 send | You get |
|---|---|
| The same key and the same body again | The stored response, with Idempotent-Replayed: true. |
| The same key with a different body or path | 422 idempotency_key_reused. |
| The same key while the first request is still running | 409 idempotency_key_in_use; retry shortly. |
| A body that fails validation | The error; the key is not used up, so fix the body and reuse it. |
| A retry after a 5xx or a timeout | The object the first attempt created — never a second job or hold. |
| A retry after 403, 409, 429 or 503 refusals that changed nothing | A 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.