Client timeouts for Sume jobs: SDK defaults and the 30-second cap
Sume's sync wait caps at 30 seconds, waitForRun defaults to 10 minutes, subscribeFormatRun and waitForJob to 20. Pick a deadline per job type, keep the job id.

Three timeouts apply to a Sume job and they are not the same thing: the server's bounded sync wait, at most 30 seconds; the SDK's wait helpers, 10 or 20 minutes by default; and your own application deadline. Only the last should decide when your user gets an answer.
The defaults
wait_timeout_seconds is clamped to 0 through 30 and bounds one HTTP request, not the job. The SDK helpers poll client-side with a 2 second interval floor, and next_poll_after_seconds wins when it asks for a longer gap.
| Mechanism | Default wait | Throws on timeout |
|---|---|---|
| mode sync or subscribe | Up to 30 seconds | No; returns the envelope, poll on |
| waitForRun | 10 minutes | SumeRunTimeoutError |
| subscribeFormatRun | 20 minutes | SumeRunTimeoutError |
| waitForJob | 20 minutes | SumeJobTimeoutError |
Set a deadline per job type
Images often finish inside the sync window; video, avatar-video and face swap routinely do not. Give each type its own deadline and surface a pending state to the user instead of a spinner that ends in an error.
A timeout is not a cancel
When any of these fire, the job keeps running and keeps billing. The timeout error carries the job or run id: save it, resume from status_url, or cancel explicitly. Never resubmit the same paid intent without the original idempotency key.
Sources
Related posts
More in Developers
- Choosing a Sume Idempotency-Key: business key plus a payload version
A good Idempotency-Key is stable across retries and changes with the request. Build it from your order id and a payload hash, or hit 409 idempotency_conflict.
- Retry Sume 429s in TypeScript: a fetch wrapper that obeys retry-after
A small fetch wrapper for the Sume API: retry 429 only when the request is a GET or carries an Idempotency-Key, wait retry-after, and never loop on queue_full.
- Sume reserve, capture, refund: what your cost ledger should mirror
Sume reserves the estimate at submit, captures it on success and releases it on failure or cancel. Mirror the three states or cost reports will double count.
- Sume SDK returns {data, error}, not exceptions: an unwrap helper
Generated @sume-com/sdk operations resolve with data, error and response instead of throwing. Wrap them in an unwrap helper that throws a typed error.
Written by Sume