> ## Documentation Index
> Fetch the complete documentation index at: https://cut.pro/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Sending a video for clipping

> The two ways to get a video_id: by public URL or by uploading your own file

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](/docs/en/api-reference/quickstart)).

<Note>
  The video must be **at least 1 minute** long. The maximum duration depends on your plan.
</Note>

## Option A: by public URL

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

```bash theme={null}
curl -X POST https://api.cut.pro/api/v1/clips/info \
  -H "X-Api-Key: YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "url": "https://www.youtube.com/watch?v=..." }'
```

The response includes `video_id`, `credits_cost` (what you will be charged when you submit), `current_balance`, and the video's title/duration. Save the `video_id` and continue to `POST /clips`.

## Option B: uploading your own file

For videos from your computer, the upload is done in **three steps** with a presigned URL, sending the bytes directly to storage.

<Note>
  Upload limits: **maximum 2 GB** and extensions **`.mp4`, `.mov`, `.webm`, `.mkv`**. The presigned URL expires in **1 hour**.
</Note>

<Steps>
  <Step title="Start the upload">
    Declare the file name and the content type. The response includes the `video_id`, the `upload_url` (where to send the bytes), and `expires_in` (seconds until it expires).

    ```bash theme={null}
    curl -X POST https://api.cut.pro/api/v1/videos/upload \
      -H "X-Api-Key: YOUR_KEY" \
      -H "Content-Type: application/json" \
      -d '{
        "file_name": "minha-live.mp4",
        "content_type": "video/mp4"
      }'
    ```
  </Step>

  <Step title="Send the bytes to the upload_url">
    Do a `PUT` of the file directly 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.

    ```bash theme={null}
    curl -X PUT "UPLOAD_URL" \
      -H "Content-Type: video/mp4" \
      --data-binary @minha-live.mp4
    ```

    The `PUT` must return `200` before you continue.
  </Step>

  <Step title="Complete the upload">
    Register the upload, providing the dimensions and duration of the file (measured on your side). The response includes the video metadata and `credits_cost`, just like analysis by URL.

    ```bash theme={null}
    curl -X POST https://api.cut.pro/api/v1/videos/upload/complete \
      -H "X-Api-Key: YOUR_KEY" \
      -H "Content-Type: application/json" \
      -d '{
        "video_id": "VIDEO_ID",
        "file_name": "minha-live.mp4",
        "duration": 5400,
        "width": 1920,
        "height": 1080
      }'
    ```

    <Warning>
      Only call this step after the `PUT` returns `200`. If the file is not in storage, the response is `404 FILE_NOT_FOUND`. If the duration is outside the limits, it returns `400 VIDEO_TOO_SHORT` or `VIDEO_TOO_LONG` (with `max_duration`).
    </Warning>
  </Step>
</Steps>

## Next step

With the `video_id` in hand (from either option), submit it for clipping:

<Card icon="terminal" href="/docs/en/api-reference/quickstart" horizontal>
  Continue in the **Quickstart** from the "Send for clipping" step (`POST /clips`).
</Card>
