外观
PhotoDance
上传一张人物照片,选择舞蹈模板生成跳舞视频。
http
POST /v1/videos/dance| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
template_id | string | 是 | 通过 GET /v1/templates?capability=video.dance 获取 |
image | string | 是 | 人物图片 URL 或 base64,最大 10MB |
duration | number | 否 | 1–30 秒;不传使用模板默认时长 |
webhook_url | string | 否 | 完成回调地址 |
bash
curl -X POST https://api.modelgo.moneygo.ai/v1/videos/dance \
-H "Authorization: Bearer sk-你的Key" \
-H "Idempotency-Key: dance-order-1001" \
-H "Content-Type: application/json" \
-d '{"template_id":"dance_21","image":"https://example.com/person.jpg","duration":8}'成功后 output.images[0] 是视频地址。
自定义舞蹈模板
你可以保存自己的身体骨骼视频和面部骨骼视频。模板只对当前账号可见,创建后返回 udance_ 开头的 ID,可直接作为生成接口的 template_id。
| 方法 | 接口 | 说明 |
|---|---|---|
| GET | /v1/dance-templates | 列出自己的舞蹈模板 |
| POST | /v1/dance-templates | 创建模板 |
| PATCH | /v1/dance-templates/{id} | 修改模板,只传要修改的字段 |
| DELETE | /v1/dance-templates/{id} | 删除模板,成功返回 204 |
创建时需要:
| 参数 | 必填 | 说明 |
|---|---|---|
name | 是 | 模板名称 |
skeleton_video | 是 | 身体骨骼视频文件名或公开 URL |
face_skeleton_video | 是 | 面部骨骼视频文件名或公开 URL |
duration | 否 | 默认时长,默认 8 秒 |
cover_url | 否 | 展示封面,不参与生成 |
bash
# 创建自定义模板
curl -X POST https://api.modelgo.moneygo.ai/v1/dance-templates \
-H "Authorization: Bearer sk-你的Key" \
-H "Content-Type: application/json" \
-d '{
"name":"我的舞蹈",
"skeleton_video":"https://example.com/body.mp4",
"face_skeleton_video":"https://example.com/face.mp4",
"duration":8
}'
# 返回的 udance_xxx 可直接生成
curl -X POST https://api.modelgo.moneygo.ai/v1/videos/dance \
-H "Authorization: Bearer sk-你的Key" \
-H "Content-Type: application/json" \
-d '{"template_id":"udance_xxx","image":"https://example.com/person.jpg"}'