Endpoints

Upload a file

For a video on your disk or in private storage: get a signed upload URL, PUT the file to it, then pass the returned video_url to POST /v1/clips.

POST/v1/uploads

How it works

  1. 1POST/v1/uploadsSend the file's name and size. You get an upload_url and a video_url.
  2. 2PUTupload_urlSend the raw bytes within 1 hour. No API key: the URL is signed.
  3. 3POST/v1/clipsPass the video_url like any other video link.

Request an upload URL

Tell us the file's name and size, with your API key like every other call.

filenamestringRequired
The file's name, like episode-112.mp4. MP4, MOV, WebM or MKV.
sizeintegerRequired
File size in bytes, up to 5 GB.

You get 201 Created with the upload ticket:

upload_urlstring
Signed URL to PUT the file to. Use it exactly as you got it: don't parse it or change it.
video_urlstring
Where the file lives once it's uploaded. Pass it to POST /v1/clips.
expires_atstring
When upload_url stops working, 1 hour after it was issued, in ISO 8601 UTC.

Upload the file

Send the file to upload_url with a PUT:

  • The body is the raw file bytes, not a multipart form.
  • Don't send your API key or any Authorization header. The signature in the URL is the permission.
  • Content-Length must be the size you sent. curl and Python's requests set it for you; with Node's fetch, set it yourself, as the example does.
  • Any 2xx answer means the file is stored.

Stream big files

The examples stream the file from disk, so a 5 GB upload doesn't need 5 GB of memory.

Create clips

Pass video_url to POST /v1/clips like any other video link. Every other field works as usual.

curl https://api.clipsdk.com/v1/clips \
  -H "Authorization: Bearer $CLIPSDK_KEY" \
  -H "Content-Type: application/json" \
  -d '{"video_url": "https://api.clipsdk.com/f/in/7h2k9d4m1q8w3e5r/episode-112.mp4"}'

Limits and expiry

  • Files up to 5 GB and 3 hours, in MP4, MOV, WebM or MKV. A size over 5 GB gets 400 INVALID_REQUEST right away.
  • upload_url expires 1 hour after it's issued, at expires_at. If it lapses, ask for a new one.
  • Each API key can upload 20 GB a day, counted by size and reset at midnight UTC. Past that, a new ticket gets 429 RATE_LIMITED with a Retry-After header.
  • Uploaded files are kept for 7 days.
  • We check the video itself when the job runs. A file we can't read fails the job with INPUT_UNSUPPORTED, and one over 3 hours with INPUT_TOO_LONG.