Clamp video duration when swapping Sora for a Sume video model

Each Sume video id has its own seconds range, so old Sora code can ask for a length a model rejects. Clamp per id before you submit; Python table of limits.

5 min readSume
All posts

After the Sora API shutdown, the length your code asked for may not fit the Sume model you swapped to, because each id has its own duration range. Clamp the requested seconds to the range of the id you are about to call. OpenAI's deprecations page lists Sora 2 and the Videos API as shut down September 24, 2026, with no replacement named, so the model choice is yours.

These ranges come from Sume's video model docs and catalog, read 2026-10-06.

Duration ranges per Sume video id

Sume video duration ranges, read 2026-10-06
Sume idSeconds
seedance-2.54 to 30
seedance-2, seedance-2-fast, seedance-2-mini4 to 15
wan-3.02 to 30
kling-34 to 15
minimax-h35 to 15
gemini-omni-flash-1.13 to 10
h3-max-recast5 to 30

A clamp function

Log every clamp. A 12 second request that becomes 10 seconds changes both the clip and the price, and you want that visible in your own logs.

LIMITS = {
    "seedance-2.5": (4, 30),
    "seedance-2": (4, 15),
    "seedance-2-fast": (4, 15),
    "seedance-2-mini": (4, 15),
    "wan-3.0": (2, 30),
    "kling-3": (4, 15),
    "minimax-h3": (5, 15),
    "gemini-omni-flash-1.1": (3, 10),
    "h3-max-recast": (5, 30),
}

def clamp_seconds(model, seconds):
    low, high = LIMITS[model]
    fixed = max(low, min(high, seconds))
    if fixed != seconds:
        print(f"clamped {model}: {seconds}s -> {fixed}s")
    return fixed

if __name__ == "__main__":
    print(clamp_seconds("gemini-omni-flash-1.1", 12))
    print(clamp_seconds("seedance-2.5", 12))

Other fields that differ

Duration is only one of the fields. Sume's video models have no seed, reject size, and return 400 for a non-empty provider.options. Resolution lists differ too: kling-3 takes 720p and 1080p, and gemini-omni-flash-1.1 takes 360p up to 4K with native audio always on. Start from the Sora port guide and pin the id with the canonical slug field.

Sources

Related posts

More in Developers

All Developers posts

Written by Sume