Sume SDK maxRetries: 0 when your job queue already retries the call
The SDK retries 408, 429 and 5xx twice by default. Under a queue with five attempts that is up to 15 tries. Set maxRetries to 0 and let one layer retry.

createSumeClient in @sume-com/sdk retries by default: maxRetries is 2, so one logical call can make three HTTP attempts. It retries 408, 429, 5xx and transport failures, honors retry-after up to 60 seconds, and adds roughly 20% jitter. POSTs retry only when an Idempotency-Key is present.
Put that client inside a job queue that retries on its own and the attempts multiply. A worker that retries five times, each making three attempts, hits the API up to 15 times for one failing job, and every extra 429 makes the next one likelier.
The multiplication
| SDK maxRetries | Queue attempts | Worst-case HTTP tries per job |
|---|---|---|
| 2 (default) | 1 | 3 |
| 2 (default) | 5 | 15 |
| 0 | 5 | 5 |
Pick one retry owner
Setting maxRetries: 0 is the simple choice when the queue already has backoff, a dead-letter path and metrics. The handler then throws on a failed job and the queue decides.
import { createSumeClient, waitForJob } from "@sume-com/sdk";
// SDK default is maxRetries: 2, so one call can make 3 HTTP attempts. Behind a
// queue that retries 5 times, one flaky 5xx can turn into 15 attempts.
const client = createSumeClient({
apiKey: process.env.SUME_API_KEY!,
maxRetries: 0, // the queue owns the retry policy
});
export async function handler(job: { data: { jobId: string } }) {
const done = await waitForJob(job.data.jobId, { client, timeout: 60_000 });
if (done.status !== "completed") {
throw new Error(`job ended ${done.status}`); // the queue decides whether to retry
}
return done.status;
}When to leave the default
- A script with no queue benefits from the SDK retry and its
retry-afterhandling. - If you do turn retries off, keep sending an
Idempotency-Keyon every POST so your queue's retry cannot create a second run. - Your queue's backoff should respect
retry-afteras well, or you will retry sooner than the server asked.
Sources
Related posts
More in Developers
- Sume STT mode sync: transcribe a short clip in one request
Send mode sync with wait_timeout_seconds up to 30. A short clip answers 200 with the finished job. A longer one answers 2xx with the queued job to poll.
- Sume STT to an SRT file: build subtitles from sentence segments
Sume returns timed sentence segments, not an SRT. Turn them into a valid .srt file in Python for YouTube, Vimeo or a player, with the timestamp format.
- Preview Sume TTS sentence ids, lengths and job cost before you submit
A short Python script that splits a script like Sume's source API, groups sentences under 20,000 characters and prices each job at $0.0475 per 1,000 characters.
- Sume waitForJob pollInterval is a floor; next_poll_after_seconds wins
waitForJob never polls faster than pollInterval, and a longer next_poll_after_seconds from the server raises the gap. Defaults, timing table, sample.
Written by Sume