基础信息
所有接口均使用 HTTPS 调用。
https://api.qjsp.net
支持模型
| model_id | 模型 | 售价 | 默认时长 | 支持时长 | 分辨率 | 说明 |
|---|---|---|---|---|---|---|
52 |
Seedance 2.0 | ¥1.00/秒 | 5 秒 | 4-15 秒 | 720P |
支持图片、音频和视频参考 |
67 |
Seedance 2.5 官补 | 480P ¥1.00/秒;720P ¥2.00/秒 | 5 秒 | 5-15、20、25、30 秒 |
480P、720P |
图片、音频、视频参考合计最多 30 个 |
51 |
Seedance Fast | ¥1.00/秒 | 4 秒 | 4-15 秒 | 480P、720P |
支持参考图、参考音频、参考视频 |
53 |
Seedance 标准线路一 | ¥1.00/秒 | 4 秒 | 4-15 秒 | 480P、720P |
固定使用标准线路一;720P 结果由本服务后处理生成 |
39 |
Happy Horse | ¥0.40/秒 | 5 秒 | 5、10、15 秒 |
720P |
支持参考图、首尾帧 |
视频接口 model_id 可不传,不传时默认使用 Seedance 2.0。选择 Seedance 2.5 官补时请传 model_id: 67,选择 Seedance Fast 时请传 model_id: 51,选择 Seedance 标准线路一时请传 model_id: 53,选择 Happy Horse 时请传 model_id: 39。
鉴权方式
所有业务接口都需要在请求头中携带客户 API Key。请妥善保管 API Key,建议由服务端调用本 API。
Authorization: Bearer kc_xxxxxxxxxxxxxxxxxxxxx
Content-Type: application/json
1. 提交视频生成任务
/api/v1/video/generations
请求参数
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
prompt | string | 是 | 视频描述文本 |
model_id | number | 否 | 52 为 Seedance 2.0,67 为 Seedance 2.5 官补,51 为 Seedance Fast,53 为 Seedance 标准线路一,39 为 Happy Horse;默认 52 |
size | string | 否 | 模型 52: 9:16、16:9、1:1、4:3、3:2、2:3、21:9;模型 67: 9:16、16:9、3:4、4:3、3:2、2:3、21:9;模型 51/53: 9:16、16:9、1:1、3:2、2:3、21:9;Happy Horse: 16:9、9:16、4:3、3:4、1:1 |
seconds | number | 否 | 模型 52: 4-15,默认 5;模型 67: 5-15/20/25/30,默认 5;模型 51/53: 4-15,默认 4;Happy Horse: 5/10/15,默认 5 |
resolution | string | 否 | 模型 52: 720P;模型 67、51、53: 480P、720P;Happy Horse: 720P |
count | number | 否 | 支持 1、2、3、4,默认 1 |
reference_image | string | 否 | 单张参考图公网 HTTPS URL |
reference_images | string[] | 否 | 多张参考图公网 HTTPS URL;模型 67 与其他参考素材合计最多 30 个,其他模型最多 9 个图片 |
frame_start | string | 否 | 模型 53、Happy Horse 支持,首帧图片公网 HTTPS URL |
frame_end | string | 否 | 模型 53、Happy Horse 支持,尾帧图片公网 HTTPS URL |
reference_audio | string | 否 | 模型 52/67/51/53 支持,单个参考音频公网 HTTPS URL |
reference_audios | string[] | 否 | 模型 52/67/51/53 支持;模型 67 三类素材合计最多 30 个,其他模型最多 3 个音频 |
reference_video | string | 否 | 模型 52/67/51/53 支持,单个参考视频公网 HTTPS URL |
reference_videos | string[] | 否 | 模型 52/67/51/53 支持;模型 67 三类素材合计最多 30 个,其他模型最多 3 个视频 |
参考素材 URL 只能使用公网 HTTPS 地址。系统会拒绝 HTTP、localhost、内网/本地 IP、带账号密码的 URL,以及 DNS 解析到内网/本地地址的域名。模型 52/67 使用参考音频时,必须同时提供至少一张图片或一个视频。
计费规则
Seedance/Happy Horse: 消费金额 = seconds × count × 模型单价
Seedance 2.5 官补: 480P ¥1.00/秒,720P ¥2.00/秒
| 模型 | seconds | count | 消费金额 |
|---|---|---|---|
| Seedance 2.0 | 5 | 1 | ¥5.00 |
| Seedance 2.0 | 15 | 4 | ¥60.00 |
| Seedance 2.5 官补 480P | 30 | 1 | ¥30.00 |
| Seedance 2.5 官补 720P | 30 | 1 | ¥60.00 |
| Seedance Fast | 8 | 2 | ¥16.00 |
| Seedance 标准线路一 | 8 | 2 | ¥16.00 |
| Happy Horse | 5 | 2 | ¥4.00 |
| Happy Horse | 15 | 4 | ¥24.00 |
余额不足时返回 402 Insufficient balance。上游失败、超时、业务错误码非 200 或生成接口没有返回 data.task_id 时,本次预扣金额会自动退回。
Seedance 2.0 请求示例
curl -X POST https://api.qjsp.net/api/v1/video/generations \
-H "Authorization: Bearer kc_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"model_id": 52,
"prompt": "海边日落延时摄影,金色阳光洒在波浪上",
"size": "9:16",
"seconds": 5,
"resolution": "720P",
"count": 1,
"reference_image": "https://your-cdn.example/reference.jpg"
}'
Seedance 2.0 音视频参考请求示例
curl -X POST https://api.qjsp.net/api/v1/video/generations \
-H "Authorization: Bearer kc_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"model_id": 52,
"prompt": "跟随参考视频节奏生成产品展示镜头",
"size": "3:2",
"seconds": 4,
"resolution": "720P",
"count": 1,
"reference_image": "https://your-cdn.example/reference.jpg",
"reference_audio": "https://your-cdn.example/reference.mp3",
"reference_video": "https://your-cdn.example/reference.mp4"
}'
Seedance 2.5 官补请求示例
curl -X POST https://api.qjsp.net/api/v1/video/generations \
-H "Authorization: Bearer kc_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"model_id": 67,
"prompt": "人物在城市街道中自然行走,镜头平稳跟随",
"size": "9:16",
"seconds": 30,
"resolution": "720P",
"count": 1,
"reference_images": [
"https://your-cdn.example/reference-1.jpg",
"https://your-cdn.example/reference-2.jpg"
],
"reference_video": "https://your-cdn.example/reference.mp4"
}'
Happy Horse 请求示例
curl -X POST https://api.qjsp.net/api/v1/video/generations \
-H "Authorization: Bearer kc_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"model_id": 39,
"prompt": "草原上奔跑的马,电影感镜头",
"size": "16:9",
"seconds": 5,
"resolution": "720P",
"count": 2,
"reference_images": [
"https://your-cdn.example/horse-1.jpg",
"https://your-cdn.example/horse-2.jpg"
]
}'
Seedance Fast 请求示例
curl -X POST https://api.qjsp.net/api/v1/video/generations \
-H "Authorization: Bearer kc_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"model_id": 51,
"prompt": "海边日落延时摄影,金色阳光洒在波浪上",
"size": "9:16",
"seconds": 8,
"resolution": "480P",
"count": 1,
"reference_image": "https://your-cdn.example/reference.jpg",
"reference_audio": "https://your-cdn.example/reference.mp3"
}'
Seedance 标准线路一请求示例
curl -X POST https://api.qjsp.net/api/v1/video/generations \
-H "Authorization: Bearer kc_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"model_id": 53,
"prompt": "城市夜景航拍,霓虹灯反射在雨后街道上",
"size": "16:9",
"seconds": 8,
"resolution": "720P",
"count": 1,
"reference_image": "https://your-cdn.example/reference.jpg"
}'
2. 查询任务状态
/api/v1/tasks/{task_id}
task_id 为提交生成任务后返回的任务 ID。后续只能使用同一个 API Key 查询该任务结果。
curl -X GET https://api.qjsp.net/api/v1/tasks/T202604271430001234C001 \
-H "Authorization: Bearer kc_your_api_key"
任务状态
status | 说明 |
|---|---|
0 | 等待处理或排队中 |
1 | 生成成功,从 data.result 获取视频地址 |
2 | 生成失败,从 data.error 获取失败原因 |
3 | 生成处理中 |
4 | 已提交或素材同步中 |
建议客户服务端轮询查询任务状态。轮询间隔建议不少于 3-5 秒。
3. 查询账户用量和余额
/api/v1/usage
该接口用于查询当前 API Key 的余额、消费金额、计费秒数/张数、任务历史和最近请求记录。
curl -X GET https://api.qjsp.net/api/v1/usage \
-H "Authorization: Bearer kc_your_api_key"
4. 健康检查
/health
该接口不需要客户 API Key,会返回当前可用模型列表。
curl https://api.qjsp.net/health
5. 客户页面
客户可打开自助页面查询余额,也可在测试台用自己的 kc_... API Key 直接测试 Seedance 2.0、Seedance 2.5 官补、Seedance Fast、Seedance 标准线路一和 Happy Horse。
https://api.qjsp.net/client
https://api.qjsp.net/test
错误码
| HTTP 状态码 | message | 说明 |
|---|---|---|
400 | Request body must be valid JSON | 请求体不是合法 JSON |
400 | prompt must be a non-empty string | 缺少 prompt 或为空 |
400 | model_id must be one of: 52, 51, 53, 67, 39 | 模型 ID 不支持 |
400 | {field} has an unsupported value | 参数值不在所选模型支持范围内 |
400 | {field} must be a public HTTPS URL | 参考素材 URL 不是公网 HTTPS 地址 |
401 | Invalid or missing API key | API Key 缺失或无效 |
403 | API key is disabled | API Key 已停用 |
402 | Insufficient balance | 余额不足 |
404 | Task not found | 任务不存在或不属于当前 API Key |
502 | Upstream request failed | 上游服务请求失败或返回业务错误 |
504 | Upstream request timed out | 上游服务请求超时 |