402 on a 30-second 1080p Seedance 2.5 job: you need $42.65
The biggest Seedance 2.5 clip (30 s, 1080p) reserves about $42.65 at submit. A 21-line Python urllib handler shows what 402 and 429 mean and what to do next.

A wallet with $30 in it can run hundreds of cheap video jobs and still fail at the one that matters. Sume reserves the price when a video job is submitted, and if the workspace balance is below that reserve the API answers 402 insufficient_credits and creates no job. For the longest Seedance 2.5 request, 30 seconds at 1080p, the price is 1,458,000 video tokens at $0.02925 per 1,000, which is $42.65.
That figure is checked in Sume's price tests, and 16:9 and 9:16 give the same value because the pixel count is the same. At 720p the same 30 seconds is $17.33 and at 480p it is $8.06, so a wallet that is too low for the final render can still be enough for a draft.
A handler that says what to do
The script submits that request with Python's urllib and treats the two refusals differently. A 402 is a balance problem and no retry helps. A 429 is a rate limit and a later retry does. It was run against a local server that answered 402, and it printed the top-up message and exited with status 2.
import json, os, urllib.error, urllib.request
BASE = os.environ.get("SUME_API_BASE", "https://api.sume.com")
body = {"model": "seedance-2.5", "prompt": "A glacier calving at sunrise",
"duration": 30, "resolution": "1080p", "aspect_ratio": "16:9"}
req = urllib.request.Request(
f"{BASE}/v1/videos", data=json.dumps(body).encode(), method="POST",
headers={"Authorization": f"Bearer {os.environ['SUME_API_KEY']}",
"Content-Type": "application/json",
"Idempotency-Key": "glacier-30s-1080p-0001"})
try:
job = json.load(urllib.request.urlopen(req))
print("accepted", job["id"])
except urllib.error.HTTPError as err:
if err.code == 402:
# Balance is below the reserve. For this job the reserve is about $42.65.
print("top up the workspace by at least $42.65, then submit again")
raise SystemExit(2)
if err.code == 429:
raise SystemExit("rate limited: wait, then submit again")
raiseThe errors you will meet
These codes come from the error table in Sume's video API contract.
| HTTP | Code | What to do |
|---|---|---|
| 400 | unsupported_capability | Change the value; it is not in the model's catalog entry |
| 402 | insufficient_credits | Top up the workspace, then submit again |
| 404 | model_not_found | Check the id against GET /v1/videos/models |
| 409 | job_not_completed | Poll again; the content is not ready |
| 429 | rate_limited | Wait and retry with the same Idempotency-Key |
Planning the balance
Before a big render, compute the price and compare it with the balance in your own code, so the failure is a message you wrote rather than an error from a queue worker at 3 a.m. The Idempotency-Key header makes a resend after a timeout return the original job when one was created, so retrying does not charge twice.
If the amount is hard to justify, lower one of the three levers: resolution, length or model. Moving the same 30 seconds from Seedance 2.5 at 1080p to Wan 3.0 at 1080p costs $7.50, because Wan bills $0.25 a second. They are not the same look, but the gap is a good reason to test before spending.
Sources
Related posts
More in Developers
- 402 on the caption step after a paid generate and trim: what now
A 402 insufficient_credits at the caption step means admission failed before provider work. The render and trim jobs you paid for stay completed.
- 429 on a chain step: retry with the same Idempotency-Key
A 429 on a trim or captions submit is rate_limited or queue_full. Wait for retry-after and resend the same body with the same Idempotency-Key.
- Brand name mispronounced by the AI voice? Four fixes and the cost
When a TTS voice says your brand name wrong, change the voice, the language, the spelling or the dictionary. Each retake on Sume costs 1 to 7 cents.
- Ack a Sume webhook in 10 s, then copy the 30-second MP4 later
Sume gives each delivery 10 seconds. Verify, store the job id, answer 204, and let a worker download the MP4 instead of doing it inside the handler.
Written by Sume