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.

Yes, you can pick a Sume video model from code instead of memory. GET /v1/videos/models returns each row with its supported_* fields, so a filter on length, resolution and aspect ratio gives you the ids that can serve a request. The script below prints matching ids and exits non-zero when none match.
The script
It reads the key from SUME_API_KEY, accepts the three constraints as arguments and treats missing fields as no match.
import os, sys, requests
secs, res, ratio = int(sys.argv[1]), sys.argv[2], sys.argv[3]
r = requests.get(
"https://api.sume.com/v1/videos/models",
headers={"Authorization": f"Bearer {os.environ['SUME_API_KEY']}"},
timeout=30,
)
r.raise_for_status()
hits = []
for m in r.json().get("data") or []:
if secs not in (m.get("supported_durations") or []):
continue
if res not in (m.get("supported_resolutions") or []):
continue
if ratio not in (m.get("supported_aspect_ratios") or []):
continue
hits.append(m["id"])
print("\n".join(hits) or "none")
sys.exit(0 if hits else 1)What to do with the result
Run python pick.py 12 1080p 9:16 and you get the ids that list 12 seconds at 1080p in 9:16. Then check each row's other limits in the Video Router docs: references, audio and end frames differ per row. If the output is none, change one constraint at a time; length is usually the first to cut, since many rows stop at 10 or 15 seconds.
| Row | Longest clip |
|---|---|
seedance-2.5 | 30 s |
wan-3.0 | 30 s |
kling-3 | 15 s |
minimax-h3, minimax-h3-max | 15 s |
gemini-omni-flash-1.1 | 10 s |
A caution on field names
The field names in the script follow the supported_* pattern the docs describe; print one row first with print(r.json()["data"][0]) to confirm the exact keys in your environment before you rely on the filter.
Sources
Related posts
More in Developers
- 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.
- Image model sume/auto or a pinned id: when to send which
Send sume/auto when you want Sume to choose and pin an id when you need the same look and price every time. Auto never names the model that ran.
Written by Sume