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.

5 min readSume
All posts

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

All Developers posts

Written by Sume