ClipSDK API Quickstart
Turn any long video URL or local MP4 up to 5 GB into ranked 9:16 captioned clips in one REST call. Switch tabs below for tailored curl, Python, or Node.js runnable scripts.
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 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.
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:
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
doneInspect 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.
{
"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 Band | Meaning | Recommended Action |
|---|---|---|
80-100 | Strong standalone hook and payoff for cold viewers | Auto-publish or queue straight to Shorts, Reels, and TikTok |
50-79 | Good insight that benefits from a sharper opening title | Add or tune a hook headline or trim opening filler via /edit |
0-49 | Context-dependent or housekeeping moment | Filter 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.
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.
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.
| Mode | Request Option | Best Fit |
|---|---|---|
| Long-poll create | POST /v1/clips?wait=60 (max 300) | CLI scripts, agent tools, and short 1-10 minute sources |
| Immediate async | ?wait=0 or Prefer: respond-async | Web apps queueing work and listening on webhook_url |
| Safe retries | Idempotency-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.
- Inspect every field for
/v1/clips,from_job, and word-level/editin Clips & Jobs Reference. - Customize burned-in typography, 8 presets, hook templates, and
bleepin Captions & Hooks. - Verify signed
job.succeededevents with replay protection in Webhooks. - Grab ready-made production scripts and agent
SKILL.mdfiles from bitgate/clipsdk-api-skills.