Seedance 2.0 API API ドキュメント

Seedance 2.0 動画生成をアプリに組み込むために必要なすべて。

ベース URL

https://api.defapi.org

認証

す��ての API リクエストには Authorization ヘッダーに API キーが必要です。

Authorization: Bearer <your-api-key>

: Bearer dk-1234567890abcdef

POST/api/video/seedance/gen

Seedance AI で動画を生成します。task_id を返します。

リクエストボディ

パラメータ必須説明
modelstringいいえ使用する AI モデル。デフォルト:seedance-2.0
contentarrayはいテスト/画像 URL の配列。最大 9 枚の画像。@image1、@image2 で参照
durationintegerいいえ動画の長さ(秒)。選択肢:5、10、15。デフォルト:5
ratiostringいいえアスペクト比。選択肢:16:9、9:16、1:1、4:3、3:4、21:9。デフォルト:16:9
callback_urlstringいいえタスク完了通知を受け取る Webhook URL

テキストから動画

POST https://api.defapi.org/api/video/seedance/gen
Authorization: Bearer dk-1234567890abcdef
Content-Type: application/json

{
  "model": "seedance-2.0",
  "content": [
    { "type": "text", "text": "A beautiful beach scene with waves gently lapping at the shore" }
  ]
}

画像から動画(@image1、@image2 で参照)

{
  "model": "seedance-2.0",
  "content": [
    { "type": "text", "text": "The cat in @image1 walks through a garden, then meets the dog in @image2" },
    { "type": "image_url", "image_url": { "url": "https://example.com/cat.png" } },
    { "type": "image_url", "image_url": { "url": "https://example.com/dog.png" } }
  ],
  "duration": 5,
  "callback_url": "https://example.com/webhook/video-callback"
}

レスポンス

{
  "code": 0,
  "message": "ok",
  "data": {
    "task_id": "ta12345678-1234-1234-1234-123456789abc"
  }
}
GET/api/task/query

動画生成タスクのステータスと結果を照会します。

クエリパラメータ

パラメータ必須説明
task_idstringはい生成エンドポイントから返された Task ID

GET https://api.defapi.org/api/task/query?task_id=ta823dfb-eaac-44fd-aec2-3e2c7ba8e071
Authorization: Bearer dk-1234567890abcdef

レスポンス

{
  "code": 0,
  "message": "ok",
  "data": {
    "task_id": "ta823dfb-eaac-44fd-aec2-3e2c7ba8e071",
    "status": "success",
    "result": { "video": "https://example.com/generated-video.mp4" },
    "consumed": "0.500000",
    "status_reason": { "message": null },
    "created_at": "2025-08-03T10:22:20.010Z"
  }
}

エラーコード

HTTP ステータスcode フィールド意味
2000成功
4001リクエストエラー — パラメータが無効
4011未認証 — API キーが不正または未設定
4041タスクが見つかりません
5001内部サーバーエラー