Remove part of a video by API: cut a section and rejoin

Video trim keeps one range per job. To cut a section out of the middle, render the kept ranges back to back in one Sume Timeline 1.0 job.

5 min readSume
All posts

To remove part of a video with the Sume API, render the parts you keep back to back in one POST /v1/timeline-1.0/render: each kept range becomes an audio.parts[] slice of the video's detached audio and a video[] slot that reads the same range of the video with source_in. Video trim alone keeps just one [start, end) range per job, so it cannot close the gap.

The facts come from Sume's Timeline 1.0, Audio detach, Video trim, Timeline audio, and Video inspect docs and the Sume API reference, read on 2026-09-27. Anything described as current behavior is read from Sume's code. A single trim is covered in Trim, filter, or detach audio.

Why can't video trim remove a middle section?

A trim returns a new MP4 holding only [start, end) of one clip. To drop seconds 20–35 of a 60-second clip, you keep two ranges, [0, 20) and [35, 60), and join them. One Timeline render can read both ranges straight from the source file, so the only other job is the audio detach.

  • The source must already be your workspace's media.sume.com artifact or asset, such as an earlier Sume job's output. Timeline, trim, and detach do not fetch from the open internet.
  • The REST asset upload routes are hidden from the public API reference, and media imports do not take YouTube links or arbitrary video URLs.

How do I find the section to remove?

Use a transcript. POST /v1/video-inspect with transcribe: true returns words[], each with start and end in seconds from the start of the video, and the gaps between words are the pauses. Put each cut inside a pause so no word is clipped. With segmentation.mode: "sentence", gapless sentence segments[] give you whole sentences to drop.

The transcript bills at the STT 1.0 rate, $0.01 per audio minute; the probe and stills are unbilled, so a visual cut point costs nothing to find.

How do I build the render?

Detach the source's audio with POST /v1/audio-detach. Its default output is a sample-exact wav, the format Timeline's audio wants. Then write one audio part and one video slot per kept range:

  • Audio part: url is the detached wav, source_in the range's start, and duration its length. Parts join gaplessly in the sample domain, and each names its own url, so several can read the same file.
  • Video slot: source_url is the original MP4, with the same source_in and duration. Its start is the running total of the kept lengths before it, and video[0].start is 0.
  • audio.duration_seconds is the sum of the kept lengths. If the parts' declared lengths add up to less, the render refuses with audio_parts_shorter_than_duration.
  • Leave out transition, and set output.width and output.height to the source's size, because the default output is 1080×1920. The unbilled POST /v1/timeline-1.0/plan checks the body first.
curl -X POST https://api.sume.com/v1/timeline-1.0/render \
  -H "Authorization: Bearer $SUME_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: talk-cut-001" \
  -d '{
    "audio": {
      "duration_seconds": 45,
      "parts": [
        { "url": "https://media.sume.com/artifacts/artf_demo/talk.wav", "source_in": 0, "duration": 20 },
        { "url": "https://media.sume.com/artifacts/artf_demo/talk.wav", "source_in": 35, "duration": 25 }
      ]
    },
    "output": { "width": 1920, "height": 1080 },
    "video": [
      { "source_url": "https://media.sume.com/artifacts/artf_demo/talk.mp4", "start": 0, "duration": 20, "source_in": 0 },
      { "source_url": "https://media.sume.com/artifacts/artf_demo/talk.mp4", "start": 20, "duration": 25, "source_in": 35 }
    ]
  }'

What if I keep more than 20 ranges?

audio.parts[] stops at 20 entries, while video[] takes up to 200 slots. For more kept ranges, join the audio first with POST /v1/timeline-1.0/audio and operation: "concat". Each job takes 1–20 parts of the same { url, source_in, duration } shape and returns one audio_url plus segments[], the offsets the docs say to re-base video[].start against. Join groups of 20, then join the results, and pass the final file as audio.url.

What does it cost, and what are the limits?

The render reserves ceil(audio.duration_seconds / 60) minutes, so the 45-second example reserves one. Each step bills on its own, plus a 5.5% agent fee by default. One detach outputs at most 900 seconds, so a longer source needs two detaches with range, and each part's source_in then counts from its own file's start.

From Timeline 1.0, Audio detach, Timeline audio, Video inspect, and API pricing, read 2026-09-27.
StepCallBillingLimits
Find the cutPOST /v1/video-inspect$0.01 per audio minute for a transcriptSource ≤ 1,800 s
AudioPOST /v1/audio-detachFlat per job, in GET /v1/catalogSource ≤ 1,800 s; output ≤ 900 s
CheckPOST /v1/timeline-1.0/planUnbilledNo job, no reservation
RenderPOST /v1/timeline-1.0/render$0.10 per output minuteOutput 1–1,800 s; ≤ 20 audio parts; 1–200 slots, each ≥ 0.2 s
Join audioPOST /v1/timeline-1.0/audioFlat per job, in GET /v1/catalog1–20 parts; ≤ 1,800 s produced

Sources

Related posts

More in Media tools

All Media tools posts

Written by Sume