TokenHubの統合APIを通じて、ByteDance Seedance 2.0の動画生成 model にアクセスできます。テキストから動画、画像から動画、動画編集、音声駆動生成などをサポートします。このガイドでは、統合手順を最初から最後まで解説します。
th-xxxxxxxxxxxx...)https://tokenhub.store/api/v1すべてのリクエストでは、ヘッダーに API Key が必要です:
Authorization: Bearer th-your-api-keyPOST/videos/generations動画生成タスクを作成し、task ID を返します
GET/videos/generations/{task_id}タスクの状態を照会し、成功時に video URL を返します
| モデル ID | 解像度 | 出力レート | 説明 |
|---|---|---|---|
| doubao-seedance-2.0 | 720p | $0.20/s | Flagship model, highest quality |
| 480p | $0.12/s | 標準品質、コスト効率に優れる | |
| doubao-seedance-2.0-fast | 720p | $0.16/s | Fast model, quicker generation |
| 480p | $0.10/s | 最も手頃な選択肢 |
料金詳細:
例:doubao-seedance-2.0(720p)、5秒の入力 video + 10秒の出力 → 料金 = (5+10)×$0.20 = $3.00
| パラメーター | 型 | 必須 | 説明 |
|---|---|---|---|
| model | string | 必須 | モデル ID。例:"doubao-seedance-2.0" |
| prompt | string | 必須 | video の説明文。英語のプロンプトのほうが一般的に良い結果になります |
| duration | number | 任意 | video の長さ(秒)。範囲は 4〜15、デフォルトは 5 |
| resolution | string | 任意 | "480p" または "720p"(デフォルトは 720p) |
| aspect_ratio | string | 任意 | アスペクト比:"adaptive"(デフォルト)、"16:9"、"9:16"、"1:1" など |
| image_url | string | 任意 | 参照画像 URL(image-to-video) |
| image_urls | string[] | 任意 | 複数の参照画像 URL の配列 |
| video_url | string | 任意 | 参照 video URL(video editing / video-to-video) |
| video_urls | string[] | 任意 | 複数の参照 video URL の配列(最大 3) |
| video_durations | number[] | 任意 | 各 video の長さ(秒)の配列。例:[3, 5] |
| input_video_duration | number | 任意 | 入力 video の合計再生時間(秒)。video_durations の代替 |
| audio_url | string | 任意 | 参照音声 URL(BGM / SFX) |
| audio_urls | string[] | 任意 | 複数の参照音声 URL の配列(最大 3) |
| generate_audio | boolean | 任意 | オーディオを生成するかどうか。デフォルトは true |
| watermark | boolean | 任意 | ウォーターマークを追加するかどうか。デフォルトは false |
| content | array | 任意 | メディア素材の配列。各項目: { type: "image_url", image_url: { url }, role }. 対応する role: first_frame (最大 1), last_frame (最大 1), reference_image, reference_video, reference_audio |
テキスト、画像、動画、オーディオを自由に組み合わせて入力できます。以下の制限に注意してください:
最も基本的な使い方です。テキストでシーンを記述して動画を生成します。
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
}'レスポンス:
{
"id": "xxxxxx-task-id",
"object": "video.generation.task",
"model": "doubao-seedance-2.0",
"status": "queued",
"created": 1719900000
}動画生成は非同期です。完了するまで状態をポーリングしてください。
# 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"タスク進行中:
{
"id": "YOUR_TASK_ID",
"object": "video.generation.task",
"model": "doubao-seedance-2.0",
"status": "running",
"created": 1719900000
}タスク完了(動画 URL を受信):
{
"id": "YOUR_TASK_ID",
"object": "video.generation.task",
"model": "doubao-seedance-2.0",
"status": "succeeded",
"created": 1719900000,
"data": [
{
"video_url": "https://xxx.volces.com/output-video.mp4",
"cover_image_url": "https://xxx.volces.com/cover.jpg"
}
],
"usage": {
"video_duration": 5
}
}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)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();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)推奨形式: [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"© 2026 TokenHub · Powered by ByteDance Seedance 2.0 · support@tokenhub.store