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 MCP insufficient_scope: re-authenticate to grant write
Sume's hosted MCP starts read-only. If Claude Code pins oauth.scopes, add mcp:write, run /mcp and re-authenticate, or the new token still lacks write.
- 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.
- Claude Code .mcp.json project scope: keep your Sume API key out of git
Project scope writes .mcp.json for your team via version control. Never put a Sume key in its header; use OAuth, or a local-scope server, for the credential.
- Claude Code tool.check ceiling and agentId: gate paid Sume tool calls
Claude Code 2.1.290 adds ceiling and agentId to tool.check, so a hook can tell subagents apart. Pair it with Sume's dry_run and max_spend_usd on paid tools.
Written by Sume