The idempotency key was already used

    Where you might see it: Claude, ChatGPT and other AI apps · API

    What happened

    A request used an Idempotency-Key that was already used, so it was not started a second time. The key's job is to make sure the same request never starts twice. Most often, the key already belongs to a transcription that failed. The app tells you which transcription, says it failed, and says nothing was charged, and it does not retry that job under the same key. Less often, the key was used before for a different request, and the API refused this one with 422 IDEMPOTENCY_KEY_CONFLICT. Either way, nothing new was started.

    Why it happens

    • The key already belongs to a transcription that failed. An AI app that sends a link or a file again with the same key gets that failed transcription back, for 24 hours, instead of a new try. For a file, the upload that transcription used is used up as well.
    • The key was used for a different request body. The API compares the method, the address and the exact body text, so even the same fields in a different order, or with different spacing, count as a different body.
    • One fixed key is used for every request. The key has to be new for each separate transcription.
    • A key is reused for a retry, but the retry changed something, such as another language or a new upload_id.

    What to do

    1. If the earlier transcription failed and you want to try the same link or file again, send it again with a new key, or without one. For a file, send the file again first: its earlier upload is used up.
    2. Use a new key for each new operation. A UUID is a good key.
    3. Reuse the same key only to retry the exact same request, with the exact same body, after a network error or a timeout. That is what the key is for: you get the first answer back instead of a second job.
    4. If you changed something on purpose, such as the language, use a new key for that request.

    In Claude, ChatGPT and other AI apps

    1. This reaches an AI app that uses an API key or API credits. Ask the app to try again: it will send the link, or the file again, with a new key or none.

    Were you charged?

    No. Nothing was started, so nothing was used. Sending a request again under the same key never starts a second job and never charges twice.

    Still stuck?

    Email support@scriptivox.com with:

    • the email address of your Scriptivox account
    • the job's id if you have it, and the request_id from the answer
    • when it happened, with your time zone
    • the exact message you saw

    In Claude, ChatGPT or another AI app, you can also ask it to send us a problem report: it shows you the report first and sends it only when you say yes.

    For developers

    With the API, a key that was used for the same request again is not an error: when the same key and the same body arrive again after a 2xx, you get the saved answer, with the header Idempotent-Replay: true. That saved answer is the original created job, even if the job failed later, so poll its id, and use a new key to start again. A request that gets an answer other than 2xx is not saved, so you can fix it and send it again under the same key.

    When the same key arrives with a different body, the answer is 422 IDEMPOTENCY_KEY_CONFLICT, at once on POST /v1/upload or POST /v1/transcribe. Sending the same request again gives the same answer: use a new key, or send the original body again. The key is checked against a hash of the method, the path and the raw body, and is kept for 24 hours; after that it can be used again.

    {
      "error": {
        "code": "IDEMPOTENCY_KEY_CONFLICT",
        "message": "Idempotency-Key was reused with a different request body. Use a new key for a different operation.",
        "docs_url": "https://www.scriptivox.com/errors/request-key-reused",
        "help_id": "request-key-reused",
        "request_id": "req_6fe725fffa7d9b98"
      }
    }