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
- Match white balance across two AI product photos with Pillow
Two image models gave your product photos different color casts. Fix both with a gray-world gain in Pillow, check the channel means, and know when it fails.
- 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 2026 roadmap lists audit trails: what Sume records for agents
The MCP 2026 roadmap names audit trails as an enterprise priority. Here is what Sume records for an agent's paid work today: jobs, receipts, the usage ledger.
- RFC 9207 iss validation in the 2026-07-28 MCP spec, and Sume OAuth
The 2026-07-28 MCP spec adds RFC 9207 iss validation (SEP-2468). Sume's OAuth issuer is the MCP origin, so a client should expect mcp.sume.com and nothing else.
Written by Sume