Seedance 1.5 Pro

Seedance 1.5 Pro 支持文生视频、首帧图生视频、首尾帧图生视频。生成模式由 input.image_urls 的图片数量自动决定。

模型

模型名称时长分辨率宽高比
doubao-seedance-1.5-pro4-12s480p, 720p, 1080p16:9, 4:3, 1:1, 3:4, 9:16, 21:9

定价

按公式计费:时长 × 每秒速率。速率由分辨率和 generate_audio 决定。

分辨率无音频有音频
480p3 credits/s7 credits/s
720p7 credits/s14 credits/s
1080p15 credits/s30 credits/s

示例:

  • 720p, 5s, 有音频:14 × 5 = 70 credits
  • 1080p, 8s, 无音频:15 × 8 = 120 credits
  • 480p, 12s, 有音频:7 × 12 = 84 credits

创建任务

POST https://api.aivideoapi.ai/v1/videos/generations

请求体

字段类型必填说明
modelstring必须为 doubao-seedance-1.5-pro
inputobject生成参数,见下方
callback_urlstring接收任务完成/失败通知的 URL

Input 对象

字段类型必填说明
promptstring视频提示词
image_urlsstring[] | object[]0 张图 = 文生视频,1 张图 = 首帧图生视频,2 张图 = 首尾帧图生视频
durationinteger视频时长,单位秒:4-12(默认:5)
aspect_ratiostring16:94:31:13:49:1621:9(默认:16:9)。也可使用 ratio 作为别名
resolutionstring480p720p1080p(默认:720p
generate_audioboolean是否生成同步音频(默认:true
watermarkboolean是否添加水印(默认:false
camera_fixedboolean是否固定摄像头(默认:false)。详见固定摄像头
seedinteger随机种子,范围:[-1, 4294967295]

该模型不支持 video_urlsaudio_urlsgeneration_typeweb_searchreturn_last_frame

生成模式

image_urls 数量模式行为
0文生视频仅根据 prompt 生成视频
1首帧图生视频将图片作为视频首帧
2首尾帧图生视频第一张图作为首帧,第二张图作为尾帧

image_urls 格式

image_urls 支持字符串数组和对象数组:

"image_urls": [
  "https://example.com/first-frame.jpg",
  "https://example.com/last-frame.jpg"
]
"image_urls": [
  { "url": "https://example.com/first-frame.jpg" },
  { "url": "https://example.com/last-frame.jpg" }
]

仅支持公开可访问的 HTTP(S) 图片 URL。

示例

文生视频

curl -X POST https://api.aivideoapi.ai/v1/videos/generations \
  -H "Authorization: Bearer sk-your-api-key" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "doubao-seedance-1.5-pro",
    "callback_url": "https://your-server.com/webhook",
    "input": {
      "prompt": "一个女孩走过夜晚的霓虹城市,电影感运镜",
      "duration": 5,
      "aspect_ratio": "16:9",
      "resolution": "720p",
      "generate_audio": true
    }
  }'

首帧图生视频

curl -X POST https://api.aivideoapi.ai/v1/videos/generations \
  -H "Authorization: Bearer sk-your-api-key" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "doubao-seedance-1.5-pro",
    "input": {
      "prompt": "镜头缓慢推进,人物微笑并转向光源。",
      "image_urls": [
        "https://example.com/first-frame.jpg"
      ],
      "duration": 8,
      "aspect_ratio": "9:16",
      "resolution": "720p",
      "generate_audio": true
    }
  }'

首尾帧图生视频

curl -X POST https://api.aivideoapi.ai/v1/videos/generations \
  -H "Authorization: Bearer sk-your-api-key" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "doubao-seedance-1.5-pro",
    "input": {
      "prompt": "从首帧平滑过渡到尾帧,保持电影感镜头运动。",
      "image_urls": [
        { "url": "https://example.com/first-frame.jpg" },
        { "url": "https://example.com/last-frame.jpg" }
      ],
      "duration": 8,
      "aspect_ratio": "9:16",
      "resolution": "1080p",
      "generate_audio": false
    }
  }'

响应

{
  "code": 200,
  "msg": "success",
  "data": {
    "taskId": "cbf6b69d-4f03-4817-8ed7-94c0292184a8"
  }
}

查询任务

curl https://api.aivideoapi.ai/v1/tasks/{taskId} \
  -H "Authorization: Bearer sk-your-api-key"

状态变化:pending -> processing -> completedfailed

完成

{
  "id": "7d89c51e-9430-410e-909e-df347131ebaa",
  "status": "completed",
  "model": "doubao-seedance-1.5-pro",
  "created_at": 1774790227,
  "completed_at": 1774796529,
  "output": {
    "urls": [
      "https://file.aivideoapi.ai/videos/2026/07/04/abc.mp4"
    ],
    "metadata": {
      "seed": 41485,
      "ratio": "16:9",
      "duration": 5,
      "resolution": "720p",
      "generate_audio": true,
      "framespersecond": 24
    }
  }
}

视频 URL 可能会过期,请在生成完成后及时下载。

回调

创建任务时传入 callback_url,系统会在任务完成或失败时自动向你的 URL 发送 POST 请求。

请求头与重试策略详见回调说明

参数详解

时长

整数,单位:秒。默认值:5

  • 取值范围:4-12
  • 时长会影响计费

宽高比

默认值:16:9

支持的值:16:94:31:13:49:1621:9

随机种子

整数。

  • 取值范围:[-1, 4294967295] 之间的整数
  • 实际使用的 seed 通过 output.metadata.seed 返回

固定摄像头

布尔值。默认值:false

说明
true固定摄像头。平台会在用户提示词中追加固定摄像头,实际效果不保证。
false不固定摄像头。

常见错误码

请求失败时,API 返回 JSON 格式的错误响应:

{
  "error": {
    "code": "insufficient_credits",
    "message": "Your credit balance is too low. Please top up.",
    "type": "billing_error"
  }
}

错误码一览

HTTP 状态码错误码类型说明
400invalid_requestinvalid_request_error缺少必填参数或参数无效
401invalid_api_keyauthentication_errorAPI Key 无效、已禁用或已删除
402insufficient_creditsbilling_error积分余额不足,请充值
403ip_not_allowedpermission_error请求 IP 不在 Key 的白名单中
404model_not_foundinvalid_request_error模型不存在或已停用
404task_not_foundinvalid_request_error任务 ID 不存在
429rate_limit_exceededrate_limit_error请求过于频繁,请降低频率
429spend_limit_exceededbilling_error达到 Key 的消费限额(每小时/每天/总量)
500internal_errorapi_error服务器内部错误
503upstream_errorupstream_error上游 AI 服务返回错误

常见场景

invalid_request (400)

缺少必填字段或参数格式错误时返回。

{
  "error": {
    "code": "invalid_request",
    "message": "'model' is required.",
    "type": "invalid_request_error"
  }
}

insufficient_credits (402)

积分不足。可通过 GET /v1/credits 查询余额,前往 Dashboard > Billing 充值。

invalid_api_key (401)

可能原因:

  • Key 不以 sk- 开头
  • Key 已被禁用或删除
  • 用户账户已被封禁

upstream_error (503)

上游 AI 服务返回错误,可能原因:

  • 输入内容包含敏感或违规信息
  • 上游服务暂时不可用
  • 请求参数不被上游支持

因上游错误导致任务失败时,预扣积分会自动退还。