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

# 建立影片(HappyHorse與 Wan)

> 此系列支援OpenAI影片生成格式（詳見連結 [影片生成Sora相容格式](/api-reference/zh-tw/%E5%BD%B1%E7%89%87%E7%94%9F%E6%88%90sora%E7%9B%B8%E5%AE%B9%E6%A0%BC%E5%BC%8F/%E5%BB%BA%E7%AB%8B%E5%BD%B1%E7%89%87)）。

HappyHorse 與 Wan 影片生成介面，公開路徑遵循 DashScope 官方協議。

HappyHorse 支援 `happyhorse-1.0`、`happyhorse-1.0-i2v`、`happyhorse-1.0-t2v`、`happyhorse-1.0-r2v`、`happyhorse-1.0-video-edit`；Wan 支援 `wan-3.0`、`wan-3.0-480p`、`wan-3.0-1080p`。其中 `happyhorse-1.0` 是聚合模型，需要透過 `mode` 區分 `t2v`、`i2v`、`r2v`、`video_edit`。Wan 三個模型分別固定 720P、480P、1080P，支援 2～30 秒及最多 10 圖、5 影片、5 音訊參考。

公開介面維持官方端點格式；渠道專用前綴僅用於閘道請求特定上游渠道時內部拼接。用戶端不需要明確傳入 `X-DashScope-Async`，由閘道或官方渠道適配層處理。

補充 HappyHorse 與 Wan 影片生成格式的公開請求骨架、任務查詢結構和推薦驗證範本，公開路徑保持 DashScope 官方端點格式。

支援模型：
happyhorse-1.0, happyhorse-1.0-t2v, happyhorse-1.0-i2v, happyhorse-1.0-r2v, happyhorse-1.0-video-edit, wan-3.0, wan-3.0-480p, wan-3.0-1080p

統一請求欄位：
- `model` (string, 必填): HappyHorse 或 Wan 對外模型名。Wan 支援 `wan-3.0`、`wan-3.0-480p`、`wan-3.0-1080p`；HappyHorse 聚合模型 `happyhorse-1.0` 需配合 `mode` 使用。
- `mode` (string, 可選): 聚合模型模式，常見值為 `t2v`、`i2v`、`r2v`、`video_edit`。固定子模型可不傳。
- `input.prompt` (string, 必填): 影片生成或編輯提示詞。
- `input.media` (array[object], 可選): 多媒體輸入。支援 `first_frame`、`last_frame`、`reference_image`、`reference_video`、`reference_audio`；Wan 最多支援 10 圖、5 影片、5 音訊。
- `parameters.duration` (integer, 可選): 生成時長，單位秒。
- `parameters.resolution` (string, 可選): 輸出解析度。Wan 三個模型分別固定 `720P`、`480P`、`1080P`；HappyHorse 常見值為 `720P`、`1080P`。
- `parameters.ratio` (string, 可選): 輸出寬高比，文生影片和參考生影片常用。
- `parameters.watermark` (boolean, 可選): 是否新增浮水印。
- `parameters.seed` (integer, 可選): 隨機種子。

常見模型／模式差異：
- `HappyHorse 聚合模型`: 支援模型 happyhorse-1.0；聚合模型透過 mode 區分最終模型。
- `HappyHorse 文生视频`: 支援模型 happyhorse-1.0-t2v；官方格式文生影片。
- `HappyHorse 首帧图生视频`: 支援模型 happyhorse-1.0-i2v；官方格式首幀圖生影片。
- `HappyHorse 参考生视频`: 支援模型 happyhorse-1.0-r2v；官方格式多參考圖生影片。
- `HappyHorse 视频编辑`: 支援模型 happyhorse-1.0-video-edit；官方格式影片編輯。
- `Wan 3.0 720P`: 支援模型 wan-3.0；Wan 3.0 官方格式多模態參考影片生成。
- `Wan 3.0 480P`: 支援模型 wan-3.0-480p；固定 480P 的 Wan 3.0 官方格式呼叫。
- `Wan 3.0 1080P`: 支援模型 wan-3.0-1080p；固定 1080P 的 Wan 3.0 官方格式呼叫。



## OpenAPI

````yaml api-reference/zh-tw/openapi.json POST /api/v1/services/aigc/video-generation/video-synthesis
openapi: 3.0.0
info:
  title: 出海營 API 參考文件
  version: 1.0.0
  description: Public AI Gateway API Reference
servers:
  - url: https://api.aiid.edu.kg
security:
  - BearerAuth: []
tags:
  - name: OpenAI格式（Chat）
  - name: OpenAI格式（Responses）
  - name: 圖片生成 Gemini 格式
  - name: 圖片生成OpenAI DALL-E 格式
  - name: 獲取模型列表
  - name: 影片生成HappyHorse與 Wan
  - name: 影片生成Kling格式
  - name: 影片生成 Omni 與 Veo 格式
  - name: 影片生成 Seedance 格式
  - name: 影片生成Sora相容格式
  - name: 影片生成 Vidu 格式
  - name: 音樂生成任務格式
paths:
  /api/v1/services/aigc/video-generation/video-synthesis:
    post:
      tags:
        - 影片生成HappyHorse與 Wan
      summary: 建立影片(HappyHorse與 Wan)
      description: >-
        此系列支援OpenAI影片生成格式（詳見連結
        [影片生成Sora相容格式](/api-reference/zh-tw/%E5%BD%B1%E7%89%87%E7%94%9F%E6%88%90sora%E7%9B%B8%E5%AE%B9%E6%A0%BC%E5%BC%8F/%E5%BB%BA%E7%AB%8B%E5%BD%B1%E7%89%87)）。


        HappyHorse 與 Wan 影片生成介面，公開路徑遵循 DashScope 官方協議。


        HappyHorse 支援
        `happyhorse-1.0`、`happyhorse-1.0-i2v`、`happyhorse-1.0-t2v`、`happyhorse-1.0-r2v`、`happyhorse-1.0-video-edit`；Wan
        支援 `wan-3.0`、`wan-3.0-480p`、`wan-3.0-1080p`。其中 `happyhorse-1.0`
        是聚合模型，需要透過 `mode` 區分 `t2v`、`i2v`、`r2v`、`video_edit`。Wan 三個模型分別固定
        720P、480P、1080P，支援 2～30 秒及最多 10 圖、5 影片、5 音訊參考。


        公開介面維持官方端點格式；渠道專用前綴僅用於閘道請求特定上游渠道時內部拼接。用戶端不需要明確傳入
        `X-DashScope-Async`，由閘道或官方渠道適配層處理。


        補充 HappyHorse 與 Wan 影片生成格式的公開請求骨架、任務查詢結構和推薦驗證範本，公開路徑保持 DashScope 官方端點格式。


        支援模型：

        happyhorse-1.0, happyhorse-1.0-t2v, happyhorse-1.0-i2v,
        happyhorse-1.0-r2v, happyhorse-1.0-video-edit, wan-3.0, wan-3.0-480p,
        wan-3.0-1080p


        統一請求欄位：

        - `model` (string, 必填): HappyHorse 或 Wan 對外模型名。Wan 支援
        `wan-3.0`、`wan-3.0-480p`、`wan-3.0-1080p`；HappyHorse 聚合模型
        `happyhorse-1.0` 需配合 `mode` 使用。

        - `mode` (string, 可選): 聚合模型模式，常見值為
        `t2v`、`i2v`、`r2v`、`video_edit`。固定子模型可不傳。

        - `input.prompt` (string, 必填): 影片生成或編輯提示詞。

        - `input.media` (array[object], 可選): 多媒體輸入。支援
        `first_frame`、`last_frame`、`reference_image`、`reference_video`、`reference_audio`；Wan
        最多支援 10 圖、5 影片、5 音訊。

        - `parameters.duration` (integer, 可選): 生成時長，單位秒。

        - `parameters.resolution` (string, 可選): 輸出解析度。Wan 三個模型分別固定
        `720P`、`480P`、`1080P`；HappyHorse 常見值為 `720P`、`1080P`。

        - `parameters.ratio` (string, 可選): 輸出寬高比，文生影片和參考生影片常用。

        - `parameters.watermark` (boolean, 可選): 是否新增浮水印。

        - `parameters.seed` (integer, 可選): 隨機種子。


        常見模型／模式差異：

        - `HappyHorse 聚合模型`: 支援模型 happyhorse-1.0；聚合模型透過 mode 區分最終模型。

        - `HappyHorse 文生视频`: 支援模型 happyhorse-1.0-t2v；官方格式文生影片。

        - `HappyHorse 首帧图生视频`: 支援模型 happyhorse-1.0-i2v；官方格式首幀圖生影片。

        - `HappyHorse 参考生视频`: 支援模型 happyhorse-1.0-r2v；官方格式多參考圖生影片。

        - `HappyHorse 视频编辑`: 支援模型 happyhorse-1.0-video-edit；官方格式影片編輯。

        - `Wan 3.0 720P`: 支援模型 wan-3.0；Wan 3.0 官方格式多模態參考影片生成。

        - `Wan 3.0 480P`: 支援模型 wan-3.0-480p；固定 480P 的 Wan 3.0 官方格式呼叫。

        - `Wan 3.0 1080P`: 支援模型 wan-3.0-1080p；固定 1080P 的 Wan 3.0 官方格式呼叫。
      operationId: create__happyhorse_wan_task
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - model
                - input
              properties:
                model:
                  type: string
                  enum:
                    - happyhorse-1.0
                    - happyhorse-1.0-t2v
                    - happyhorse-1.0-i2v
                    - happyhorse-1.0-r2v
                    - happyhorse-1.0-video-edit
                    - wan-3.0
                    - wan-3.0-480p
                    - wan-3.0-1080p
                  example: happyhorse-1.0-t2v
                  description: >-
                    HappyHorse 或 Wan 對外模型名。Wan 支援
                    `wan-3.0`、`wan-3.0-480p`、`wan-3.0-1080p`；HappyHorse 聚合模型
                    `happyhorse-1.0` 需配合 `mode` 使用。
                mode:
                  type: string
                  enum:
                    - t2v
                    - i2v
                    - r2v
                    - video_edit
                  description: 聚合模型模式，常見值為 `t2v`、`i2v`、`r2v`、`video_edit`。固定子模型可不傳。
                input:
                  type: object
                  required:
                    - prompt
                  properties:
                    prompt:
                      type: string
                      example: >-
                        A white horse running through a neon city street,
                        cinematic
                      description: 影片生成或編輯提示詞。
                    media:
                      type: array
                      items:
                        type: object
                        required:
                          - type
                          - url
                        properties:
                          type:
                            type: string
                            enum:
                              - first_frame
                              - last_frame
                              - reference_image
                              - reference_video
                              - reference_audio
                              - video
                              - audio
                          url:
                            type: string
                            format: uri
                      description: >-
                        多媒體輸入。支援
                        `first_frame`、`last_frame`、`reference_image`、`reference_video`、`reference_audio`；Wan
                        最多支援 10 張圖片、5 部影片、5 個音訊。
                parameters:
                  type: object
                  properties:
                    resolution:
                      type: string
                      enum:
                        - 480P
                        - 720P
                        - 1080P
                      example: 720P
                      description: >-
                        輸出解析度。Wan 三個模型分別固定 `720P`、`480P`、`1080P`；HappyHorse 常見值為
                        `720P`、`1080P`。
                    ratio:
                      type: string
                      example: '16:9'
                      description: 輸出寬高比，文生影片和參考生影片常用。
                    duration:
                      type: integer
                      example: 5
                      description: 生成時長，單位為秒。
                    watermark:
                      type: boolean
                      description: 是否加上浮水印。
                    seed:
                      type: integer
                      description: 隨機種子。
            examples:
              happyhorse_native_aggregate_t2v:
                summary: HappyHorse 聚合模型
                value:
                  model: happyhorse-1.0
                  mode: t2v
                  input:
                    prompt: >-
                      A white horse running through a neon city street,
                      cinematic
                  parameters:
                    resolution: 720P
                    ratio: '16:9'
                    duration: 5
              happyhorse_native_t2v:
                summary: HappyHorse 文生影片
                value:
                  model: happyhorse-1.0-t2v
                  input:
                    prompt: >-
                      A white horse running through a neon city street,
                      cinematic
                  parameters:
                    resolution: 720P
                    ratio: '16:9'
                    duration: 5
              happyhorse_native_i2v:
                summary: HappyHorse 首幀圖生影片
                value:
                  model: happyhorse-1.0-i2v
                  input:
                    prompt: The subject walks forward naturally
                    media:
                      - type: first_frame
                        url: https://example.com/first-frame.jpg
                  parameters:
                    resolution: 720P
                    duration: 5
              happyhorse_native_r2v:
                summary: HappyHorse 參考生影片
                value:
                  model: happyhorse-1.0-r2v
                  input:
                    prompt: >-
                      Keep the character and product consistent in a cinematic
                      shot
                    media:
                      - type: reference_image
                        url: https://example.com/ref-1.jpg
                      - type: reference_image
                        url: https://example.com/ref-2.jpg
                  parameters:
                    resolution: 720P
                    ratio: '16:9'
                    duration: 5
              happyhorse_native_video_edit:
                summary: HappyHorse 影片編輯
                value:
                  model: happyhorse-1.0-video-edit
                  input:
                    prompt: Change the jacket to a striped sweater
                    media:
                      - type: video
                        url: https://example.com/input.mp4
                      - type: reference_image
                        url: https://example.com/reference.jpg
                  parameters:
                    resolution: 720P
              wan_3_0_native:
                summary: Wan 3.0 720P
                value:
                  model: wan-3.0
                  input:
                    prompt: Keep the character consistent across all references
                    media:
                      - type: reference_image
                        url: https://example.com/reference.jpg
                      - type: reference_audio
                        url: https://example.com/reference.mp3
                  parameters:
                    resolution: 720P
                    ratio: '16:9'
                    duration: 10
              wan_3_0_480p_native:
                summary: Wan 3.0 480P
                value:
                  model: wan-3.0-480p
                  input:
                    prompt: Create a smooth transition
                    media:
                      - type: first_frame
                        url: https://example.com/first.jpg
                      - type: last_frame
                        url: https://example.com/last.jpg
                  parameters:
                    resolution: 480P
                    ratio: '16:9'
                    duration: 10
              wan_3_0_1080p_native:
                summary: Wan 3.0 1080P
                value:
                  model: wan-3.0-1080p
                  input:
                    prompt: Generate a cinematic reference video
                    media:
                      - type: reference_video
                        url: https://example.com/reference.mp4
                  parameters:
                    resolution: 1080P
                    ratio: '16:9'
                    duration: 10
      responses:
        '200':
          description: 任務建立成功
          content:
            application/json:
              schema:
                type: object
                required:
                  - id
                properties:
                  id:
                    type: string
                    example: task_xxx
                  output:
                    type: object
                    properties:
                      task_id:
                        type: string
                        description: 建立任務時返回的任務 ID，用於查詢任務。
                      task_status:
                        type: string
                        description: 任務狀態，常見值 `PENDING`、`RUNNING`、`SUCCEEDED`、`FAILED`。
                      video_url:
                        type: string
                        description: 任務成功後生成的影片 URL。
                  usage:
                    type: object
                    properties:
                      duration:
                        type: string
                        description: 生成時長，單位為秒。
                      SR:
                        type: string
                        description: 輸出解析度檔位。
      security:
        - BearerAuth: []
components:
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: |-
        使用 Bearer Token 認證。
        格式: `Authorization: Bearer sk-xxxxxx`

````