S
Seedance 2.0 API-Leitfaden

Seedance 2.0 API für Videogenerierung

Greife über die vereinheitlichte TokenHub API auf die Videogenerierungsmodelle von ByteDance Seedance 2.0 zu. Unterstützt Text-zu-Video, Bild-zu-Video, Videobearbeitung, audiogesteuerte Generierung und mehr. Dieser Leitfaden führt dich durch den kompletten Integrationsprozess.

Text → VideoImage → VideoVideo → VideoAudio Reference480p / 720p4–15 Sek.

1API Key erhalten

  1. Besuche tokenhub.store um ein Konto zu erstellen (GitHub / Google-Anmeldung unterstützt)
  2. Gehen Sie zu Dashboard → API Keys und klicken Sie auf "Create New Key"
  3. Gehen Sie zu Dashboard → Billing, um Credits hinzuzufügen (1 Credit = $1 USD)
  4. Kopieren Sie Ihren API Key (Format: th-xxxxxxxxxxxx...
⚠️ Der API Key wird bei der Erstellung nur einmal angezeigt. Speichern Sie ihn sicher. Wenn er verloren geht, müssen Sie einen neuen erstellen.

2API-Übersicht

Base URL

https://tokenhub.store/api/v1

Authentifizierung

Alle Anfragen erfordern einen API Key im Header:

Header
Authorization: Bearer th-your-api-key

Zwei Endpunkte

POST
/videos/generations

Erstellt eine Videogenerierungsaufgabe und gibt die Task-ID zurück

GET
/videos/generations/{task_id}

Fragt den Aufgabenstatus ab und gibt bei Erfolg die Video-URL zurück

3Modelle & Preise

Model-IDAuflösungAusgaberateBeschreibung
doubao-seedance-2.0720p$0.20/sFlagship model, höchste Qualität
480p$0.12/sStandardqualität, kosteneffizient
doubao-seedance-2.0-fast720p$0.16/sSchnelles model, schnellere Generierung
480p$0.10/sGünstigste Option

Abrechnungsdetails:

  • Ausgabevideo: Abrechnung nach tatsächlicher Dauer × Rate
  • Eingabebild: kostenlos (keine Gebühr)
  • Eingabevideo: Abrechnung nach Eingabevideodauer × Rate
  • Gesamtkosten = (Eingabevideodauer + Ausgabevideodauer) × Rate

Beispiel: doubao-seedance-2.0 (720p), 5s Eingabevideo + 10s Ausgabe → Kosten = (5+10)×$0.20 = $3.00

4Anfrageparameter

ParameterTypErforderlichBeschreibung
modelstringErforderlichModel-ID, z. B. "doubao-seedance-2.0"
promptstringErforderlichTextbeschreibung des Videos. Englische Prompts liefern in der Regel bessere Ergebnisse
durationnumberOptionalVideodauer (Sek.), Bereich 4–15, Standard 5
resolutionstringOptional"480p" oder "720p" (Standard 720p)
aspect_ratiostringOptionalSeitenverhältnis: "adaptive" (Standard), "16:9", "9:16", "1:1", usw.
image_urlstringOptionalURL des Referenzbilds (Bild-zu-Video)
image_urlsstring[]OptionalArray mit mehreren URL(s) von Referenzbildern
video_urlstringOptionalURL des Referenzvideos (Videobearbeitung / Video-zu-Video)
video_urlsstring[]OptionalArray mit mehreren URL(s) von Referenzvideos (max. 3)
video_durationsnumber[]OptionalArray mit Dauern pro Video in Sekunden, z. B. [3, 5]
input_video_durationnumberOptionalGesamtdauer des Eingabevideos in Sekunden (Alternative zu video_durations)
audio_urlstringOptionalURL der Referenz-Audio (Hintergrundmusik / SFX)
audio_urlsstring[]OptionalArray mit mehreren URL(s) von Referenz-Audios (max. 3)
generate_audiobooleanOptionalOb Audio generiert werden soll, Standard: true
watermarkbooleanOptionalOb ein Wasserzeichen hinzugefügt werden soll, Standard: false
contentarrayOptionalArray von Medien-Assets. Jedes Element: { type: "image_url", image_url: { url }, role }. Unterstützte Rollen: first_frame (max 1), last_frame (max 1), reference_image, reference_video, reference_audio

5Eingabebeschränkungen

Sie können Text, Bilder, Videos und Audio frei als Eingabe kombinieren. Beachten Sie die folgenden Einschränkungen:

Bilder: 0–9 pro Anfrage
Videos: 0–3 pro Anfrage, jeweils 2–15 s, Gesamtdauer ≤ 15 s
Audios: 0–3 pro Anfrage, jeweils 2–15 s, Gesamtdauer ≤ 15 s
❌ Eingaben nur mit "Text + Audio" und "reinem Audio" werden NICHT unterstützt

Unterstützte Formate

  • Bildformate: JPEG, PNG, WebP, BMP, TIFF, GIF (jeweils max. 30 MB)
  • Videoformate: MP4, MOV (H.264/H.265, jeweils max. 50 MB)
  • Audioformate: WAV, MP3 (jeweils max. 15 MB)
⚡ Tipp: Nur die Videodauer beeinflusst die Abrechnung. Gesamtkosten = (Eingabe-Videodauer + Ausgabe-Videodauer) × Rate. Eingabebilder sind kostenlos.

6Vollständige API-Beispiele

Die grundlegendste Nutzung — beschreiben Sie eine Szene in Textform, um ein Video zu generieren.

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
  }'

Antwort:

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

Die Videogenerierung erfolgt asynchron — fragen Sie den Status ab, bis sie abgeschlossen ist.

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"

Task läuft:

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

Task abgeschlossen (Video-URL erhalten):

json
{
  "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
  }
}
💡 Empfohlenes Abfrageintervall: alle 3–5 Sekunden. Statuswerte: queued → waiting, running → generating, succeeded → done, failed → error

7Python Vollständiges Beispiel

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 Vollständiges Beispiel

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();

9Python-Beispiel für Bild-zu-Video

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)

10Prompt-Tipps

Grundstruktur

Empfohlenes Format: [Subjekt] + [Aktion] + [Umgebung/Hintergrund] + [Kamera/Stil]

Gute Prompt-Beispiele

  • "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"

Tipps für Referenzbilder/-videos

  • Verwenden Sie "image 1", "image 2", "video 1", "audio 1" im Prompt, um auf Ihre Assets zu verweisen
  • Geben Sie den Szeneninhalt pro Zeitsegment an (z. B. "0-2s: xxx, 2-4s: xxx")
  • Geben Sie Anfangs- und Endframes an (z. B. "first frame is image 1", "end frame freezes on image 2")
  • Geben Sie die Quelle der Kameraperspektive an (z. B. "use video 1 POV throughout")
  • Geben Sie die Audioverwendung an (z. B. "use audio 1 as background music throughout")

Tipps

  • Englische Prompts führen in der Regel zu besseren Ergebnissen; Chinesisch wird ebenfalls unterstützt
  • Konkretere und lebendigere Beschreibungen führen zu besseren Ergebnissen
  • Vermeiden Sie zu abstrakte Beschreibungen (z. B. "a nice video")
  • Kamerasprache verbessert die Qualität erheblich (Slow Motion, Close-up, Luftaufnahme, Tracking Shot...)

11FAQ

Bereit zum Start?

Registriere dich bei TokenHub und nutze jetzt die Seedance 2.0 Video Generation API

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