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

# HappyHorse-1.1-参考生视频

> 提交一个异步的阿里云 HappyHorse `happyhorse-1.1-r2v` 参考生视频任务。

提交任务后，请通过 `GET /ali/api/v1/tasks/{task_id}` 查询任务状态。



## OpenAPI

````yaml api-reference/zh-Hans/zmodelVideo/ali/happyhorse-1.1-r2v.json POST /ali/api/v1/services/aigc/video-generation/video-synthesis
openapi: 3.0.1
info:
  title: HappyHorse-1.1-参考生视频
  version: 1.0.0
  description: >-
    阿里云 HappyHorse `happyhorse-1.1-r2v` 参考生视频能力文档。平台统一接口端点为
    `/ali/api/v1/services/aigc/video-generation/video-synthesis`，用于创建异步视频生成任务。支持传入多张参考图像，通过文本提示词描述场景，将图像中的主体角色融合生成一段流畅的视频。
  license:
    name: Project License
    url: https://github.com/QuantumNous/new-api/blob/main/LICENSE
servers:
  - url: https://api.powertokens.ai
    description: baze平台 API 服务端点
security: []
tags:
  - name: HappyHorse Video
    description: 阿里云 HappyHorse happyhorse-1.1-r2v 参考生视频能力
paths:
  /ali/api/v1/services/aigc/video-generation/video-synthesis:
    post:
      tags:
        - HappyHorse Video
      summary: 创建 happyhorse-1.1-r2v 参考生视频任务
      description: |-
        提交一个异步的阿里云 HappyHorse `happyhorse-1.1-r2v` 参考生视频任务。

        提交任务后，请通过 `GET /ali/api/v1/tasks/{task_id}` 查询任务状态。
      operationId: aliHappyHorse11R2VCreate
      parameters:
        - name: Content-Type
          in: header
          required: true
          schema:
            type: string
          description: 请求内容类型。此参数必须设置为 application/json。
        - name: X-DashScope-Async
          in: header
          required: true
          schema:
            type: string
          description: >-
            异步处理配置参数。HTTP 请求只支持异步，必须设置为 enable。缺少此请求头将报错："current user api does
            not support synchronous calls"。
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/HappyHorse11R2VRequest'
            examples:
              参考生视频（多图像）:
                summary: 参考生视频（多图像）
                value:
                  model: happyhorse-1.1-r2v
                  input:
                    prompt: >-
                      [Image
                      1]中身着红色旗袍的女性，镜头先以侧面中景勾勒旗袍修身剪裁与S型曲线，随即切换至低角度仰拍，捕捉她轻抬玉手展开[Image
                      2]中的折扇的同时，[Image
                      3]中的流苏耳坠随头部转动轻盈摆动的细节，最后推近至面部特写，定格在她指尖轻点扇骨、眼波流转间的含蓄风情，多视角全方位展现东方韵味。
                    media:
                      - type: reference_image
                        url: >-
                          https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20260424/mvzfud/hh-v2v-girl.jpg
                      - type: reference_image
                        url: >-
                          https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20260424/fvuihk/hh-v2v2-folding-fan.jpg
                      - type: reference_image
                        url: >-
                          https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20260424/imerii/hh-v2v-earrings.jpg
                  parameters:
                    resolution: 720P
                    ratio: '16:9'
                    duration: 5
      responses:
        '200':
          description: 提交成功，返回视频任务对象。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VideoTaskResponse'
              example:
                output:
                  task_status: PENDING
                  task_id: 0385dc79-5ff8-4d82-bcb6-xxxxxx
                request_id: 4909100c-7b5a-9f92-bfe5-xxxxxx
        '400':
          description: 请求参数不合法。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: 鉴权失败，例如未提供令牌或令牌无效。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: 触发速率限制或账户额度不足。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: 服务端处理请求时发生内部错误。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - BearerAuth: []
components:
  schemas:
    HappyHorse11R2VRequest:
      type: object
      required:
        - model
        - input
      properties:
        model:
          type: string
          enum:
            - happyhorse-1.1-r2v
          description: 模型名称。可选值：`happyhorse-1.1-r2v`。
        input:
          $ref: '#/components/schemas/HappyHorse11R2VInput'
        parameters:
          $ref: '#/components/schemas/HappyHorse11R2VParameters'
    VideoTaskResponse:
      type: object
      properties:
        output:
          type: object
          properties:
            task_id:
              type: string
              description: 任务ID。查询有效期24小时。
            task_status:
              type: string
              description: |-
                任务状态。

                枚举值：
                - PENDING：任务排队中
                - RUNNING：任务处理中
                - SUCCEEDED：任务执行成功
                - FAILED：任务执行失败
                - CANCELED：任务已取消
                - UNKNOWN：任务不存在或状态未知
        request_id:
          type: string
          description: 请求唯一标识。可用于请求明细溯源和问题排查。
        code:
          type: string
          description: 请求失败的错误码。请求成功时不会返回此参数。
        message:
          type: string
          description: 请求失败的详细信息。请求成功时不会返回此参数。
    ErrorResponse:
      type: object
      properties:
        code:
          type: string
          description: 错误码。
        message:
          type: string
          description: 错误信息。
        request_id:
          type: string
          description: 请求 ID。
    HappyHorse11R2VInput:
      type: object
      required:
        - prompt
        - media
      properties:
        prompt:
          type: string
          description: >-
            文本提示词。用来描述生成视频中期望包含的元素和视觉特点。支持任何语言输入，长度不超过 5000 个非中文字符或 2500
            个中文字符，超过部分会自动截断。


            参考指代：在 prompt 中通过 "[Image 1]、[Image 2]" 标识指代 `media`
            数组中对应位置的参考图像，顺序与 `media` 数组顺序一致。使用时需要指明参考图中的具体对象，例如 "[Image
            1]中身着红色旗袍的女性"。
          maxLength: 5000
        media:
          type: array
          description: >-
            媒体素材列表，用于指定参考图像。数组的每个元素为一个媒体对象，包含type和url字段。按照数组顺序定义 prompt
            中角色引用的顺序。数组中的第 1 个 `reference_image` 对应 [Image 1]，第 2 个对应 [Image
            2]，以此类推。参考图像数量：1～9 张。
          minItems: 1
          maxItems: 9
          items:
            $ref: '#/components/schemas/ReferenceImageItem'
    HappyHorse11R2VParameters:
      type: object
      properties:
        resolution:
          type: string
          enum:
            - 1080P
            - 720P
          description: |-
            生成视频的分辨率档位。
            - `1080P`：默认值。
            - `720P`
          default: 1080P
        ratio:
          type: string
          enum:
            - '16:9'
            - '9:16'
            - '3:4'
            - '4:3'
            - '4:5'
            - '5:4'
            - '1:1'
            - '9:21'
            - '21:9'
          description: |-
            生成视频的宽高比。
            - `16:9`：默认值。
            - `9:16`
            - `3:4`
            - `4:3`
            - `4:5`
            - `5:4`
            - `1:1`
            - `9:21`
            - `21:9`
          default: '16:9'
        duration:
          type: integer
          description: 生成视频的时长，单位为秒。取值范围：3～15 之间的整数。默认值：5。
          minimum: 3
          maximum: 15
          default: 5
        watermark:
          type: boolean
          description: |-
            是否在生成的视频上添加水印标识。水印位于视频右下角，文案固定为 "Happy Horse"。
            - `true`：默认值，添加水印。
            - `false`：不添加水印。
          default: true
        seed:
          type: integer
          description: >-
            随机数种子，取值范围为 [0, 2147483647]。未指定时，系统自动生成随机种子。若需提升生成结果的可复现性，建议固定 seed
            值。请注意，由于模型生成具有概率性，即使使用相同 seed，也不能保证每次生成结果完全一致。
          minimum: 0
          maximum: 2147483647
    ReferenceImageItem:
      type: object
      required:
        - type
        - url
      properties:
        type:
          type: string
          enum:
            - reference_image
          description: |-
            媒体素材类型。固定值为：
            - `reference_image`：参考图像。
        url:
          type: string
          description: >-
            参考图像 URL 或 Base64 编码数据。


            图像限制：

            - 格式：JPEG、JPG、PNG、WEBP。

            - 分辨率：短边不低于 400 像素，推荐 720P 以上清晰图。避免传入过小、模糊或压缩过度的图像，影响效果。

            - 文件大小：不超过 20MB。


            支持输入的格式：

            1. 公网URL：支持 HTTP 或 HTTPS 协议。示例值：https://xxx/xxx.jpg。

            2. Base64 编码图像后的字符串：数据格式
            `data:{MIME_type};base64,{base64_data}`。示例值：data:image/png;base64,GDU7MtCZzEbTbmRZ......


            **Base64 编码数据格式**


            格式：`data:{MIME_type};base64,{base64_data}`。


            - `{base64_data}`：图像文件经过 Base64 编码后的字符串。

            - `{MIME_type}`：图像的媒体类型，需与文件格式对应。


            **图像格式与 MIME Type 对应表**


            | 图像格式 | MIME Type |

            | --- | --- |

            | JPEG | image/jpeg |

            | JPG | image/jpeg |

            | PNG | image/png |

            | WEBP | image/webp |
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: '在请求头中传入 `Authorization: Bearer <token>`。'

````