Seedance 2.5 文生影片 API(Text to Video)
Seedance 2.5 文生影片 API 只需要一段文字提示詞,就能生成最長 30 秒、帶同步音訊的影片。提示詞裡寫清楚主體、動作、場景、鏡頭運動和風格,效果最好。
doubao-seedance-2-5-261111480p / 720p / 1080p4–30 秒低至 ¥0.5044/秒(中國)· $0.0874/秒(海外)概覽
Seedance 2.5 是字節跳動 Seedance 系列目前最新的影片生成模型,單次最長生成 30 秒影片,解析度 480p / 720p / 1080p,每個請求最多 30 張參考圖、10 段參考影片、10 段參考音訊。
Decode 透過火山引擎(中國)和 BytePlus(海外)兩個官方通道提供 Seedance 2.5 API,介面與官方完全一致,已串接官方 API 的程式碼只需更換介面位址和 Key。
呼叫 API
1. 取得 API Key
註冊並登入 Decode,在「錢包」儲值,然後在「API 金鑰」裡建立一個以 sk- 開頭的 Key,存到環境變數:
export DECODE_API_KEY="sk-..."
2. 提交任務並取得影片
影片生成是非同步的:先提交任務取得任務 ID,再查詢任務直到完成。完整範例:
curl https://decode8.com/api/v3/contents/generations/tasks \
-H "Authorization: Bearer $DECODE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "doubao-seedance-2-5-261111",
"content": [
{
"type": "text",
"text": "一隻橘貓在灑滿陽光的窗台上伸懶腰,鏡頭緩慢推近,暖色調,電影感"
}
],
"resolution": "720p",
"ratio": "16:9",
"duration": 5,
"generate_audio": true
}'import os
import time
import requests
BASE_URL = "https://decode8.com/api/v3/contents/generations/tasks"
HEADERS = {"Authorization": f"Bearer {os.environ['DECODE_API_KEY']}"}
payload = {
"model": "doubao-seedance-2-5-261111",
"content": [
{
"type": "text",
"text": "一隻橘貓在灑滿陽光的窗台上伸懶腰,鏡頭緩慢推近,暖色調,電影感"
}
],
"resolution": "720p",
"ratio": "16:9",
"duration": 5,
"generate_audio": True
}
# 1. 提交任務,取得任務 ID
task_id = requests.post(BASE_URL, headers=HEADERS, json=payload).json()["id"]
# 2. 每 10 秒查詢一次,直到結束
while True:
task = requests.get(f"{BASE_URL}/{task_id}", headers=HEADERS).json()
if task["status"] in ("succeeded", "failed", "cancelled", "expired"):
break
time.sleep(10)
print(task["status"], task.get("content", {}).get("video_url"))const BASE_URL = 'https://decode8.com/api/v3/contents/generations/tasks'
const headers = {
Authorization: `Bearer ${process.env.DECODE_API_KEY}`,
'Content-Type': 'application/json',
}
const payload = {
"model": "doubao-seedance-2-5-261111",
"content": [
{
"type": "text",
"text": "一隻橘貓在灑滿陽光的窗台上伸懶腰,鏡頭緩慢推近,暖色調,電影感"
}
],
"resolution": "720p",
"ratio": "16:9",
"duration": 5,
"generate_audio": true
}
// 1. 提交任務,取得任務 ID
const { id } = await fetch(BASE_URL, {
method: 'POST',
headers,
body: JSON.stringify(payload),
}).then((res) => res.json())
// 2. 每 10 秒查詢一次,直到結束
let task
do {
await new Promise((resolve) => setTimeout(resolve, 10_000))
task = await fetch(`${BASE_URL}/${id}`, { headers }).then((res) => res.json())
} while (['queued', 'running'].includes(task.status))
console.log(task.status, task.content?.video_url)使用海外通道時把 model 換成 dreamina-seedance-2-5-261111,其餘欄位不變。
認證
所有請求在請求標頭帶上 Authorization: Bearer sk-...。請在伺服器端呼叫,不要把 Key 暴露在瀏覽器或 App 裡。介面位址:https://decode8.com(預設)或 https://cn.decode8.com(中國大陸建議使用,影片從中國境內儲存下載)。
提交與查詢任務
提交任務
POST /api/v3/contents/generations/tasks 回傳 { "id": "task_xxxxxxxx" }。
查詢任務狀態
GET /api/v3/contents/generations/tasks/{id}
curl https://decode8.com/api/v3/contents/generations/tasks/task_xxxxxxxx \
-H "Authorization: Bearer $DECODE_API_KEY"| status | 含義 |
|---|---|
queued | 排隊中 |
running | 生成中 |
succeeded | 已完成,影片位址在 content.video_url |
failed | 失敗,原因在 error.message,費用全額退還 |
cancelled / expired | 已取消 / 已過期 |
建議每 10 秒左右查詢一次。不支援 callback_url。
傳入檔案
圖片、影片、音訊可以用三種方式傳入:可公開存取的 http(s) URL;base64(data URI);素材庫引用 asset://素材ID。所有參考素材都會先存入你的素材庫、通過上游審核後再用於生成,同一個 Key 的同一個檔案只存一份。
請求參數
| 參數 | 類型 | 必填 | 說明 |
|---|---|---|---|
model | string | 是 | 模型 ID:中國 doubao-seedance-2-5-261111,海外 dreamina-seedance-2-5-261111 |
content | array | 是 | 輸入內容陣列,見下表 |
resolution | string | 否 | 輸出解析度:480p、720p、1080p |
ratio | string | 否 | 長寬比:16:9、9:16、1:1、4:3、3:4、21:9、adaptive |
duration | integer | 否 | 影片時長(秒),4–30;-1 由模型決定 |
generate_audio | boolean | 否 | 是否同時生成音訊(音效、環境聲、對白) |
content 陣列
| 類型 | 寫法 | 說明 |
|---|---|---|
| 文字提示 | { "type": "text", "text": "..." } | 必填 |
回傳結果
任務完成後,查詢介面回傳(其餘欄位與官方一致):
{
"id": "task_xxxxxxxx",
"model": "doubao-seedance-2-5-261111",
"status": "succeeded",
"content": {
"video_url": "https://...mp4"
},
"usage": {
"completion_tokens": 108000,
"total_tokens": 108000
},
"created_at": 1794459000,
"updated_at": 1794459120
}
usage.completion_tokens 是本次計費的 tokens。影片由 Decode 保存 60 天,請及時下載。
Seedance 2.5 文生影片 API 價格
以 720p、不含影片輸入為例:中國通道官方價 ¥70.00/百萬 tokens,Decode ¥52.50(約 ¥1.1340/秒,10 秒影片約 ¥11.34);海外通道官方價 $10.70/百萬 tokens,Decode $9.10(約 $0.1965/秒)。中國 7.5 折(省 25%),海外 8.5 折(省 15%)。
| 模型 | 解析度 | 官方價 / 百萬 tokens | Decode 價 / 百萬 tokens | 官方價 / 秒 | Decode 價 / 秒 | 10 秒影片(Decode) | 優惠 |
|---|---|---|---|---|---|---|---|
| Seedance 2.5 | 480p | ¥70.00 | ¥52.50 | ¥0.6725 | ¥0.5044 | ¥5.04 | 7.5 折(省 25%) |
| 720p | ¥70.00 | ¥52.50 | ¥1.5120 | ¥1.1340 | ¥11.34 | 7.5 折(省 25%) | |
| 1080p | ¥77.00 | ¥57.75 | ¥3.7422 | ¥2.8067 | ¥28.07 | 7.5 折(省 25%) |
| 模型 | 解析度 | 官方價 / 百萬 tokens | Decode 價 / 百萬 tokens | 官方價 / 秒 | Decode 價 / 秒 | 10 秒影片(Decode) | 優惠 |
|---|---|---|---|---|---|---|---|
| Seedance 2.5 | 480p | $10.70 | $9.10 | $0.1028 | $0.0874 | $0.87 | 8.5 折(省 15%) |
| 720p | $10.70 | $9.10 | $0.2311 | $0.1965 | $1.96 | 8.5 折(省 15%) | |
| 1080p | $11.70 | $9.95 | $0.5686 | $0.4833 | $4.83 | 8.5 折(省 15%) |
資料日期 2026-11-23。官方價:中國為火山方舟人民幣定價,海外為 BytePlus ModelArk 美元定價。按秒價格按 16:9、24 fps 估算(tokens = 寬 × 高 × 24 × 秒數 ÷ 1024),實際以上游回傳的 tokens 結算;其他長寬比的像素數略有不同。以上為新用戶預設價,月用量大的客戶可聯絡業務申請專屬折扣;即時價格以控制台「模型廣場」為準。
預算有限?中國特價模型 seedance-2.5-px 按中國官方價 6.4 折計費,參數限制更多,見特價模型價格。
常見問題
Seedance 2.5 文生影片 API 多少錢?
以 720p、不含影片輸入為例:中國通道官方價 ¥70.00/百萬 tokens,Decode ¥52.50(約 ¥1.1340/秒,10 秒影片約 ¥11.34);海外通道官方價 $10.70/百萬 tokens,Decode $9.10(約 $0.1965/秒)。中國 7.5 折(省 25%),海外 8.5 折(省 15%)。
Seedance 2.5 能生成多長的影片?
單次 4–30 秒,用 duration 指定;傳 -1 由模型決定時長。解析度支援 480p、720p、1080p。
圖片、影片、音訊怎麼傳?
可以用公開 URL、base64,或素材庫中的 asset://素材ID。所有參考素材會先存入你的素材庫並通過上游審核再用於生成;審核未通過直接回傳 400,不扣費。
和官方 API 有什麼區別?已經串接官方 API 要改什麼?
介面路徑、請求和回傳格式與火山方舟 / BytePlus ModelArk 官方一致,只需把介面位址換成 https://decode8.com/api/v3、Key 換成 Decode 的 Key。差別:參考素材會自動入庫審核;不支援 callback_url,請輪詢查詢介面。
生成失敗會扣費嗎?
不會。提交時按預估用量預扣,完成後按上游實際用量多退少補;任務失敗全額退還。
相關模型與文件
Seedance 2.5 的其他功能
其他模型的文生影片 API
Seedance 2.5 模型介紹 · 串接教學 · 價格表 · 完整 API 文件