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.

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.
| Field | Effect |
|---|---|
audio.duration_seconds | Output length, 1 to 1800 s, required |
audio.source_in | In-point into a single audio.url spine |
soundtrack.loop | Loop flag on an optional music bed |
soundtrack.fade_out_seconds | Fade-out, at most 10 s |
soundtrack.gain_db | Bed 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
- Akool talking photo links expire in 7 days: what to archive
Akool says talking photo image, video and voice resources are valid for 7 days, so save them early. Sume media URLs do not expire; archive by need.
- Alibaba's Sora 2, Veo 3.1, Kling 3.0 migration table vs Sume ids
Alibaba Model Studio maps Sora 2, Veo 3.1 and Kling 3.0 to happyhorse-1.1 models. Which of its targets are Sume catalog ids, and how model: sume/auto fits in.
- Amazon A+ createMedia 201, 200, 409: retry-safe uploads on Sume
Amazon's createMedia answers 201, 200 or 409 on retry. Pair it with one Sume Idempotency-Key per asset so a retried submit never bills twice.
- Amazon A+ media status NOT_APPROVED: poll Sume, then upload
Amazon A+ video media moves through PENDING_PROCESSING, PENDING_REVIEW and AVAILABLE. Two clocks run: finish the Sume job first, then poll Amazon.
Written by Sume