ClipSDKDOCS
REST Reference (Node.js)

ClipSDK Clips API Reference (Node.js)

Complete Node.js reference for POST /v1/clips, async job polling, from_job passes, presigned uploads, and post-render clip editing on 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.
Create async clipping job + second-pass from_job in Node.jsjavascript
const API_KEY = process.env.CLIPSDK_KEY;

async function postClips(body, idempotencyKey) {
  const res = await fetch("https://api.clipsdk.com/v1/clips", {
    method: "POST",
    headers: {
      Authorization: `Bearer ${API_KEY}`,
      "Content-Type": "application/json",
      Prefer: "respond-async",
      "Idempotency-Key": idempotencyKey,
    },
    body: JSON.stringify(body),
  });
  if (!res.ok) throw new Error(`HTTP ${res.status}: ${await res.text()}`);
  return (await res.json()).job;
}

const firstJob = await postClips(
  {
    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", keyword_color: "#FACC15", pop_in: true },
    hook: { template: "pill", seconds: 4 },
    first_seconds: 3600,
    webhook_url: "https://app.example.com/webhooks/clipsdk",
  },
  "ep88-pass-1",
);

const moreJob = await postClips(
  { from_job: firstJob.id, clips: 5, captions: "minimal" },
  "ep88-pass-2",
);
console.log({ first: firstJob.id, second: moreJob.id });

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
Inspect words, fix a caption word, trim, and poll edit status in Node.jsjavascript
const API_KEY = process.env.CLIPSDK_KEY;
const JOB_ID = "job_3k9x0c2m1q8w7e6r5t4y";

const headers = { Authorization: `Bearer ${API_KEY}`, "Content-Type": "application/json" };

const wordsRes = await fetch(`https://api.clipsdk.com/v1/jobs/${JOB_ID}/clips/1/words`, { headers });
const { segment_s, words } = await wordsRes.json();

const fixedWords = words.map((w) =>
  w.text.toLowerCase() === "clip-sdk" ? { ...w, text: "ClipSDK" } : w,
);

await fetch(`https://api.clipsdk.com/v1/jobs/${JOB_ID}/clips/1/edit`, {
  method: "POST",
  headers,
  body: JSON.stringify({
    trim: { start_s: 1.8, end_s: Math.max(5, segment_s - 1.0) },
    words: fixedWords,
    hook: { template: "banner", text: "How we cut render costs 4x", seconds: 4 },
  }),
});

for (;;) {
  const { job } = await (await fetch(`https://api.clipsdk.com/v1/jobs/${JOB_ID}`, { headers })).json();
  const clip = job.result.clips.find((c) => c.rank === 1);
  if (clip.edit.status !== "rendering") {
    console.log("Updated clip:", clip.edit.status, clip.video);
    break;
  }
  await new Promise((r) => setTimeout(r, 4000));
}

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.