Python preflight: price a video batch before you submit to Sume
A short Python function prices Seedance 2.5 and Wan 3.0 jobs at list x 1.25 and compares the total with your balance before any submit. Example: $99.36.

This Python function prices a list of Sume video jobs offline and checks the total against your balance, so a 402 does not land halfway through a batch. For 12 ten-second Seedance 2.5 jobs at 720p and 8 fifteen-second Wan 3.0 jobs at 1080p it prints $99.36. It uses the list prices and the 1.25 margin documented in the Video Router docs, frozen at 2026-10-13.
The code
It covers Wan 3.0 (flat per second) and Seedance 2.5 (video tokens, with the higher 1080p rate). Each job is rounded up to the cent, as Sume bills it. Add rows for other models from the Video Router table.
import math
# List $ per second from the Video Router docs, before the 1.25 margin.
FLAT = {("wan-3.0", "480p"): 0.05, ("wan-3.0", "720p"): 0.10, ("wan-3.0", "1080p"): 0.20}
# Seedance 2.5: list $ per 1000 video tokens; tokens = w * h * seconds * 24 / 1024.
SEEDANCE_25 = {"480p": (864, 496, 0.0214), "720p": (1280, 720, 0.0214), "1080p": (1920, 1080, 0.0234)}
def job_price(model, res, seconds):
if model == "wan-3.0":
list_usd = FLAT[(model, res)] * seconds
else:
w, h, rate = SEEDANCE_25[res]
list_usd = math.ceil(w * h * seconds * 24 / 1024) * rate / 1000
return math.ceil(round(list_usd * 1.25 * 100, 6)) / 100
def preflight(jobs, balance):
total = sum(job_price(*j) for j in jobs)
return total, balance >= total
jobs = [("seedance-2.5", "720p", 10)] * 12 + [("wan-3.0", "1080p", 15)] * 8
total, ok = preflight(jobs, balance=100.0)
print(f"need ${total:.2f}, balance ok: {ok}")
Limits of an offline check
The prices here are the repo's at the date above; the live source is pricing_skus from GET /v1/videos/models. Use the function to size a batch, then confirm one real job's usage.cost against it. It also ignores reference-video surcharges (the repo prices a reference video at 60% of the base video-token cost) and edit-job hints.
The balance check is not an admission check: the plan's accepted capacity can still return 429 queue_full (see generation admission).
Sources
Related posts
More in Developers
- Python script: filter Sume video models by length, size and ratio
A short Python script reads GET /v1/videos/models and keeps the rows that fit your seconds, resolution and aspect ratio. Run it before you pick an id.
- Qwen Image 2.1 rate limits: 120 RPM Turbo, 20 RPM Pro, and batching
Alibaba caps qwen-image-2.1-turbo at 120 requests per minute and Pro at 20. Here is how to size a batch and where Sume's async mode fits.
- Qwen Image 2.1 rate limits: Pro 20 RPM, Turbo 120 RPM vs Sume's queue
Alibaba caps qwen-image-2.1-pro at 20 requests a minute and Turbo at 120. How long 1,000 images take at each cap, and how Sume's plan queue behaves instead.
- Repeatable AI images: seed returns 400 on Sume, so do this
Sume's schema accepts seed, but no image model lists it, so seed returns 400 unsupported_parameter. Pin the model and prompt, and keep the output file.
Written by Sume