Back to home

API reference

The autoclip REST API: authenticate with an API key, send a long video by link or upload, start a clip job, poll it and download clips and subtitles.

Last updated: 2026-11-25

The REST API runs the same clip job as the studio and the MCP server, with the same prices, limits and refunds. Every request and answer is JSON over HTTPS at https://autoclip.sh.

Authentication

Create a key at Settings → API keys and send it on every call:

Authorization: Bearer sk_…

Keys act as your account and spend its credits. Keep them out of client-side code and repositories; revoke a leaked key from the same page. A missing, unknown or revoked key answers 401.

Response shape

Every answer has the same envelope. code is 0 on success and data holds the result; otherwise message says what went wrong.

{ "code": 0, "message": "ok", "data": { … } }

1. Send the source

By link (the simplest). The file must be a public https URL to an MP4, MOV, M4A, MP3 or WAV that reports its size:

curl -s https://autoclip.sh/api/clips/sources \
  -H "Authorization: Bearer $AUTOCLIP_KEY" \
  -H "Content-Type: application/json" \
  -d '{"url":"https://example.com/talk.mp4"}'

The answer is the measured source: id, fileName, kind (video or audio), seconds, width and height. Keep the id: it is the sourceId a job takes. GET /api/clips/sources lists your earlier uploads.

By upload (for files on disk). Three calls, in parts:

  1. POST /api/clips/upload/start with {"fileName","contentType","size"} returns sourceId, token, partSize and partCount.
  2. PUT /api/clips/upload/part?n=N with the token in an X-Upload-Token header and the raw bytes of part N as the body (1-based, partSize bytes each, the last one shorter). Each answer holds the part's partNumber and etag.
  3. POST /api/clips/upload/complete with {"sourceId","token","parts":[{"partNumber","etag"}]}. The server measures the stored file and answers with the source.

Sources longer than 60 minutes are refused.

2. Start a job

curl -s https://autoclip.sh/api/clips/jobs \
  -H "Authorization: Bearer $AUTOCLIP_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: talk-2026-11-25" \
  -d '{"sourceId":"…","mode":"shorts","count":8,"focus":"pricing questions"}'
FieldMeaning
sourceIdRequired. From step 1.
modetranscript, clips, vertical or shorts. See the rates.
countHighlights to pick, 1 to 20. Ignored for transcript.
focusOptional, up to 200 characters. Steers which moments are picked.
rangesOptional. [{"start":754,"end":812,"title":"…"}] in seconds: cut exactly these instead of the AI pick (each 15 to 90 s, no overlaps). Not for transcript.
localeen or zh: the language of highlight titles.

The job is charged when it starts: the mode's credits per minute times the source minutes, rounded up, minimum 5 minutes. The answer is the job view with its id and credits. Sending the same Idempotency-Key again returns the first job instead of charging twice.

3. Poll until done

curl -s https://autoclip.sh/api/clips/jobs/$JOB_ID \
  -H "Authorization: Bearer $AUTOCLIP_KEY"

phase moves through audio (long files only), transcribe, pick, render and ends at done or failed. Poll every 20 to 30 seconds; an hour of video usually finishes within a few minutes. When phase is done:

  • clips[] lists each highlight with start, end, title, hook, score, status and output (the MP4 URL).
  • transcriptUrl is the word-timed transcript as JSON.
  • refunded is the credits returned for clips that failed to render.

GET /api/clips/jobs lists your latest jobs, and DELETE /api/clips/jobs/$JOB_ID deletes a finished job with its files.

4. Subtitles

curl -s "https://autoclip.sh/api/clips/jobs/$JOB_ID/subtitles?format=srt" \
  -H "Authorization: Bearer $AUTOCLIP_KEY" -o talk.srt

Use format=vtt for WebVTT.

Errors and limits

StatusMeaning
400The request is invalid; message says which field.
401Missing, unknown or revoked API key.
402Not enough credits. Nothing was charged.
404No such source or job on your account.
422The request was refused by the content check.
429Too fast, or too many jobs running at once. Wait and retry.

A free account runs one job at a time and a paid account three. A clip that fails to render is refunded automatically; a job that produces nothing is refunded in full.

MCP instead of HTTP

Claude, ChatGPT, Cursor and VS Code can run the same job through the MCP server. API keys work there too, as the same Bearer token.