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

# Upload Video and Create Clip Project

> Upload a video file with the V2 upload-link API and create a clip project using the Opus API.

> [!WARNING]
>
> This guide uses **V2** of the upload-link API: `POST /api/upload-links-v2`.
> **V1 (`POST /api/upload-links`) is deprecated and stops working on December 24, 2026.**
> If your integration calls V1, follow [Migrate from V1](#migrate-from-v1). The change takes a few minutes.

## Overview

This guide shows how to upload a video file to Google Cloud Storage (GCS) with the Opus API and then create a clip project from it. There are four steps: get an upload link, start a resumable upload session, upload the video, and create the clip project.

***

## Authentication

All API requests require an API key:

```
Authorization: Bearer <API_KEY>
```

> [!TIP]
>
> Replace `<API_KEY>` with your valid API token.

***

## Step 1: Generate Upload Link

### Endpoint

```
POST https://api.opus.pro/api/upload-links-v2
```

### Headers

```
Accept: application/json
Content-Type: application/json
Authorization: Bearer <API_KEY>
```

### Request Body

```json theme={"dark"}
{
  "usecase": "LocalUpload"
}
```

### Response Example

```json theme={"dark"}
{
  "url": "https://storage.googleapis.com/ext.gcs.opus.pro/upload/org_000000000/google-upload",
  "uploadId": "abc123xyz456",
  "useAmount": 0,
  "totalAmount": 107974182498,
  "contentType": "application/octet-stream",
  "requiredHeaders": {
    "x-goog-resumable": "start",
    "Content-Type": "application/octet-stream"
  }
}
```

> [!NOTE]
>
> * `url` is a signed URL. The file's content type is part of the signature.
> * `requiredHeaders` lists the headers you must send in Step 2, exactly as returned.
> * Keep `uploadId` for Step 4.

### cURL Example

```bash theme={"dark"}
curl --request POST \
  --url https://api.opus.pro/api/upload-links-v2 \
  --header 'Accept: application/json' \
  --header 'Content-Type: application/json' \
  --header 'Authorization: Bearer <API_KEY>' \
  --data '{
    "usecase": "LocalUpload"
  }'
```

***

## Step 2: Initiate Resumable Upload Session

### Endpoint

```
POST <url_from_previous_step>
```

### Headers

Send every header in `requiredHeaders` from Step 1, plus `Content-Length: 0`:

```
x-goog-resumable: start
Content-Type: application/octet-stream
Content-Length: 0
```

### Request Body

(empty)

> [!WARNING]
>
> Send the `requiredHeaders` values exactly as returned. If a header is missing or different, GCS rejects the request with `403`.

> [!NOTE]
>
> * Replace `<url_from_previous_step>` with the `url` received from Step 1
> * No response body is returned
> * Look for the `location` header in the response which contains the resumable upload URL

### Example Response Headers

```
HTTP/2 201
x-goog-resumable-upload-id: AAkIAwy-YC6V...
location: https://storage.googleapis.com/ext.gcs.opus.pro/upload/org_000000000/google-upload
```

### cURL Example

```bash theme={"dark"}
curl --request POST \
  --url "<url_from_previous_step>" \
  --header 'x-goog-resumable: start' \
  --header 'Content-Type: application/octet-stream' \
  --header 'Content-Length: 0' \
  --verbose
```

***

## Step 3: Upload Video File

### Endpoint

```
PUT <resumable_upload_location>
```

### Headers

```
Content-Type: application/octet-stream
```

### Upload File

Use the `--upload-file` option with your actual video file (e.g., `test.mp4`).

### cURL Example

```bash theme={"dark"}
curl -X PUT -v \
  -H "Content-Type: application/octet-stream" \
  --upload-file test.mp4 \
  "<location>"
```

> [!TIP]
>
> Replace `<location>` with the `location` URL from Step 2 response headers.

***

## Step 4: Create Clip Project

### Endpoint

```
POST https://api.opus.pro/api/clip-projects
```

### Headers

```
Accept: application/json
Content-Type: application/json
Authorization: Bearer <API_KEY>
```

### Response Headers

```
...other headers
x-opus-upload-id: <source_id_from_upload_source>
```

### Request Body

```json theme={"dark"}
{
  "videoUrl": "<uploadId>",
  "conclusionActions": [
    {
      "type": "EMAIL",
      "notifyFailure": true,
      "email": "opusclip@opus.pro"
    }
  ],
  "curationPref": {
    "range": {
      "startSec": 28,
      "endSec": 636
    },
    "clipDurations": [
      [
        0,
        90
      ]
    ],
    "topicKeywords": [
      "OpusClip"
    ],
    "genre": "Auto",
    "skipCurate": false
  },
  "importPref": {
    "sourceLang": "auto"
  },
  "brandTemplateId": "preset-fancy-Karaoke"
}
```

### cURL Example

```bash theme={"dark"}
curl --request POST \
  --url https://api.opus.pro/api/clip-projects \
  --header 'Accept: application/json' \
  --header 'Content-Type: application/json' \
  --header 'Authorization: Bearer <API_KEY>' \
  --data '{
    "videoUrl": "<uploadId>",
    "conclusionActions": [
      {
        "type": "EMAIL",
        "notifyFailure": true,
        "email": "opusclip@opus.pro"
      }
    ],
    "curationPref": {
      "range": {
        "startSec": 28,
        "endSec": 636
      },
      "clipDurations": [
        [
          0,
          90
        ]
      ],
      "topicKeywords": [
        "OpusClip"
      ],
      "genre": "Auto",
      "skipCurate": false
    },
    "importPref": {
      "sourceLang": "auto"
    },
    "brandTemplateId": "preset-fancy-Karaoke"
  }'
```

> [!NOTE]
>
> **`forceStrategy` (optional, advanced)** pins curation to an explicit
> strategy instead of letting OpusClip auto-select one.
> [Talk to our support team](https://www.opus.pro/contact-support) to learn how
> to use it.

> [!NOTE]
>
> * Replace `<uploadId>` with the ID returned in Step 1

> [!TIP]
>
> For detailed explanations of the project-creation request body, refer to [Create a New Project](https://help.opus.pro/api-reference/endpoints/create-project.md), which documents the `POST /api/clip-projects` API.

***

## Full Workflow Summary

**1. Generate Upload Link**

Get `url`, `uploadId`, and `requiredHeaders` from `POST /api/upload-links-v2`

**2. Start Resumable Session**

Send `requiredHeaders` to the `url` from Step 1 and get `location` from the response headers

**3. Upload Video File**

Upload your video file to the `location` from Step 2

**4. Create Clip Project**

Create a new clip project using the `uploadId` from Step 1

***

## Migrate from V1

V1 (`POST /api/upload-links`) stops working on **December 24, 2026**. After that date, V1 requests fail and uploads stop. V2 sets the file's content type on the server and signs it into the upload URL, so a file cannot be stored with a type the client chose.

To move an existing integration, make two changes. Steps 3 and 4 stay the same.

| | V1 (deprecated) | V2 |
| - | - | - |
| Step 1 endpoint | `POST /api/upload-links` | `POST /api/upload-links-v2` |
| Step 1 body | `{"video": {"usecase": "LocalUpload"}}` | `{"usecase": "LocalUpload"}` (the V1 body also works) |
| Step 2 headers | `x-goog-resumable: start` | Every header in `requiredHeaders`: `x-goog-resumable: start` and `Content-Type: application/octet-stream` |

> [!TIP]
>
> The V1 guide stays available for reference: [Upload Video and Create Clip Project (V1, deprecated)](https://help.opus.pro/api-reference/endpoints/upload-video-create-project-v1.md).

***

## Related Endpoints

> [card] [POST /api/clip-projects](https://help.opus.pro/api-reference/endpoints/create-project.md)
>
> Refer to the full API reference for creating a clip project.

> [card] [Get Clips](https://help.opus.pro/api-reference/endpoints/get-clips.md)
>
> Retrieve clips from your created projects


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.