Skip to main content
idempotency_conflict means your organization already used this Idempotency-Key for a run with a different body. Read this page if you retry runs, or if you build keys from ids that can repeat.

What happened

Route: POST /v1/runs. An Idempotency-Key belongs to one request for the life of your organization; keys never expire. When a key arrives again, OpenType compares the new body with the one stored for that key: “The same body” means the same input and the same contract: Changing any value in the left column under an old key gets this error. Changing only a value in the right column does not: you get the stored run back, as it first ran. The request was refused before a new run existed, and the original run is unchanged.

How to fix

  • Retrying the same request: send exactly the original body with the original key. You get the stored run back.
  • Sending a new request: use a new key. A changed prompt, schema or question set is a new request.
  • Keys that repeat by accident: if two different requests can derive the same key, add the part that differs to the key, such as the question-set version: ticket-4822-triage-v2.
A content-derived key repeats for the same body. When a run fails with a 5xx that tells you to retry with a new key, add an attempt counter to the key, such as -a2. Otherwise the replay returns the stored pending run with 202.
A 409 on this code is not fixed by waiting. Retrying the same body and key gives the same answer.

Example

Deriving the key from both the business id and the request contents, so a changed body always gets a new key and a retry always reuses the old one: