Cut a 3-minute Short from a longer render with video trim
YouTube Shorts and Instagram's recommended Reel length both stop at three minutes. Cut 180 seconds from a longer clip with video trim, using start and duration.

A 7-minute vertical render is too long for a YouTube Short and, per Instagram, over the length that is recommended to new audiences. Cutting a 180-second window is a one-call job.
The call
Video trim takes video_url, start, and exactly one of end or duration. duration runs from 0.2 to 900 s. The source may be up to 1,800 s. The default precision is exact, a frame-accurate re-encode; keyframe is a stream copy that can start a GOP early. The rate is $0.02 per job.
| Field | Value |
|---|---|
| start | 60 |
| duration | 180 |
| precision | exact (default) |
| audio | keep (default) |
Request
import json, os, urllib.request
body = {
"video_url": "https://media.sume.com/artifacts/example/long.mp4",
"start": 60,
"duration": 180,
}
req = urllib.request.Request(
"https://api.sume.com/v1/video-trim",
data=json.dumps(body).encode(),
headers={
"Authorization": "Bearer " + os.environ["SUME_API_KEY"],
"Content-Type": "application/json",
"Idempotency-Key": "trim-180-001",
},
method="POST",
)
print(urllib.request.urlopen(req).read().decode())Edge cases
If end is past the source it clamps and returns trim_clamped_to_source. Sending end and duration together is refused with video_trim_range_conflict. Use the new video_url from the result, never the source.
Sources
Related posts
More in Developers
- Debug a Sume webhook signature mismatch offline: a diagnosis script
Saved a failing Sume webhook? This Python script tells you if it was a stale timestamp, an empty secret, a mutated body or the wrong secret. Self-test included.
- Dedupe Sume webhooks with SQLite: INSERT OR IGNORE on job_id and event
Sume retries up to 10 times and Redeliver repeats events. A stdlib SQLite table keyed on job_id and event makes your video webhook handler safe to run twice.
- Two model fields: deepseek-flash for your planner, sume-agent for Sume
Your planner config says deepseek-flash. The Sume Agent Completion model field takes only sume-agent. Keep them in separate settings.
- DeepSeek V4.1 Flash peak pricing vs Sume spend caps for agent loops
DeepSeek bills Flash at double rates 01:00-04:00 and 06:00-10:00 UTC on weekdays. Sume spend caps cover generation only, so budget planner tokens separately.
Written by Sume