ClipSDKDOCS
REST Reference (curl)

ClipSDK Clips API Reference (curl)

Complete curl reference for POST /v1/clips, GET /v1/jobs/{id}, DELETE /v1/jobs/{id}, POST /v1/uploads, and post-render clip editing at https://api.clipsdk.com.

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.

FieldType & RangeDefaultBehavior
video_urlHTTPS 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_jobjob_[a-z0-9]{20}NoneRe-clip a succeeded job (<7 days old) skipping already clipped moments.
clipsinteger 1-20 (1-50 paid)5Max ranked clips returned best-first (rank: 1 highest score).
min_secondsinteger 10-90 (10-180 paid)20Minimum duration per clip in seconds.
max_secondsinteger 15-90 (15-180 paid)60Maximum clip duration; must be at least min_seconds + 5.
aspect9:16, 1:1, 4:5, 16:99:161080x1920, 1080x1080, 1080x1350, or 1920x1080 output resolution.
reframeauto, center, noneautoauto tracks active speaker; center crops middle; none fits whole frame over blur.
captionsfalse, preset string, or objectbold8 presets or style object; see Captions & Hooks.
hookboolean or style objectfalseOpening headline overlay (classic, outline, sticky, banner, pill).
languageISO 639-1 (e.g. en, es)AutoSpoken language hint for transcription.
promptstring (<=500 chars)NoneSteers moment selection toward specific themes or speakers.
qualitystandard, highstandardhigh renders higher-bitrate sharper video at 1.5x job price.
bleepbooleanfalseBleeps swear words in audio and censors them in captions, SRT/VTT, and hook.
first_secondsinteger 60-10800First 3hTranscribes, clips, and bills only the opening N seconds (>= min_seconds).
webhook_urlHTTPS URINoneReceives signed job.succeeded or job.failed webhook POST.
POST /v1/clips with custom captions, prompt, and webhookbash
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/uploads source once no other job references it. Returns 200 { "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_FINISHED with Retry-After.
  • 7-Day Automatic Expiry: All rendered MP4, JPG, SRT, VTT, and uploaded source files live at GET /f/{key} for 7 days with HTTP Range support (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.

StepRequestImportant Constraint
1. Request ticketPOST /v1/uploads with { "filename": "ep42.mp4", "size": 842104832 }Returns 201 { upload_url, video_url, expires_at } (valid 1 hour)
2. Upload bytesPUT <upload_url> with raw file stream and Content-Length: <exact size>Do NOT send Authorization; any 2xx confirms storage for 7 days
3. Clip videoPOST /v1/clips passing returned video_urlReuse 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 FieldSchemaNotes
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 / reframe9:16|1:1|4:5|16:9 / auto|center|noneSwitch platform framing without re-transcribing the source video
captions / hook / bleepSame schemas as /v1/clips + hook.textOverride opening headline text (hook.text, <=1024 chars) or toggle profanity bleeping
Fetch clip words and submit a post-render editbash
# 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.