Clips, Jobs, Uploads & Edit API
Full REST reference for POST /v1/clips, GET and DELETE /v1/jobs/{id}, POST /v1/uploads, word-level clip editing, and Range-enabled /f/{key} downloads.
POST /v1/clips Parameters
POST https://api.clipsdk.com/v1/clips accepts a video_url or from_job plus clip count, aspect ratio, active-speaker reframe, caption preset, hook banner, prompt, and webhook_url.
Control wait behavior with ?wait=0..300 (default 60) or the Prefer header (wait=120 or respond-async). Pass Idempotency-Key (1-255 printable ASCII chars, 24h TTL per API key) to retry safely without double billing; replayed responses include Idempotent-Replayed: true.
| Field | Type & Range | Default | Behavior |
|---|---|---|---|
video_url | HTTPS URI (<=4096 chars) | Required* | 15 supported platforms, direct MP4/MOV/WebM/MKV, or /v1/uploads URL (<=5 GB, <=48h, first 3h clipped). *Omit with from_job. |
from_job | job_[a-z0-9]{20} | None | Re-clip a succeeded job (<7 days old) skipping already clipped moments. |
clips | integer 1-20 (1-50 paid) | 5 | Max ranked clips returned best-first (rank: 1 highest score). |
min_seconds | integer 10-90 (10-180 paid) | 20 | Minimum duration per clip in seconds. |
max_seconds | integer 15-90 (15-180 paid) | 60 | Maximum clip duration; must be at least min_seconds + 5. |
aspect | 9:16, 1:1, 4:5, 16:9 | 9:16 | 1080x1920, 1080x1080, 1080x1350, or 1920x1080 output resolution. |
reframe | auto, center, none | auto | auto tracks active speaker; center crops middle; none fits whole frame over blur. |
captions | false, preset string, or object | bold | 8 presets or style object; see Captions & Hooks. |
hook | boolean or style object | false | Opening headline overlay (classic, outline, sticky, banner, pill). |
language | ISO 639-1 (e.g. en, es) | Auto | Spoken language hint for transcription. |
prompt | string (<=500 chars) | None | Steers moment selection toward specific themes or speakers. |
quality | standard, high | standard | high renders higher-bitrate sharper video at 1.5x job price. |
bleep | boolean | false | Bleeps swear words in audio and censors them in captions, SRT/VTT, and hook. |
first_seconds | integer 60-10800 | First 3h | Transcribes, clips, and bills only the opening N seconds (>= min_seconds). |
webhook_url | HTTPS URI | None | Receives signed job.succeeded or job.failed webhook POST. |
curl -sS -X POST "https://api.clipsdk.com/v1/clips" \
-H "Authorization: Bearer $CLIPSDK_KEY" \
-H "Content-Type: application/json" \
-H "Prefer: respond-async" \
-H "Idempotency-Key: podcast-ep88-main" \
-d '{
"video_url": "https://cdn.example.com/interview-ep88.mp4",
"clips": 8,
"min_seconds": 25,
"max_seconds": 75,
"aspect": "9:16",
"reframe": "auto",
"captions": {
"preset": "karaoke",
"font": "Montserrat",
"position": "bottom",
"keyword_color": "#FACC15",
"pop_in": true
},
"hook": { "template": "pill", "seconds": 4 },
"language": "en",
"prompt": "concrete metrics, pricing lessons, and contrarian opinions",
"quality": "standard",
"bleep": false,
"first_seconds": 3600,
"webhook_url": "https://app.example.com/webhooks/clipsdk"
}'GET and DELETE /v1/jobs/{id}
Poll GET /v1/jobs/{id}?wait=0..300 to track stages (fetching, transcribing, ranking, reframing, rendering) and call DELETE /v1/jobs/{id} to purge finished files early.
Any API key belonging to the account can read a job. While job.status is queued or running, GET /v1/jobs/{id} returns 202 Accepted with Location and Retry-After. Once finished, it returns 200 OK whether status is succeeded or failed. Every response carries a Request-Id header matching error.request_id.
DELETE /v1/jobs/{id}: Deletes the finished job's clips, posters, captions, transcript, and its/v1/uploadssource once no other job references it. Returns200 { "id": "...", "deleted": true }. Billing is unaffected.- Active Jobs Protection: Deleting an in-progress job or one with a rendering clip edit returns
409 JOB_NOT_FINISHEDwithRetry-After. - 7-Day Automatic Expiry: All rendered MP4, JPG, SRT, VTT, and uploaded source files live at
GET /f/{key}for 7 days with HTTPRangesupport (200,206,416) and zero auth header required.
POST /v1/uploads Presigned Uploads
Mint a 1-hour presigned upload_url via POST /v1/uploads for local MP4, MOV, WebM, or MKV files up to 5 GB within the 20 GB per UTC day account quota.
| Step | Request | Important Constraint |
|---|---|---|
| 1. Request ticket | POST /v1/uploads with { "filename": "ep42.mp4", "size": 842104832 } | Returns 201 { upload_url, video_url, expires_at } (valid 1 hour) |
| 2. Upload bytes | PUT <upload_url> with raw file stream and Content-Length: <exact size> | Do NOT send Authorization; any 2xx confirms storage for 7 days |
| 3. Clip video | POST /v1/clips passing returned video_url | Reuse the same video_url across multiple jobs while stored |
Word-Level Post-Render Clip Edits
Paid accounts can inspect word timestamps with GET /v1/jobs/{id}/clips/{rank}/words and re-render individual clips via POST /v1/jobs/{id}/clips/{rank}/edit up to 20 times per clip.
POST /v1/jobs/{id}/clips/{rank}/edit accepts only the fields you want to change (trim, aspect, reframe, captions, hook, words, bleep); omitted fields stay unchanged. It answers 202 Accepted immediately while clip.edit.status stays rendering on GET /v1/jobs/{id}. Once edit.status returns to idle, the clip's video, poster, srt, and vtt URLs point to the new render and edit.revision increments.
| Edit Field | Schema | Notes |
|---|---|---|
trim | { start_s, end_s } (0..segment_s, >=3s) | Relative to the clip's original untrimmed start; later trims can restore earlier cuts |
words | [{ text, start_s, end_s }] (1-3000 items) | Pass the full array from /words with fixed spelling or punctuation |
aspect / reframe | 9:16|1:1|4:5|16:9 / auto|center|none | Switch platform framing without re-transcribing the source video |
captions / hook / bleep | Same schemas as /v1/clips + hook.text | Override opening headline text (hook.text, <=1024 chars) or toggle profanity bleeping |
# 1. Read word timestamps for rank 1
curl -sS "https://api.clipsdk.com/v1/jobs/$JOB_ID/clips/1/words" \
-H "Authorization: Bearer $CLIPSDK_KEY"
# 2. Re-render clip 1 with trim, updated hook text, and bleep enabled
curl -sS -X POST "https://api.clipsdk.com/v1/jobs/$JOB_ID/clips/1/edit" \
-H "Authorization: Bearer $CLIPSDK_KEY" \
-H "Content-Type: application/json" \
-d '{
"trim": { "start_s": 2.4, "end_s": 39.8 },
"captions": { "preset": "bold", "keyword_color": "#FACC15", "pop_in": true },
"hook": { "template": "banner", "text": "Why 90% of video APIs overcharge", "seconds": 4 },
"bleep": true
}'
# 3. Delete the finished job and its 7-day files early when no longer needed
curl -sS -X DELETE "https://api.clipsdk.com/v1/jobs/$JOB_ID" \
-H "Authorization: Bearer $CLIPSDK_KEY"Paid accounts allow 20 edits per clip and 100 edits per UTC day until 1 hour before a job's 7-day files expire (410 CLIP_EXPIRED). Free-tier edit calls return 402 PAYMENT_REQUIRED with error.billing_url.
GET /f/{key} File Delivery
ClipSDK serves every rendered MP4, JPG poster, SRT, and VTT file from GET https://api.clipsdk.com/f/{key} for 7 days with public access and byte-range streaming.
Player elements (<video src="...">), social schedulers, and media workers can stream or copy /f/{key} assets directly without attaching your API key. Mirror long-lived customer assets into your own object storage inside your webhook worker, then optionally call DELETE /v1/jobs/{id} to remove temporary files immediately. Check rate limits and full error codes in Pricing & Limits.