国产视频模型生成
使用 `POST /v1/videos` 提交国产视频任务。
POST
https://duoyuanx.com/v1/videos请求示例
curl -X POST https://duoyuanx.com/v1/videos \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '
{
"model": "Kling-3.0-Omni",
"prompt": "镜头环绕建筑并使用希区柯克变焦",
"seconds": "15",
"size": "720x1280",
"metadata": {
"scene_type": "motion_control",
"motion_level": "pro",
"file_infos": [
{
"type": "Url",
"category": "Video",
"url": "https://example.com/motion-ref.mp4"
}
],
"output_config": {
"duration": 15,
"resolution": "720P",
"aspect_ratio": "9:16",
"audio_generation": "Enabled"
}
}
}'通过 POST /v1/videos 提交国产视频任务,支持文生视频、图生视频、首尾帧、动作控制、数字人、对口型、模板特效等场景,扩展参数通过 metadata 传递。
请求头
Authorizationstring必填请求身份认证。使用 Bearer Token,示例值:Bearer YOUR_API_KEY。
Content-Typestring必填请求内容类型,必须设置为 application/json。
请求体
modelstring必填模型名称。可以直接传基础模型,也可以传组合计费模型。
promptstring必填提示词。
secondsstring | integer时长。顶层 seconds 优先级最高。
durationinteger时长兼容字段。
sizestring快速尺寸字段,例如 720x1280 或 1280x720。
imagestring单张参考图或首帧图。
imagesarray<string>多张参考图。
input_referencestring | array<string>参考图输入,兼容 URL、base64、data URI 与文件上传。
metadataobject扩展参数。常用 metadata.output_config、scene_type、motion_level、offpeak、video_url、file_infos、ext_info。
请求示例
场景
| 场景 | 关键字段 |
|---|---|
| 文生视频 | prompt + seconds |
| 图生视频 | image / images / input_reference |
| 首尾帧 | image + metadata.last_frame_url |
| 动作控制 | metadata.scene_type=motion_control + 视频参考 |
| 数字人 | metadata.scene_type=avatar_i2v |
| 对口型 | metadata.scene_type=lip_sync |
| 模板特效 | metadata.scene_type=template_effect |
规则
seconds/duration可以放顶层,也可以放metadata- 顶层时长优先级最高
scene_type=motion_control必须提供视频参考scene_type=lip_sync不足 5 秒按 5 秒计FileInfos最多 3 项
metadata.output_config
常用字段:
resolutionaspect_ratioaudio_generationdurationperson_generationinput_compliance_checkoutput_compliance_checkenhance_switchframe_interpolatelogo_add