Fail fast at startup: check video model ids against the catalog

A retired id in config fails at 2 a.m. Check every configured video model against GET /v1/videos/models when your service boots, and refuse to start on a miss.

5 min readSume
All posts

A model id sitting in config is a time bomb: the first request that uses it fails, often long after the deploy. Check at boot instead. Call GET /v1/videos/models, compare every id your service is configured to use, and exit non-zero if one is missing. The video generation docs describe the list, and the admission guide says an unknown model returns 404 model_not_found. OpenAI's Sora ids are the cautionary tale.

Why a boot check beats a scan

Scanning code for old ids finds what is written down. A boot check finds what is actually configured in this environment, including values from environment variables and feature-flag systems that no grep will see. It also catches the reverse failure: a model you depend on being delisted later.

What the check covers (read 2026-10-04)
Source of the idFound by code scanFound by boot check
String in sourceYesYes
Environment variableSometimesYes
Feature-flag valueNoYes
Delisted laterNoYes, on next boot
Duration or resolution no longer supportedNoYes, if you also check limits

A runnable check

This script reads the list with an API key from the environment, compares it with the ids in VIDEO_MODELS (comma separated), and exits 1 on a miss. It uses the data[].id field shown in the docs.

import os, sys, requests

key = os.environ["SUME_API_KEY"]
wanted = [m.strip() for m in os.environ["VIDEO_MODELS"].split(",") if m.strip()]
r = requests.get(
    "https://api.sume.com/v1/videos/models",
    headers={"Authorization": f"Bearer {key}"},
    timeout=15,
)
r.raise_for_status()
have = {m["id"] for m in r.json()["data"]}
missing = [m for m in wanted if m != "sume/auto" and m not in have]
if missing:
    print("unknown video models:", ", ".join(missing))
    sys.exit(1)
print("ok:", ", ".join(wanted))

Check limits as well as ids

An id can stay while its envelope changes. Each catalog entry lists supported_durations, supported_resolutions and supported_aspect_ratios; the docs note limits are not uniform. Extend the check to confirm your default duration and resolution appear in the lists for each model. Fail the deploy, not the customer.

Where to run it

Run it as a container health step, in CI against staging, and once at the start of a batch job. Treat a network failure on the catalog call as a warning, not a reason to block a running service, but treat a definite missing id as fatal. The API reference lists the catalog routes if you also want the public GET /v1/catalog.

Sources

Related posts

More in Developers

All Developers posts

Written by Sume