视频 API
数字人
数字人
功能概览
本页用于说明 数字人 的核心能力、调用入口和接入要点,帮助开发者快速判断适用场景并完成集成。
适用场景
- 产品原型验证:快速接入模型能力,验证内容生成、理解或编辑流程。
- 生产业务接入:用于批量任务、自动化工作流和多模型组合调用。
- 能力迁移适配:适合从原有模型或 SDK 平滑切换到亿速API统一接口。
接入建议
- 优先确认模型名称、请求路径和响应字段,再接入具体业务流程。
- 对异步任务、媒体生成和长耗时请求,建议在业务侧加入重试与状态轮询。
- 上线前建议准备日志追踪、错误处理和内容安全校验,便于稳定运行。
接口总览
POST /digitalhuman/uploadDigitalHumanFile
POST /digitalhuman/createHuman
GET /digitalhuman/getDigitalHumanList
GET /digitalhuman/getDigitalHumanInfo
POST /digitalhuman/createDigitalHumanTimbre
GET /digitalhuman/getDigitalHumanTimbreList
GET /digitalhuman/getDigitalHumanTimbreInfo
POST /digitalhuman/submitDigitalHumanTask
GET /digitalhuman/queryDigitalHumanTask
所有接口基础地址:
https://api.yisu.com
鉴权
所有接口都需要在请求头中传入 API Key:
Authorization: Bearer <API_KEY>
JSON 请求需要设置:
Content-Type: application/json
文件上传接口使用 multipart/form-data。
推荐接入流程
- 调用
POST /digitalhuman/uploadDigitalHumanFile上传图片、视频或音频素材,获得file_id。 - 调用
POST /digitalhuman/createHuman,使用图片或视频素材的file_id创建数字人形象,获得human_id。 - 如需文本驱动,调用
POST /digitalhuman/createDigitalHumanTimbre创建音色,或使用内置音色。 - 调用
POST /digitalhuman/submitDigitalHumanTask创建数字人视频任务,获得tag_id。 - 调用
GET /digitalhuman/queryDigitalHumanTask查询任务状态和结果视频地址。
通用错误格式
{
"error": {
"message": "file_id is required",
"type": "invalid_request_error",
"param": "file_id",
"code": null
}
}
常见 HTTP 状态码:
| 状态码 | 说明 |
|---|---|
400 | 请求参数错误或服务暂不可用 |
401 | API Key 无效或未授权 |
403 | IP 白名单等权限限制 |
404 | 资源不存在 |
429 | 请求频率超限 |
502 | 服务处理失败 |
文件与形象接口
上传数字人相关素材文件
POST /digitalhuman/uploadDigitalHumanFile
上传数字人相关素材文件。上传成功后会返回 file_id,后续创建数字人形象、创建音色时都使用该 file_id。
请求
curl "https://api.yisu.com/digitalhuman/uploadDigitalHumanFile" \
-H "Authorization: Bearer <API_KEY>" \
-F "file=@/path/to/input.mp4"
请求参数
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
file | file | 是 | 要上传的素材文件。字段名推荐使用 file |
响应示例
上传成功后常见响应结构如下:
{
"code": 200,
"message": "上传成功",
"data": {
"file_id": 1637,
"file_url": "https://cache.jiuma.com/static/uploads/20260710/example.mp4",
"file_name": "example.mp4",
"ext": "mp4",
"mime": "video/mp4",
"size": 1234567,
"duration": 2.04
}
}
创建数字人形象
POST /digitalhuman/createHuman
使用上传接口返回的 file_id 创建数字人形象。创建成功后返回 human_id,可用于后续形象查询和视频任务创建。
请求
curl "https://api.yisu.com/digitalhuman/createHuman" \
-H "Authorization: Bearer <API_KEY>" \
-H "Content-Type: application/json" \
-d '{
"file_id": 1637,
"name": "口播数字人",
"role_type": 2,
"gender": 1,
"age": 28
}'
请求参数
| 字段 | 类型 | 必填 | 默认值 | 说明 |
|---|---|---|---|---|
file_id | int | 是 | - | 通过 /digitalhuman/uploadDigitalHumanFile 上传后获得的文件 ID |
name | string | 否 | 自动生成 | 数字人名称 |
role_type | int | 否 | 1 | 角色类型:1 未知,2 真人,3 卡通,4 动物 |
gender | int | 否 | 0 | 性别:0 未知,1 男,2 女 |
age | int | 否 | 0 | 年龄 |
响应示例
{
"code": 200,
"message": "created",
"data": {
"id": "44439",
"human_id": "44439",
"name": "口播数字人",
"gender_name": "男",
"age": 28,
"belong_type": 2,
"role_type_name": "真人",
"file_id": 1637,
"file_url": "https://cache.jiuma.com/static/uploads/20260710/example.jpg",
"video_file_id": 0,
"video_file_url": ""
}
}
说明
- 创建成功后的
human_id可用于形象管理;创建视频任务时通过video_id传入。
获取当前账号可用的数字人形象列表
GET /digitalhuman/getDigitalHumanList
获取可用的数字人形象列表。
请求
curl "https://api.yisu.com/digitalhuman/getDigitalHumanList?page=1&list_rows=15&belong_type=2" \
-H "Authorization: Bearer <API_KEY>"
请求参数
| 字段 | 类型 | 必填 | 默认值 | 说明 |
|---|---|---|---|---|
page | int | 否 | 1 | 第几页 |
list_rows | int | 否 | 15 | 每页数量,最大 100 |
belong_type | int | 否 | - | 归属类型:1 公有/内置,2 私有/自定义;不传查询全部可用形象 |
响应示例
{
"code": 200,
"message": "success",
"data": {
"page": 1,
"list_rows": 15,
"total": 1,
"list": [
{
"id": "44439",
"human_id": "44439",
"name": "口播数字人",
"gender_name": "男",
"age": 28,
"belong_type": 2,
"role_type_name": "真人",
"file_id": 1637,
"file_url": "https://cache.jiuma.com/static/uploads/20260710/example.jpg",
"video_file_id": 0,
"video_file_url": ""
}
]
}
}
获取数字人形象详情
GET /digitalhuman/getDigitalHumanInfo
获取指定数字人形象详情。
请求
单个形象:
curl "https://api.yisu.com/digitalhuman/getDigitalHumanInfo?human_id=44439" \
-H "Authorization: Bearer <API_KEY>"
多个形象:
curl "https://api.yisu.com/digitalhuman/getDigitalHumanInfo?human_id=44439,44440" \
-H "Authorization: Bearer <API_KEY>"
请求参数
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
human_id | string / array | 是 | 数字人形象 ID;支持单个 ID、英文逗号分隔多个 ID,或数组 |
单个形象响应示例
{
"code": 200,
"message": "success",
"data": {
"id": "44439",
"human_id": "44439",
"name": "口播数字人",
"gender_name": "男",
"age": 28,
"belong_type": 2,
"role_type_name": "真人",
"file_id": 1637,
"file_url": "https://cache.jiuma.com/static/uploads/20260710/example.jpg",
"video_file_id": 0,
"video_file_url": ""
}
}
多个形象响应示例
{
"code": 200,
"message": "success",
"data": [
{
"id": "44439",
"human_id": "44439",
"name": "口播数字人",
"gender_name": "男",
"age": 28,
"belong_type": 2,
"role_type_name": "真人",
"file_id": 1637,
"file_url": "https://cache.jiuma.com/static/uploads/20260710/example.jpg",
"video_file_id": 0,
"video_file_url": ""
}
]
}
音色接口
创建数字人音色
POST /digitalhuman/createDigitalHumanTimbre
创建数字人音色。先通过上传文件接口上传音频文件,再将返回的 file_id 传入本接口。
请求
curl "https://api.yisu.com/digitalhuman/createDigitalHumanTimbre" \
-H "Authorization: Bearer <API_KEY>" \
-H "Content-Type: application/json" \
-d '{
"file_id": 2010,
"name": "我的音色",
"gender": 1,
"age": 28,
"belong_type": 2
}'
请求参数
| 字段 | 类型 | 必填 | 默认值 | 说明 |
|---|---|---|---|---|
file_id | int | 是 | - | 上传音频文件后获得的文件 ID |
name | string | 否 | 空 | 音色名称 |
age | int | 否 | 0 | 年龄 |
belong_type | int | 否 | 2 | 归属类型,通常自定义音色为 2 |
type | int | 否 | 0 | 音色类型 |
gender | int | 否 | 0 | 性别 |
config | string / object | 否 | 空 | 音色配置 |
volume | number | 否 | 0 | 音量 |
des_label | string | 否 | 空 | 描述标签 |
响应示例
{
"code": 200,
"message": "操作成功",
"data": "2494"
}
data 即音色 ID,创建文本驱动任务时传入 input_reference.audio_config.timbre。
获取数字人音色列表
GET /digitalhuman/getDigitalHumanTimbreList
获取数字人音色列表。
请求
curl "https://api.yisu.com/digitalhuman/getDigitalHumanTimbreList?page=1&list_rows=15&belong_type=1" \
-H "Authorization: Bearer <API_KEY>"
请求参数
| 字段 | 类型 | 必填 | 默认值 | 说明 |
|---|---|---|---|---|
page | int | 否 | 1 | 第几页 |
list_rows | int | 否 | 15 | 每页数量 |
belong_type | int | 否 | 1 | 1 查询内置音色,2 查询当前账号自定义音色 |
timbre_id | string | 否 | 空 | 指定音色 ID |
search_key | string | 否 | 空 | 按名称或音色 ID 搜索 |
自定义音色响应示例
{
"code": 200,
"message": "获取成功",
"data": {
"total": 1,
"per_page": 15,
"current_page": "1",
"last_page": 1,
"data": [
{
"id": "2494",
"name": "我的音色",
"age": 28,
"belong_type": 2,
"type": 0,
"gender": 1,
"config": "",
"volume": "0.00",
"des_label": ""
}
]
}
}
获取数字人音色详情
GET /digitalhuman/getDigitalHumanTimbreInfo
获取数字人音色详情。
请求
curl "https://api.yisu.com/digitalhuman/getDigitalHumanTimbreInfo?timbre_id=2494" \
-H "Authorization: Bearer <API_KEY>"
请求参数
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
timbre_id | string | 是 | 音色 ID |
响应示例
{
"code": 200,
"message": "获取成功",
"data": {
"id": "2494",
"name": "我的音色",
"age": 28,
"belong_type": 2,
"type": 0,
"gender": 1,
"config": "",
"volume": "0.00",
"des_label": ""
}
}
视频任务接口
创建数字人视频任务
POST /digitalhuman/submitDigitalHumanTask
创建数字人视频任务。该接口是异步任务接口,创建成功后返回 tag_id,需要通过查询接口获取最终视频结果。
engine 为顶层非必填参数,用于选择生成引擎:auto 自动,standard 超拟真,ultra Q版。请不要把 engine 放到 input_reference 或 audio_config 内。
限制说明:当 video_id 对应的数字人形象是图片素材创建的形象时,不能创建超拟真视频任务,engine 不能传 standard。
文本驱动请求
curl "https://api.yisu.com/digitalhuman/submitDigitalHumanTask" \
-H "Authorization: Bearer <API_KEY>" \
-H "Content-Type: application/json" \
-d '{
"model": "jiuma-digital-human",
"engine": "standard",
"input_reference": {
"video_id": 44439,
"audio_config": {
"drive": "text",
"timbre": 2494,
"words": "大家早上好,欢迎观看今天的产品介绍。",
"end_silent": 1
},
"callback_url": "https://example.com/callback"
}
}'
音频驱动请求
curl "https://api.yisu.com/digitalhuman/submitDigitalHumanTask" \
-H "Authorization: Bearer <API_KEY>" \
-H "Content-Type: application/json" \
-d '{
"model": "jiuma-digital-human",
"engine": "ultra",
"input_reference": {
"video_id": 44439,
"audio_config": {
"drive": "audio",
"audio_url": "https://example.com/audio.mp3",
"timbre": 1,
"duration": 12.5
}
}
}'
请求参数
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
model | string | 是 | 固定为 jiuma-digital-human |
engine | string | 否 | 生成引擎:auto 自动,standard 超拟真,ultra Q版。如果 video_id 对应图片形象,不能传 standard |
input_reference | object | 是 | 输入引用对象 |
input_reference.video_id | int / string | 是 | 数字人形象或短视频 ID |
input_reference.callback_url | string | 否 | 任务结果通知地址,最大 2000 字符 |
input_reference.audio_config | object | 是 | 驱动音频或文本配置 |
input_reference.audio_config.drive | string | 是 | 驱动类型:text 或 audio |
input_reference.audio_config.timbre | int / string | 文本驱动必填 | 音色 ID |
input_reference.audio_config.words | string | 文本驱动必填 | 驱动文本,最长 2000 字符 |
input_reference.audio_config.end_silent | number | 否 | 结尾静音设置 |
input_reference.audio_config.audio_url | string | 音频驱动必填 | 可公网访问的音频 URL |
input_reference.audio_config.duration | number | 音频驱动建议传 | 音频时长,单位秒;不传时系统会尝试通过 audio_url 下载并识别 |
input_reference.audio_config.duration_seconds | number | 否 | duration 的兼容字段 |
input_reference.audio_config.audio_duration | number | 否 | duration 的兼容字段 |
input_reference.audio_config.audio_seconds | number | 否 | duration 的兼容字段 |
创建成功响应
{
"status": "success",
"tag_id": "89425"
}
创建失败响应
创建失败时可能返回:
{
"status": "failed",
"message": "Create digital human task failed",
"request_id": "f7dad4740c308e8f8ca4f2ae506fefff"
}
参数校验失败时返回通用错误格式。
- 创建任务时会先根据预计时长进行预扣。
- 文本驱动按文本长度估算时长:约每
4个字符按1秒估算,最少1秒。 - 音频驱动优先使用传入的
duration、duration_seconds、audio_duration、audio_seconds。 - 若音频驱动未传时长,系统会尝试下载
audio_url并识别音频时长;如果 URL 无法访问、返回403、不是音频文件或识别失败,会返回参数错误。 - 任务完成后按实际结果时长结算,多退少补或释放预扣金额。
查询数字人视频任务状态
GET /digitalhuman/queryDigitalHumanTask
查询数字人视频任务状态。传入创建任务返回的 tag_id。
请求
curl "https://api.yisu.com/digitalhuman/queryDigitalHumanTask?tag_id=89425" \
-H "Authorization: Bearer <API_KEY>"
请求参数
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
tag_id | string | 是 | 创建任务接口返回的任务 ID |
响应状态
status | 说明 |
|---|---|
queued | 排队中 |
in_progress | 制作中 |
completed | 制作完成 |
failed | 制作失败 |
排队中响应示例
{
"status": "queued",
"tag_id": "89425"
}
制作中响应示例
{
"status": "in_progress",
"tag_id": "89425"
}
制作完成响应示例
{
"status": "completed",
"tag_id": "89425",
"new_video_file_url": "https://cache.jiuma.com/static/uploads/20260710/6a50b2aedb24b.mp4",
"new_video_file_duration": "2.04",
"type": "super"
}
制作失败响应示例
{
"status": "failed",
"tag_id": "89425",
"message": "制作失败"
}
任务结果通知
创建任务时可以传入 input_reference.callback_url 或顶层 callback_url。
任务完成或失败后,系统会向该地址发送 JSON 通知。制作完成通知示例:
{
"status": "completed",
"tag_id": "91851",
"new_video_file_url": "https://cache.jiuma.com/static/uploads/20260713/6a54b4b902282.mp4",
"type": "cartoon"
}
制作失败通知示例:
{
"status": "failed",
"tag_id": "91851",
"message": "制作失败"
}
建议同时保留主动查询逻辑,以便在网络超时或通知失败时补偿获取结果。
字段说明
数字人形象对象
| 字段 | 类型 | 说明 |
|---|---|---|
id | string | 数字人形象 ID,等同于 human_id |
human_id | string | 数字人形象 ID |
name | string | 数字人名称 |
gender_name | string | 性别名称,如男、女、未知 |
age | int | 年龄 |
belong_type | int | 归属类型:1 公有/内置,2 私有/自定义 |
role_type_name | string | 角色类型名称,如真人、卡通、动物、未知 |
file_id | int | 数字人封面图或形象图片 ID |
file_url | string | 数字人封面图或形象图片地址 |
video_file_id | int | 数字人训练视频 ID |
video_file_url | string | 数字人训练视频地址 |
音色对象
| 字段 | 类型 | 说明 |
|---|---|---|
id | string / int | 音色 ID |
name | string | 音色名称 |
age | int | 年龄 |
belong_type | int | 归属类型:1 内置,2 自定义 |
type | int | 音色类型 |
gender | int | 性别 |
config | string / object | 音色配置 |
volume | string | 音量 |
des_label | string | 描述标签 |
注意事项
- 数字人视频任务制作耗时通常较长,请按异步任务处理。
submitDigitalHumanTask只支持video_id,不支持传入video_url。engine是submitDigitalHumanTask的顶层参数,可选值为auto、standard、ultra。- 如果
video_id对应的数字人形象是图片素材创建的形象,不能制作超拟真视频任务,即engine不能为standard;可以不传engine,或传auto、ultra。 - 音频驱动建议显式传入
duration,可避免服务端因音频 URL 无法下载或识别失败导致创建任务失败。 - 任务结果通知可能受网络、证书、超时等因素影响,建议同时使用查询接口补偿获取结果。