跳转到主要内容
POST
/
v1
/
tasks
HappyHorse 系列
curl --request POST \
  --url https://www.qingbo.dev/v1/tasks \
  --header 'Content-Type: application/json' \
  --data '
{
  "model": "<string>",
  "action": "<string>",
  "prompt": "<string>",
  "duration": 123,
  "resolution": "<string>",
  "aspect_ratio": "<string>",
  "image_urls": [
    "<string>"
  ],
  "first_frame_image": "<string>",
  "video_urls": [
    "<string>"
  ],
  "audio_urls": [
    "<string>"
  ],
  "callback_url": "<string>",
  "audio_setting": "<string>"
}
'
import requests

url = "https://www.qingbo.dev/v1/tasks"

payload = {
"model": "<string>",
"action": "<string>",
"prompt": "<string>",
"duration": 123,
"resolution": "<string>",
"aspect_ratio": "<string>",
"image_urls": ["<string>"],
"first_frame_image": "<string>",
"video_urls": ["<string>"],
"audio_urls": ["<string>"],
"callback_url": "<string>",
"audio_setting": "<string>"
}
headers = {"Content-Type": "application/json"}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
model: '<string>',
action: '<string>',
prompt: '<string>',
duration: 123,
resolution: '<string>',
aspect_ratio: '<string>',
image_urls: ['<string>'],
first_frame_image: '<string>',
video_urls: ['<string>'],
audio_urls: ['<string>'],
callback_url: '<string>',
audio_setting: '<string>'
})
};

fetch('https://www.qingbo.dev/v1/tasks', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
package main

import (
"fmt"
"strings"
"net/http"
"io"
)

func main() {

url := "https://www.qingbo.dev/v1/tasks"

payload := strings.NewReader("{\n \"model\": \"<string>\",\n \"action\": \"<string>\",\n \"prompt\": \"<string>\",\n \"duration\": 123,\n \"resolution\": \"<string>\",\n \"aspect_ratio\": \"<string>\",\n \"image_urls\": [\n \"<string>\"\n ],\n \"first_frame_image\": \"<string>\",\n \"video_urls\": [\n \"<string>\"\n ],\n \"audio_urls\": [\n \"<string>\"\n ],\n \"callback_url\": \"<string>\",\n \"audio_setting\": \"<string>\"\n}")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("Content-Type", "application/json")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.post("https://www.qingbo.dev/v1/tasks")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"<string>\",\n \"action\": \"<string>\",\n \"prompt\": \"<string>\",\n \"duration\": 123,\n \"resolution\": \"<string>\",\n \"aspect_ratio\": \"<string>\",\n \"image_urls\": [\n \"<string>\"\n ],\n \"first_frame_image\": \"<string>\",\n \"video_urls\": [\n \"<string>\"\n ],\n \"audio_urls\": [\n \"<string>\"\n ],\n \"callback_url\": \"<string>\",\n \"audio_setting\": \"<string>\"\n}")
.asString();
{
  "task_id": "task-wave1775285160b950328499",
  "model": "happyhorse-1.0",
  "action": "generate",
  "status": "queued",
  "created_at": 1775285160040,
  "progress": 0
}
阿里云百炼上的视频生成模型。 单模型统一入口 — 只用一个 happyhorse-1.0,后端按传入字段自动路由 T2V / I2V / R2V / EDIT 四种模式,无需切换 model id。 分辨率 × 时长 计费,3-15 秒任意整数。

定价

按秒计费,单位 $/秒(售价即结算 USD 价)。generate 与 edit 同价
分辨率单价(generate)单价(edit)5 秒视频
720P$0.14625 / 秒$0.14625 / 秒$0.73125
1080P$0.25875 / 秒$0.25875 / 秒$1.29375
EDIT 模式(action: edit)需传 video_urls,输出时长与源视频一致(超过 15s 按截取后的 15s 计费),duration 参数不生效;计费分辨率仍按 resolution 取价。

模式路由

传入字段路由模式说明
promptT2V(文生视频)画面比例由 aspect_ratio 控制
+ first_frame_image(单帧)I2V(图生视频)aspect_ratio 被忽略,跟随首帧比例
+ image_urls(1-9 张)R2V(参考生视频)多图风格 / 角色一致性
+ video_urls(单元素数组)EDIT(视频编辑)可叠加 image_urls ≤5 张作为风格参考
字段互斥first_frame_image / image_urls / video_urls 两两互斥,只有 video_urls + image_urls 可同时传(EDIT 模式叠加风格参考)。

调用示例

curl -X POST https://www.qingbo.dev/v1/tasks \
  -H "Authorization: Bearer $WAVE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "happyhorse-1.0",
    "prompt": "一只柴犬穿宇航服在月球上行走,电影感光影",
    "duration": 5,
    "resolution": "1080p",
    "aspect_ratio": "16:9"
  }'
curl -X POST https://www.qingbo.dev/v1/tasks \
  -H "Authorization: Bearer $WAVE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "happyhorse-1.0",
    "prompt": "人物缓缓走向镜头",
    "first_frame_image": "https://cdn.example.com/portrait.jpg",
    "duration": 8,
    "resolution": "1080p"
  }'
curl -X POST https://www.qingbo.dev/v1/tasks \
  -H "Authorization: Bearer $WAVE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "happyhorse-1.0",
    "prompt": "保持角色形象,在森林中奔跑",
    "image_urls": [
      "https://cdn.example.com/char-1.jpg",
      "https://cdn.example.com/char-2.jpg"
    ],
    "duration": 6,
    "resolution": "1080p"
  }'
curl -X POST https://www.qingbo.dev/v1/tasks \
  -H "Authorization: Bearer $WAVE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "happyhorse-1.0",
    "action": "edit",
    "prompt": "把场景改为雪天",
    "video_urls": ["https://cdn.example.com/source.mp4"],
    "audio_setting": "origin",
    "duration": 0,
    "resolution": "1080p"
  }'
{
  "task_id": "task-wave1775285160b950328499",
  "model": "happyhorse-1.0",
  "action": "generate",
  "status": "queued",
  "created_at": 1775285160040,
  "progress": 0
}
提交后用 GET /v1/tasks/{task_id} 轮询状态,详见 任务系统

可用模型

模型 ID说明
happyhorse-1.0统一入口,T2V/I2V/R2V/EDIT 自动路由,720P/1080P,3-15 秒

通用参数

model
string
必填
固定为 happyhorse-1.0
action
string
默认值:"generate"
操作类型,通常无需显式传,后端按媒体字段自动路由。可选值:
  • generate — 文生视频(T2V)
  • image2video — 图生视频(I2V),需配合 first_frame_image
  • reference — 参考生视频(R2V),需配合 image_urls
  • edit — 视频编辑,需配合 video_url
  • reference_audio — 配合 audio_urls 作驱动音
prompt
string
视频描述文本,最多 5000 字符。T2V 模式必填;其他模式可选作引导
duration
integer
默认值:"5"
视频时长(秒),范围 3-15 任意整数;EDIT 模式可传 0 表示跟随源视频
resolution
string
默认值:"720p"
输出分辨率,可选值:
  • 720p
  • 1080p
aspect_ratio
string
默认值:"16:9"
画面宽高比,仅 T2V 生效;I2V / R2V / EDIT 时跟随源素材比例。可选值:
  • 16:9 — 横版宽屏
  • 9:16 — 竖版长屏
  • 4:3 — 横版
  • 3:4 — 竖版
  • 1:1 — 正方形
image_urls
string[]
参考图片 URL 数组,1-9 张:
  • 触发 R2V 模式(多图风格 / 角色一致性)
  • EDIT 模式叠加,作风格参考(≤5 张)
first_frame_image
string
视频首帧图 URL,触发 I2V 模式
video_urls
string[]
源视频 URL 数组(单元素),触发 EDIT 模式:
  • 暂不支持 base64
  • 需公网可下载链接
audio_urls
string[]
参考音频 URL 数组(reference_audio 模式)
callback_url
string
Webhook 回调地址,任务终态时调用。详见 回调机制

模型特定参数

audio_setting
string
默认值:"auto"
音频设置,仅 EDIT 模式生效。可选值:
  • auto — 自动生成与编辑后视频匹配的音频
  • origin — 保留源视频原音轨

资源限制

项目限制
参考图片最多 9 张,单张 ≤ 30MB,JPG/PNG/WEBP
源视频(EDIT)MP4/MOV,≤ 100MB,2-30 秒
参考音频WAV/MP3,≤ 15MB,3-30 秒
输出MP4,链接 24 小时有效

相关文档