Match STT results to file ids: the job echoes your Idempotency-Key
Sending 300 recordings to Sume STT? Set Idempotency-Key to your own file id. The job record returns it, so results map back after a crash or a retry.

A transcription batch has two bookkeeping problems. After a crash you do not know which files already have a job, and when jobs complete you must know which transcript belongs to which recording. The Sume STT job answers both if you use the file id as the Idempotency-Key.
Why this works
The jobs guide says a retry of the same submit with the same Idempotency-Key returns the original job rather than billing a second one. The same key with a different payload returns 409 idempotency_conflict. The job record itself carries an idempotency_key field, so reading a job from GET /v1/jobs/:id tells you which of your keys created it.
The pattern
Before you start, nothing needs to be stored. On every run, submit every file with its id as the key. Already submitted files return their existing jobs at no extra cost. Then read the results by job id. The key is a stable name for the operation, so build it from the file id plus the part number for chunks, such as rec-0412-p03.
import os, requests
B = "https://api.sume.com/v1"
H = {"Authorization": "Bearer " + os.environ["SUME_API_KEY"]}
files = {"rec-0412": "https://example.com/a.mp3", "rec-0413": "https://example.com/b.mp3"}
jobs = {}
for fid, url in files.items():
r = requests.post(B + "/stt-1.0/transcribe", headers={**H, "Idempotency-Key": fid},
json={"audio_url": url, "duration_seconds": 600, "mode": "async"})
r.raise_for_status()
jobs[fid] = r.json()["data"]["job"]["id"]
for fid, job in jobs.items():
s = requests.get(f"{B}/jobs/{job}/status", headers=H).json()["data"]
print(fid, job, s["sume_status"], s["terminal"])Rules for good keys
- Use the same key only for the same payload. If you change
language_codefor a file, add a revision suffix, such asrec-0412-v2, or you get the 409. - Do not reuse a key across STT and TTS, or between different files.
- Keep keys short and stable. A timestamp in the key defeats the purpose.
- The key does not live in the audio, so a renamed file needs a mapping of its own.
Cost
STT 1.0 costs about $0.01 per minute. A run that crashed at file 212 and restarted from file 1 does not pay for 211 files again if the keys match, since the retry returns the original jobs. That is the saving the pattern buys. It is a bookkeeping feature, not a discount.
Sources
Related posts
More in Developers
- max_spend_usd is optional on Sume MCP: send it on every paid call
Sume enforces max_spend_usd only when you send it. Make your coding agent send it with dry_run and an idempotency_key. Wallet admission is the real gate.
- MCP SEP-2352: credentials bound to issuer, re-register on a new host
MCP SEP-2352 binds client credentials to the issuer and deprecates DCR for Client ID Metadata Documents. Re-register if the Sume host changes.
- MCP subscriptions/listen and tasks versus Sume's pull-based job events
The 2026-07-28 MCP spec adds subscriptions/listen and a tasks extension. Sume has no SSE or WebSocket: poll job events, or use jobs_wait with a 55-second cap.
- MCP timeline_create provider_fields_not_accepted: no ffmpeg fields
Sume's timeline_create refuses model, filtergraph, ffmpeg_args, codec, preset and crf with provider_fields_not_accepted. Describe the edit, not the encoder.
Written by Sume