POST
https://nezhagate.com/v1/videos/generations
Seedance 2.0 Fast 视频生成(异步任务):与 2.0 规格相同(4–15 秒、720P、六种画幅、可生成音轨)但更快更省;带 image 即图生视频。提交后返回任务号(HTTP 202),轮询 GET /v1/videos/jobs/{id}。按秒计费、失败全额退。
在 Playground 试用 →认证
Authorization: Bearer YOUR_API_KEY Content-Type: application/json
在控制台创建 API Key 后即可调用。
请求参数
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
| model | string | 是 | 模型 ID,此处为 seedance-2.0-fast。 |
| prompt | string | 是 | 视频内容、镜头与运动的描述。最长 5000 字节(UTF-8,中文一个字算 3 字节,约 1666 字)。传多张参考图时,可用 @Image1 / @Image2 在提示词里点名第几张,例如「@Image1 的角色站在 @Image2 的场景里」;不点名则由模型自行取用。 |
| duration | integer | 否 | 时长秒数,4–15 的任意整数(默认 4)。也可写作 seconds。按秒计费。 |
| resolution | string | 否 | 分辨率:720P。 |
| size | string | 否 | 画幅:16:9(默认)/ 9:16 / 21:9 / 4:3 / 1:1 / 3:4。也可写作 aspect_ratio。 |
| audio | boolean | 否 | 是否生成结果音轨,默认 true。 |
| image | string | 否 | 图生视频:带参考图(默认作首帧)即走图生视频,可传公网 URL、data: URI 或 base64;不带则为文生视频。 |
| images | array | 否 | 多张参考图,最多 4 张(本模型上限)。数组元素可以是公网 URL、data: URI 或 base64。超过上限会直接报错,不会截断。也可写作 reference_images。 |
| image_role | string | 否 | 参考图用法:first_frame(默认,作首帧;传两张时第二张作尾帧)或 reference(作为主体/风格参考图,多张时用这个)。用 reference_images 传入时默认就是 reference。 |
| audio_reference | string / array | 否 | 参考音频的公网 http(s) 链接,最多 1 段。必须与参考图或参考视频一起使用,不能单独提供。也可写作 audio_references,两者不要同时给。 |
| video_references | array | 否 | 参考视频的公网 http(s) 链接,最多 3 个。只接受公网链接(data: URI 会失败);不能与参考图或首尾帧同时使用。 |
请求示例
# 1) submit -> 202 {"id":"img_...","status":"queued"}
curl https://nezhagate.com/v1/videos/generations -H 'Authorization: Bearer YOUR_API_KEY' -H 'Content-Type: application/json' -d '{"model": "seedance-2.0-fast", "prompt": "a cat surfing a wave at sunset", "duration": 4, "resolution": "720P", "size": "16:9"}'
# image-to-video: also pass "image": "https://example.com/first-frame.png"
# 2) poll every ~5s until status=succeeded, then read data[0].url
curl https://nezhagate.com/v1/videos/jobs/img_3f9a...c2 -H 'Authorization: Bearer YOUR_API_KEY'响应示例
{
"id": "img_3f9a...c2",
"object": "video.generation.job",
"status": "queued",
"model": "seedance-2.0-fast"
}异步视频任务(提交 → 轮询)
一个模型通过参数生成不同类型视频:tier=lite/fast/quality、resolution=720p/1080p/4k(1080p/4k 仅 quality 档)、size=16:9/9:16、duration=4s/6s/8s;带 image 参数即图生视频(以图为首帧)。提交后返回 HTTP 202 与任务号,轮询直到 status=succeeded,结果在 data[0].url(重托管的 mp4 稳定直链,约 1-2 分钟出片)。
curl https://nezhagate.com/v1/videos/generations -H 'Authorization: Bearer YOUR_API_KEY' -H 'Content-Type: application/json' -d '{"model": "seedance-2.0-fast", "prompt": "一只猫在日落时冲浪", "tier": "quality", "resolution": "1080p", "size": "16:9", "duration": "8s"}'图生视频:额外传 image 参数(首帧参考图,可为公网 URL、data: URI 或 base64)。
{ "id": "img_3f9a...c2", "object": "video.generation.job", "status": "queued", "model": "seedance-2.0-fast" }curl https://nezhagate.com/v1/videos/jobs/img_3f9a...c2 -H 'Authorization: Bearer YOUR_API_KEY'
{
"id": "img_3f9a...c2",
"object": "video.generation.job",
"status": "succeeded",
"model": "seedance-2.0-fast",
"data": [{ "url": "https://img.nezhagate.com/i/9f86d081a8....mp4" }]
}按秒计费(每秒 $0.083 × 时长),预扣与结算完全一致;生成失败或超时会自动全额退还。
错误码
| Code | 说明 |
|---|---|
| 401 | Invalid or missing API key |
| 402 | Insufficient balance / key limit reached |
| 400 | Invalid parameters or model |
| 429 | Rate limited |
| 502 | All upstream providers failed |