Preflight a video request against the catalog before you pay

Check duration, resolution, aspect ratio, frame types and reference types against a GET /v1/videos/models entry in Python, and catch the 400 fields up front.

5 min readSume
All posts

You can catch most rejected video requests before submitting by checking the request against the model's entry in GET /v1/videos/models. Compare duration to supported_durations, resolution to supported_resolutions, aspect_ratio to supported_aspect_ratios, and each reference type to supported_input_references. A short Python function does it in a few lines.

Sume's video generation docs (read 2026-10-02) say to check these fields before submitting, because limits are not uniform across models. They also list three request fields that are always rejected on the v1 route, which a preflight should block too.

What does a preflight check?

It compares each request field with the descriptor that gates it and returns a list of problems. Keep it dumb: it does not predict quality, only whether the request can be accepted.

def preflight(model, req):
    problems = []
    d = req.get("duration")
    if d is not None and d not in (model.get("supported_durations") or []):
        problems.append(f"duration {d} not supported")
    res = req.get("resolution")
    if res and res not in (model.get("supported_resolutions") or []):
        problems.append(f"resolution {res} not supported")
    ar = req.get("aspect_ratio")
    if ar and ar not in (model.get("supported_aspect_ratios") or []):
        problems.append(f"aspect_ratio {ar} not supported")
    allowed = model.get("supported_input_references") or []
    for ref in req.get("input_references") or []:
        if ref.get("type") not in allowed:
            problems.append(f"reference type {ref.get('type')} not supported")
    for banned in ("size", "seed"):
        if banned in req:
            problems.append(f"{banned} is rejected on the v1 route")
    if (req.get("provider") or {}).get("options"):
        problems.append("provider.options is rejected on the v1 route")
    return problems

Which fields are always rejected?

The docs say these on the v1 route. Preflight them even though they look harmless, because they are common in clients written for other APIs.

Rejected request fields on /v1/videos, from Sume docs read 2026-10-02
FieldWhat happensUse instead
size400 unsupported_parameterresolution plus aspect_ratio
seedRejected; every model reports seed: falseLog the job id and request
provider.options400 unsupported_parameterNothing; allowed_passthrough_parameters is empty

How do I use it?

Fetch the catalog once per run, pick the entry whose id equals the model you will call, and run preflight on each request before you submit. If the list is empty, send the job; if not, fix the request or pick another model. Whole-second durations only: the catalog lists integers, so a value like 4.5 will not match.

Sources

Related posts

More in Developers

All Developers posts

Written by Sume