Audio detach retry: what idempotency_hit true means for the $0.01

Retrying an audio detach with the same Idempotency-Key and body returns the first job (idempotency_hit true): $0.01 once. A changed body returns 409.

4 min readSume
All posts

If you retry an audio detach request with the same Idempotency-Key and the same body, Sume returns the original job with idempotency_hit true and you pay the $0.01 detach price once. If the body changed, the API answers 409 idempotency_conflict and creates nothing.

Three retries, three outcomes

Audio detach is $0.01 per job. Retrying is only free when the request is byte-for-byte the same payload under the same key.

Audio detach retries at $0.01 per new job (read 2026-10-09)
RetrySame keySame bodyResultNew charge
Network timeout, resendyesyesoriginal job, idempotency_hit true$0.00
Resend with range 0-30 changed to 0-45yesno409 idempotency_conflict$0.00
Resend with a new keynoyesnew job$0.01

Check the flag in code

The submit response carries data.idempotency_hit next to data.job.id. Log it, and skip any downstream work you already queued for that job id.

import os, requests
r = requests.post(
    "https://api.sume.com/v1/audio-detach",
    headers={"Authorization": f"Bearer {os.environ['SUME_API_KEY']}",
             "Idempotency-Key": "ep-114-detach"},
    json={"video_url": "https://media.sume.com/artifacts/artf_demo/ep.mp4",
          "range": {"start": 0, "end": 30}},
)
if r.status_code == 409:
    raise SystemExit("same key, different body: pick a new key on purpose")
r.raise_for_status()
d = r.json()["data"]
print(d["job"]["id"], "replay" if d["idempotency_hit"] else "new")

Gotchas

Derive the key from your own stable id (episode id plus the range), not a random value, or every retry becomes a new paid job. Randomly generated keys are the usual reason a retry loop charges twice.

Detach also has caps: the source is at most 1,800 seconds and the output at most 900 seconds, so a long source needs a range. A failed job is terminal; check status before assuming the retry will return a fresh attempt.

Sources

Related posts

More in Developers

All Developers posts

Written by Sume