Trim a self-hosted AI clip with Sume: $0.02, audio kept

Open-weights video models give fixed-length clips with sound. Import the file to Sume and cut a start-to-end range with video trim at $0.02 a job.

5 min readSume
All posts

To cut a clip from a self-hosted video model, import the MP4 into your Sume workspace, then call video trim with a start and either an end or a duration. The public rate is $0.02 per job, there is no model inference, and the audio track is kept by default, which matters for models that generate sound with the picture.

Why trim a local clip at all?

Open models produce fixed-length clips. The Kandinsky 6.0 repository, for example, describes 5-second clips with synchronized audio. The first or last half second often holds a settling frame or a clipped syllable. Cutting a clean range is a small job that does not need a GPU or another generation. It also keeps your local pipeline simple: generate with whatever model you run, then do the finishing cut on a hosted worker that runs ffmpeg for you, instead of maintaining your own filter scripts. The API rejects raw ffmpeg fields, so there is nothing to tune beyond the range, precision, audio and an optional output size.

What does the trim route accept?

Video trim takes one clip that already lives on Sume's media host. The docs say the API does not fetch from the open internet, so you import first with the media import route. You send start in seconds and only one of end or duration.

Video trim limits from docs.sume.com, read 2026-10-11
ItemValue
Public rate$0.02 per job
Source lengthUp to 1800 s
Output length0.2 s to 900 s
Audiokeep (default) or drop
Precisionexact (default, frame-accurate re-encode) or keyframe
Idempotency-Key headerRequired

What does the call look like?

Set SUME_API_KEY, use the media.sume.com URL the import gave you, and poll the job until it reports a result.

import os
import requests

key = os.environ.get("SUME_API_KEY", "")
if not key:
    raise SystemExit("Set SUME_API_KEY first")

resp = requests.post(
    "https://api.sume.com/v1/video-trim",
    headers={
        "Authorization": f"Bearer {key}",
        "Idempotency-Key": "trim-local-clip-001",
    },
    json={
        "video_url": "https://media.sume.com/artifacts/artf_demo/clip.mp4",
        "start": 0.4,
        "duration": 4,
    },
    timeout=60,
)
resp.raise_for_status()
print(resp.json())

What can go wrong?

If the URL is not on the Sume media host the API refuses it as an unsupported media source. A start with both end and duration is refused as a range conflict. If your end is past the clip, the cut clamps to the source and the result carries a warning. The result is a new MP4 artifact; the source is never changed.

Use the keyframe mode only when you accept a cut that can start a GOP early, which is a stream copy and avoids a re-encode. For a tight 4-second range from a 5-second clip, leave the default exact mode on.

When should you regenerate instead?

Trim removes frames; it cannot add them. If you need 7 seconds from a 5-second model, stitch clips or use a hosted row with a longer envelope. Sume's Video Router docs list wan-3.0 at 2 to 30 seconds and minimax-h3 at 5 to 15 seconds; read the live catalog capabilities before you choose.

Sources

Related posts

More in Use cases

All Use cases posts

Written by Sume