メインコンテンツへスキップ

概要

これらのエンドポイントは、Volc 形式の Seedance タスク構造をすでに利用しているチーム向けです。認証には TokenLab Bearer API Key を使います。返されるタスク ID は cgt- で始まります。statussucceededfailedcancelledexpired のいずれかになるまでポーリングしてください。 Action ディスパッチャーとして CreateContentsGenerationsTasksGetContentsGenerationsTaskListContentsGenerationsTasksDeleteContentsGenerationsTasks も呼び出せます。ActionVersion は大文字小文字を区別しません。Version は省略可能で、指定する場合は 2024-01-01 である必要があります。 このバージョンでは callback_url は受け付けません。完了イベントを見落とさないよう、タスクステータスをポーリングしてください。 関連項目 Seedance 2.0 動画モデル および 動画生成.

コンテンツ規則

  • プロンプト文には type=text を使います。
  • role なしの type=image_url は最初のフレームとして扱われます。明示的に role=first_frame を指定することもできます。
  • role=last_frame は最初のフレームと一緒にのみ使用できます。
  • 参照メディアには role=reference_imagereference_videoreference_audio を使います。
  • 1 つのリクエストで首尾フレーム入力と参照メディアを混在させないでください。

パラメータ補足

  • ratio16:94:31:13:49:1621:9adaptive を受け付けます。
  • generate_audio の既定値は true です。無音動画が必要な場合は false を指定します。
  • service_tier=default は受け付けます。Seedance 2.0 互換タスクでは service_tier=flexframescamera_fixed=true は拒否されます。
  • 選択したモデルが対応している場合、tools には { "type": "web_search" } のようなオブジェクトを渡せます。不正な tool 項目は無視せず拒否します。

curl https://api.tokenlab.sh/api/v3/contents/generations/tasks \
  -H "Authorization: Bearer $TOKENLAB_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "doubao-seedance-2-0-260128",
    "content": [
      {"type": "text", "text": "A cinematic forest at sunset"},
      {"type": "image_url", "role": "reference_image", "image_url": {"url": "https://example.com/ref.png"}}
    ],
    "ratio": "16:9",
    "duration": 5,
    "resolution": "720p",
    "generate_audio": true
  }'