S
Seedance 2.0 APIガイド

Seedance 2.0 動画生成API

TokenHubの統合APIを通じて、ByteDance Seedance 2.0の動画生成 model にアクセスできます。テキストから動画、画像から動画、動画編集、音声駆動生成などをサポートします。このガイドでは、統合手順を最初から最後まで解説します。

公開中のモデルと最新料金はモデル一覧と料金ページをご覧ください。ページは自動更新されます。

Using Gemini to write prompts or scripts? See the text-generation API examples. For an unlisted model, use the model ID provided by your account administrator. Gemini API

Responses API のストリーミングと課金

Query your balance and usage or manage API keys with an access token generated in Settings. View account API documentation

API キーは名前または先頭部分で検索でき、1 ページに 20 件表示されます。新しいキーは最初のページに表示されます。別のウィンドウや API で作成したキーを表示するには、一覧を更新してください。 API Keys

Text → VideoImage → VideoVideo → VideoAudio Reference480p / 720p / 1080p4–15秒

1API Keyを取得する

  1. 訪問 tokenhub.store アカウントを作成するには(GitHub / Google サインイン対応)
  2. Dashboard → API Keys に移動し、「Create New Key」をクリック
  3. Dashboard → Billing に移動して Credits を追加します(1 Credit = $1 USD)
  4. API Key をコピーします(形式: th-xxxxxxxxxxxx...)
⚠️ API Key は作成時に一度だけ表示されます。安全な場所に保存してください。紛失した場合は、新しいものを作成する必要があります。

2API 概要

Base URL

https://tokenhub.store/api/v1

認証

すべてのリクエストでは、ヘッダーに API Key が必要です:

Header
Authorization: Bearer th-your-api-key

2つのエンドポイント

POST
/videos/generations

動画生成タスクを作成し、task ID を返します

GET
/videos/generations/{task_id}

タスクの状態を照会し、成功時に video URL を返します

3モデルと料金

モデル ID入力価格説明
doubao-seedance-2.0動画入力なし$6.970/1M (1080p $7.727)主力 model、最高品質。1080pに対応。
動画入力あり$4.242/1M (1080p $4.697)動画入力対応のフラッグシップモデル。コスト効率に優れています。
doubao-seedance-2.0-fast動画入力なし$5.606/1M高速 model、より速く生成します。
動画入力あり$3.333/1M動画入力対応の高速 model、最も手頃です。

料金詳細:

  • 出力 video: 1M tokensごとに課金(token数は解像度と長さにより変動)
  • 入力画像:無料(課金なし)
  • 入力 video: 動画入力ありのレートで1M tokensごとに課金
  • 合計費用 = 総消費token数 × token単価(上の表を参照)

例: doubao-seedance-2.0で動画入力なし(≤720p)、5秒動画を約1M tokensで生成 → 料金は約 $6.970

4リクエストパラメーター

パラメーター型必須説明
modelstring必須モデル ID。例:"doubao-seedance-2.0"
promptstring必須video の説明文。英語のプロンプトのほうが一般的に良い結果になります
durationnumber任意video の長さ(秒)。範囲は 4〜15、デフォルトは 5
resolutionstring任意"480p"、"720p"、または"1080p"(デフォルトは720p。1080pはdoubao-seedance-2.0のみ)
aspect_ratiostring任意アスペクト比:"adaptive"(デフォルト)、"16:9"、"9:16"、"1:1" など
image_urlstring任意参照画像 URL(image-to-video)
image_urlsstring[]任意複数の参照画像 URL の配列
video_urlstring任意参照 video URL(video editing / video-to-video)
video_urlsstring[]任意複数の参照 video URL の配列(最大 3)
video_durationsnumber[]任意各 video の長さ(秒)の配列。例:[3, 5]
input_video_durationnumber任意入力 video の合計再生時間(秒)。video_durations の代替
audio_urlstring任意参照音声 URL(BGM / SFX)
audio_urlsstring[]任意複数の参照音声 URL の配列(最大 3)
generate_audioboolean任意オーディオを生成するかどうか。デフォルトは true
watermarkboolean任意ウォーターマークを追加するかどうか。デフォルトは false
contentarray任意メディア素材の配列。各項目: { type: "image_url", image_url: { url }, role }. 対応する role: first_frame (最大 1), last_frame (最大 1), reference_image, reference_video, reference_audio

5入力制限

テキスト、画像、動画、オーディオを自由に組み合わせて入力できます。以下の制限に注意してください:

画像: 1 リクエストあたり 0〜9 枚
動画: 1 リクエストあたり 0〜3 本、各 2〜15 秒、合計尺 ≤ 15 秒
オーディオ: 1 リクエストあたり 0〜3 本、各 2〜15 秒、合計尺 ≤ 15 秒
❌ 「テキスト + オーディオのみ」および「純オーディオ」の入力はサポートされていません

対応形式

  • 画像形式: JPEG, PNG, WebP, BMP, TIFF, GIF(各最大 30MB)
  • 動画形式: MP4, MOV(H.264/H.265、各最大 50MB)
  • オーディオ形式: WAV, MP3(各最大 15MB)
⚡ ヒント: 課金に影響するのは動画の尺のみです。合計料金 = (入力動画の尺 + 出力動画の尺) × レート。入力画像は無料です。

6API 完全サンプル

最も基本的な使い方です。テキストでシーンを記述して動画を生成します。

bash
curl -X POST https://tokenhub.store/api/v1/videos/generations \
  -H "Authorization: Bearer th-your-api-key" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "doubao-seedance-2.0",
    "prompt": "A golden retriever running on a sunny beach, waves crashing in the background, cinematic slow motion, 4K quality",
    "duration": 5,
    "resolution": "720p",
    "aspect_ratio": "16:9",
    "watermark": false
  }'

レスポンス:

json
{
  "id": "xxxxxx-task-id",
  "object": "video.generation.task",
  "model": "doubao-seedance-2.0",
  "status": "queued",
  "created": 1719900000
}

動画生成は非同期です。完了するまで状態をポーリングしてください。

bash
# Poll task status using the task_id from creation response
curl https://tokenhub.store/api/v1/videos/generations/YOUR_TASK_ID \
  -H "Authorization: Bearer th-your-api-key"

タスク進行中:

json
{
  "id": "YOUR_TASK_ID",
  "object": "video.generation.task",
  "model": "doubao-seedance-2.0",
  "status": "running",
  "created": 1719900000
}

タスク完了(動画 URL を受信):

json
{
  "id": "YOUR_TASK_ID",
  "object": "video.generation.task",
  "model": "doubao-seedance-2.0",
  "status": "succeeded",
  "created": 1719900000,
  "data": [
    {
      "video_url": "https://tokenhub-data.tos-cn-hongkong.volces.com/user_sd_file/YOUR_TASK_ID.mp4",
      "cover_image_url": "https://tokenhub-data.tos-cn-hongkong.volces.com/user_sd_file/YOUR_TASK_ID_cover.jpg"
    }
  ],
  "usage": {
    "video_duration": 5
  }
}
💡 推奨ポーリング間隔: 3〜5 秒ごと。状態値: queued → waiting, running → generating, succeeded → done, failed → error

7Python 完全サンプル

python
import requests
import time

API_BASE = "https://tokenhub.store/api/v1"
API_KEY = "th-your-api-key"

headers = {
    "Authorization": f"Bearer {API_KEY}",
    "Content-Type": "application/json"
}

# Step 1: Create video generation task
payload = {
    "model": "doubao-seedance-2.0",
    "prompt": "A majestic eagle soaring over snow-capped mountains, golden hour lighting, cinematic aerial shot",
    "duration": 5,
    "resolution": "720p",
    "aspect_ratio": "16:9",
    "watermark": False
}

resp = requests.post(f"{API_BASE}/videos/generations", json=payload, headers=headers)
task = resp.json()
task_id = task["id"]
print(f"Task created: {task_id}, status: {task['status']}")

# Step 2: Poll for result
while True:
    resp = requests.get(f"{API_BASE}/videos/generations/{task_id}", headers=headers)
    result = resp.json()
    status = result["status"]
    print(f"Status: {status}")

    if status == "succeeded":
        video_url = result["data"][0]["video_url"]
        duration = result["usage"]["video_duration"]
        print(f"Video ready! Duration: {duration}s")
        print(f"URL: {video_url}")
        break
    elif status == "failed":
        print(f"Failed: {result.get('error', {}).get('message', 'Unknown error')}")
        break

    time.sleep(5)

8JavaScript / Node.js 完全サンプル

javascript
const API_BASE = "https://tokenhub.store/api/v1";
const API_KEY = "th-your-api-key";

const headers = {
  "Authorization": `Bearer ${API_KEY}`,
  "Content-Type": "application/json"
};

// Step 1: Create task
const createResp = await fetch(`${API_BASE}/videos/generations`, {
  method: "POST",
  headers,
  body: JSON.stringify({
    model: "doubao-seedance-2.0",
    prompt: "A majestic eagle soaring over snow-capped mountains, cinematic aerial shot",
    duration: 5,
    resolution: "720p",
    aspect_ratio: "16:9",
    watermark: false,
  }),
});
const task = await createResp.json();
console.log("Task created:", task.id);

// Step 2: Poll for result
const poll = async () => {
  while (true) {
    const resp = await fetch(`${API_BASE}/videos/generations/${task.id}`, { headers });
    const result = await resp.json();
    console.log("Status:", result.status);

    if (result.status === "succeeded") {
      console.log("Video URL:", result.data[0].video_url);
      console.log("Duration:", result.usage.video_duration, "seconds");
      return result;
    }
    if (result.status === "failed") {
      console.error("Failed:", result.error?.message);
      return result;
    }
    await new Promise(r => setTimeout(r, 5000));
  }
};

await poll();

9画像から動画への Python サンプル

python
import requests, time

API_BASE = "https://tokenhub.store/api/v1"
headers = {
    "Authorization": "Bearer th-your-api-key",
    "Content-Type": "application/json"
}

# Image-to-Video with a single reference image
payload = {
    "model": "doubao-seedance-2.0",
    "prompt": "The woman in the photo turns to face the camera and smiles warmly, her hair gently blowing in the wind",
    "duration": 5,
    "resolution": "720p",
    "image_url": "https://your-bucket.com/portrait.jpg",
    "watermark": False
}

resp = requests.post(f"{API_BASE}/videos/generations", json=payload, headers=headers)
task_id = resp.json()["id"]
print(f"Task: {task_id}")

# Poll for result
while True:
    r = requests.get(f"{API_BASE}/videos/generations/{task_id}", headers=headers).json()
    if r["status"] == "succeeded":
        print(f"Done: {r['data'][0]['video_url']}")
        break
    elif r["status"] == "failed":
        print(f"Error: {r.get('error', {}).get('message')}")
        break
    time.sleep(5)

10実写人物画像から動画生成

入力画像に実在人物が含まれる場合、TokenHub は real-person 生成に対応した上流 provider に自動でルーティングします。クライアント側の変更は不要です。

上流のコンテンツフィルターが入力画像内に実在人物を検知すると自動的に発火します。

リクエスト形式は通常の image-to-video と同じです — POST /v1/videos/generations の body も共通です。

2つの応答形式があります

  • 通常: { "id": "cgt-...", "status": "queued" } (既存の挙動)
  • Real-person 経路: { "id": "pat-...", "status": "queued" } — 追加のアセット処理があり、10〜90秒の追加遅延を見込んでください

GET のポーリングも同じです — POST が返した id を使って /v1/videos/generations/{id} を、status が succeeded または failed になるまで呼び出してください。id の書き換えはサーバー側で処理されるため、リクエストの有効期間中は常に同じ id が見えます。

エラー: unsupported_real_person_input

アカウントに real-person 対応 provider が設定されていない場合に、status 400 で返されます。対応 provider を有効にするには管理者に連絡してください。

エラー: アセット処理がタイムアウトしました

上流のアセット準備が5分を超えると、GET 経由で status: failed として返されます。安全にリクエストを再試行できます。

完全なライフサイクル例

pat-id はクライアントからは不透明です — status が変わるまでポーリングを続けてください。

bash
# POST
curl -X POST https://tokenhub.store/api/v1/videos/generations \
  -H "Authorization: Bearer $TH_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "doubao-seedance-2.0",
    "prompt": "let her dance and spin",
    "duration": 8,
    "resolution": "480p",
    "content": [
      { "type": "image_url", "image_url": { "url": "https://example.com/portrait.png" }, "role": "first_frame" }
    ]
  }'
# → {"id":"pat-abc123","status":"queued"}

# GET (asset still uploading)
curl https://tokenhub.store/api/v1/videos/generations/pat-abc123 -H "Authorization: Bearer $TH_KEY"
# → {"id":"pat-abc123","status":"queued"}

# GET (upstream task running)
# → {"id":"pat-abc123","status":"running"}

# GET (complete — id stays pat-, video_url in data)
# → {"id":"pat-abc123","status":"succeeded","data":[{"video_url":"..."}]}

11プロンプトのヒント

基本構成

推奨形式: [Subject] + [Action] + [Environment/Background] + [Camera/Style]

良いプロンプト例

  • "A young woman walking through a cherry blossom garden, petals falling in slow motion, soft natural lighting, cinematic 35mm film look"
  • "Close-up of hands pouring latte art into a ceramic cup, steam rising, warm cafe ambiance, shallow depth of field"
  • "Aerial drone shot of a winding river through autumn forest, golden and red leaves, morning mist, 4K cinematic"

参照画像/動画のヒント

  • プロンプト内で "image 1", "image 2", "video 1", "audio 1" を使って素材を参照します
  • 時間区間ごとにシーン内容を指定します(例: "0-2s: xxx, 2-4s: xxx")
  • 開始/終了フレームを指定します(例: "first frame is image 1", "end frame freezes on image 2")
  • カメラ構図のソースを指定します(例: "use video 1 POV throughout")
  • オーディオの使い方を指定します(例: "use audio 1 as background music throughout")

ヒント

  • 英語のプロンプトのほうが一般的に良い結果が出ます。中国語もサポートされています
  • より具体的で生き生きとした説明ほど、より良い結果につながります
  • 抽象的すぎる説明は避けてください(例: "a nice video")
  • カメラに関する表現は品質を大きく向上させます(slow motion, close-up, aerial shot, tracking shot...)

12よくある質問

準備はできましたか?

TokenHubに登録して、Seedance 2.0 Video Generation APIを今すぐ使い始めましょう

© 2026 TokenHub · Powered by ByteDance Seedance 2.0 · support@tokenhub.store