跳轉到主要內容
POST
Create video
使用正式環境的 DGrid Model API Key,確認帳號有模型存取權限且餘額足以支付預估費用。以下參數適用於 Seedance 2.5。憑證設定和完整流程請參閱影片生成指南。

Seedance 2.5 請求參數

將以下範例儲存為 request.json。
以 application/json 傳送請求內容,並使用 Bearer 權杖驗證。每筆新任務都要使用專屬的 Idempotency-Key。送出請求可能產生費用。
HTTP 202 表示 DGrid 已受理任務並預留預估費用。請保存 id 以便查詢任務。以下回應使用示意數值。

引用參考素材

使用 BytePlus Seedance 渠道時,可在 content 陣列的文字提示詞旁加入媒體項目。請使用上傳回傳的完整 HTTPS 網址,或提供伺服器可存取的 HTTPS 網址。外部參考影片須使用支援 HTTP Range 且可讀取影片長度的 MP4 直連網址。
同一使用者透過 DGrid 送審的素材達到 Active 後,可將 asset://<IMAGE_ASSET_ID> 填入 image_url.url,或將 asset://<VIDEO_ASSET_ID> 填入 video_url.url。DGrid 會在預留費用前及送出上游生成請求前確認官方狀態。即使簽名上傳網址過期,仍為 Active 的素材也可引用。素材仍須符合模型輸入規格與內容要求。詳情請參閱上傳參考素材。

冪等與錯誤處理

如果建立請求逾時或暫時回傳 503,且尚未取得任務 ID,請用同一組 API Key、冪等鍵和請求內容重試。變更請求內容(含簽名網址)可能造成衝突。若受理結果仍不確定,請先查明或恢復原請求,再建立新任務。若已取得任務 ID,請直接查詢原任務。 請先檢查 HTTP 狀態。錯誤詳細資訊可能是 error 字串或 error.code 欄位。閘道錯誤可能傳回其他格式。

授權

Authorization
string
header
必填

Your DGrid API key. All endpoints use Authorization: Bearer <DGRID_API_KEY>.

標頭

Idempotency-Key
string

Use a unique key for a new task. Reuse that key with the same request body if you retry.

主體

application/json
model
string
必填

Video model ID. The documented request format applies to Seedance 2.5.

範例:

"bytedance/seedance-2.5"

content
object[]
必填

Text prompt and optional reference media.

duration
integer
必填

Duration in seconds. The maximum depends on the supported input combination.

必填範圍: 1 <= x <= 30
範例:

5

resolution
string
必填

Output resolution. Available settings depend on the model and channel.

範例:

"720p"

ratio
string

Output aspect ratio.

範例:

"16:9"

generate_audio
boolean

Whether to generate audio.

watermark
boolean

Whether to include a watermark.

seed
integer

Seed value.

回應

Video task accepted.

id
string<uuid>

DGrid video task ID.

model
string

Model used for the task.

status
string

Video task status.

settlement_status
string

Billing settlement status.

estimated_amount
string

Estimated cost in USD as a decimal string.

created_at
string<date-time>

Task creation timestamp.