Fast video cut API: precision keyframe and actual_start_seconds
Sume video trim has two modes. Keyframe copies the stream and can start a GOP early; exact re-encodes. Both cost $0.02. Re-base on actual_start_seconds.

To cut a clip quickly with an API, send precision: "keyframe" to POST /v1/video-trim. Sume copies the stream instead of re-encoding it, but the cut can start one GOP early, so read actual_start_seconds from the result and re-base your times against it. The default, exact, is a frame-accurate re-encode. Both cost $0.02 per job.
Exact versus keyframe
The trim input is a media.sume.com clip in your workspace, a start in seconds, and exactly one of end or duration. The source is never changed; the result is a new MP4.
| Mode | How it cuts | Start accuracy | Output conform |
|---|---|---|---|
| exact (default) | Frame-accurate re-encode (libx264, yuv420p); kept audio remuxed as AAC | Frame accurate | Allowed: width, height 256-2160; fps 24, 25, 30, 60 |
| keyframe | Stream copy | Can start a GOP early | Refused: video_trim_output_requires_exact |
Re-basing after a keyframe cut
The docs say a keyframe cut "can start a GOP early". On typical sources the Video inspect page puts a keyframe snap at roughly 0 to 5 seconds, though that figure is for stills, not trims, so treat it as an order of magnitude. The safe pattern is to read the real value.
The result carries video_url, duration_seconds, actual_start_seconds, precision, and audio. Suppose you asked for start: 12, and actual_start_seconds came back lower. Every caption cue or overlay time you planned relative to second 12 must be shifted by the difference. If you then place the clip in a timeline render, use source_in: 0 on the new file, as the docs suggest.
curl -X POST https://api.sume.com/v1/video-trim \
-H "Authorization: Bearer $SUME_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: trim-fast-001" \
-d '{
"video_url": "https://media.sume.com/artifacts/artf_demo/talk.mp4",
"start": 12,
"duration": 20,
"precision": "keyframe"
}'When to choose which
Pick keyframe for rough cuts, previews, or when you will trim again later. Pick exact when the cut point matters, such as removing a claimed song bar, or when you need the output conform to set width, height, or frame rate. Because both modes bill $0.02 per job, there is no price reason to prefer the fast one; the difference is accuracy and whether re-encoding is acceptable.
Clamping works the same way in both: an end past the source end clamps and the result warns trim_clamped_to_source. The output must be at least 0.2 seconds and at most 900 seconds.
Worked example of a re-base
Say you request start: 12 and a 20-second duration with keyframe precision, and the result reports an actual_start_seconds of 10.0 (an illustrative value, not a measurement). The file now begins two seconds earlier than you asked. A caption cue you planned for second 3 of your intended cut is at second 5 of the new file, so add the 2-second difference to every time you planned.
The cleanest alternative is to avoid the problem. If your next step needs times that are exact to the frame, such as burning cues or aligning to an audio spine, use the default exact mode at the same $0.02 price. Use keyframe only when a rough cut is acceptable or you will trim again.
Submit and read
The default mode is async. Pass mode: "sync" to wait up to 30 seconds for a 200; otherwise you receive 202 and poll GET /v1/jobs/:id/status and then GET /v1/jobs/:id/result. There is no GET /v1/video-trim/:id.
Sources
Related posts
More in Media tools
- Dim a 20-minute video: trim to four 300 s pieces, then filter, $0.16
Video filter takes sources up to 300 seconds, video trim up to 1,800. A 20-minute video needs four trims and four filter jobs: 8 x $0.02 = $0.16.
- TTS word timestamps for captions: timestamps.words and what you get
Set timestamps.words true on Sume TTS and the result carries words[] with start and end seconds. A 600-character caption script costs $0.02850.
- Upscale is $0.20: 1K Nano Banana 2.1 plus upscale $0.30 vs 4K $0.20
On Sume a 1K Nano Banana 2.1 image plus Image Upscale costs $0.30, while a native 4K render costs $0.20. When upscaling is worth paying for and when it is not.
- Generate at 4K or upscale a 1K: $0.20 vs $0.30 on Sume
Nano Banana 2.1 at 4K is $0.20. A 1K image plus Sume Image Upscale ($0.20) is $0.30. GPT Image 2.5 low plus upscale is $0.22475, against $0.2225 for high at 4K.
Written by Sume