API 参考
OmniHuman Audio-to-Video
创建文生视频任务,并跟踪其完成或失败状态。
01
概览
使用支持的模型创建异步文生视频任务。使用返回的任务 ID 查询状态,或提供 callback_url 接收终态投递。
快速开始
- 创建 API Key,并将其设置为 RUNAPI_API_KEY。
- 选择一个支持的模型,并发送与该模型 Schema 匹配的 POST 请求。
- 保存返回的任务 ID,随后轮询到终态,或处理终态回调。
端点
- 基础 URL
https://runapi.ai- API 版本
v1- 身份验证
Authorization: Bearer YOUR_API_TOKEN
02
支持的模型
打开模型页可查看当前价格、限流和商业使用详情。
03
JSON 请求体请求 Schema
字段和允许的取值取决于所选模型。提供 callback_url 后,它会收到任务终态投递。
omnihuman-1.59 个字段
callback_urlstring
可选
enable_fast_modeboolean
可选
mask_urlsarray
可选
modelstring
可选
output_resolutionstring
可选
可选值:
720p, 1080p
promptstring
可选
边界:
1000
seedinteger
可选
source_audio_urlstring
必填
source_image_urlstring
必填
04
HTTP 202创建已接受
POST /api/v1/omnihuman/audio_to_video
JSON
{
"billing": {
"refund": null,
"reservation": null,
"settlement": null
},
"id": "tsk_reference_demo",
"status": "processing"
}
05
HTTP 200轮询处理中
GET /api/v1/omnihuman/audio_to_video/:id
JSON
{
"billing": {
"refund": null,
"reservation": null,
"settlement": null
},
"id": "tsk_reference_demo",
"status": "processing"
}
06
HTTP 200轮询已完成
GET /api/v1/omnihuman/audio_to_video/:id
JSON
{
"billing": {
"refund": null,
"reservation": null,
"settlement": null
},
"id": "tsk_reference_demo",
"status": "completed",
"videos": [
{
"url": "https://file.runapi.ai/reference-video.mp4"
}
]
}
07
HTTP 200轮询失败
GET /api/v1/omnihuman/audio_to_video/:id
JSON
{
"billing": {
"refund": null,
"reservation": null,
"settlement": null
},
"error": "Task processing failed.",
"id": "tsk_reference_demo",
"status": "failed"
}
08
HTTP 200客户回调:已完成
POST callback_url
JSON
{
"billing": {
"refund": null,
"reservation": null,
"settlement": null
},
"id": "tsk_reference_demo",
"status": "completed",
"videos": [
{
"url": "https://file.runapi.ai/reference-video.mp4"
}
]
}
09
HTTP 200客户回调:失败
POST callback_url
JSON
{
"billing": {
"refund": null,
"reservation": null,
"settlement": null
},
"error": {
"code": "generation_failed",
"message": "Task processing failed."
},
"id": "tsk_reference_demo",
"status": "failed"
}
10
HTTP 400错误
JSON
{
"error": {
"code": "invalid_request",
"message": "A required request field is missing."
}
}
11
生成的代码示例
直接使用 cURL,或安装所用语言的 SDK。每个示例都会提交本参考中经过验证的请求。
CURL
curl -X POST https://runapi.ai/api/v1/omnihuman/audio_to_video \
-H 'Authorization: Bearer YOUR_API_TOKEN' \
-H 'Content-Type: application/json' \
-d '{"model":"omnihuman-1.5","source_image_url":"https://file.runapi.ai/portrait.png","source_audio_url":"https://file.runapi.ai/narration.mp3","prompt":"A natural speaking portrait."}'
12