Skip to content
Platform / Docs / AI video — create a character API

API Reference

AI video — create a character API

POST video-character-api ID 12

Create a character asset that later video-generation calls can reuse.

POST https://xiaoapis.com/api/video/character

Overview

  • 角色创建
  • 供生成接口引用

Use cases

  • 角色一致性视频
  • 系列内容生产
Conventions
  • Gateway · https://xiaoapis.com
  • Auth · send key (query or JSON body, as this API specifies)
  • Response · JSON. Check the business code and the HTTP status, not only HTTP 200

Authentication

Send the platform API key (query parameter key or JSON field key, as this page specifies). Create one in API key management.

POST https://xiaoapis.com/api/video/character
Content-Type: application/json

{
  "key": "YOUR_API_KEY"
}

Request example

https://xiaoapis.com/api/video/character?key=你的密钥

Details

请求HEADER:

名称值
Content-Typeapplication/json

请求参数说明:

名称必填类型示例值说明
pid否strings_6933c62623048191a0f20b5dbe781888视频pid AI生成视频结果的pid值(可以出现真人形象,pid和视频地址参数二选一即可)
url否stringhttps://ope.oss-cn-shanghai.aliyuncs.com/9d1212e12.mp4视频URL(禁止出现真人形象,视频地址可公网访问下载,视频时长不要过长)
timestamps否string0,3视频取用角色出现的时间范围 格式: 开始秒数,结束秒数,最多3秒
notify是stringhttps://xx.com/xxx回调地址 ( 任务推送地址)

返回参数说明:



名称类型说明
codeint状态码
msgstring状态信息
dataarray请求结果数据集
- task_idstring 任务ID
exec_timefloat执行耗时
user_ipstring客户端IP



回调参数说明:

名称类型说明
codeint状态码
msgstring状态信息
dataarray请求结果数据集
- task_idstring 任务ID
- character_idstringcharacter.name 

character_id: 角色id

- failure_reasonstring

失败原因

"output_moderation": 输出违规

"input_moderation": 输入违规

"error": 其他错误

------

当生成失败时,会返还积分


- errorstring

失败详细信息

exec_timefloat执行耗时
user_ipstring客户端IP


Response example

{  "code": 200,  "msg": "xxxx",  "data": [    {      "task_id": "xxxxx",      "character_id": "character.name",      "failure_reason": "",      "error": ""    }  ]}

FAQ

角色创建接口用途?

生成可复用的角色标识,便于多支视频保持人物一致。

如何使用角色?

在支持角色参数的视频生成接口中传入返回的角色 ID。

需要什么素材?

按文档提交角色参考图或描述字段。

是否异步?

以该接口文档为准。

和数字人区别?

数字人侧重口播出镜合成;角色创建服务于文生视频等模型角色资产。

Full console doc (with the debugger):/doc/12