ClipSDKDOCS
Quickstart (curl)

ClipSDK curl Quickstart

Run your first automated video clipping job from the terminal with curl and jq. Send a YouTube link or local MP4 to POST /v1/clips and download 9:16 captioned clips.

Auth Header
Bearer csdk_live_...
Create keys at clipsdk.com/dashboard/keys
Default Wait
60 seconds
Tune ?wait=0..300 or Prefer: respond-async
Free First Video
$0 up to 60m
Test full output before adding prepaid credit

Get Your ClipSDK API Key

ClipSDK authenticates every /v1/* endpoint with Authorization: Bearer csdk_live_... and gives every new account a $0 free first video up to 60 minutes.

Generate a live key in the dashboard at clipsdk.com/dashboard/keys and export it as CLIPSDK_KEY. Never embed live keys in browser bundles; call https://api.clipsdk.com from your backend or connect AI agents through https://mcp.clipsdk.com/mcp.

Export your API keybash
export CLIPSDK_KEY="csdk_live_replace_with_your_key"

Create Ranked Clips in curl

Send one POST https://api.clipsdk.com/v1/clips request in curl with an Idempotency-Key header to transcribe, rank, reframe to 9:16, and burn karaoke captions automatically.

Create clips with curlbash
export CLIPSDK_KEY="csdk_live_your_key"

curl -sS -X POST "https://api.clipsdk.com/v1/clips?wait=60" \
  -H "Authorization: Bearer $CLIPSDK_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: quickstart-ep42-v1" \
  -d '{
    "video_url": "https://www.youtube.com/watch?v=VIDEO_ID",
    "clips": 5,
    "min_seconds": 20,
    "max_seconds": 60,
    "aspect": "9:16",
    "reframe": "auto",
    "captions": "karaoke",
    "hook": true
  }'

Poll Until Succeeded When HTTP 202 Returns

Multi-minute videos return 202 Accepted after ?wait=60 elapses. Hold the next poll open with ?wait=60 and sleep Retry-After seconds between polls:

Long-poll GET /v1/jobs/{id}bash
JOB_ID="job_3k9x0c2m1q8w7e6r5t4y"

while true; do
  RESP=$(curl -sS "https://api.clipsdk.com/v1/jobs/$JOB_ID?wait=60" \
    -H "Authorization: Bearer $CLIPSDK_KEY")
  STATUS=$(printf '%s' "$RESP" | jq -r '.job.status')
  STAGE=$(printf '%s' "$RESP" | jq -r '.job.stage')
  echo "status=$STATUS stage=$STAGE"
  if [ "$STATUS" = "succeeded" ] || [ "$STATUS" = "failed" ]; then
    printf '%s\n' "$RESP" | jq '.job.result.clips[] | {rank, score, title, video, srt}'
    break
  fi
  sleep 5
done

Inspect Returned Clips & Scores

ClipSDK returns HTTP 200 once a job finishes, sorting clips best-first with 0-100 standalone scores, MP4 links, JPG posters, SRT/VTT captions, and billing metadata.

Finished JobEnvelope responsejson
{
  "job": {
    "id": "job_3k9x0c2m1q8w7e6r5t4y",
    "op": "clips",
    "status": "succeeded",
    "stage": null,
    "usage": { "source_minutes": 42.5, "clips": 5, "output_seconds": 214.8 },
    "pricing": { "basis": "source_minutes", "reason": null, "quality_multiplier": 1 },
    "result": {
      "source": { "duration_s": 2550, "language": "en", "speakers": null },
      "clips": [
        {
          "rank": 1,
          "score": 92,
          "title": "Why usage-based video APIs beat seat licenses",
          "reason": "Opens with a bold claim and lands a concrete math proof in 41 seconds.",
          "start_s": 412.4,
          "end_s": 453.6,
          "duration_s": 41.2,
          "post_caption": "Flat seat subscriptions punish irregular publishing schedules...",
          "video": "https://api.clipsdk.com/f/clip_1_1080x1920.mp4",
          "poster": "https://api.clipsdk.com/f/clip_1_poster.jpg",
          "srt": "https://api.clipsdk.com/f/clip_1.srt",
          "vtt": "https://api.clipsdk.com/f/clip_1.vtt"
        }
      ],
      "locked": null
    },
    "error": null,
    "poll_url": "https://api.clipsdk.com/v1/jobs/job_3k9x0c2m1q8w7e6r5t4y"
  }
}
Score BandMeaningRecommended Action
80-100Strong standalone hook and payoff for cold viewersAuto-publish or queue straight to Shorts, Reels, and TikTok
50-79Good insight that benefits from a sharper opening titleAdd or tune a hook headline or trim opening filler via /edit
0-49Context-dependent or housekeeping momentFilter out automatically or request extra cuts with from_job

Upload Local Video Files in curl

ClipSDK supports local MP4, MOV, WebM, and MKV files up to 5 GB through POST /v1/uploads, returning a 1-hour presigned PUT URL and 7-day video_url.

Do Not Send Authorization on the Presigned PUT

Include Authorization: Bearer csdk_live_... on POST /v1/uploads, then omit Authorization on the direct PUT to upload_url and send the exact Content-Length byte count.

Upload local MP4 via POST /v1/uploadsbash
FILE="./episode-42.mp4"
SIZE=$(wc -c < "$FILE" | tr -d ' ')

TICKET=$(curl -sS -X POST "https://api.clipsdk.com/v1/uploads" \
  -H "Authorization: Bearer $CLIPSDK_KEY" \
  -H "Content-Type: application/json" \
  -d "{\"filename\": \"episode-42.mp4\", \"size\": $SIZE}")

UPLOAD_URL=$(printf '%s' "$TICKET" | jq -r '.upload_url')
VIDEO_URL=$(printf '%s' "$TICKET" | jq -r '.video_url')

# PUT raw bytes with exact Content-Length and NO Authorization header
curl -fsS -X PUT "$UPLOAD_URL" \
  -H "Content-Length: $SIZE" \
  --upload-file "$FILE"

curl -sS -X POST "https://api.clipsdk.com/v1/clips?wait=60" \
  -H "Authorization: Bearer $CLIPSDK_KEY" \
  -H "Content-Type: application/json" \
  -d "{\"video_url\": \"$VIDEO_URL\", \"clips\": 5, \"aspect\": \"9:16\", \"captions\": \"bold\"}"

Sync Wait vs Async Webhooks

Use ?wait=60 for CLI scripts and short videos, or send Prefer: respond-async with webhook_url in production SaaS backends to avoid tying up HTTP workers.

ModeRequest OptionBest Fit
Long-poll createPOST /v1/clips?wait=60 (max 300)CLI scripts, agent tools, and short 1-10 minute sources
Immediate async?wait=0 or Prefer: respond-asyncWeb apps queueing work and listening on webhook_url
Safe retriesIdempotency-Key: <unique-id> (24h TTL)Network retry loops without duplicating render spend

Next Steps After Your First Clip

Move from quickstart to production with full parameter schemas, custom caption presets, HMAC-SHA256 webhook verification, and AI agent skills.