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.

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 id | Seconds |
|---|---|
| seedance-2.5 | 4 to 30 |
| seedance-2, seedance-2-fast, seedance-2-mini | 4 to 15 |
| wan-3.0 | 2 to 30 |
| kling-3 | 4 to 15 |
| minimax-h3 | 5 to 15 |
| gemini-omni-flash-1.1 | 3 to 10 |
| h3-max-recast | 5 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
- Claude Code PreToolUse hook: block paid Sume calls without a spend cap
A PreToolUse hook that denies Sume generate and TTS tools when max_spend_usd or idempotency_key is missing. Python hook with the settings.json matcher, tested.
- AGENTS.md rules for a coding agent that calls Sume over hosted MCP
Six AGENTS.md lines that stop a coding agent double-billing Sume video jobs: idempotency_key, jobs_wait slices, dry_run, plus a CI lint script.
- curl and jq script to test a new Sume image model id in one command
A 6-line shell script that posts one prompt to Sume POST /v1/images for any model id and prints the url, cost and status, to vet a gpt-image-1 replacement fast.
- Cursor mcp.json for the hosted Sume server: env interpolation or OAuth
Cursor reads .cursor/mcp.json with url and headers and supports ${env:NAME}. Pass the Sume key from the environment, or omit headers and use OAuth. Validated.
Written by Sume