ToAPIsToAPIs
doubao-seedance-1-5-pro

Doubao SeeDance 1.5 Pro 視頻生成

使用字節跳動豆包 Doubao SeeDance 1.5 Pro 模型生成視頻

POST
/v1/videos/generations

中國大陸用戶請注意: 中國大陸用戶請使用 https://toapis.cn 作為接口地址(Base URL)。文檔示例中的 https://toapis.com 請替換為 https://toapis.cn。

  • 字節跳動豆包視頻生成模型 1.5 Pro 版本
  • 支持文本到視頻生成
  • 支持首幀/尾幀圖控制
  • 不支持參考圖模式
  • 支持音頻生成(1.5 Pro 獨有功能)
  • 異步任務管理,通過任務 ID 查詢結果

Authorizations

Authorizationstring請求頭必填

所有接口均需要使用 Bearer Token 進行認證

獲取 API Key:訪問 API Key 管理頁面 獲取您的 API Key

使用時在請求頭中添加:

Authorization: Bearer YOUR_API_KEY

Body

modelstring請求體必填預設值: doubao-seedance-1-5-pro

視頻生成模型名稱

可用模型:

  • doubao-seedance-1-5-pro - 1.5 Pro 版,支持音頻生成和首幀/尾幀控制
promptstring請求體必填

視頻內容描述

詳細描述場景、動作、風格以獲得更好的生成效果

示例:"海灘日落,金色陽光照在海面上,海浪輕輕拍打沙灘"

durationinteger請求體預設值: 5

視頻時長(秒)

支持範圍:4 ~ 12 秒

默認:5

aspect_ratiostring請求體預設值: 16:9

視頻寬高比

可選項:

  • 16:9 - 橫屏
  • 9:16 - 豎屏
  • 1:1 - 方形
  • 4:3 - 傳統比例
  • 3:4 - 豎向傳統比例
  • 21:9 - 超寬屏

默認:16:9

分辨率與寬高比組合

分辨率支持的寬高比備註
480p16:9, 4:3, 1:1, 3:4, 9:16, 21:9全部支持
720p16:9, 4:3, 1:1, 3:4, 9:16, 21:9全部支持(默認)
1080p16:9, 4:3, 1:1, 3:4, 9:16, 21:9全部支持
image_urlsstring[]請求體

兼容圖片 URL 數組,用於首尾幀圖生視頻

兼容規則:

  • 1 張圖片:作爲 first_frame
  • 2 張圖片:分別作爲 first_frame 和 last_frame
  • 超過 2 張:僅使用前兩張,其餘忽略

建議優先使用 image_with_roles 顯式指定首幀和尾幀

示例:["https://example.com/first.png", "https://example.com/last.png"]

image_urls 和 image_with_roles 不能同時使用

image_with_rolesarray請求體

帶角色的圖像數組,用於顯式首尾幀控制

字段說明
urlstring請求體必填

圖像 URL 地址

rolestring請求體必填

圖像角色

可選項:

  • first_frame - 首幀圖,作爲視頻起始畫面(僅支持一張)
  • last_frame - 尾幀圖,作爲視頻結束畫面(僅支持一張)

示例:

[
  {"url": "https://example.com/first.png", "role": "first_frame"},
  {"url": "https://example.com/last.png", "role": "last_frame"}
]
  • image_urls 和 image_with_roles 不能同時使用
  • 首幀和尾幀僅支持各一張
  • 1.5 Pro 不支持 reference_image(參考圖)角色,如需參考圖功能請使用 Seedance 2.0
metadataobject請求體

擴展參數

字段說明
resolutionstring請求體預設值: 720p

視頻分辨率

可選項:

  • 480p - 標清
  • 720p - 高清(默認)
  • 1080p - 全高清
seedinteger請求體

種子整數,用於控制生成內容的隨機性

取值範圍:-1 ~ 2^32-1

相同 seed 值會生成類似結果,但不保證完全一致

audioboolean請求體預設值: false

是否生成音頻

設置爲 true 時,視頻將包含 AI 生成的配套音頻

1.5 Pro 獨有功能

camerafixedboolean請求體預設值: false

是否固定攝像頭

設置爲 true 時,攝像頭位置保持固定

與 1.0 版本的差異

特性1.0 fast/quality1.5 Pro
默認分辨率1080p720p
支持分辨率480p/720p/1080p480p/720p/1080p
時長範圍2-12秒4-12秒
音頻生成不支持支持
圖片控制模式reference 單參考圖first_frame / last_frame 首尾幀模式

素材審核

請求帶有圖片素材時, 部分渠道會在提交生成前自動審核素材. 無需額外參數, 在原有圖片欄位中傳入圖片 URL 即可.

  • 請求受理後立即返回視頻任務. 需要審核時任務維持 queued, 本次請求的素材全部通過後才提交生成. 首次審核可能需要數分鐘, 同一使用者在同一渠道重複使用相同 URL 時會重用審核結果.
  • 每輪素材準備預設最長 20 分鐘. 素材被拒絕或準備逾時會結束任務, 狀態為 failed, 原因見 error.message. 審核未通過不收取視頻生成費用.
  • 圖片須為公網 HTTP(S) URL, 不接受 Base64 與本機路徑, 建議不超過 30 MB; 模型原有的格式限制不變.
  • 需要審核的渠道會在受理時驗證圖片 URL: 帶有帳號密碼或超過 2048 位元組時直接返回 HTTP 400, error.code 為 invalid_private_assets.
  • 平台依 URL 識別素材. 檔案內容變更後請改用新的 URL.
  • 舊的 asset:// 素材引用已停用, 會返回 HTTP 400.

Response

idstring

任務唯一標識符,用於查詢任務狀態

objectstring

對象類型,固定爲 generation.task

modelstring

使用的模型名稱

statusstring

任務狀態

  • queued - 排隊等待處理
  • in_progress - 處理中
  • completed - 成功完成
  • failed - 失敗
progressinteger

任務進度百分比(0-100)

created_atinteger

任務創建時間戳(Unix 時間戳)

metadataobject

任務元數據

請求示例

curl --request POST \
  --url https://toapis.com/v1/videos/generations \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
    "model": "doubao-seedance-1-5-pro",
    "prompt": "海灘日落,金色陽光照在海面上,海浪輕輕拍打沙灘",
    "duration": 5,
    "aspect_ratio": "16:9",
    "metadata": {
      "resolution": "720p",
      "audio": true
    }
  }'
curl --request POST \
  --url https://toapis.com/v1/videos/generations \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
    "model": "doubao-seedance-1-5-pro",
    "prompt": "貓在草地上追逐一條蛇,鏡頭快速跟隨",
    "image_with_roles": [
      {"url": "https://example.com/first.png", "role": "first_frame"}
    ],
    "metadata": {
      "resolution": "720p",
      "audio": true
    }
  }'
curl --request POST \
  --url https://toapis.com/v1/videos/generations \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
    "model": "doubao-seedance-1-5-pro",
    "prompt": "女孩在櫻花樹下旋轉,花瓣隨風飄落,最後慢慢停下",
    "image_with_roles": [
      {"url": "https://example.com/first.png", "role": "first_frame"},
      {"url": "https://example.com/last.png", "role": "last_frame"}
    ],
    "duration": 5,
    "aspect_ratio": "9:16",
    "metadata": {
      "resolution": "720p",
      "audio": true
    }
  }'
import requests

response = requests.post(
    "https://toapis.com/v1/videos/generations",
    headers={
        "Authorization": "Bearer your-ToAPIs-key",
        "Content-Type": "application/json"
    },
    json={
        "model": "doubao-seedance-1-5-pro",
        "prompt": "海灘日落,金色陽光照在海面上,海浪輕輕拍打沙灘",
        "duration": 5,
        "aspect_ratio": "16:9",
        "metadata": {
            "resolution": "720p",
            "audio": True
        }
    }
)

task = response.json()
print(f"任務 ID: {task['id']}")
print(f"狀態: {task['status']}")
const response = await fetch('https://toapis.com/v1/videos/generations', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer your-ToAPIs-key',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    model: 'doubao-seedance-1-5-pro',
    prompt: '海灘日落,金色陽光照在海面上,海浪輕輕拍打沙灘',
    duration: 5,
    aspect_ratio: '16:9',
    metadata: {
      resolution: '720p',
      audio: true
    }
  })
});

const task = await response.json();
console.log(`任務 ID: ${task.id}`);
console.log(`狀態: ${task.status}`);

響應示例

{
  "id": "task_vid_xyz789ghi012",
  "object": "generation.task",
  "model": "doubao-seedance-1-5-pro",
  "status": "queued",
  "progress": 0,
  "created_at": 1703884800,
  "metadata": {}
}