API Reference
AI video API
POST
ai-video-api
ID 6
Generate a video from a prompt. The job is async.
POST
https://xiaoapis.com/api/video/create
Overview
- 视频生成
- 异步任务
- 回调/查询
Use cases
- 创意短视频
- 营销视频草稿
- Agent 自动出片
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/create
Content-Type: application/json
{
"key": "YOUR_API_KEY"
}
Request example
https://xiaoapis.com/api/video/create?key=你的密钥
Details
请求HEADER:
| 名称 | 值 |
|---|---|
| Content-Type | application/json |
请求参数说明:
| 名称 | 必填 | 类型 | 示例值 | 说明 |
|---|---|---|---|---|
| prompt | 是 | string | 一个美女在喝茶 | 提示词 须避免出现黄、暴、政相关内容 |
| image_urls | 否 | string | ['https://xx.png','https://xxx.png'] | 隔开 、图片须避免出现真人形象 上传后的文件 URL;最大大小:10.0MB |
| aspect_ratio | 否 | string | 9:16 | 输出视频比例, 支持的比例: 9:16(竖屏), 16:9(横屏) 默认:9:16 |
| remixid | 否 | string | s_xxxxxxxxx | 视频续作 remix目标id 可参考返回结果的pid值: s_xxxxxxxxx |
duration | 否 | int | 10 | 视频长度:10秒,15秒;填写 10,15 |
| notify | 是 | string | https://xx.com/xxx | 回调地址 ( 任务推送地址) |
返回参数说明:
| 名称 | 类型 | 说明 |
|---|---|---|
| code | int | 状态码 |
| msg | string | 状态信息 |
| data | array | 请求结果数据集 |
| - task_id | string | 任务ID |
| exec_time | float | 执行耗时 |
| user_ip | string | 客户端IP |
回调参数说明:
| 名称 | 类型 | 说明 |
|---|---|---|
| code | int | 200 |
| data | array | |
| - task_id | string | 任务ID |
| - video_url | string | https://v.xiaobao.ink/video20251016/53128775-1853-4502-965a-f3492841cbf4.mp4 |
| - pid | string | s_xxxxxxxxxxxxxxx |
| msg | string | success |
| fail_reason | string | 失败原因 |
Response example
{ "status": 0, "data": { "task_id": "string" }, "msg": "string"}
FAQ
AI 视频 API 怎么接入?
提交提示词等参数创建任务,轮询或回调获取视频地址。
和智能剪辑有何区别?
AI 视频侧重模型生成画面;智能剪辑侧重模板化包装已有真人/素材。
是否支持参考图?
部分模型支持,见具体参数说明。
如何选模型?
平台提供多种视频模型接口,按效果、时长与价格选择。
任务多久完成?
视模型与负载而定,请用查询接口获取进度,勿假设固定时长。
Related APIs
Full console doc (with the debugger):/doc/6