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.

4 min readSume
All posts

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")
    raise

The errors you will meet

These codes come from the error table in Sume's video API contract.

Video submit and fetch errors in Sume's video API contract (read 2026-10-05)
HTTPCodeWhat to do
400unsupported_capabilityChange the value; it is not in the model's catalog entry
402insufficient_creditsTop up the workspace, then submit again
404model_not_foundCheck the id against GET /v1/videos/models
409job_not_completedPoll again; the content is not ready
429rate_limitedWait 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

All Developers posts

Written by Sume