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

# happyhorse-1.1

> HappyHorse 1.1 文生视频、图生视频和参考图生视频 API。

通过 `POST /v1/video/generations` 创建 HappyHorse 1.1 任务。三种工作流使用不同的模型 ID 和输入结构。

<Tabs sync={false}>
  <Tab title="文生视频">
    ## 创建任务

    `POST /v1/video/generations`

    <div className="kling-api-example-panel happyhorse-api-example-panel">
      ```bash cURL theme={null}
      curl --request POST \
        --url https://www.anyfast.ai/v1/video/generations \
        --header 'Authorization: Bearer YOUR_API_KEY' \
        --header 'Content-Type: application/json' \
        --data '{
          "model": "happyhorse-1.1-t2v",
          "input": {"prompt": "夜晚，一座纸板搭建的微缩城市苏醒。"},
          "parameters": {"resolution": "720P", "ratio": "16:9", "duration": 5, "watermark": false, "seed": 42}
        }'
      ```

      ```json 200 theme={null}
      {
        "id": "asyntask_jwgfhsG0m2aDjLmiiELRf74eoWmss6ya",
        "task_id": "asyntask_jwgfhsG0m2aDjLmiiELRf74eoWmss6ya",
        "object": "video",
        "model": "happyhorse-1.1-t2v",
        "status": "queued",
        "progress": 0,
        "created_at": 1784520000
      }
      ```
    </div>

    ## 请求头

    <ParamField header="Authorization" type="string" required>Bearer 鉴权，格式为 `Bearer YOUR_API_KEY`。</ParamField>
    <ParamField header="Content-Type" type="string" default="application/json" required>请求体格式。</ParamField>

    ## 请求参数

    <ParamField body="model" type="string" required>必须为 `happyhorse-1.1-t2v`。</ParamField>
    <ParamField body="input.prompt" type="string" required>文本提示，最多 5000 个非中文字符或 2500 个中文字符。</ParamField>
    <ParamField body="parameters.resolution" type="string" default="1080P">`720P` 或 `1080P`。</ParamField>
    <ParamField body="parameters.ratio" type="string" default="16:9">`16:9`、`9:16`、`1:1`、`4:3`、`3:4`、`4:5`、`5:4`、`9:21` 或 `21:9`。</ParamField>

    ## 查询任务（单个）

    `GET /v1/video/generations/{task_id}`

    ### 请求头

    <ParamField header="Authorization" type="string" required>Bearer 鉴权，格式为 `Bearer YOUR_API_KEY`。</ParamField>
    <ParamField header="Content-Type" type="string" default="application/json" required>请求体格式。</ParamField>

    ### 路径参数

    <ParamField path="task_id" type="string" required>创建任务时返回的任务 ID。</ParamField>

    <div className="kling-api-example-panel happyhorse-api-example-panel">
      ```bash cURL theme={null}
      curl --request GET \
        --url https://www.anyfast.ai/v1/video/generations/TASK_ID \
        --header 'Authorization: Bearer YOUR_API_KEY' \
        --header 'Content-Type: application/json'
      ```

      ```json 200 theme={null}
      {
        "code": "success",
        "message": "",
        "data": {
          "task_id": "asyntask_6rTCHZ9Xi7wXdmotOYsZP3o0XWWA1dOY",
          "action": "generate",
          "status": "SUCCESS",
          "result_url": "https://dashscope-a717.oss-accelerate.aliyuncs.com/.../xxx_refiner.mp4?Expires=...",
          "fail_reason": "https://dashscope-a717.oss-accelerate.aliyuncs.com/.../xxx_refiner.mp4?Expires=...",
          "submit_time": 1777343862,
          "start_time": 1777343866,
          "finish_time": 1777343961,
          "progress": "100%",
          "request_id": "20260731061043150392831bGTNOtlT",
          "data": {
            "output": {
              "task_id": "e45a6a1b-6f05-43e5-ab06-ddfdc97587a7",
              "task_status": "SUCCEEDED",
              "video_url": "https://dashscope-a717.oss-accelerate.aliyuncs.com/.../xxx_refiner.mp4?Expires=...",
              "orig_prompt": "A cat running on grass",
              "submit_time": "2026-04-28 10:37:42.625",
              "scheduled_time": "2026-04-28 10:37:42.652",
              "end_time": "2026-04-28 10:39:04.185"
            },
            "request_id": "53121cad-c008-9b96-af1d-4289a4fc714b",
            "usage": {
              "SR": 720,
              "duration": 5,
              "input_video_duration": 0,
              "output_video_duration": 5,
              "ratio": "16:9",
              "video_count": 1
            }
          }
        }
      }
      ```
    </div>

    ### 响应字段

    <ResponseField name="code" type="string">查询成功时为 `success`。</ResponseField>
    <ResponseField name="message" type="string">附加响应消息。</ResponseField>
    <ResponseField name="data.task_id" type="string">AnyFast 任务 ID。</ResponseField>
    <ResponseField name="data.action" type="string">任务使用的工作流动作。</ResponseField>
    <ResponseField name="data.status" type="string">任务状态，例如 `QUEUED`、`IN_PROGRESS`、`SUCCESS` 或 `FAILURE`。</ResponseField>
    <ResponseField name="data.result_url" type="string">任务成功后的结果视频 URL。</ResponseField>
    <ResponseField name="data.fail_reason" type="string">上游任务服务返回的失败详情；成功响应中该字段也可能被填充为结果 URL。</ResponseField>
    <ResponseField name="data.submit_time" type="integer">任务提交时间，Unix 时间戳。</ResponseField>
    <ResponseField name="data.start_time" type="integer">任务开始处理时间，Unix 时间戳。</ResponseField>
    <ResponseField name="data.finish_time" type="integer">任务完成时间，Unix 时间戳。</ResponseField>
    <ResponseField name="data.progress" type="string">任务进度百分比。</ResponseField>
    <ResponseField name="data.request_id" type="string">AnyFast 外层响应的请求 ID。</ResponseField>
    <ResponseField name="data.data.output" type="object">上游任务输出详情。</ResponseField>
    <ResponseField name="data.data.output.task_id" type="string">上游任务 ID。</ResponseField>
    <ResponseField name="data.data.output.task_status" type="string">上游任务状态，例如 `SUCCEEDED`。</ResponseField>
    <ResponseField name="data.data.output.video_url" type="string">上游结果视频 URL。</ResponseField>
    <ResponseField name="data.data.output.orig_prompt" type="string">任务提交时使用的原始提示词。</ResponseField>
    <ResponseField name="data.data.output.submit_time" type="string">上游任务提交时间。</ResponseField>
    <ResponseField name="data.data.output.scheduled_time" type="string">上游任务调度时间。</ResponseField>
    <ResponseField name="data.data.output.end_time" type="string">上游任务完成时间。</ResponseField>
    <ResponseField name="data.data.request_id" type="string">上游任务服务返回的请求 ID。</ResponseField>
    <ResponseField name="data.data.usage" type="object">上游任务服务返回的用量和输出指标。</ResponseField>
    <ResponseField name="data.data.usage.SR" type="integer">输出超分辨率值。</ResponseField>
    <ResponseField name="data.data.usage.duration" type="number">请求或生成的视频时长。</ResponseField>
    <ResponseField name="data.data.usage.input_video_duration" type="number">输入视频时长。</ResponseField>
    <ResponseField name="data.data.usage.output_video_duration" type="number">输出视频时长。</ResponseField>
    <ResponseField name="data.data.usage.ratio" type="string">输出画面比例。</ResponseField>
    <ResponseField name="data.data.usage.video_count" type="integer">生成的视频数量。</ResponseField>
  </Tab>

  <Tab title="图生视频">
    ## 创建任务

    `POST /v1/video/generations`

    <div className="kling-api-example-panel happyhorse-api-example-panel">
      ```bash cURL theme={null}
      curl --request POST \
        --url https://www.anyfast.ai/v1/video/generations \
        --header 'Authorization: Bearer YOUR_API_KEY' \
        --header 'Content-Type: application/json' \
        --data '{
          "model": "happyhorse-1.1-i2v",
          "input": {
            "prompt": "小猫从草地上快速跑过。",
            "media": [{"type": "first_frame", "url": "https://example.com/cat.png"}]
          },
          "parameters": {"resolution": "720P", "duration": 5, "watermark": false}
        }'
      ```

      ```json 200 theme={null}
      {
        "id": "asyntask_jwgfhsG0m2aDjLmiiELRf74eoWmss6ya",
        "task_id": "asyntask_jwgfhsG0m2aDjLmiiELRf74eoWmss6ya",
        "object": "video",
        "model": "happyhorse-1.1-i2v",
        "status": "queued",
        "progress": 0,
        "created_at": 1784520000
      }
      ```
    </div>

    ## 请求头

    <ParamField header="Authorization" type="string" required>Bearer 鉴权，格式为 `Bearer YOUR_API_KEY`。</ParamField>
    <ParamField header="Content-Type" type="string" default="application/json" required>请求体格式。</ParamField>

    ## 请求参数

    <ParamField body="model" type="string" required>必须为 `happyhorse-1.1-i2v`。</ParamField>
    <ParamField body="input.media" type="object[]" required>必须且只能包含一张首帧图片对象。</ParamField>
    <ParamField body="input.media[0].type" type="string" required>必须为 `first_frame`。</ParamField>
    <ParamField body="input.media[0].url" type="string" required>公网图片 URL 或 Base64 Data URL。</ParamField>
    <ParamField body="parameters.ratio" type="string">不支持；输出比例跟随首帧图片。</ParamField>

    ## 查询任务（单个）

    `GET /v1/video/generations/{task_id}`

    ### 请求头

    <ParamField header="Authorization" type="string" required>Bearer 鉴权，格式为 `Bearer YOUR_API_KEY`。</ParamField>
    <ParamField header="Content-Type" type="string" default="application/json" required>请求体格式。</ParamField>

    ### 路径参数

    <ParamField path="task_id" type="string" required>创建任务时返回的任务 ID。</ParamField>

    <div className="kling-api-example-panel happyhorse-api-example-panel">
      ```bash cURL theme={null}
      curl --request GET \
        --url https://www.anyfast.ai/v1/video/generations/TASK_ID \
        --header 'Authorization: Bearer YOUR_API_KEY' \
        --header 'Content-Type: application/json'
      ```

      ```json 200 theme={null}
      {
        "code": "success",
        "message": "",
        "data": {
          "task_id": "asyntask_6rTCHZ9Xi7wXdmotOYsZP3o0XWWA1dOY",
          "action": "firstTailGenerate",
          "status": "SUCCESS",
          "result_url": "https://dashscope-a717.oss-accelerate.aliyuncs.com/.../xxx_refiner.mp4?Expires=...",
          "fail_reason": "https://dashscope-a717.oss-accelerate.aliyuncs.com/.../xxx_refiner.mp4?Expires=...",
          "submit_time": 1777343862,
          "start_time": 1777343866,
          "finish_time": 1777348588,
          "progress": "100%",
          "request_id": "20260731061043150392831bGTNOtlT",
          "data": {
            "output": {
              "task_id": "e45a6a1b-6f05-43e5-ab06-ddfdc97587a7",
              "task_status": "SUCCEEDED",
              "video_url": "https://dashscope-a717.oss-accelerate.aliyuncs.com/.../xxx_refiner.mp4?Expires=...",
              "orig_prompt": "A cat running on grass",
              "submit_time": "2026-04-28 10:37:42.625",
              "scheduled_time": "2026-04-28 10:37:42.652",
              "end_time": "2026-04-28 10:39:04.185"
            },
            "request_id": "53121cad-c008-9b96-af1d-4289a4fc714b",
            "usage": {
              "SR": 720,
              "duration": 5,
              "input_video_duration": 0,
              "output_video_duration": 5,
              "ratio": "16:9",
              "video_count": 1
            }
          }
        }
      }
      ```
    </div>

    ### 响应字段

    ### 响应字段

    <ResponseField name="code" type="string">查询成功时为 `success`。</ResponseField>
    <ResponseField name="message" type="string">附加响应消息。</ResponseField>
    <ResponseField name="data.task_id" type="string">AnyFast 任务 ID。</ResponseField>
    <ResponseField name="data.action" type="string">任务使用的工作流动作。</ResponseField>
    <ResponseField name="data.status" type="string">任务状态，例如 `QUEUED`、`IN_PROGRESS`、`SUCCESS` 或 `FAILURE`。</ResponseField>
    <ResponseField name="data.result_url" type="string">任务成功后的结果视频 URL。</ResponseField>
    <ResponseField name="data.fail_reason" type="string">上游任务服务返回的失败详情；成功响应中该字段也可能被填充为结果 URL。</ResponseField>
    <ResponseField name="data.submit_time" type="integer">任务提交时间，Unix 时间戳。</ResponseField>
    <ResponseField name="data.start_time" type="integer">任务开始处理时间，Unix 时间戳。</ResponseField>
    <ResponseField name="data.finish_time" type="integer">任务完成时间，Unix 时间戳。</ResponseField>
    <ResponseField name="data.progress" type="string">任务进度百分比。</ResponseField>
    <ResponseField name="data.request_id" type="string">AnyFast 外层响应的请求 ID。</ResponseField>
    <ResponseField name="data.data.output" type="object">上游任务输出详情。</ResponseField>
    <ResponseField name="data.data.output.task_id" type="string">上游任务 ID。</ResponseField>
    <ResponseField name="data.data.output.task_status" type="string">上游任务状态，例如 `SUCCEEDED`。</ResponseField>
    <ResponseField name="data.data.output.video_url" type="string">上游结果视频 URL。</ResponseField>
    <ResponseField name="data.data.output.orig_prompt" type="string">任务提交时使用的原始提示词。</ResponseField>
    <ResponseField name="data.data.output.submit_time" type="string">上游任务提交时间。</ResponseField>
    <ResponseField name="data.data.output.scheduled_time" type="string">上游任务调度时间。</ResponseField>
    <ResponseField name="data.data.output.end_time" type="string">上游任务完成时间。</ResponseField>
    <ResponseField name="data.data.request_id" type="string">上游任务服务返回的请求 ID。</ResponseField>
    <ResponseField name="data.data.usage" type="object">上游任务服务返回的用量和输出指标。</ResponseField>
    <ResponseField name="data.data.usage.SR" type="integer">输出超分辨率值。</ResponseField>
    <ResponseField name="data.data.usage.duration" type="number">请求或生成的视频时长。</ResponseField>
    <ResponseField name="data.data.usage.input_video_duration" type="number">输入视频时长。</ResponseField>
    <ResponseField name="data.data.usage.output_video_duration" type="number">输出视频时长。</ResponseField>
    <ResponseField name="data.data.usage.ratio" type="string">输出画面比例。</ResponseField>
    <ResponseField name="data.data.usage.video_count" type="integer">生成的视频数量。</ResponseField>
  </Tab>

  <Tab title="参考图生视频">
    ## 创建任务

    `POST /v1/video/generations`

    <div className="kling-api-example-panel happyhorse-api-example-panel">
      ```bash cURL theme={null}
      curl --request POST \
        --url https://www.anyfast.ai/v1/video/generations \
        --header 'Authorization: Bearer YOUR_API_KEY' \
        --header 'Content-Type: application/json' \
        --data '{
          "model": "happyhorse-1.1-r2v",
          "input": {
            "prompt": "[Image 1]展开[Image 2]中的折扇。",
            "media": [
              {"type": "reference_image", "url": "https://example.com/person.jpg"},
              {"type": "reference_image", "url": "https://example.com/fan.jpg"}
            ]
          },
          "parameters": {"resolution": "720P", "ratio": "16:9", "duration": 5, "watermark": false}
        }'
      ```

      ```json 200 theme={null}
      {
        "id": "asyntask_jwgfhsG0m2aDjLmiiELRf74eoWmss6ya",
        "task_id": "asyntask_jwgfhsG0m2aDjLmiiELRf74eoWmss6ya",
        "object": "video",
        "model": "happyhorse-1.1-r2v",
        "status": "queued",
        "progress": 0,
        "created_at": 1784520000
      }
      ```
    </div>

    ## 请求头

    <ParamField header="Authorization" type="string" required>Bearer 鉴权，格式为 `Bearer YOUR_API_KEY`。</ParamField>
    <ParamField header="Content-Type" type="string" default="application/json" required>请求体格式。</ParamField>

    ## 请求参数

    <ParamField body="model" type="string" required>必须为 `happyhorse-1.1-r2v`。</ParamField>
    <ParamField body="input.media" type="object[]" required>包含 1 至 9 张参考图对象。</ParamField>
    <ParamField body="input.media[].type" type="string" required>必须为 `reference_image`。</ParamField>
    <ParamField body="input.media[].url" type="string" required>公网图片 URL 或 Base64 Data URL。</ParamField>
    <ParamField body="parameters.ratio" type="string" default="16:9">`16:9`、`9:16`、`1:1`、`4:3`、`3:4`、`4:5`、`5:4`、`9:21` 或 `21:9`。</ParamField>

    ## 查询任务（单个）

    `GET /v1/video/generations/{task_id}`

    ### 请求头

    <ParamField header="Authorization" type="string" required>Bearer 鉴权，格式为 `Bearer YOUR_API_KEY`。</ParamField>
    <ParamField header="Content-Type" type="string" default="application/json" required>请求体格式。</ParamField>

    ### 路径参数

    <ParamField path="task_id" type="string" required>创建任务时返回的任务 ID。</ParamField>

    <div className="kling-api-example-panel happyhorse-api-example-panel">
      ```bash cURL theme={null}
      curl --request GET \
        --url https://www.anyfast.ai/v1/video/generations/TASK_ID \
        --header 'Authorization: Bearer YOUR_API_KEY' \
        --header 'Content-Type: application/json'
      ```

      ```json 200 theme={null}
      {
        "code": "success",
        "message": "",
        "data": {
          "task_id": "asyntask_6rTCHZ9Xi7wXdmotOYsZP3o0XWWA1dOY",
          "action": "referenceGenerate",
          "status": "SUCCESS",
          "result_url": "https://dashscope-a717.oss-accelerate.aliyuncs.com/.../xxx_refiner.mp4?Expires=...",
          "fail_reason": "https://dashscope-a717.oss-accelerate.aliyuncs.com/.../xxx_refiner.mp4?Expires=...",
          "submit_time": 1777343862,
          "start_time": 1777343866,
          "finish_time": 1777348588,
          "progress": "100%",
          "request_id": "20260731061043150392831bGTNOtlT",
          "data": {
            "output": {
              "task_id": "e45a6a1b-6f05-43e5-ab06-ddfdc97587a7",
              "task_status": "SUCCEEDED",
              "video_url": "https://dashscope-a717.oss-accelerate.aliyuncs.com/.../xxx_refiner.mp4?Expires=...",
              "orig_prompt": "A cat running on grass",
              "submit_time": "2026-04-28 10:37:42.625",
              "scheduled_time": "2026-04-28 10:37:42.652",
              "end_time": "2026-04-28 10:39:04.185"
            },
            "request_id": "53121cad-c008-9b96-af1d-4289a4fc714b",
            "usage": {
              "SR": 720,
              "duration": 5,
              "input_video_duration": 0,
              "output_video_duration": 5,
              "ratio": "16:9",
              "video_count": 1
            }
          }
        }
      }
      ```
    </div>

    ### 响应字段

    ### 响应字段

    <ResponseField name="code" type="string">查询成功时为 `success`。</ResponseField>
    <ResponseField name="message" type="string">附加响应消息。</ResponseField>
    <ResponseField name="data.task_id" type="string">AnyFast 任务 ID。</ResponseField>
    <ResponseField name="data.action" type="string">任务使用的工作流动作。</ResponseField>
    <ResponseField name="data.status" type="string">任务状态，例如 `QUEUED`、`IN_PROGRESS`、`SUCCESS` 或 `FAILURE`。</ResponseField>
    <ResponseField name="data.result_url" type="string">任务成功后的结果视频 URL。</ResponseField>
    <ResponseField name="data.fail_reason" type="string">上游任务服务返回的失败详情；成功响应中该字段也可能被填充为结果 URL。</ResponseField>
    <ResponseField name="data.submit_time" type="integer">任务提交时间，Unix 时间戳。</ResponseField>
    <ResponseField name="data.start_time" type="integer">任务开始处理时间，Unix 时间戳。</ResponseField>
    <ResponseField name="data.finish_time" type="integer">任务完成时间，Unix 时间戳。</ResponseField>
    <ResponseField name="data.progress" type="string">任务进度百分比。</ResponseField>
    <ResponseField name="data.request_id" type="string">AnyFast 外层响应的请求 ID。</ResponseField>
    <ResponseField name="data.data.output" type="object">上游任务输出详情。</ResponseField>
    <ResponseField name="data.data.output.task_id" type="string">上游任务 ID。</ResponseField>
    <ResponseField name="data.data.output.task_status" type="string">上游任务状态，例如 `SUCCEEDED`。</ResponseField>
    <ResponseField name="data.data.output.video_url" type="string">上游结果视频 URL。</ResponseField>
    <ResponseField name="data.data.output.orig_prompt" type="string">任务提交时使用的原始提示词。</ResponseField>
    <ResponseField name="data.data.output.submit_time" type="string">上游任务提交时间。</ResponseField>
    <ResponseField name="data.data.output.scheduled_time" type="string">上游任务调度时间。</ResponseField>
    <ResponseField name="data.data.output.end_time" type="string">上游任务完成时间。</ResponseField>
    <ResponseField name="data.data.request_id" type="string">上游任务服务返回的请求 ID。</ResponseField>
    <ResponseField name="data.data.usage" type="object">上游任务服务返回的用量和输出指标。</ResponseField>
    <ResponseField name="data.data.usage.SR" type="integer">输出超分辨率值。</ResponseField>
    <ResponseField name="data.data.usage.duration" type="number">请求或生成的视频时长。</ResponseField>
    <ResponseField name="data.data.usage.input_video_duration" type="number">输入视频时长。</ResponseField>
    <ResponseField name="data.data.usage.output_video_duration" type="number">输出视频时长。</ResponseField>
    <ResponseField name="data.data.usage.ratio" type="string">输出画面比例。</ResponseField>
    <ResponseField name="data.data.usage.video_count" type="integer">生成的视频数量。</ResponseField>
  </Tab>
</Tabs>

## 通用请求参数

<ParamField body="parameters.duration" type="integer" default={5}>视频时长，范围为 3 至 15 秒。</ParamField>
<ParamField body="parameters.watermark" type="boolean" default={true}>是否添加 HappyHorse 水印。</ParamField>
<ParamField body="parameters.seed" type="integer">`[0, 2147483647]` 范围内的随机种子。</ParamField>

## 响应

<ResponseField name="id" type="string">创建后的任务 ID。</ResponseField>
<ResponseField name="task_id" type="string">创建后的任务 ID，用于查询任务。</ResponseField>
<ResponseField name="model" type="string">创建任务所使用的模型。</ResponseField>
<ResponseField name="status" type="string">任务初始状态。</ResponseField>
<ResponseField name="progress" type="integer">任务初始进度。</ResponseField>

## 错误响应

* `400 Bad Request` - 请求参数无效或参数组合不支持。
* `401 Unauthorized` - API 密钥缺失或无效。
* `429 Rate limit exceeded` - 请求超过适用的速率限制。

<script src="/public/feedback.js" />
