Price ceiling guard: refuse a $42.65 Seedance 2.5 clip before the POST

A Seedance 2.5 1080p 30 s clip bills $42.6465. A 20-line Python guard refuses any request over your per-clip ceiling before it is sent. Tested.

3 min readSume
All posts

A single parameter change can multiply a request's price. On seedance-2.5, a 10-second 720p clip bills $5.778; the same 10 seconds at 1080p bills $14.2155; 1080p at 30 seconds bills $42.6465. A script or agent that picks resolution and duration from user input can turn a typo into a bill. A ceiling check before the POST makes the worst case your choice.

A balance check is not a substitute: 402 insufficient_credits only fires when the balance runs out, and a large balance happily pays for a large mistake.

Seedance 2.5 on Sume with a $10 ceiling (read 2026-10-07)
CaseBilled (USD)Result at a $10 ceiling
720p, 10 s$5.778sent
1080p, 10 s$14.2155refused
1080p, 30 s$42.6465refused

The guard

It computes the billed amount from the token formula and raises before any network call. Printed output from Python 3.14.7: 720p 10 ok 5.778, then a refusal at $14.22 and one at $42.65.

import math
DIMS = {"480p": (496, 864), "720p": (720, 1280), "1080p": (1080, 1920)}  # 9:16

def seedance_25_micros(res, secs):
    w, h = DIMS[res]
    rate = 23400 if res == "1080p" else 21400  # list micros per 1000 tokens
    tokens = math.ceil(w * h * secs * 24 / 1024)
    return math.ceil(math.ceil(tokens * rate / 1000) * 1.25)

def guard(res, secs, ceiling_usd):
    cost = seedance_25_micros(res, secs) / 1e6
    if cost > ceiling_usd:
        raise SystemExit(f"refused: {res} {secs}s is ${cost:.2f}, ceiling ${ceiling_usd:.2f}")
    return cost

for res, secs in [("720p", 10), ("1080p", 10), ("1080p", 30)]:
    try:
        print(res, secs, "ok", guard(res, secs, 10.0))
    except SystemExit as e:
        print(e)

Where to put it

Call it in the one function that builds the request, not in each caller, and put the ceiling in config. Refusing is a decision for a person or a policy, so report the number and the settings instead of silently downgrading the resolution. For the batch version, sum the guard over the whole list first and compare with your budget.

Sources

Related posts

More in Pricing

All Pricing posts

Written by Sume