任务:生成数字人视频
数字人视频生成接口,用于基于形象和声音信息生成数字人视频。
概览
- 请求方法:
POST - 请求路径:
/avatar/generation - 内容类型:
application/json - 分类:视频模型(Video)/数字人
认证方式
- Header:
Authorization: Bearer <token>
请求参数
JSON 请求体字段
| 字段 | 类型 | 必填 | 描述 |
|---|---|---|---|
| avatar_url | string | 是 | 数字人形象的图片或视频 URL |
| audio_url | string | 否 | 音频 URL,三个参数中可选其一:audio_url、create_voice、use_voice |
| no_watermark | boolean | 否 | 是否去除水印,默认 false |
| create_voice | object | 否 | 使用音频创建数字人声音,需提供 audio_url, language, text |
| use_voice | object | 否 | 使用已有 voice 生成数字人,需提供 voice_engine_id, audio_id, language, text |
create_voice 子字段
| 字段 | 类型 | 必填 | 描述 |
|---|---|---|---|
| audio_url | string | 是 | 音色音频 URL,用于 AI 模仿音色,需至少 20 秒的录音 |
| language | string | 是 | 语言,支持 zh, en |
| text | string | 是 | 要转换的文本内容 |
use_voice 子字段
| 字段 | 类型 | 必填 | 描述 |
|---|---|---|---|
| voice_engine_id | string | 是 | 语音引擎 ID |
| audio_id | string | 是 | 音频 ID |
| language | string | 是 | 语言,支持 zh, en |
| text | string | 是 | 要转换的文本内容 |
说明:
audio_url、create_voice、use_voice三选一。
请求示例
curl 示例
bash
curl -X POST "https://api.gpt.ge/avatar/generation" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $YOUR_TOKEN" \
-d '{
"audio_url": "https://cdn.gptbest.vip/file/cdn/20250107/RFDQkBGVrHFydzGzzvgXGQmbuPhicK.mp3",
"avatar_url": "https://p2.a.kwimgs.com/bs2/upload-ylab-stunt/special-effect/output/HB1_PROD_ai_web_119206500/9065890952728122033/out.mp4",
"no_watermark": true
}'JavaScript (fetch) 示例
javascript
fetch('https://api.gpt.ge/avatar/generation', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer YOUR_TOKEN'
},
body: JSON.stringify({
audio_url: 'https://cdn.gptbest.vip/file/cdn/20250107/RFDQkBGVrHFydzGzzvgXGQmbuPhicK.mp3',
avatar_url: 'https://p2.a.kwimgs.com/bs2/upload-ylab-stunt/special-effect/output/HB1_PROD_ai_web_119206500/9065890952728122033/out.mp4',
no_watermark: true
})
})
.then(res => res.json())
.then(console.log)Python 示例(requests)
python
import requests
resp = requests.post(
'https://api.gpt.ge/avatar/generation',
headers={
'Content-Type': 'application/json',
'Authorization': 'Bearer YOUR_TOKEN'
},
json={
'audio_url': 'https://cdn.gptbest.vip/file/cdn/20250107/RFDQkBGVrHFydzGzzvgXGQmbuPhicK.mp3',
'avatar_url': 'https://p2.a.kwimgs.com/bs2/upload-ylab-stunt/special-effect/output/HB1_PROD_ai_web_119206500/9065890952728122033/out.mp4',
'no_watermark': True
}
)
print(resp.json())返回字段说明
| 字段 | 类型 | 描述 |
|---|---|---|
| id | string | 任务 ID,后续通过查询接口获取生成结果 |
返回示例(200)
json
{
"code": "success",
"message": "",
"data": "57b9ba07db5e4ed5bf18ebb4179a826d"
}