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
api.clipsdk.com/v1/uploadsHow it works
- 1POST
/v1/uploadsSend the file's name and size. You get anupload_urland avideo_url. - 2PUT
upload_urlSend the raw bytes within 1 hour. No API key: the URL is signed. - 3POST
/v1/clipsPass thevideo_urllike 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_urlstops 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
Authorizationheader. The signature in the URL is the permission. Content-Lengthmust be thesizeyou 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
sizeover 5 GB gets400 INVALID_REQUESTright away. upload_urlexpires 1 hour after it's issued, atexpires_at. If it lapses, ask for a new one.- Each API key can upload 20 GB a day, counted by
sizeand reset at midnight UTC. Past that, a new ticket gets429 RATE_LIMITEDwith aRetry-Afterheader. - 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 withINPUT_TOO_LONG.