Skip to content

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).

The simplest way. Send the URL of a public video (YouTube, TikTok, Twitch, Kick, Vimeo and others) for analysis. Analyzing costs no credits.

Terminal window
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.

Not every public link can be clipped. These cases come back as 422 with a code naming the reason:

codeWhat happened
LIVE_STREAMThe stream is still on air. Wait for it to end and become a video
PLAYLIST_URLThe URL points to a playlist. Send the link of a single video
CHANNEL_URLThe URL points to a channel. Send the link of a single video
SHORTS_NOT_SUPPORTEDThe video is already a vertical short, there is nothing to cut
AUDIO_ONLYThe link has no video track
INVALID_DURATIONUnder 1 minute, or longer than your plan allows
INVALID_URLThe 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).

For videos on your machine, the upload takes three steps with a presigned URL, sending the bytes straight to storage.

  1. Declare the file name and the content type. The response carries the video_id, the upload_url (where to send the bytes) and expires_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"
    }'
  2. PUT the file straight to the upload_url. Do not send your API key here (the URL is already signed), and use the same Content-Type you declared in the previous step.

    Terminal window
    curl -X PUT "UPLOAD_URL" \
    -H "Content-Type: video/mp4" \
    --data-binary @my-stream.mp4

    The PUT must return 200 before you move on.

  3. 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 PUT returned 200. If the file is not in storage, the response is 404 FILE_NOT_FOUND. If the duration is out of bounds, it returns 400 VIDEO_TOO_SHORT or VIDEO_TOO_LONG (with max_duration).