公共 API

使用你的工具生成视频与图像

创建密钥,使用 Bearer 认证调用 API,并轮询任务状态直到结果就绪。适用于 Claude Code、Codex 及任何 HTTP 客户端。

管理密钥

快速入门

步骤1

创建密钥

在控制面板中生成 API 密钥。该密钥仅显示一次,请妥善保管。

步骤2

调用API

使用您的 Bearer 密钥和 Idempotency-Key 标头发送 POST 请求。

步骤3

获取结果

轮询任务状态端点,直到状态变为“已完成”或“失败”,然后读取输出。

身份验证

所有请求均需在 Authorization 标头中携带 Bearer API 密钥进行身份验证。

http
Authorization: Bearer sk_live_your_api_key
Content-Type: application/json
Idempotency-Key: a-unique-id-per-request

Seedance 2 Video

文本、图像或媒体转视频

1

提交任务

POST
/api/v1/video/seedance2

参数

参数类型必填默认允许值
mode

Generation mode.

string选填text-to-video
text-to-videoimage-to-videomedia-to-video
quality_tier

Quality tier.

string选填standard
ministandardpro
channel

Rendering channel.

string选填standard
standardrealwild
prompt

Text prompt.

string必填
3–10000 chars
aspect_ratio

Aspect ratio.

string选填16:9
1:121:94:33:416:99:16adaptive
duration

Clip duration.

string选填5
4–15 (seconds)
resolution

Output resolution. 1080p-plus and 4k are available on pro only.

string选填720p
720p1080p1080p-plus4k
image_url

Start frame — required for image-to-video.

string (URL)选填
public https URL
end_image_url

Optional end frame.

string (URL)选填
public https URL
media_urls

Required for media-to-video. Video URLs must support duration probing.

string[] (URL)选填
≤ 12 public https image/video URLs
generate_audio

Generate an audio track.

boolean选填true
truefalse
fixed_lens

Lock the camera lens.

boolean选填false
truefalse
seed

Not supported on the real channel or mini tier.

integer选填
-1 – 4294967295

Seedance prompt guide

Seedance prompts work best as concrete director instructions. Describe the subject, action, scene, camera motion, visual style, and constraints, then map every reference asset to the right API parameter.

  • Use image_url for the opening frame, end_image_url for the closing frame, and media_urls for character, motion, style, source-video, or extension references.
  • Describe asset roles in natural language inside prompt. Do not send raw asset ids, asset:// URLs, or in-app-only labels such as @图片1.
  • For edits say “strictly edit the supplied source video”; for extensions say “continue from the supplied previous clip.”
  • For complex scenes, use ordered shots plus a style and constraint package: stable faces, natural motion, no deformation, no watermark, no logo, and no subtitles unless intended.

请求

bash
curl -X POST https://seedance2ai.io/api/v1/video/seedance2 \
  -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"
  }'

响应202

json
{
  "id": "sd2_xxxxx",
  "status": "processing",
  "model": "seedance2",
  "quality_tier": "standard",
  "channel": "standard",
  "credits_used": 30
}
2

查看任务状态

GET
/api/v1/tasks/{id}

请求

bash
curl https://seedance2ai.io/api/v1/tasks/sd2_xxxxx \
  -H "Authorization: Bearer $SEEDANCE_API_KEY"

响应200

json
{
  "id": "sd2_xxxxx",
  "status": "completed",
  "model": "seedance2",
  "quality_tier": "standard",
  "channel": "standard",
  "credits_used": 30,
  "credits_refunded": 0,
  "output": {
    "video_url": "https://...",
    "last_frame_url": "https://...",
    "seed": 123
  },
  "error": null,
  "created_at": "2026-06-03T10:00:00.000Z",
  "updated_at": "2026-06-03T10:03:12.000Z"
}

status: processing · completed · failed

错误码

All errors share this shape:

json
{ "error": { "code": "invalid_request", "message": "Invalid request body" } }
代码HTTP含义
unauthorized401Missing, invalid, or revoked API key.
invalid_request400Bad input or unsupported field.
insufficient_credits402Not enough credits on the balance.
rate_limited429Too many requests — limit is 30 requests per 60 seconds per account. Retry after the Retry-After response header (in seconds).
idempotency_conflict409Same Idempotency-Key reused with a different body, or still running.
service_busy503Temporary upstream or credit-concurrency issue. Retry.
not_found404Task does not exist or does not belong to this key owner.
internal_error500Unexpected server-side failure.

配合 Claude Code 使用

点击“Copy for AI”,以干净的 Markdown 格式获取完整 API,将其粘贴到 Claude Code 或 Codex 中,即可自动完成集成配置。或者直接将 Agent 指向原始文本端点。

打开llms.txt

Skill

将 Seedance 技能安装到 Claude Code、Codex 或任何 agent 中——它能为你编写电影级提示词,并通过 API 直接渲染成片。

bash
# Download the one-file skill from Seedance 2 AI
mkdir -p ~/.claude/skills/seedance
curl -L https://seedance2ai.io/downloads/seedance-skill.md -o ~/.claude/skills/seedance/SKILL.md

常见问题

谁可以使用 API?

任何拥有积分的用户均可使用。无套餐限制——任何持有积分的账户均可创建密钥并调用API。

如何获取积分?

在定价页面充值或订阅,积分将即时到账。

网站和API的积分是否共享?

是的——您的个人积分余额可用于网页生成和 API 调用。在团队中,API 调用使用每位成员自己的个人余额,而非团队共享积分池。

如何开始?

在控制面板中创建一个 API 密钥,然后使用 Bearer 令牌调用接口(参见上方快速入门指南)。

若调用返回 insufficient_credits,该如何处理?

您的余额不足——请在定价页面充值后重试。