With the video_id in hand, pick up from the “Submit it for clipping” step (POST /clips)
Submitting a video for clipping
Before generating clips you need a video_id. There are two ways to get one, and both converge on the same next step: calling POST /clips with that video_id (see the Quickstart).
Option A: by public URL
Section titled “Option A: by public URL”The simplest way. Send the URL of a public video (YouTube, TikTok, Twitch, Kick, Vimeo and others) for analysis. Analyzing costs no credits.
curl -X POST https://api.cut.pro/api/v1/clips/info \ -H "X-Api-Key: $CUTPRO_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ" }'The response carries video_id, credits_cost (what you will be charged on submit), current_balance and the title and duration of the video. Keep the video_id and move on to POST /clips.
When the link will not do
Section titled “When the link will not do”Not every public link can be clipped. These cases come back as 422 with a code naming the reason:
code | What happened |
|---|---|
LIVE_STREAM | The stream is still on air. Wait for it to end and become a video |
PLAYLIST_URL | The URL points to a playlist. Send the link of a single video |
CHANNEL_URL | The URL points to a channel. Send the link of a single video |
SHORTS_NOT_SUPPORTED | The video is already a vertical short, there is nothing to cut |
AUDIO_ONLY | The link has no video track |
INVALID_DURATION | Under 1 minute, or longer than your plan allows |
INVALID_URL | The platform is not supported or the address is wrong |
A private, age-restricted or region-blocked video comes back as 403 (PRIVATE_VIDEO, AGE_RESTRICTED, REGION_BLOCKED).
Option B: uploading your own file
Section titled “Option B: uploading your own file”For videos on your machine, the upload takes three steps with a presigned URL, sending the bytes straight to storage.
-
Start the upload
Section titled “Start the upload”Declare the file name and the content type. The response carries the
video_id, theupload_url(where to send the bytes) andexpires_in(seconds until it expires).Terminal window curl -X POST https://api.cut.pro/api/v1/videos/upload \-H "X-Api-Key: $CUTPRO_API_KEY" \-H "Content-Type: application/json" \-d '{"file_name": "my-stream.mp4","content_type": "video/mp4"}' -
Send the bytes to the upload_url
Section titled “Send the bytes to the upload_url”PUTthe file straight to theupload_url. Do not send your API key here (the URL is already signed), and use the sameContent-Typeyou declared in the previous step.Terminal window curl -X PUT "UPLOAD_URL" \-H "Content-Type: video/mp4" \--data-binary @my-stream.mp4The
PUTmust return200before you move on. -
Complete the upload
Section titled “Complete the upload”Register the upload with the dimensions and the duration of the file (measured on your side). The response carries the video metadata and the
credits_cost, same as the URL analysis.Terminal window curl -X POST https://api.cut.pro/api/v1/videos/upload/complete \-H "X-Api-Key: $CUTPRO_API_KEY" \-H "Content-Type: application/json" \-d '{"video_id": "VIDEO_ID","file_name": "my-stream.mp4","duration": 5400,"width": 1920,"height": 1080}'Only call this step after the
PUTreturned200. If the file is not in storage, the response is404 FILE_NOT_FOUND. If the duration is out of bounds, it returns400 VIDEO_TOO_SHORTorVIDEO_TOO_LONG(withmax_duration).