Duration dropdown from supported_durations: 27, 29 and 8 choices

Seedance 2.5 offers 27 lengths, Wan 3.0 29, Omni Flash 1.1 8. Map supported_durations to options in TypeScript, with the price of the longest option.

4 min readSume
All posts

supported_durations on GET /v1/videos/models is the list your length picker should render: Seedance 2.5 gives 27 choices (4 to 30 s), Wan 3.0 gives 29 (2 to 30 s) and Gemini Omni Flash 1.1 gives 8 (3 to 10 s). Build the dropdown from that array and the 400 for an unsupported length never reaches a user.

Counts and the price of the longest option

The ranges below come from the docs model pages; confirm them against the live array, because the docs say to always read supported_durations from the endpoint. The last column is the cost of the top option, so the picker can show a price next to the longest clip.

Duration options and top-length cost, billable USD (read 2026-10-09)
ModelRangeOptionsLongest clipRate per secondTotal
seedance-2.54 to 30 s2730 s, 720p, 9:16$0.5778$17.334
wan-3.02 to 30 s2930 s, 720p$0.125$3.75
gemini-omni-flash-1.13 to 10 s810 s, 720p$0.125$1.25
minimax-h35 to 15 s1115 s, 768p$0.075$1.125

Map the array to options

Fetch the catalog once per page load, find the selected model and map its durations. Keep the value as a number, because the request field duration is an integer.

const res = await fetch("https://api.sume.com/v1/videos/models", {
  headers: { Authorization: `Bearer ${process.env.SUME_API_KEY}` },
});
const { data } = await res.json();
const model = data.find((m: { id: string }) => m.id === "wan-3.0");
const options = model.supported_durations.map((s: number) => ({
  value: s,
  label: `${s} s`,
}));
console.log(options.length, options[0], options.at(-1));

Gotchas

Re-render the dropdown when the model changes: switching from Wan 3.0 (2 to 30 s) to Omni Flash 1.1 (3 to 10 s) must reset a 20 s choice, not keep it. The OpenAPI schema only says duration is an integer of at least 1, so the per-model limit lives in the catalog, not in the request schema.

Do this in your backend or a build step if the key must stay private. Never ship SUME_API_KEY to a browser.

Sources

Related posts

More in Developers

All Developers posts

Written by Sume