invalid_idempotency_key means a POST /v1/runs request sent an Idempotency-Key header that OpenType cannot use as a key. Read this page if you build keys from long ids, user text or non-ASCII data.
What happened
Route:POST /v1/runs.
The header is present but breaks one of these rules:
The run was refused before it existed. Nothing was stored and nothing was charged.
A missing header is a different code:
idempotency_key_required.
How to fix
Send 1 to 255 bytes of printable ASCII. Build the key from your own business id, so a retry of the same request carries the same key. If your id can be long or can contain other characters, hash it. A SHA-256 hex digest is always 64 ASCII characters, well inside the limit, and the same input always gives the same key. Because the request was refused before a run existed, no key was used up. Send the same body with the corrected key.Example
Related
- Idempotency - how keys are matched, replayed and kept.
- idempotency_key_required - the header is missing altogether.
- Limits - every size and count limit in one table.
- Problem codes - every code, its status, and whether a retry can help.