Trim an AI-generated clip without a media import
Generated artifacts already live on media.sume.com, which is the host video-trim accepts. Use media-imports only for clips from outside Sume.

You do not need a media import to trim a clip that Sume generated. POST /v1/video-trim takes a video_url that is a media.sume.com artifact or asset of your workspace, and the docs say Sume mirrors generated outputs into Sume-owned media URLs before showing them in public results. So the artifact url in a completed render job is a valid trim input. Import is for clips that come from somewhere else.
What the trim API accepts
The trim API does not fetch from the open internet. A video_url on any other host is refused at admission as unsupported_media_source, and a dead or foreign-workspace media.sume.com URL gives source_not_found. If the HEAD result is not a video, you get unsupported_media_type.
| Source | Do you import first? | Why |
|---|---|---|
A render from /v1/video-router/generate | No | The result artifact URL is on media.sume.com |
| Another Sume job's output | No | Same host, same workspace |
| A file on your own server | Yes: POST /v1/media-imports | Trim does not fetch off-host URLs |
A URL on example.com | Yes | unsupported_media_source otherwise |
A direct call
Take result.artifacts[].url from the render's result and put it in video_url. The request must carry start and exactly one of end or duration, plus an Idempotency-Key.
curl -X POST https://api.sume.com/v1/video-trim \
-H "Authorization: Bearer $SUME_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: video-trim-001" \
-d '{
"video_url": "https://media.sume.com/artifacts/artf_demo/talk.mp4",
"start": 2,
"duration": 8
}'Limits to keep in mind
The source can be up to 1800 seconds and the output 0.2 to 900 seconds, so a 30-second render is far inside both. duration and end are mutually exclusive: sending both gives video_trim_range_conflict, and neither gives video_trim_range_required. An end past the source clamps and the result carries trim_clamped_to_source in warnings[].
precision defaults to exact, a frame-accurate re-encode. keyframe is a stream copy: the cut can start a GOP early, so read actual_start_seconds from the result and re-base your times. The result's video_url is a new artf_, never the source, and the source is not modified.
Checking a URL before you send it
A one-line host check in your code saves a failed job. If the URL's host is media.sume.com, send it. If it is anything else, import it first and use the Sume URL the import returns. The check is cheap and the error you avoid, unsupported_media_source, is a refusal at admission.
Also check the workspace. A media.sume.com URL from another workspace gives source_not_found, because the trim API reads your workspace's artifacts and assets. This matters if you copy URLs between environments.
After the trim, the result is a new artifact on the same host, so the next step, such as captions, needs no import either.
- Host is
media.sume.com: send it. - Any other host: import first.
- Another workspace's URL:
source_not_found.
Common mistakes
The first is importing a Sume clip you already have: it costs a call and gives you nothing the original URL did not. The second is passing a signed storage URL from your own bucket and expecting the trim API to fetch it; it will not, because only the Sume media host is accepted at admission. The third is sending both end and duration, which fails with video_trim_range_conflict and not with a quiet pick of one.
Fix the request, not the retry: none of these refusals changes if you resend the same body with the same key. Change the input and use a new key, as the retry rules for trim describe.
Sources
Related posts
More in Developers
- Trim and caption a 30-second AI clip: two fixed prices, $0.22
Trim is $0.02 per job and captions are $0.20 per accepted job for videos up to 60 s, so a 30-second AI clip costs $0.22 after the render.
- Korean TTS segment text has no spaces, unless a digit is in it
Sume's TTS segment text joins tokens with spaces only if one has a Latin letter or digit; else with nothing. Use segments for timing, your script for text.
- TTS sentence slices: mp3 gives timings only, wav gives audio_urls
Sume TTS segmentation returns sentence timings for any container, but slice audio_urls only with wav or raw. Request shape, the 70 ms rule and when to pick wav.
- Pipes and @{} markers in a Sume TTS transcript: stripped, never spoken
Sume strips || cue breaks, @{...} markers and the display side of <display|spoken> before the voice reads; an empty result returns 400 transcript_no_speech.
Written by Sume