AI music exactly 30 seconds: no duration field, use Timeline

Music Router rejects duration and duration_seconds. Ask for the length in the prompt, then fix the exact output length with Timeline 1.0 audio.duration_seconds.

4 min readSume
All posts

You cannot request an exact length from the music endpoint: Sume's Music Router rejects duration and duration_seconds. Say the length in the prompt ("a 30-second track"), then make the final length exact in a Timeline 1.0 render, where audio.duration_seconds sets the output length.

What does the music API accept for length?

Per the Music Router docs, read 2026-10-01: steer length in the prompt, with phrases like "a 2-minute track" or timestamped sections such as [0:00-0:30] Intro: .... The duration fields are refused, so sending one is an error, not a hint. The model may land near the target rather than on it; this post does not claim how close.

How does Timeline make the length exact?

Timeline's audio.duration_seconds is required and runs 1 to 1800, and it is the output length. A single audio.url spine can start at audio.source_in, and the output is still duration_seconds long. If a source is shorter than needed, the docs describe padded or looped short sources as soft warnings, and say the unbilled /plan preflight cannot predict them, so listen to the result.

Timeline fields that shape music length, from the Sume docs, read 2026-10-01.
FieldEffect
audio.duration_secondsOutput length, 1 to 1800 s, required
audio.source_inIn-point into a single audio.url spine
soundtrack.loopLoop flag on an optional music bed
soundtrack.fade_out_secondsFade-out, at most 10 s
soundtrack.gain_dbBed level

What if the music is a bed under other audio?

Use soundtrack for the music and put your voice or other audio on the spine. A soundtrack bed can loop and fade out over at most 10 seconds, so a 30-second video ends on a fade instead of a hard cut. Ducking (duck_db) needs a real spine, not silence.

What are the steps?

Generate with the length in the prompt, import the file with POST /v1/media-imports (Timeline takes only media.sume.com files), then render with audio.duration_seconds: 30 and an Idempotency-Key. Related: one section with an exact length.

Sources

Related posts

More in Developers

All Developers posts

Written by Sume