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

# Tạo video

> Giao diện tạo video định dạng tương thích OpenAI Sora. Hỗ trợ chế độ tạo từ văn bản thành video và tạo bằng ảnh/video tham chiếu.

- `POST /v1/videos`: Tạo tác vụ video
- `GET /v1/videos/{video_id}`: Truy vấn trạng thái tác vụ
- `GET /v1/videos/{video_id}/content`: Lấy nội dung nhị phân của video

Hiện chưa cung cấp ra bên ngoài:
- `GET /v1/videos`
- `POST /v1/videos/{video_id}/remix`

Header xác thực tiêu chuẩn:
- `Content-Type: application/json`

1. `POST /v1/videos` tạo tác vụ, lấy `id`
2. Thăm dò `GET /v1/videos/{id}` cho đến khi `completed` hoặc `failed`
3. Sau khi hoàn tất, ưu tiên sử dụng `video_url` trong kết quả trả về
4. Nếu cần tải xuống thống nhất, gọi `GET /v1/videos/{id}/content`

Tham số cốt lõi:
- `model: string`: Bắt buộc, tên mô hình công khai
- `prompt: string`: Khuyến nghị, mô tả tạo video
- `seconds: number|string`: Tùy chọn, thời lượng mục tiêu
- `duration: number|string`: Tùy chọn, bí danh thời lượng
- `size: string`: Tùy chọn, kích thước đầu ra
- `mode: string`: Tùy chọn, các giá trị phổ biến `t2v` `i2v` `i2v_first_last` `reference_material`

Tham số tương thích thường dùng:
- `aspect_ratio`
- `ratio`
- `quality`
- `resolution`
- `fps`
- `image`
- `image_url`
- `image_urls`
- `images`
- `reference_images`
- `input_reference`
- `end_image_url`
- `last_image_url`
- `video_urls`
- `audio_urls`
- `function_mode`
- `content`
- `callback_url`
- `external_task_id`

Các tham số mở rộng thường dùng của Kling:
- `model_name`
- `negative_prompt`
- `cfg_scale`
- `sound`
- `camera_control`
- `image_list`
- `video_id`
- `task_id`
- `watermark_info`

### 4.1 Dòng Veo

Lưu ý: `stable`, `official` v.v. biểu thị các nhóm khác nhau, không phải hậu tố `model` dùng đối ngoại; khi gọi, vui lòng giữ `model` là tên mô hình cơ sở, nhóm tài khoản hoặc mã thông báo sẽ quyết định thực tế đi qua nhóm nào.

#### Mô hình chính Veo 3.x

- `veo3`
- `veo3-fast`
- `veo3-fast-frames`
- `veo3-frames`
- `veo3-pro`
- `veo3-pro-frames`
- `veo3.1`
- `veo3.1-fast`
- `veo3.1-pro`
- `veo3.1-components`
- `veo3.1-4k`
- `veo3.1-pro-4k`

Khuyến nghị:
- Với video tạo từ văn bản thuần túy, ưu tiên dùng mô hình chính `veo3*` / `veo3.1*`
- Với các tình huống tạo video từ ảnh hoặc từ tham chiếu, nên truyền rõ ràng `mode + image_url/reference_images`

### 4.2 Dòng Sora

Mô hình cơ sở:
- `sora-2`
- `sora-2-pro`

Khuyến nghị:
- `sora-2*` phù hợp cho các lệnh gọi thông dụng
- Nếu cần sử dụng các nhóm như `stable` / `official`, vui lòng giữ `model` là tên mô hình cơ sở, không thêm hậu tố vào sau tên mô hình.

Ví dụ yêu cầu:

```json
{
  "size": "1280x720",
  "images": [
    "https://example.png"
  ],
  "model": "sora-2",
  "prompt": "this is an example",
  "duration": 12,
  "fps": "24",
  "seed": "20231024",
  "mode": "i2v"
}
```

### 4.3 Dòng HappyHorse

Mô hình công khai:
- `happyhorse-1.0`

Khuyến nghị:
- `happyhorse-1.0` được phân biệt thông qua `mode`, `t2v`, `i2v`, `r2v`, `video_edit`.
- Trong định dạng tương thích của Sora, nên dùng mảng `content` để truyền các mục phương tiện.
- Mục văn bản dùng `type=text`, mục phương tiện dùng `type=image_url` và có thể kết hợp `role`, `name` để đánh dấu mục đích sử dụng của tài nguyên.

Ví dụ yêu cầu:

```json
{
  "size": "720x1280",
  "model": "happyhorse-1.0",
  "mode": "r2v",
  "prompt": "this is an example",
  "duration": 15,
  "content": [
    {
      "type": "text",
      "text": "this is an example"
    },
    {
      "type": "image_url",
      "image_url": {
        "url": "https://example.png"
      },
      "role": "reference_image",
      "name": "image1"
    }
  ],
  "parameters": {
    "resolution": "720P",
    "ratio": "9:16",
    "duration": 15,
    "seed": 1
  }
}
```

### 4.4 Dòng Seedance

Mô hình công khai:
- `doubao-seedance-1-0-lite-t2v-250428`
- `doubao-seedance-1-0-lite-i2v-250428`
- `doubao-seedance-1-0-pro-250528`
- `doubao-seedance-1-0-pro-fast-251015`
- `doubao-seedance-1-5-pro-251215`
- `doubao-seedance-2-0-260128`
- `doubao-seedance-2-0-fast-260128`

Khuyến nghị:
- Với tạo video từ văn bản, ưu tiên `*-t2v-*` hoặc `pro / fast`
- Với tạo video từ hình ảnh, ưu tiên `*-i2v-*`
- Với các tình huống có tư liệu tham chiếu phức tạp, ưu tiên dùng `content`

Ví dụ yêu cầu:

```json
{
  "size": "1280x720",
  "model": "doubao-seedance-2-0-fast-260128",
  "prompt": "this is an example",
  "duration": 15,
  "fps": "24",
  "seed": "20231024",
  "mode": "reference_material",
  "content": [
    {
      "type": "text",
      "text": "this is an example"
    },
    {
      "type": "image_url",
      "image_url": {
        "url": "https://example.png"
      },
      "role": "reference_image",
      "name": "image1"
    },
    {
      "type": "audio_url",
      "audio_url": {
        "url": "https://example.mp3"
      },
      "role": "reference_audio",
      "name": "audio1"
    }
  ]
}
```

### 4.5 Dòng video Grok

Mô hình công khai:
- `grok-imagine-1.0-video`
- `grok-imagine-video-1.5-preview`
- `grok-video-3`

Tham số thường dùng:
- `prompt`
- `ratio` / `aspect_ratio`
- `resolution` / `size`
- `seconds` / `duration`
- `image` / `image_url` / `input_reference`
- `reference_images`

Ví dụ:

```json
{
  "model": "grok-imagine-1.0-video",
  "prompt": "雨夜霓虹街道上的电影感推镜，光影丰富，运动自然",
  "reference_images": [
    "https://example.com/ref-1.jpg"
  ],
  "seconds": 10,
  "aspect_ratio": "16:9",
  "resolution": "720P"
}
```

### 4.6 Mô hình chính video Kling

Mô hình chính công khai:
- `kling-video`

Bắt buộc:
- `model`
- `model_name`

Các `model_name` được hỗ trợ:
- `kling-v1`
- `kling-v1-5`
- `kling-v1-6`
- `kling-v2-master`
- `kling-v2-1`
- `kling-v2-1-master`
- `kling-v2-5-turbo`
- `kling-v2-6`
- `kling-v3`

Các `mode` phổ biến:
- `t2v`
- `i2v`
- `multi_i2v`
- `extend`

Tham số đầu vào tối thiểu:
- Tạo video từ văn bản: `model + model_name + prompt + mode=t2v`
- Tạo video từ hình ảnh: `model + model_name + prompt + mode=i2v + image`
- Tham chiếu nhiều ảnh: `model + model_name + prompt + mode=multi_i2v + image_list`
- Kéo dài video: `model + model_name + mode=extend + video_id`

Ví dụ:

```json
{
  "model": "kling-video",
  "model_name": "kling-v2-6",
  "mode": "t2v",
  "prompt": "海边日落镜头，电影感，风吹长发",
  "duration": 5,
  "aspect_ratio": "16:9"
}
```

### 4.7 Series video MiniMax / Hailuo

Mô hình công khai:
- `minimax-h3`
- `hailuo-2.3`

Khuyến nghị:
- `minimax-h3` hỗ trợ tạo video từ văn bản, tham chiếu hình ảnh và tham chiếu âm thanh; khuyến nghị trộn văn bản và tài nguyên qua `content`; cũng có thể dùng các trường tương thích như `image_urls`, `audio_urls`.
- `hailuo-2.3` cần ảnh khung hình đầu tiên, khuyến nghị truyền mục `image_url` của `role=first_frame` trong `content`, hoặc dùng `image_urls` để truyền ảnh khung hình đầu tiên.
- `minimax-h3` thường dùng `duration=5~15`, `resolution=1440p`; `hailuo-2.3` thường dùng `duration=6` hoặc `10`, `resolution=768p`.

`minimax-h3` Ví dụ:

```json
{
  "model": "minimax-h3",
  "prompt": "A cinematic product video with smooth camera motion",
  "content": [
    {
      "type": "text",
      "text": "Use the product image as reference and match the rhythm of the audio."
    },
    {
      "type": "image_url",
      "image_url": {
        "url": "https://example.com/product.jpg"
      },
      "role": "reference_image",
      "name": "product"
    },
    {
      "type": "audio_url",
      "audio_url": {
        "url": "https://example.com/music.mp3"
      },
      "role": "reference_audio",
      "name": "music"
    }
  ],
  "duration": 8,
  "resolution": "1440p",
  "aspect_ratio": "16:9",
  "generate_audio": true
}
```

`hailuo-2.3` Ví dụ:

```json
{
  "model": "hailuo-2.3",
  "prompt": "The camera slowly pushes in, natural motion and cinematic lighting.",
  "content": [
    {
      "type": "text",
      "text": "The camera slowly pushes in, natural motion and cinematic lighting."
    },
    {
      "type": "image_url",
      "image_url": {
        "url": "https://example.com/first-frame.jpg"
      },
      "role": "first_frame",
      "name": "first"
    }
  ],
  "duration": 10,
  "resolution": "768p",
  "aspect_ratio": "16:9"
}
```

- `mode=t2v`
- Tham số đầu vào tối thiểu: `model + prompt`

- `mode=i2v`
- Tham số đầu vào tối thiểu: `model + prompt + image_url`

- `mode=i2v_first_last`
- Tham số đầu vào tối thiểu: `model + prompt + image_url + end_image_url`

- `mode=reference_images`
- Tham số đầu vào tối thiểu: `model + prompt + reference_images`

- `mode=reference_material`
- Tham số đầu vào tối thiểu: `model + prompt + (image_urls/video_urls/audio_urls 至少一种)`

### Hướng dẫn gọi Gemini Omni

- `gemini-omni` là tên mô hình video công khai của new-api, có thể trực tiếp gọi qua `POST /v1/videos`.
- `mode=t2v`: tạo video từ văn bản, tham số đầu vào tối thiểu là `model + prompt`.
- `mode=r2v`: tạo bằng ảnh/tư liệu tham chiếu, ảnh có thể đặt trong `image`、`image_url`、`images`、`image_urls`、`reference_images`、`input_reference` hoặc `content`.
- `mode=edit`: chỉnh sửa video, video có thể đặt trong `video`、`video_url`、`videos` hoặc `content`, đồng thời cũng có thể truyền ảnh tham chiếu.
- Trường thời lượng có thể dùng `seconds` hoặc `duration`, hệ thống sẽ tự động khớp với các mức 4 / 6 / 8 / 10 giây.



## OpenAPI

````yaml api-reference/vi/openapi.json POST /v1/videos
openapi: 3.0.0
info:
  title: Tài liệu tham khảo API của 出海营
  version: 1.0.0
  description: Public AI Gateway API Reference
servers:
  - url: https://api.aiid.edu.kg
security:
  - BearerAuth: []
tags:
  - name: Định dạng OpenAI (Chat)
  - name: Định dạng OpenAI (Responses)
  - name: Định dạng Gemini cho tạo ảnh
  - name: Tạo hình ảnhOpenAI định dạng DALL-E
  - name: Lấy danh sách mô hình
  - name: Tạo video HappyHorse và Wan
  - name: Định dạngKling tạo video
  - name: Định dạng Video Generation Omni và Veo
  - name: Tạo video Seedance
  - name: Định dạng tương thích Sora cho tạo video
  - name: Tạo video Vidu
  - name: Định dạng tác vụ tạo nhạc
paths:
  /v1/videos:
    post:
      tags:
        - Định dạng tương thích Sora cho tạo video
      summary: Tạo video
      description: >-
        Giao diện tạo video định dạng tương thích OpenAI Sora. Hỗ trợ chế độ tạo
        từ văn bản thành video và tạo bằng ảnh/video tham chiếu.


        - `POST /v1/videos`: Tạo tác vụ video

        - `GET /v1/videos/{video_id}`: Truy vấn trạng thái tác vụ

        - `GET /v1/videos/{video_id}/content`: Lấy nội dung nhị phân của video


        Hiện chưa cung cấp ra bên ngoài:

        - `GET /v1/videos`

        - `POST /v1/videos/{video_id}/remix`


        Header xác thực tiêu chuẩn:

        - `Content-Type: application/json`


        1. `POST /v1/videos` tạo tác vụ, lấy `id`

        2. Thăm dò `GET /v1/videos/{id}` cho đến khi `completed` hoặc `failed`

        3. Sau khi hoàn tất, ưu tiên sử dụng `video_url` trong kết quả trả về

        4. Nếu cần tải xuống thống nhất, gọi `GET /v1/videos/{id}/content`


        Tham số cốt lõi:

        - `model: string`: Bắt buộc, tên mô hình công khai

        - `prompt: string`: Khuyến nghị, mô tả tạo video

        - `seconds: number|string`: Tùy chọn, thời lượng mục tiêu

        - `duration: number|string`: Tùy chọn, bí danh thời lượng

        - `size: string`: Tùy chọn, kích thước đầu ra

        - `mode: string`: Tùy chọn, các giá trị phổ biến `t2v` `i2v`
        `i2v_first_last` `reference_material`


        Tham số tương thích thường dùng:

        - `aspect_ratio`

        - `ratio`

        - `quality`

        - `resolution`

        - `fps`

        - `image`

        - `image_url`

        - `image_urls`

        - `images`

        - `reference_images`

        - `input_reference`

        - `end_image_url`

        - `last_image_url`

        - `video_urls`

        - `audio_urls`

        - `function_mode`

        - `content`

        - `callback_url`

        - `external_task_id`


        Các tham số mở rộng thường dùng của Kling:

        - `model_name`

        - `negative_prompt`

        - `cfg_scale`

        - `sound`

        - `camera_control`

        - `image_list`

        - `video_id`

        - `task_id`

        - `watermark_info`


        ### 4.1 Dòng Veo


        Lưu ý: `stable`, `official` v.v. biểu thị các nhóm khác nhau, không phải
        hậu tố `model` dùng đối ngoại; khi gọi, vui lòng giữ `model` là tên mô
        hình cơ sở, nhóm tài khoản hoặc mã thông báo sẽ quyết định thực tế đi
        qua nhóm nào.


        #### Mô hình chính Veo 3.x


        - `veo3`

        - `veo3-fast`

        - `veo3-fast-frames`

        - `veo3-frames`

        - `veo3-pro`

        - `veo3-pro-frames`

        - `veo3.1`

        - `veo3.1-fast`

        - `veo3.1-pro`

        - `veo3.1-components`

        - `veo3.1-4k`

        - `veo3.1-pro-4k`


        Khuyến nghị:

        - Với video tạo từ văn bản thuần túy, ưu tiên dùng mô hình chính `veo3*`
        / `veo3.1*`

        - Với các tình huống tạo video từ ảnh hoặc từ tham chiếu, nên truyền rõ
        ràng `mode + image_url/reference_images`


        ### 4.2 Dòng Sora


        Mô hình cơ sở:

        - `sora-2`

        - `sora-2-pro`


        Khuyến nghị:

        - `sora-2*` phù hợp cho các lệnh gọi thông dụng

        - Nếu cần sử dụng các nhóm như `stable` / `official`, vui lòng giữ
        `model` là tên mô hình cơ sở, không thêm hậu tố vào sau tên mô hình.


        Ví dụ yêu cầu:


        ```json

        {
          "size": "1280x720",
          "images": [
            "https://example.png"
          ],
          "model": "sora-2",
          "prompt": "this is an example",
          "duration": 12,
          "fps": "24",
          "seed": "20231024",
          "mode": "i2v"
        }

        ```


        ### 4.3 Dòng HappyHorse


        Mô hình công khai:

        - `happyhorse-1.0`


        Khuyến nghị:

        - `happyhorse-1.0` được phân biệt thông qua `mode`, `t2v`, `i2v`, `r2v`,
        `video_edit`.

        - Trong định dạng tương thích của Sora, nên dùng mảng `content` để
        truyền các mục phương tiện.

        - Mục văn bản dùng `type=text`, mục phương tiện dùng `type=image_url` và
        có thể kết hợp `role`, `name` để đánh dấu mục đích sử dụng của tài
        nguyên.


        Ví dụ yêu cầu:


        ```json

        {
          "size": "720x1280",
          "model": "happyhorse-1.0",
          "mode": "r2v",
          "prompt": "this is an example",
          "duration": 15,
          "content": [
            {
              "type": "text",
              "text": "this is an example"
            },
            {
              "type": "image_url",
              "image_url": {
                "url": "https://example.png"
              },
              "role": "reference_image",
              "name": "image1"
            }
          ],
          "parameters": {
            "resolution": "720P",
            "ratio": "9:16",
            "duration": 15,
            "seed": 1
          }
        }

        ```


        ### 4.4 Dòng Seedance


        Mô hình công khai:

        - `doubao-seedance-1-0-lite-t2v-250428`

        - `doubao-seedance-1-0-lite-i2v-250428`

        - `doubao-seedance-1-0-pro-250528`

        - `doubao-seedance-1-0-pro-fast-251015`

        - `doubao-seedance-1-5-pro-251215`

        - `doubao-seedance-2-0-260128`

        - `doubao-seedance-2-0-fast-260128`


        Khuyến nghị:

        - Với tạo video từ văn bản, ưu tiên `*-t2v-*` hoặc `pro / fast`

        - Với tạo video từ hình ảnh, ưu tiên `*-i2v-*`

        - Với các tình huống có tư liệu tham chiếu phức tạp, ưu tiên dùng
        `content`


        Ví dụ yêu cầu:


        ```json

        {
          "size": "1280x720",
          "model": "doubao-seedance-2-0-fast-260128",
          "prompt": "this is an example",
          "duration": 15,
          "fps": "24",
          "seed": "20231024",
          "mode": "reference_material",
          "content": [
            {
              "type": "text",
              "text": "this is an example"
            },
            {
              "type": "image_url",
              "image_url": {
                "url": "https://example.png"
              },
              "role": "reference_image",
              "name": "image1"
            },
            {
              "type": "audio_url",
              "audio_url": {
                "url": "https://example.mp3"
              },
              "role": "reference_audio",
              "name": "audio1"
            }
          ]
        }

        ```


        ### 4.5 Dòng video Grok


        Mô hình công khai:

        - `grok-imagine-1.0-video`

        - `grok-imagine-video-1.5-preview`

        - `grok-video-3`


        Tham số thường dùng:

        - `prompt`

        - `ratio` / `aspect_ratio`

        - `resolution` / `size`

        - `seconds` / `duration`

        - `image` / `image_url` / `input_reference`

        - `reference_images`


        Ví dụ:


        ```json

        {
          "model": "grok-imagine-1.0-video",
          "prompt": "雨夜霓虹街道上的电影感推镜，光影丰富，运动自然",
          "reference_images": [
            "https://example.com/ref-1.jpg"
          ],
          "seconds": 10,
          "aspect_ratio": "16:9",
          "resolution": "720P"
        }

        ```


        ### 4.6 Mô hình chính video Kling


        Mô hình chính công khai:

        - `kling-video`


        Bắt buộc:

        - `model`

        - `model_name`


        Các `model_name` được hỗ trợ:

        - `kling-v1`

        - `kling-v1-5`

        - `kling-v1-6`

        - `kling-v2-master`

        - `kling-v2-1`

        - `kling-v2-1-master`

        - `kling-v2-5-turbo`

        - `kling-v2-6`

        - `kling-v3`


        Các `mode` phổ biến:

        - `t2v`

        - `i2v`

        - `multi_i2v`

        - `extend`


        Tham số đầu vào tối thiểu:

        - Tạo video từ văn bản: `model + model_name + prompt + mode=t2v`

        - Tạo video từ hình ảnh: `model + model_name + prompt + mode=i2v +
        image`

        - Tham chiếu nhiều ảnh: `model + model_name + prompt + mode=multi_i2v +
        image_list`

        - Kéo dài video: `model + model_name + mode=extend + video_id`


        Ví dụ:


        ```json

        {
          "model": "kling-video",
          "model_name": "kling-v2-6",
          "mode": "t2v",
          "prompt": "海边日落镜头，电影感，风吹长发",
          "duration": 5,
          "aspect_ratio": "16:9"
        }

        ```


        ### 4.7 Series video MiniMax / Hailuo


        Mô hình công khai:

        - `minimax-h3`

        - `hailuo-2.3`


        Khuyến nghị:

        - `minimax-h3` hỗ trợ tạo video từ văn bản, tham chiếu hình ảnh và tham
        chiếu âm thanh; khuyến nghị trộn văn bản và tài nguyên qua `content`;
        cũng có thể dùng các trường tương thích như `image_urls`, `audio_urls`.

        - `hailuo-2.3` cần ảnh khung hình đầu tiên, khuyến nghị truyền mục
        `image_url` của `role=first_frame` trong `content`, hoặc dùng
        `image_urls` để truyền ảnh khung hình đầu tiên.

        - `minimax-h3` thường dùng `duration=5~15`, `resolution=1440p`;
        `hailuo-2.3` thường dùng `duration=6` hoặc `10`, `resolution=768p`.


        `minimax-h3` Ví dụ:


        ```json

        {
          "model": "minimax-h3",
          "prompt": "A cinematic product video with smooth camera motion",
          "content": [
            {
              "type": "text",
              "text": "Use the product image as reference and match the rhythm of the audio."
            },
            {
              "type": "image_url",
              "image_url": {
                "url": "https://example.com/product.jpg"
              },
              "role": "reference_image",
              "name": "product"
            },
            {
              "type": "audio_url",
              "audio_url": {
                "url": "https://example.com/music.mp3"
              },
              "role": "reference_audio",
              "name": "music"
            }
          ],
          "duration": 8,
          "resolution": "1440p",
          "aspect_ratio": "16:9",
          "generate_audio": true
        }

        ```


        `hailuo-2.3` Ví dụ:


        ```json

        {
          "model": "hailuo-2.3",
          "prompt": "The camera slowly pushes in, natural motion and cinematic lighting.",
          "content": [
            {
              "type": "text",
              "text": "The camera slowly pushes in, natural motion and cinematic lighting."
            },
            {
              "type": "image_url",
              "image_url": {
                "url": "https://example.com/first-frame.jpg"
              },
              "role": "first_frame",
              "name": "first"
            }
          ],
          "duration": 10,
          "resolution": "768p",
          "aspect_ratio": "16:9"
        }

        ```


        - `mode=t2v`

        - Tham số đầu vào tối thiểu: `model + prompt`


        - `mode=i2v`

        - Tham số đầu vào tối thiểu: `model + prompt + image_url`


        - `mode=i2v_first_last`

        - Tham số đầu vào tối thiểu: `model + prompt + image_url +
        end_image_url`


        - `mode=reference_images`

        - Tham số đầu vào tối thiểu: `model + prompt + reference_images`


        - `mode=reference_material`

        - Tham số đầu vào tối thiểu: `model + prompt +
        (image_urls/video_urls/audio_urls 至少一种)`


        ### Hướng dẫn gọi Gemini Omni


        - `gemini-omni` là tên mô hình video công khai của new-api, có thể trực
        tiếp gọi qua `POST /v1/videos`.

        - `mode=t2v`: tạo video từ văn bản, tham số đầu vào tối thiểu là `model
        + prompt`.

        - `mode=r2v`: tạo bằng ảnh/tư liệu tham chiếu, ảnh có thể đặt trong
        `image`、`image_url`、`images`、`image_urls`、`reference_images`、`input_reference`
        hoặc `content`.

        - `mode=edit`: chỉnh sửa video, video có thể đặt trong
        `video`、`video_url`、`videos` hoặc `content`, đồng thời cũng có thể
        truyền ảnh tham chiếu.

        - Trường thời lượng có thể dùng `seconds` hoặc `duration`, hệ thống sẽ
        tự động khớp với các mức 4 / 6 / 8 / 10 giây.
      operationId: createVideo
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                model:
                  type: string
                  description: >-
                    Bắt buộc, tên mô hình công khai. `gemini-omni` Có thể được
                    gọi thông qua `/v1/videos`.
                  enum:
                    - sora-2
                    - sora-2-pro
                    - gemini-omni
                    - happyhorse-1.0
                    - happyhorse-1.0-i2v
                    - happyhorse-1.0-t2v
                    - happyhorse-1.0-r2v
                    - happyhorse-1.0-video-edit
                    - doubao-seedance-1-0-lite-i2v-250428
                    - doubao-seedance-1-0-lite-t2v-250428
                    - doubao-seedance-1-0-pro-250528
                    - doubao-seedance-1-0-pro-fast-251015
                    - doubao-seedance-1-5-pro-251215
                    - doubao-seedance-2-0-260128
                    - doubao-seedance-2-0-fast-260128
                    - veo3
                    - veo3-fast
                    - veo3-fast-frames
                    - veo3-frames
                    - veo3-pro
                    - veo3-pro-frames
                    - veo3.1
                    - veo3.1-4k
                    - veo3.1-components
                    - veo3.1-fast
                    - veo3.1-pro
                    - veo3.1-pro-4k
                    - kling-video
                    - grok-imagine-1.0-video
                    - grok-imagine-video-1.5-preview
                    - grok-video-3
                    - minimax-h3
                    - hailuo-2.3
                    - viduq3-turbo
                  example: sora-2
                prompt:
                  type: string
                  description: >-
                    Điểm nhập prompt thống nhất. Bắt buộc với hầu hết các mô
                    hình.
                image:
                  type: string
                  format: binary
                  description: >-
                    Cổng vào cho một ảnh đơn, một số chế độ tương thích sẽ được
                    ánh xạ tới `images`.
                duration:
                  type: integer
                  description: >-
                    Đầu vào thời lượng được thống nhất; một số mô hình cũng chấp
                    nhận seconds.
                width:
                  type: integer
                  example: 512
                  description: Video width
                height:
                  type: integer
                  example: 512
                  description: Video height
                fps:
                  type: integer
                  example: 30
                  description: Video frame rate
                seed:
                  type: integer
                  example: 20231234
                  description: Random seed
                'n':
                  type: integer
                  example: 1
                  description: Number of videos to generate
                response_format:
                  type: string
                  example: url
                  description: Response format
                user:
                  type: string
                  example: user-1234
                  description: User identifier
                metadata:
                  type: object
                  additionalProperties: true
                  description: >-
                    Container trường mở rộng động. Một số lượng lớn các trường
                    đặc thù của mô hình được giải tuần tự hóa từ đây.
                mode:
                  type: string
                  description: >-
                    Tùy chọn, chế độ tạo video. `gemini-omni` Hỗ trợ `t2v`,
                    `r2v`, `edit`.
                images:
                  type: array
                  description: >-
                    Điểm vào thống nhất cho nhiều ảnh. Vidu, Seedance, Veo sẽ sử
                    dụng, v.v.
                  items:
                    type: string
                content:
                  type: array
                  items:
                    type: object
                    additionalProperties: true
                size:
                  type: string
                  description: >-
                    Điểm vào kích thước hợp nhất, sẽ được ánh xạ thành
                    resolution/aspect_ratio, v.v.
                seconds:
                  type: string
                  description: >-
                    Sora điểm vào tương thích, trong thời gian chạy sẽ quay về
                    duration.
                input_reference:
                  type: string
                  description: >-
                    Sora/Veo điểm vào ảnh tham chiếu tương thích, có thể là tệp
                    multipart hoặc đối tượng tương thích.
                parameters:
                  type: object
                  additionalProperties: true
              required:
                - model
                - prompt
            examples:
              openai_i2v_json:
                summary: OpenAI Sora i2v (application/json)
                value:
                  size: 1280x720
                  images:
                    - https://example.png
                  model: sora-2
                  prompt: this is an example
                  duration: 12
                  fps: '24'
                  seed: '20231024'
                  mode: i2v
              openai_i2v_input_reference:
                summary: OpenAI i2v (input_reference)
                value:
                  model: sora-2
                  prompt: A cinematic drone shot over snowy mountains at sunrise
                  input_reference:
                    image_url: https://example.com/input.jpg
                  seconds: '8'
                  size: 1280x720
                  response_format: url
              openai_alias_compat:
                summary: Alias兼容 (image_url/duration/aspect_ratio)
                value:
                  model: sora-2
                  prompt: A cinematic drone shot over snowy mountains at sunrise
                  image_url: https://example.com/input.jpg
                  duration: '8'
                  aspect_ratio: '16:9'
                  response_format: url
              gemini_omni_sora_t2v:
                summary: Gemini Omni Sora t2v
                value:
                  model: gemini-omni
                  mode: t2v
                  prompt: A cinematic product video with smooth camera motion
                  duration: 8
                  size: 1280x720
              gemini_omni_sora_r2v:
                summary: Gemini Omni Sora r2v
                value:
                  model: gemini-omni
                  mode: r2v
                  content:
                    - type: text
                      text: Keep the product consistent and create a short ad video
                    - type: image_url
                      image_url:
                        url: https://example.com/product.jpg
                  duration: 8
                  size: 1280x720
              gemini_omni_sora_edit:
                summary: Gemini Omni Sora edit
                value:
                  model: gemini-omni
                  mode: edit
                  content:
                    - type: text
                      text: Change the outfit color while keeping the motion natural
                    - type: video_url
                      video_url:
                        url: https://example.com/input.mp4
                    - type: image_url
                      image_url:
                        url: https://example.com/style.jpg
                  duration: 8
                  size: 1280x720
              happyhorse_sora_t2v:
                summary: HappyHorse Sora t2v
                value:
                  model: happyhorse-1.0
                  mode: t2v
                  content:
                    - type: text
                      text: >-
                        A cinematic white horse running through a neon city
                        street
                  duration: 5
                  resolution: 720P
                  ratio: '16:9'
              happyhorse_sora_i2v:
                summary: HappyHorse Sora i2v
                value:
                  model: happyhorse-1.0
                  mode: i2v
                  content:
                    - type: text
                      text: The camera slowly pushes in, natural motion
                    - type: image_url
                      image_url: https://example.com/first-frame.jpg
                  duration: 5
                  resolution: 720P
              happyhorse_sora_r2v:
                summary: HappyHorse Sora r2v
                value:
                  size: 720x1280
                  model: happyhorse-1.0
                  mode: r2v
                  prompt: this is an example
                  duration: 15
                  content:
                    - type: text
                      text: this is an example
                    - type: image_url
                      image_url:
                        url: https://example.png
                      role: reference_image
                      name: image1
                  parameters:
                    resolution: 720P
                    ratio: '9:16'
                    duration: 15
                    seed: 1
              happyhorse_sora_video_edit:
                summary: HappyHorse Sora video_edit
                value:
                  model: happyhorse-1.0
                  mode: video_edit
                  content:
                    - type: text
                      text: >-
                        Change the jacket to a striped sweater and keep the
                        motion natural
                    - type: video_url
                      video_url: https://example.com/input.mp4
                    - type: image_url
                      image_url: https://example.com/reference.jpg
                  resolution: 720P
              seedance_i2v_first:
                summary: Seedance i2v_first
                value:
                  model: doubao-seedance-1-0-lite-i2v-250428
                  mode: i2v_first
                  prompt: A panda skateboarding in a city street, cinematic
                  image_urls:
                    - https://example.com/first.jpg
                  seconds: '5'
                  size: 1280x720
              seedance_i2v_first_last:
                summary: Seedance i2v_first_last
                value:
                  model: doubao-seedance-1-0-lite-i2v-250428
                  mode: i2v_first_last
                  prompt: A camera moves from first frame to last frame naturally
                  image_urls:
                    - https://example.com/first.jpg
                  end_image_url: https://example.com/last.jpg
                  seconds: '5'
                  size: 1280x720
              seedance_reference_images:
                summary: Seedance reference_images
                value:
                  model: doubao-seedance-1-0-lite-i2v-250428
                  mode: reference_images
                  prompt: Stylized short video keeping character consistency
                  reference_images:
                    - https://example.com/ref-1.jpg
                    - https://example.com/ref-2.jpg
                  seconds: '5'
                  size: 1280x720
              seedance_reference_material:
                summary: Seedance Chế độ tham chiếu toàn năng(reference_material)
                value:
                  model: doubao-seedance-1-0-lite-i2v-250428
                  mode: reference_material
                  prompt: >-
                    Blend image and short reference video into a coherent
                    cinematic clip
                  reference_images:
                    - https://example.com/ref-1.jpg
                    - https://example.com/ref-2.jpg
                  video_urls:
                    - https://example.com/ref-video.mp4
                  audio_urls:
                    - https://example.com/ref-audio.mp3
                  seconds: '5'
                  size: 1280x720
              seedance_volc_content:
                summary: Seedance chế độ content của Volcengine Ark
                value:
                  size: 1280x720
                  model: doubao-seedance-2-0-fast-260128
                  prompt: this is an example
                  duration: 15
                  fps: '24'
                  seed: '20231024'
                  mode: reference_material
                  content:
                    - type: text
                      text: this is an example
                    - type: image_url
                      image_url:
                        url: https://example.png
                      role: reference_image
                      name: image1
                    - type: audio_url
                      audio_url:
                        url: https://example.mp3
                      role: reference_audio
                      name: audio1
              veo_first_last_frame:
                summary: Veo chế độ khung đầu-cuối
                value:
                  model: veo3.1-fast
                  prompt: >-
                    A smooth transition from first frame to last frame,
                    cinematic motion
                  image_urls:
                    - https://example.com/first-frame.jpg
                  end_image_url: https://example.com/last-frame.jpg
                  seconds: '8'
                  size: 1280x720
              veo_reference_images_1to3:
                summary: Veo Chế độ 1~3 ảnh tham chiếu
                value:
                  model: veo3.1-fast
                  prompt: >-
                    Use reference style and character consistency for a short ad
                    clip
                  reference_images:
                    - https://example.com/ref-1.jpg
                  seconds: '8'
                  size: 1280x720
              kling_text2video:
                summary: Kling tạo video từ văn bản
                value:
                  model: kling-video
                  prompt: A cat playing piano in the garden
                  duration: 5
                  size: 1280x720
                  metadata:
                    negative_prompt: blurry, low quality
                    mode: std
              kling_image2video:
                summary: Kling Chuyển hình ảnh thành video
                value:
                  model: kling-video
                  prompt: A cat playing piano in the garden
                  image: https://example.com/input.jpg
                  duration: 5
                  size: 1280x720
                  metadata:
                    negative_prompt: blurry, low quality
                    mode: std
              grok_reference_video:
                summary: Grok Chế độ video
                value:
                  model: grok-imagine-1.0-video
                  prompt: A dramatic cinematic shot with fast motion and rich lighting
                  reference_images:
                    - https://example.com/ref-1.jpg
                  seconds: 10
                  aspect_ratio: '16:9'
                  resolution: 720P
              minimax_h3_sora_reference:
                summary: Video đa tư liệu MiniMax H3
                value:
                  model: minimax-h3
                  prompt: A cinematic product video with smooth camera motion
                  content:
                    - type: text
                      text: >-
                        Use the product image as reference and match the rhythm
                        of the audio.
                    - type: image_url
                      image_url:
                        url: https://example.com/product.jpg
                      role: reference_image
                      name: product
                    - type: audio_url
                      audio_url:
                        url: https://example.com/music.mp3
                      role: reference_audio
                      name: music
                  duration: 8
                  resolution: 1440p
                  aspect_ratio: '16:9'
                  generate_audio: true
              hailuo_2_3_sora_first_frame:
                summary: Hailuo 2.3 Tạo video từ ảnh khung đầu tiên
                value:
                  model: hailuo-2.3
                  prompt: >-
                    The camera slowly pushes in, natural motion and cinematic
                    lighting.
                  content:
                    - type: text
                      text: >-
                        The camera slowly pushes in, natural motion and
                        cinematic lighting.
                    - type: image_url
                      image_url:
                        url: https://example.com/first-frame.jpg
                      role: first_frame
                      name: first
                  duration: 10
                  resolution: 768p
                  aspect_ratio: '16:9'
              vidu_sora_t2v:
                summary: Vidu Sora t2v
                value:
                  model: viduq3-turbo
                  mode: t2v
                  content:
                    - type: text
                      text: A stylish product ad clip with cinematic lighting
                  duration: 5
                  resolution: 720p
                  aspect_ratio: '16:9'
              vidu_sora_i2v:
                summary: Vidu Sora i2v
                value:
                  model: viduq3-turbo
                  mode: i2v
                  content:
                    - type: text
                      text: A stylish ad clip from a product still image
                    - type: image_url
                      image_url: https://example.com/product.jpg
                  duration: 5
                  resolution: 720p
              vidu_sora_first_last:
                summary: Vidu Sora i2v_first_last
                value:
                  model: viduq3-turbo
                  mode: i2v_first_last
                  content:
                    - type: text
                      text: A smooth shot from start frame to end frame
                    - type: image_url
                      image_url: https://example.com/start.jpg
                    - type: image_url
                      image_url: https://example.com/end.jpg
                  duration: 5
                  resolution: 720p
              vidu_sora_reference:
                summary: Vidu Sora reference_images
                value:
                  model: viduq3-turbo
                  mode: reference_images
                  content:
                    - type: text
                      text: Maintain product style and character consistency
                    - type: image_url
                      image_url: https://example.com/ref-1.jpg
                    - type: image_url
                      image_url: https://example.com/ref-2.jpg
                    - type: image_url
                      image_url: https://example.com/ref-3.jpg
                  duration: 5
                  resolution: 720p
                  aspect_ratio: '16:9'
              hailuo_text2video:
                summary: Hailuo 2.3 Tạo video từ ảnh khung đầu tiên
                value:
                  model: hailuo-2.3
                  prompt: A cinematic travel shot over the coastline
                  image_urls:
                    - https://example.com/first-frame.jpg
                  duration: 6
                  resolution: 768p
                  aspect_ratio: '16:9'
      responses:
        '200':
          description: Đã tạo tác vụ video thành công
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                  task_id:
                    type: string
                    description: Tương thích với giao diện cũ (Sắp ngừng hỗ trợ)
                  object:
                    type: string
                  model:
                    type: string
                  status:
                    type: string
                    description: >-
                      Should use VideoStatus constants: VideoStatusQueued,
                      VideoStatusInProgress, VideoStatusCompleted,
                      VideoStatusFailed
                    enum:
                      - queued
                      - in_progress
                      - completed
                      - failed
                      - video_url
                      - url
                      - completed_at
                  progress:
                    type: integer
                  created_at:
                    type: integer
                  completed_at:
                    type: integer
                  expires_at:
                    type: integer
                  seconds:
                    type: string
                  size:
                    type: string
                  remixed_from_video_id:
                    type: string
                  error:
                    type: object
                  metadata:
                    type: object
                    additionalProperties: true
                  output:
                    type: object
                  request_id:
                    type: string
                required:
                  - created_at
                  - id
                  - model
                  - object
                  - progress
                  - status
              example:
                id: video_abc123
                object: video
                model: sora-2
                status: queued
                progress: 0
                created_at: 1764347090922
                seconds: '8'
          headers: {}
        '400':
          description: Tham số yêu cầu bị lỗi
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          headers: {}
      deprecated: false
      security:
        - BearerAuth: []
components:
  schemas:
    ErrorResponse:
      type: object
      properties:
        error:
          type: object
          properties:
            message:
              type: string
              description: Thông báo lỗi
            type:
              type: string
              description: Loại lỗi
            param:
              type: string
              description: Các tham số liên quan
              nullable: true
            code:
              type: string
              description: Mã lỗi
              nullable: true
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: |-
        Sử dụng xác thực Bearer Token.
        Định dạng: `Authorization: Bearer sk-xxxxxx`

````