文件

Seedance 視頻生成 API 參考

以 bytedance/seedance-2.0(Seedance 2.0)為例,演示提交任務、輪詢狀態與下載成片的完整呼叫流程。

欄位
Base URLhttps://token.easyapi.com
認證Authorization: Bearer `API_KEY`
示例模型bytedance/seedance-2.0
格式REST JSON(異步任務)
計費按量計費
注意: Seedance 2.0 支援多時長與 480p / 720p / 1080p 解析度;流程為提交任務 → 輪詢 job_id → 使用查詢結果中的 download_url 下載成片。

示例模型

下文均以 bytedance/seedance-2.0(Seedance 2.0)為例;更換其他模型時,請替換 model 參數,並參考控制台模型說明調整 size、quality 等欄位。

提交視頻生成任務

POSThttps://token.easyapi.com/v1/videos

提交異步視頻生成任務,成功返回 202 及 job_id 供後續輪詢狀態。建議傳入 Idempotency-Key 以防重複建立。

請求參數

名稱位置類型必選說明
AuthorizationheaderstringEasyAPI API Key。格式:Bearer `API_KEY`
Content-Typeheaderstring請求體格式
Idempotency-Keyheaderstring冪等鍵,相同 key 重複提交時返回首次建立的任務,不會重複建立

請求體

名稱類型必選說明
modelstring模型 ID,目前使用 bytedance/seedance-2.0
promptstring視頻描述,建議包含主體、動作、場景、鏡頭和風格。不同模型上限不同:Sora 500 字,Hailuo 2000 字,Wan T2V 1500 字、I2V 800 字。EasyAPI 本身不設硬性上限,超出後由上游拒絕並透傳 502 / 503。
durationinteger視頻時長(秒),取值範圍隨模型不同
resolutionstring輸出解析度:480p、720p 或 1080p
aspect_ratiostring寬高比:16:9、4:3、1:1、3:4、9:16、21:9 或 adaptive
generate_audioboolean是否生成音訊
seedinteger隨機種子,-1 到 4294967295;相同 seed 不保證完全一致
sizestring精確輸出尺寸,如 1280x720
input_referencesarray可選參考素材陣列,用於圖生視頻、首尾幀驅動、視頻風格遷移或音訊驅動生成
input_references[].typestring參考素材類型:image、video 或 audio,必須與 role 匹配
input_references[].urlstring參考素材的 HTTPS 地址
input_references[].rolestring參考素材用途。可選值:first_frame(首幀圖)、last_frame(尾幀圖)、reference(外觀參考圖,影響生成但不作首幀、不鎖定畫面位置)、reference_video(參考視頻)、reference_audio(參考音訊)
metadataobject業務透傳欄位,用於審計或來源標記
webhook_urlstring任務完成或失敗後的回調地址

示例

{
  "model": "bytedance/seedance-2.0",
  "prompt": "A golden retriever running on a sunny beach, cinematic camera movement",
  "duration": 6,
  "resolution": "720p",
  "aspect_ratio": "16:9",
  "generate_audio": false,
  "seed": -1,
  "input_references": [
    {
      "type": "image",
      "url": "https://cdn.example.com/portrait.jpg",
      "role": "first_frame"
    }
  ],
  "metadata": {
    "source": "playground"
  },
  "webhook_url": "https://example.com/webhooks/easyapi-video"
}

返回欄位說明

名稱類型說明
job_idstring任務唯一 ID
statusstring任務狀態:pending / in_progress / completed / failed
modelstring使用的模型
status_urlstring查詢任務狀態的完整 URL
messagestring服務端提示資訊
current_balancestring當前帳戶餘額(USD)
estimated_coststring預估費用
pre_deduct_amountstring預扣展示金額
balance_after_estimatestring按預估費用計算後的餘額
currencystring貨幣類型,目前為 USD
billing_noticestring計費提示

返回示例

{
  "code": 200,
  "msg": "",
  "data": {
    "job_id": "video_abc123",
    "status": "in_progress",
    "model": "bytedance/seedance-2.0",
    "status_url": "https://token.easyapi.com/v1/videos/video_abc123",
    "message": "视频任务已提交,请调用 status_url 查询生成进度。",
    "current_balance": "100.0000000000",
    "estimated_cost": "1.0800000000",
    "pre_deduct_amount": "1.0800000000",
    "balance_after_estimate": "98.9200000000",
    "currency": "USDT",
    "billing_notice": "视频生成完成后按实际任务结果扣款,提交后请保持余额充足。"
  }
}

返回結果

狀態碼狀態碼含義說明資料模型
202Accepted任務已提交並排隊,響應中包含用於輪詢的 job_id。VideoSubmitResponse
400Bad Request參數錯誤ErrorResponse
401Unauthorized未登入或 Token 無效ErrorResponse
402Payment Required餘額不足,響應中包含預估費用與當前餘額。ErrorResponse
429Too Many Requests請求過於頻繁,請降低呼叫頻率。ErrorResponse
500Internal Server Error服務內部錯誤ErrorResponse

查詢任務狀態

GEThttps://token.easyapi.com/v1/videos/{job_id}

示例請求: https://token.easyapi.com/v1/videos/video_abc123

輪詢任務狀態、進度及計費資訊。任務完成後響應中包含 download_url。

請求參數

名稱位置類型必選說明
job_idpathstring視頻任務 ID
AuthorizationheaderstringEasyAPI API Key。格式:Bearer `API_KEY`

返回欄位說明

名稱類型說明
job_idstring任務唯一 ID
statusstring任務狀態:pending / in_progress / completed / failed
modelstring使用的模型
status_urlstring查詢任務狀態的完整 URL
download_urlstring視頻下載入口 URL(狀態為 completed 後出現)
durationinteger視頻時長(秒)
resolutionstring輸出解析度
aspect_ratiostring寬高比
generate_audioboolean是否包含音訊
estimated_coststring預估費用
billed_coststring實際扣費金額
billing_statusstring計費狀態:pre_deducted 或 settled
expires_atstring(ISO 8601)視頻檔案過期時間
created_atstring(ISO 8601)任務建立時間
completed_atstring(ISO 8601)任務完成時間

返回示例

{
  "code": 200,
  "msg": "",
  "data": {
    "job_id": "video_abc123",
    "status": "completed",
    "model": "bytedance/seedance-2.0",
    "status_url": "https://token.easyapi.com/v1/videos/video_abc123",
    "download_url": "https://cdn.example.com/videos/video_abc123.mp4",
    "duration": 6,
    "resolution": "720p",
    "aspect_ratio": "16:9",
    "generate_audio": false,
    "estimated_cost": "1.0800000000",
    "billed_cost": "1.0800000000",
    "billing_status": "settled",
    "expires_at": "2026-06-26T05:00:00Z",
    "created_at": "2026-05-27T05:00:00Z",
    "completed_at": "2026-05-27T05:03:00Z"
  }
}

返回結果

狀態碼狀態碼含義說明資料模型
200OK成功VideoStatusResponse
401Unauthorized未登入或 Token 無效ErrorResponse
404Not Found任務不存在,或任務不屬於當前 API Key。ErrorResponse
500Internal Server Error服務內部錯誤ErrorResponse