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

# Happy Horse

> Happy Horse API 支持 Alibaba Happy Horse 的文生视频、图生视频、参考生视频和视频编辑工作流

> [!TIP]
>
> 1. 提交后会返回 `task_id`。如果提供了 `callback_url`，当任务状态变为 `finished` 或 `failed` 时，系统会向 `callback_url` 发送 POST 请求。
> 2. 无论是否提供 `callback_url`，都可以通过统一的[查询任务状态](https://docs.vidgo.ai/zh/api-manual/task-management/status.md)接口获取结果。

`happy-horse` 通过一个公开 model ID 支持文生视频、图生视频、参考生视频和视频编辑。

## 模型

* **happy-horse** - Alibaba Happy Horse 1.0 视频生成与编辑

## 必填参数

* **model**：`happy-horse`
* **input.prompt**：文生视频、参考生视频和视频编辑必填（最多 2,500 个字符）；图生视频可选。
* **input.video\_url**：视频编辑必填。
* **input.reference\_image\_urls**：参考生视频必填。

## 可选参数

* **image\_urls**：图生视频的首帧图片 URL 数组，只含一项
* **reference\_image\_urls**：参考生视频使用 1-9 张图片，视频编辑可选最多 5 张
* **aspect\_ratio**：仅文生视频和参考生视频。`16:9`、`9:16`、`1:1`、`4:3` 或 `3:4`。默认 `16:9`
* **resolution**：`720p` 或 `1080p`。默认 `1080p`
* **duration**：文生视频、图生视频和参考生视频为 `3` 到 `15` 的整数秒。视频编辑会忽略此参数
* **audio\_setting**：仅视频编辑。`auto` 或 `origin`。默认 `auto`
* **seed**：可选，`0` 到 `2147483647` 的整数
* **enable\_safety\_checker**：可选布尔值

## 工作流

### 文生视频

只发送 `prompt`，不带图片或视频输入字段。用 `aspect_ratio`、`resolution` 和 `duration` 控制输出。

### 图生视频

发送只含一项的 `image_urls` 数组，该图片用作首帧。`prompt` 可选；如果提供，不能为空，最多 2,500 个字符。

### 参考生视频

发送包含 1-9 张图片的 `reference_image_urls`，并提供必填的 `prompt`。在提示词中描述所引用的主体；无需使用 `character1` 和 `character2` 标记。

不要将 `reference_image_urls` 与 `image_urls` 同时使用。

### 视频编辑

发送 `video_url` 和必填的编辑 `prompt`。可选的 `reference_image_urls`（最多 5 张）用于引导编辑；在提示词中描述所引用的主体即可，无需特殊标记。`audio_setting` 控制由 Happy Horse 自动决定音频处理方式，还是保留原始音频。

源视频时长须为 3-60 秒。视频编辑按检测到的源视频时长、依据当前工作流的定价配置计费。

## 定价

Happy Horse 的计费取决于所选工作流、输出分辨率和计费视频时长。在提交生产流量前，请在 Vidgo 定价页或仪表盘查看当前价格。

文生视频、图生视频和参考生视频按请求的 `duration` 计费。视频编辑按检测到的源视频时长计费，并以该工作流的最大计费时长封顶。

## 工作流 ID

原有 ID 仍可使用。新接入可选择专用的工作流：

* [alibaba/happyhorse-1.0/text-to-video](https://docs.vidgo.ai/zh/api-manual/video-series/alibaba-happyhorse-1-0-text-to-video.md)
* [alibaba/happyhorse-1.0/image-to-video](https://docs.vidgo.ai/zh/api-manual/video-series/alibaba-happyhorse-1-0-image-to-video.md)
* [alibaba/happyhorse-1.0/reference-to-video](https://docs.vidgo.ai/zh/api-manual/video-series/alibaba-happyhorse-1-0-reference-to-video.md)
* [alibaba/happyhorse-1.0/video-edit](https://docs.vidgo.ai/zh/api-manual/video-series/alibaba-happyhorse-1-0-video-edit.md)

## 注意事项

* `image_urls` 必须恰好对应一张图片，且仅用于图生视频。
* 提供 `reference_image_urls` 时会选择参考生视频；但如果同时存在 `video_url`，则将其视为视频编辑的可选参考图片。
* 文生视频和参考生视频不要传 `video_url`，并使用 `aspect_ratio`。
* 视频编辑不要传 `duration`；系统使用源视频时长进行校验和按时长计费。


## OpenAPI

````yaml zh/api-manual/video-series/happy-horse.json POST /api/generate/submit
openapi: 3.0.0
info:
  title: Vidgo API - Happy Horse API
  description: Alibaba Happy Horse 视频生成与编辑，支持文生视频、图生视频、参考生视频和视频编辑工作流。
  version: 1.0.0
servers:
  - url: https://api.vidgo.ai
    description: 生产环境服务器
security:
  - BearerAuth: []
paths:
  /api/generate/submit:
    post:
      tags:
        - Happy Horse
      summary: 提交 Happy Horse 视频任务
      description: >-
        通过统一提交接口使用 Happy Horse 生成或编辑视频。计费取决于所选工作流、输出分辨率和计费视频时长；当前价格请查看 Vidgo
        定价页或仪表盘。
      operationId: submitHappyHorseTask
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SubmitRequest'
            examples:
              text-to-video:
                summary: 文生视频
                value:
                  model: happy-horse
                  callback_url: https://your-domain.com/callback
                  input:
                    prompt: >-
                      A cinematic tracking shot through a neon city street after
                      rain, reflective pavement, soft ambient audio, realistic
                      motion.
                    resolution: 1080p
                    duration: 5
                    aspect_ratio: '16:9'
                    seed: 42
                    enable_safety_checker: true
              image-to-video:
                summary: 图生视频
                value:
                  model: happy-horse
                  input:
                    image_urls:
                      - https://cdn.vidgo.ai/temp/first-frame.png
                    prompt: >-
                      Animate the scene with a slow push-in camera move and
                      natural wind motion.
                    resolution: 1080p
                    duration: 5
              reference-to-video:
                summary: 参考生视频
                value:
                  model: happy-horse
                  input:
                    prompt: >-
                      The two people from the reference images walk through a
                      bright studio set, keeping identity and outfit details
                      consistent.
                    reference_image_urls:
                      - https://cdn.vidgo.ai/temp/character1.png
                      - https://cdn.vidgo.ai/temp/character2.png
                    resolution: 720p
                    duration: 6
                    aspect_ratio: '9:16'
              video-edit:
                summary: 视频编辑
                value:
                  model: happy-horse
                  callback_url: https://your-domain.com/callback
                  input:
                    prompt: >-
                      Change the background into a cyberpunk street while
                      preserving the subject movement and camera timing.
                    video_url: https://cdn.vidgo.ai/temp/source-video.mp4
                    reference_image_urls:
                      - https://cdn.vidgo.ai/temp/style-reference.png
                    resolution: 1080p
                    audio_setting: auto
      responses:
        '200':
          description: 任务提交成功
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SubmitResponse'
components:
  schemas:
    SubmitRequest:
      type: object
      required:
        - model
        - input
      properties:
        model:
          type: string
          example: happy-horse
        callback_url:
          type: string
          format: uri
          description: 可选的 Webhook 回调 URL，用于接收结果通知。
          example: https://your-domain.com/callback
        input:
          type: object
          description: Happy Horse 的输入参数。工作流根据所提供的媒体字段自动选择。
          properties:
            prompt:
              type: string
              minLength: 1
              description: 生成或编辑提示词。文生视频、参考生视频和视频编辑必填（最多 2,500 个字符）；图生视频可选。
              example: A cinematic street scene with realistic character motion.
            image_urls:
              type: array
              items:
                type: string
                format: uri
              maxItems: 1
              description: 图生视频的单张首帧图片 URL。不要与 reference_image_urls 或 video_url 同时使用。
            reference_image_urls:
              type: array
              items:
                type: string
                format: uri
              description: 参考图片。参考生视频使用 1–9 张；视频编辑可选最多 5 张。
            video_url:
              type: string
              format: uri
              description: 视频编辑的源视频 URL。源视频时长须为 3–60 秒。
            aspect_ratio:
              type: string
              description: 文生视频和参考生视频的输出宽高比。
              enum:
                - '16:9'
                - '9:16'
                - '1:1'
                - '4:3'
                - '3:4'
              default: '16:9'
              example: '16:9'
            resolution:
              type: string
              description: 输出分辨率。计费可能因分辨率和工作流而不同；当前价格请查看 Vidgo 定价页或仪表盘。
              enum:
                - 720p
                - 1080p
              default: 1080p
              example: 1080p
            duration:
              type: integer
              minimum: 3
              maximum: 15
              description: 文生视频、图生视频和参考生视频的时长（秒）。视频编辑会忽略此参数：系统会检测源视频时长，并按该工作流的最大计费时长封顶。
              default: 5
              example: 5
            audio_setting:
              type: string
              description: 视频编辑的音频处理模式。
              enum:
                - auto
                - origin
              default: auto
              example: auto
            seed:
              type: integer
              minimum: 0
              maximum: 2147483647
              description: 可选的整数种子，用于可复现的生成。
              example: 42
            enable_safety_checker:
              type: boolean
              description: 可选的安全检查开关。
              example: true
    SubmitResponse:
      type: object
      required:
        - code
        - data
      properties:
        code:
          type: integer
          example: 200
          description: HTTP 状态码
        data:
          type: object
          required:
            - task_id
            - status
            - created_time
          properties:
            task_id:
              type: string
              example: task-unified-1757165031-uyujaw3d
              description: 任务唯一标识，用于跟踪状态
            status:
              type: string
              enum:
                - not_started
              example: not_started
              description: 任务初始状态
            created_time:
              type: string
              format: date-time
              example: '2026-05-11T10:30:00'
              description: 任务创建时间，ISO 8601 格式
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: >-
        所有 API 接口都需要 Bearer Token 认证


        获取 API Key：


        访问 [API Key 管理页面](https://vidgo.ai/apis/dashboard/api-key)（**仪表盘 → API
        密钥**）获取 API Key


        添加到请求头：


        ```

        Authorization: Bearer VIDGO_API_KEY

        ```

````

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