HappyHorse 1.1 视频 API:面向高频工作负载的轻量视频生成
目标型号:
happyhorse-1.1
推理端点:https://toapis.com/v1/videos/generations
相关阅读:Vidu Q3 API 开发者指南 · Vidu Q3 Drama Mode API · Wan 2.6 图生视频流水线 · HappyHorse 1.1 视频生成 · happyhorse-1.1 型号指南
1. TL;DR 与能力概览
排期标题把 HappyHorse 1.1 定位为面向高频工作负载的轻量生成器。在 2026-11-26 核对的页面上,这是定位表述,不是可测量的 SLA。官方 HappyHorse 1.1 视频生成 参考(HTTP 200)文档化的是一套紧凑、基于 action 的合同——文生视频、图生视频、参考图生视频和视频编辑——时长窗口为 3–15 秒。它没有文档化 10–14 秒出片、100 路并行、亚 12 秒延迟、99.95% SLA,或 loop: true 字段。
已文档化的公共型号名是 happyhorse-1.1(带点)。规划稿别名 happyhorse-1-1 不是已文档化 ID。现网型号指南是 /model-guide/happyhorse-1-1(标题使用 happyhorse-1.1)。/model-guide/happyhorse-1.1 返回了 HTTP 404;/model-guide/happyhorse 是软 404(“Model Guide Not Found”)。
已文档化的内容如下:
action—text-to-video、image-to-video、reference-to-video或video-edit。若省略action,带有首帧图表示图生视频;否则请求为文生视频。- 时长 3–15 秒,默认 5。分辨率
720P或1080P,默认1080P(官方示例使用大写P)。 - 鉴权与轮询 —
Authorization: Bearer <API_KEY>。先POST /v1/videos/generations,再GET /v1/videos/generations/{task_id}(HappyHorse 页面给出了这条路径)。普通任务也可以用GET /v1/tasks/{id}查询。官方示例使用https://toapis.com(中国大陆为https://toapis.cn)。completed后读取result.data[0].url。视频保留 30 天。 - 价格 — 2026-11-26 的型号指南快照是 17.1428 credits/秒,高于
viduq3的 8.5714 credits/秒。不要把它写成最便宜的商用视频 API。
2. 官方 ID、action 与字段规则
发送 model: "happyhorse-1.1"。官方页面将该值列为必填且为默认值。
action | 作用 | 额外必填项 | 说明 |
|---|---|---|---|
text-to-video | 由提示词生成 | 必须提供 prompt | aspect_ratio 生效(16:9、9:16、1:1、4:3、3:4;默认 16:9)。兼容别名:size。 |
image-to-video | 让首帧动起来 | image_urls(只使用第一张图) | prompt 可选,但建议用于控制运动和风格。图生视频的宽高比由首帧尺寸决定。 |
reference-to-video | 由 1–9 张参考图生成 | 必须提供 prompt 和 reference_images(1–9 张) | 不要依赖 action 自动检测;请显式设置为 reference-to-video。 |
video-edit | 编辑输入视频 | 必须提供 prompt 和 url;reference_images 可选,最多 5 张 | audio_setting 为 auto 或 origin(默认 auto),且仅适用于该 action。 |
图生视频首帧的兼容别名:input_reference、images、image,或 image_with_roles[{ role: "first_frame" }]。官方页面中的图片要求:JPEG / JPG / PNG / BMP / WEBP,最大 10MB,至少 300px,宽高比介于 1:2.5 与 2.5:1。请使用公开 HTTP(S) URL;本地文件先通过 上传图片 API 或 上传视频 API 上传。不要在 image_urls 中传 base64。
其他已文档化字段:seed,以及 watermark(默认 true)。若需要干净输出,请显式把 watermark 设为 false——该默认值与若干 Vidu Q3 多模型示例相反。
该页的分辨率字符串是 720P 和 1080P。官方示例使用大写 P。不要在未确认同一页面也接受小写形式的情况下,把它们悄悄改成 720p;示例并未使用小写。
今天核对的官方字段列表不包含 loop。不要文档化循环播放。该字段列表中也没有 fps,因此“720p 24fps 作为独特卖点”是规划稿说法,不是官方差异化能力。文档化的默认分辨率是 1080P。

图 1:选择已文档化的 action(text-to-video、image-to-video、reference-to-video 或 video-edit),提交 POST /v1/videos/generations,轮询 GET /v1/videos/generations/{task_id},并在 completed 后读取 result.data[0].url。
3. 生产实现:cURL 与 Python
官方示例使用 https://toapis.com。中国大陆应使用 https://toapis.cn。轮询前先保存返回的任务 id。
步骤 1:文生视频的 cURL
curl --request POST \
--url https://toapis.com/v1/videos/generations \
--header "Authorization: Bearer YOUR_API_KEY" \
--header "Content-Type: application/json" \
--data '{
"model": "happyhorse-1.1",
"action": "text-to-video",
"prompt": "At night under an urban railway bridge, a graffiti teenager comes alive from a concrete wall and performs a high-energy English rap.",
"duration": 10,
"resolution": "1080P",
"aspect_ratio": "16:9",
"seed": 42,
"watermark": true
}'
步骤 2:图生视频与参考图生视频的 cURL
curl --request POST \
--url https://toapis.com/v1/videos/generations \
--header "Authorization: Bearer YOUR_API_KEY" \
--header "Content-Type: application/json" \
--data '{
"model": "happyhorse-1.1",
"action": "image-to-video",
"prompt": "Animate the character naturally while preserving the original visual style.",
"image_urls": ["https://example.com/first-frame.png"],
"duration": 5,
"resolution": "1080P"
}'
curl --request POST \
--url https://toapis.com/v1/videos/generations \
--header "Authorization: Bearer YOUR_API_KEY" \
--header "Content-Type: application/json" \
--data '{
"model": "happyhorse-1.1",
"action": "reference-to-video",
"prompt": "The character from image 1 runs through the scene in image 2, then picks up the prop from image 3. Keep a 3D cartoon style.",
"reference_images": [
"https://example.com/image-01.jpg",
"https://example.com/image-02.png",
"https://example.com/image-03.jpeg"
],
"duration": 5,
"resolution": "1080P",
"aspect_ratio": "16:9",
"watermark": false
}'
视频编辑使用 "action": "video-edit",必填输入视频的 "url",可选最多 5 张 reference_images,以及 "audio_setting": "origin" 或 "auto"。
步骤 3:带有界轮询的 Python
import os
import time
import random
import requests
BASE = "https://toapis.com" # mainland China: https://toapis.cn
HEADERS = {
"Authorization": f"Bearer {os.environ['TOAPIS_API_KEY']}",
"Content-Type": "application/json",
}
def submit_happyhorse(payload: dict) -> str:
body = {"model": "happyhorse-1.1", **payload}
response = requests.post(
f"{BASE}/v1/videos/generations",
headers=HEADERS,
json=body,
timeout=30,
)
response.raise_for_status()
return response.json()["id"]
def poll_video_task(task_id: str, max_wait: int = 600, interval: int = 10) -> dict:
"""Poll until completed or failed, honoring Retry-After on 429."""
time.sleep(5)
start = time.time()
current = interval
while time.time() - start < max_wait:
response = requests.get(
f"{BASE}/v1/videos/generations/{task_id}",
headers=HEADERS,
timeout=30,
)
if response.status_code == 429:
retry_after = int(response.headers.get("Retry-After", current))
time.sleep(retry_after + random.uniform(0, 1))
current = min(current * 2, 60)
continue
response.raise_for_status()
data = response.json()
status = data.get("status")
if status == "completed":
return data
if status == "failed":
raise RuntimeError(data.get("error") or data)
time.sleep(current + random.uniform(0, 1))
raise TimeoutError(f"task {task_id} still running after {max_wait}s; query before resubmitting")
if __name__ == "__main__":
task_id = submit_happyhorse(
{
"action": "text-to-video",
"prompt": "At night under an urban railway bridge, a graffiti teenager comes alive from a concrete wall and performs a high-energy English rap.",
"duration": 10,
"resolution": "1080P",
"aspect_ratio": "16:9",
"seed": 42,
"watermark": True,
}
)
result = poll_video_task(task_id)
print(result["result"]["data"][0]["url"])
print("expires_at", result.get("expires_at"))
官方 HappyHorse“查询任务”片段使用 GET /v1/videos/generations/{task_id}。共享的状态语义来自 查询视频任务状态:先等待 5 秒,间隔 10 秒,上限 600 秒,加入抖动,并在 429 时遵守 Retry-After。生产环境优先使用 任务 Webhooks,并把轮询作为兜底。
4. 错误处理与状态矩阵
HTTP 提交成功并不等于视频已经完成。务必读取任务 status。
| HTTP 或任务状态 | 常见类别 | 建议操作 |
|---|---|---|
400 | 未知型号(happyhorse-1-1)、video-edit 缺少 url、reference-to-video 缺少 reference_images、时长超出 3–15,或虚构了 loop 字段 | 发送 happyhorse-1.1 以及所选 action 已文档化的字段 |
400 | 首帧图不满足格式、大小或宽高比规则 | 使用 JPEG/JPG/PNG/BMP/WEBP,≤10MB,≥300px,宽高比 1:2.5–2.5:1 |
401 | 缺少或无效的 API 密钥 | 确认 Authorization: Bearer <API_KEY>。官方 HappyHorse 页面没有文档化额外的 OAuth 范围 |
429 | 速率或并发限制 | 遵守 Retry-After;带抖动退避。不要假定存在已文档化的“100 路并行”上限 |
5xx 或客户端超时 | 网关或上游临时问题 | 重新提交前先查询已有任务 id |
status: queued 或 in_progress | 不是错误 | 继续轮询 GET /v1/videos/generations/{task_id} |
status: failed | 生成未成功 | 读取 error.message。官方文档并未写明失败任务一定不计费 |
5. 价格与 FinOps
官方生成页没有发布 HappyHorse 1.1 的美元价表。2026-11-26 核对的现网 型号指南 给出的价格参考是 17.1428 credits/秒。
按当天 /pricing 页面写明的 1 credit ≈ $0.005($1 = 200 credits),该快照约为 $0.0857 / 秒——5 秒片段大约 85.7 credits(约 $0.43),10 秒片段大约 171.4 credits(约 $0.86)。未认证的 GET /api/v1/pricing 返回了 401;请通过 价格目录 以及已完成任务上的 实际费用 字段确认。
该费率并不低于同一天 viduq3 / viduq3-turbo 的 8.5714 credits/秒快照。$0.010/秒 或“性价比最高的商用视频 API”等规划稿说法,不在今天核对的官方页面上。当你需要其已文档化的 action 集合(尤其是 reference-to-video 和 video-edit)时再选择 HappyHorse 1.1,而不是因为规划稿称它便宜。
请把所有数字当作有日期的快照。在预测高频批量成本前,用 GET /v1/models?type=video 和账户目录确认 ID 与实时报价。今天核对的官方页面没有文档化延迟或并发 SLA,因此请根据账户中观察到的限额来设计轮询器和队列,而不是根据规划稿中的“100 路并行 / 亚 12 秒”数字。
6. 常见问题
见 frontmatter 中的 FAQ。摘要:发送 happyhorse-1.1,不要发送 happyhorse-1-1;reference-to-video 和 video-edit 请显式设置 action;使用大写 P 的分辨率字符串;不要文档化 loop;轮询 GET /v1/videos/generations/{task_id} 并读取 result.data[0].url;把 17.1428 credits/秒当作 2026-11-26 快照,而不是“目录中最便宜”的断言。
7. 行动清单
- 用
GET /v1/models?type=video确认你的密钥能看到happyhorse-1.1— 不要发送happyhorse-1-1。 - 把
action设为已文档化的值。reference-to-video 发送 1–9 张reference_images;video-edit 发送url(以及可选的audio_setting)。 - 使用分辨率
720P或1080P(默认1080P),时长 3–15 秒。若不想使用默认的true,请显式设置watermark。 - 本地媒体先上传,只传 HTTPS URL。不要发送 base64,也不要虚构
loop: true。 - 向
https://toapis.com(中国大陆为https://toapis.cn)的POST /v1/videos/generations提交。轮询GET /v1/videos/generations/{task_id};仅在completed后读取result.data[0].url。在expires_at之前下载(保留 30 天)。 - 只引用实时账户目录中的价格。不要按
$0.010/秒或“最便宜 API”的说法预测批量成本。 - 下一步:Vidu Q3 开发者指南 了解已文档化的 subjects / 多参考图一致性,或 Vidu Q3 Drama Mode 了解叙事参考片段。