Cut a 30-second hook from a video's audio: detach with a range
Pull just seconds 45 to 75 of a Sume-hosted video as a mono mp3 with POST /v1/audio-detach and range. Source and output caps, price and refusals.

How do you extract a short section of a video's audio? Call POST /v1/audio-detach with a video_url and a range of { start, end } in seconds, and ask for format: "mp3" if you want a small file. The docs say it takes one workspace media.sume.com video and returns a new audio artifact, leaving the video untouched.
The default format is sample-exact wav, mp3 is 128 kbps, and channels can be source or mono. A whole track longer than 900 seconds needs a range, since the output cap is 900 seconds.
The request
Idempotency-Key is required and video_url must be this workspace's media.sume.com file; off-host URLs are rejected, so import first with POST /v1/media-imports. mode: "sync" waits up to 30 seconds.
curl -X POST https://api.sume.com/v1/audio-detach \
-H "Authorization: Bearer $SUME_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: hook-detach-001" \
-d '{
"video_url": "https://media.sume.com/artifacts/artf_demo/talk.mp4",
"format": "mp3",
"range": { "start": 45, "end": 75 },
"channels": "mono"
}'Options and caps
| Field | Rule |
|---|---|
format | wav default, or mp3 at 128 kbps |
range | { start, end? } seconds; end open-ended when omitted |
channels | source default, or mono |
sample_rate | 16000, 44100 or 48000; omit to inherit |
| Source length | Up to 1800 seconds |
| Output length | Up to 900 seconds |
Read the result
When the job is ready, GET /v1/jobs/:id/result returns kind: audio_detach with audio_url, duration_seconds, format, channels, sample_rate, source_duration_seconds and optional warnings[]. There is no GET /v1/audio-detach/:id; poll the job envelope instead. The public rate is $0.01 per job.
Common refusals
A source with no audio fails detach_source_has_no_audio; check probe.has_audio with video inspect first. A start past the end fails detach_start_past_source, and an end at or before start fails audio_detach_range_empty. ffmpeg-style fields such as filter or codec are rejected with ffmpeg_fields_rejected, because the server compiles ffmpeg itself.
Sources
Related posts
More in Developers
- Claude rejects forced tool_choice: steer generate_video by description
Claude Sonnet 5.5 and Opus 5.5 return a 400 for tool_choice any or tool, and thinking cannot be disabled. Steer Sume tool calls with descriptions and a dry run.
- Docker Compose: make a Sume webhook receiver refuse an empty secret
Use ${SUME_COM_WEBHOOK_SIGNING_SECRET:?message} in compose.yaml so docker compose stops before the receiver starts, and check again in the app code.
- Draft with GPT Image 2.5 Flare, finish with Sunburst: a two-pass edit
OpenAI pairs Flare with fast generation and Sunburst with editing precision. A Python two-pass on Sume's Image API that drafts, then refines the first result.
- Dramatiq retry_when for Sume: retry only retryable errors
A Dramatiq actor with retry_when that retries 429 and 5xx but not 402 or 400, and sends one stable Idempotency-Key so a retried Sume submit is not billed twice.
Written by Sume