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
- Avatar video captions error over 60 seconds: split the script
Inline captions on an avatar video are rejected when the estimated duration is over 60 seconds, the same cap as the job. Split long scripts into jobs.
- Green screen removal by API: chromakey in a video filter graph
Sume's video filter allowlists chromakey and colorkey, but an MP4 holds no alpha, so a key must be composited inside the graph. Not AI background removal.
- Claude mcp_tool_listing pin: what a Sume tool list depends on
A pinned mcp_tool_listing holds the Sume tool list fetched for one session scope. Sume's list depends on mcp:read vs mcp:write and never pushes list changes.
- Claude Code MCP 403 insufficient_scope: re-auth Sume with Write
Claude Code 2.1.274 names the missing permission on a 403 insufficient_scope. For Sume, a read-only grant lacks mcp:write: re-authenticate and turn Write on.
Written by Sume