使用你的工具生成视频与图像
创建密钥,使用 Bearer 认证调用 API,并轮询任务状态直到结果就绪。适用于 Claude Code、Codex 及任何 HTTP 客户端。
快速入门
步骤1
创建密钥
在控制面板中生成 API 密钥。该密钥仅显示一次,请妥善保管。
步骤2
调用API
使用您的 Bearer 密钥和 Idempotency-Key 标头发送 POST 请求。
步骤3
获取结果
轮询任务状态端点,直到状态变为“已完成”或“失败”,然后读取输出。
身份验证
所有请求均需在 Authorization 标头中携带 Bearer API 密钥进行身份验证。
Authorization: Bearer sk_live_your_api_key
Content-Type: application/json
Idempotency-Key: a-unique-id-per-requestSeedance Video
文本、图像或媒体转视频
/api/v1/video/seedance参数
| 参数 | 类型 | 必填 | 默认 | 允许值 |
|---|---|---|---|---|
modeGeneration mode. | string | 选填 | text-to-video | text-to-videoimage-to-videomedia-to-video |
quality_tierQuality tier. | string | 选填 | standard | standardpro |
channelRendering channel. | string | 选填 | standard | standardrealwild |
promptText prompt. | string | 必填 | — | 3–10000 chars |
aspect_ratioAspect ratio. | string | 选填 | 16:9 | 1:121:94:33:416:99:16 |
durationClip duration. | string | 选填 | 5 | 4–15 (seconds) |
resolutionOutput resolution. | string | 选填 | 720p | 720p1080p |
image_urlStart frame — required for image-to-video. | string (URL) | 选填 | — | public https URL |
end_image_urlOptional end frame. | string (URL) | 选填 | — | public https URL |
media_urlsRequired for media-to-video. | string[] (URL) | 选填 | — | ≤ 12 public https URLs |
generate_audioGenerate an audio track. | boolean | 选填 | true | truefalse |
fixed_lensLock the camera lens. | boolean | 选填 | false | truefalse |
seedNot supported on the real channel. | integer | 选填 | — | -1 – 4294967295 |
提交任务
curl -X POST https://seedance2ai.io/api/v1/video/seedance \
-H "Authorization: Bearer $SEEDANCE_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: demo-video-001" \
-d '{
"mode": "text-to-video",
"quality_tier": "standard",
"prompt": "A cinematic shot of a glass train crossing a snowy mountain bridge",
"aspect_ratio": "16:9",
"duration": "5",
"resolution": "720p"
}'GPT Image 2
高保真图像生成。
/api/v1/image/gpt-image-2参数
| 参数 | 类型 | 必填 | 默认 | 允许值 |
|---|---|---|---|---|
typeGeneration type. | string | 必填 | — | text-to-imageimage-to-image |
channelGeneration channel. economy is lower-cost with polling-based delivery. | string | 选填 | standard | standardeconomy |
promptText prompt. | string | 必填 | — | 3–20000 chars |
resolutionOutput resolution. auto only supports 1K; 1:1 cannot use 4K on the standard channel. | string | 必填 | — | 1K2K4K |
aspectRatioAspect ratio. | string | 必填 | — | auto1:15:49:1621:916:94:33:24:53:42:32:11:23:11:39:21 |
batchCountNumber of images. | integer | 选填 | 1 | 1–4 |
imageUrlsRequired for image-to-image. | string[] (URL) | 选填 | — | 1–10 public https URLs |
提交任务
curl -X POST https://seedance2ai.io/api/v1/image/gpt-image-2 \
-H "Authorization: Bearer $SEEDANCE_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: demo-gpt-image-001" \
-d '{
"type": "text-to-image",
"prompt": "Editorial product photo of a transparent running shoe on chrome",
"resolution": "1K",
"aspectRatio": "1:1"
}'Nano Banana Pro
风格化、高品质的图像输出。
/api/v1/image/nano-banana-pro参数
| 参数 | 类型 | 必填 | 默认 | 允许值 |
|---|---|---|---|---|
typeGeneration type. | string | 必填 | — | text-to-imageimage-to-image |
promptText prompt. | string | 必填 | — | 3–10000 chars |
image_sizeAspect ratio. | string | 选填 | auto | 1:19:1616:93:44:33:22:35:44:521:9auto |
output_formatImage format. | string | 选填 | png | pngjpeg |
resolutionOutput resolution. | string | 选填 | 1K | 1K2K4K |
image_urlsRequired for image-to-image. | string[] (URL) | 选填 | — | 1–8 public https URLs |
提交任务
curl -X POST https://seedance2ai.io/api/v1/image/nano-banana-pro \
-H "Authorization: Bearer $SEEDANCE_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: demo-nbp-001" \
-d '{
"type": "text-to-image",
"prompt": "A premium packaging mockup for an AI video studio",
"image_size": "1:1",
"resolution": "1K",
"output_format": "png"
}'查看任务状态
持续轮询,直至状态变为“已完成”或“失败”。
curl https://seedance2ai.io/api/v1/tasks/sd2_xxxxx \
-H "Authorization: Bearer $SEEDANCE_API_KEY"{
"id": "sd2_xxxxx",
"status": "completed",
"model": "seedance",
"output": { "video_url": "https://..." },
"credits_used": 30
}错误码
| 代码 | HTTP | 含义 |
|---|---|---|
unauthorized | 401 | Missing, invalid, or revoked API key. |
invalid_request | 400 | Bad input or unsupported field. |
insufficient_credits | 402 | Not enough credits on the balance. |
rate_limited | 429 | Too many requests for this account. |
idempotency_conflict | 409 | Same Idempotency-Key reused with a different body, or still running. |
service_busy | 503 | Temporary upstream or credit-concurrency issue. Retry. |
not_found | 404 | Task does not exist or does not belong to this key owner. |
internal_error | 500 | Unexpected server-side failure. |
Skill
将 Seedance 技能安装到 Claude Code、Codex 或任何 agent 中——它能为你编写电影级提示词,并通过 API 直接渲染成片。
# Clone into Claude Code's skills folder
git clone https://github.com/tkaptop/seedance-skill ~/.claude/skills/seedance配合 Claude Code 使用
点击“Copy for AI”,以干净的 Markdown 格式获取完整 API,将其粘贴到 Claude Code 或 Codex 中,即可自动完成集成配置。或者直接将 Agent 指向原始文本端点。
常见问题
谁可以使用 API?
任何拥有积分的用户均可使用。无套餐限制——任何持有积分的账户均可创建密钥并调用API。
如何获取积分?
在定价页面充值或订阅,积分将即时到账。
网站和API的积分是否共享?
是的——您的个人积分余额可用于网页生成和 API 调用。在团队中,API 调用使用每位成员自己的个人余额,而非团队共享积分池。
如何开始?
在控制面板中创建一个 API 密钥,然后使用 Bearer 令牌调用接口(参见上方快速入门指南)。
若调用返回 insufficient_credits,该如何处理?
您的余额不足——请在定价页面充值后重试。