跳到主要内容
AI
MarkdownLLMs.txt

Happy-Horse 视频生成

Happy-Horse 支持文生视频、图生视频、多参考图生视频和视频编辑。通过统一视频生成接口提交任务,再轮询任务 ID,直到返回结果视频 URL。

支持模型

模型用途
happy-horse-720p720p 文生视频、图生视频和多参考图生成。
happy-horse-1080p1080p 文生视频、图生视频和多参考图生成。
happy-horse-edit-720p720p 视频编辑。
happy-horse-edit-1080p1080p 视频编辑。

Endpoint

POST /v1/video/generations
GET /v1/videos/{task_id}

Authentication

Authorization: Bearer sk-***
Content-Type: application/json

请求参数

参数类型必填说明
modelstringHappy-Horse 公共模型 ID。
promptstring提示词。来源限制最多 2500 字符。
aspect_ratiostring16:99:161:14:33:4
durationinteger条件必填输出秒数,来源范围为 315
seedinteger随机种子,范围 02147483647
imagestring条件必填单张公开可访问的源图片 URL。
imagesstring[]条件必填19 张公开可访问的参考图 URL。
videostring条件必填编辑模型使用的源视频 URL。
reference_image_urlsstring[]视频编辑参考图。
audio_settingstringautoorigin;默认跟随上游配置。

文生视频示例

curl -X POST "{BASE_URL}/v1/video/generations" \
-H "Authorization: Bearer sk-***" \
-H "Content-Type: application/json" \
-d '{
"model": "happy-horse-720p",
"prompt": "A cinematic wide shot of a white horse running across a misty grassland at sunrise, realistic motion, soft rim light.",
"duration": 4,
"aspect_ratio": "16:9",
"size": "720p",
"seed": 12345
}'

图生视频示例

curl -X POST "{BASE_URL}/v1/video/generations" \
-H "Authorization: Bearer sk-***" \
-H "Content-Type: application/json" \
-d '{
"model": "happy-horse-1080p",
"prompt": "Animate the subject naturally, with subtle camera push-in and realistic cloth movement.",
"image": "https://example.com/source-frame.png",
"duration": 6,
"size": "1080p",
"seed": 67890
}'

多参考图示例

curl -X POST "{BASE_URL}/v1/video/generations" \
-H "Authorization: Bearer sk-***" \
-H "Content-Type: application/json" \
-d '{
"model": "happy-horse-1080p",
"prompt": "character1 rides character2 through a futuristic city street, keep both identities consistent.",
"images": [
"https://example.com/character1.png",
"https://example.com/character2.png"
],
"duration": 8,
"aspect_ratio": "9:16",
"seed": 24680
}'

视频编辑示例

curl -X POST "{BASE_URL}/v1/video/generations" \
-H "Authorization: Bearer sk-***" \
-H "Content-Type: application/json" \
-d '{
"model": "happy-horse-edit-720p",
"prompt": "Change the actor jacket into a red leather jacket while preserving motion, face identity, camera movement, and background.",
"video": "https://example.com/source-video.mp4",
"reference_image_urls": [
"https://example.com/jacket-reference.png"
],
"duration": 4,
"size": "720p"
}'

查询任务状态

curl "{BASE_URL}/v1/videos/task_xxx" \
-H "Authorization: Bearer sk-***"
{
"id": "task_xxx",
"task_id": "task_xxx",
"object": "video.generation.job",
"model": "happy-horse-720p",
"status": "completed",
"progress": 100,
"video_url": "https://example.com/output.mp4"
}

建议每 2 到 5 秒轮询一次。statuscompletedfailed 时停止。

计费说明

Happy-Horse 计费与模型档位、输出分辨率、输出秒数和操作类型有关。视频编辑可能涉及源视频处理。最终价格以当前产品价格页和任务结算记录为准。

常见错误

  • 编辑模型没有传 video
  • duration 不在 315 范围内。
  • 媒体 URL 私有、过期或上游不可访问。
  • 参考图超过 9 张。
  • 使用 720p 模型却请求 1080p size

相关页面