POST https://api.onelinkai.cloud/v1/videos/generations| 参数 | 值 |
|---|---|
| Content-Type | application/json |
| Authorization | Bearer <ApiKey> |
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
| model | string | 是 | 模型名称,固定为 happyhorse-1.0-video-edit |
| prompt | string | 是 | 编辑指令,描述对视频的修改意图,如风格转换、局部替换等。长度不超过 5000 个非中文字符或 2500 个中文字符 |
| video | string | 是 | 待编辑视频的 URL,须为公网可访问地址。格式:MP4 / MOV(建议 H.264 编码),时长 3–60 秒,分辨率长边 ≤ 2160px、短边 ≥ 320px,宽高比 1:2.5–2.5:1,文件大小 ≤ 100MB,帧率 > 8fps |
| images | array | 否 | 参考图片 URL 列表,0–5 张。格式:JPEG / JPG / PNG / WEBP,分辨率宽高 ≥ 300px,宽高比 1:2.5–2.5:1,文件大小 ≤ 20MB |
| extra.parameters.resolution | string | 否 | 输出分辨率,默认 1080P,可选 720P / 1080P |
| extra.parameters.watermark | boolean | 否 | 是否添加水印,默认 true |
| extra.parameters.audio_setting | string | 否 | 声音控制,默认 auto(模型自动控制),可选 origin(保留原始声音) |
| extra.parameters.seed | integer | 否 | 随机种子,范围 0–2147483647 |
status: "pending",需轮询查询接口获取最终结果。{
"id": "task-abc123",
"object": "video.generation",
"created_at": 1746000000,
"model": "happyhorse-1.0-video-edit",
"status": "pending",
"progress": 0,
"data": null,
"usage": null
}GET https://api.onelinkai.cloud/v1/videos/generations/{task_id}| 参数 | 值 |
|---|---|
| Authorization | Bearer <ApiKey> |
status 枚举值| 值 | 说明 |
|---|---|
| pending | 任务排队中 |
| running | 生成中 |
| completed | 生成完成 |
| failed | 生成失败 |
{
"id": "task-abc123",
"object": "video.generation",
"created_at": 1746000000,
"model": "happyhorse-1.0-video-edit",
"status": "running",
"progress": 60,
"data": null,
"usage": null
}{
"id": "task-abc123",
"object": "video.generation",
"created_at": 1746000000,
"model": "happyhorse-1.0-video-edit",
"status": "completed",
"progress": 100,
"data": {
"url": "https://cdn.example.com/output/task-abc123.mp4",
"expires_at": 1746086400
},
"usage": {
"duration": 13.24
}
}{
"id": "task-abc123",
"object": "video.generation",
"created_at": 1746000000,
"model": "happyhorse-1.0-video-edit",
"status": "failed",
"progress": 0,
"data": null,
"usage": null,
"fail_reason": "输入内容不符合使用规范"
}data.url)有效期 24 小时,请在过期前下载保存。