POST /v1/video/generations
提交一个视频生成任务
请求
POST /api/v1/video/generations
Authorization: Bearer sk_xxx
Content-Type: application/json请求体
| 字段 | 类型 | 必填 | 默认值 | 说明 |
|---|---|---|---|---|
prompt | string | ✅ | — | 视频描述 |
model | string | — | seedance-2.0-fast | 模型 id |
duration_sec | number | — | 模型默认值 | 时长(秒) |
aspect_ratio | string | — | '16:9' | 16:9 / 9:16 / 1:1 |
resolution | string | — | '1080p' | 720p / 1080p(仅 Seedance) |
image_inputs | string[] | — | — | 参考图片 URL(第一张将作为首帧) |
seed | number | — | 随机 | 复现用随机种子 |
negative_prompt | string | — | — | 需要避免出现的内容 |
extra | object | — | — | Provider 专属参数(原样透传) |
示例
curl -X POST https://genace.ai/api/v1/video/generations \
-H "authorization: Bearer sk_xxx" \
-H "content-type: application/json" \
-d '{
"prompt": "a corgi astronaut floating in space, cinematic",
"duration_sec": 5,
"aspect_ratio": "16:9",
"resolution": "1080p"
}'响应
202 Accepted
{
"job_id": "abc123",
"state": "queued",
"model": "seedance-2.0-fast",
"created_at": "2026-05-29T10:00:00Z",
"credits_held": 25
}401 Unauthorized
缺少或无效的 API key。
402 Insufficient Credits
{
"error": {
"type": "insufficient_credits",
"code": "NOT_ENOUGH_CREDITS",
"message": "credits 不足:当前 5,需要 25"
}
}429 Rate Limited / Concurrency Limited
{
"error": {
"type": "rate_limited",
"code": "RATE_LIMIT_EXCEEDED",
"message": "请求过于频繁:每 60s 限 5 次"
}
}下一步
拿到 job_id 后,通过以下方式获取结果:
- GET /v1/jobs/:id —— 单次查询或长轮询
- GET /v1/jobs/:id/stream —— SSE 进度流
Genace 文档