Accédez aux model de génération vidéo Seedance 2.0 de ByteDance via l'API unifiée TokenHub. Prend en charge la génération texte vers vidéo, image vers vidéo, l'édition vidéo, la génération pilotée par l'audio, et plus encore. Ce guide vous accompagne tout au long du processus d'intégration.
th-xxxxxxxxxxxx...)https://tokenhub.store/api/v1Toutes les requêtes nécessitent une API Key dans l'en-tête :
Authorization: Bearer th-your-api-keyPOST/videos/generationsCrée une tâche de génération vidéo, renvoie l'ID de tâche
GET/videos/generations/{task_id}Interroge l'état de la tâche, renvoie l'URL de la vidéo en cas de succès
| ID du model | Résolution | Taux de sortie | Description |
|---|---|---|---|
| doubao-seedance-2.0 | 720p | $0.20/s | Flagship model, highest quality |
| 480p | $0.12/s | Qualité standard, rentable | |
| doubao-seedance-2.0-fast | 720p | $0.16/s | Fast model, quicker generation |
| 480p | $0.10/s | Option la plus abordable |
Détails de facturation :
Exemple : doubao-seedance-2.0 (720p), vidéo d'entrée de 5 s + sortie de 10 s → coût = (5+10)×$0.20 = $3.00
| Paramètre | Type | Obligatoire | Description |
|---|---|---|---|
| model | string | Obligatoire | Model ID, par ex. "doubao-seedance-2.0" |
| prompt | string | Obligatoire | Texte décrivant la vidéo. Les prompts en anglais donnent généralement de meilleurs résultats |
| duration | number | Facultatif | Durée de la vidéo (sec), plage 4–15, défaut 5 |
| resolution | string | Facultatif | "480p" ou "720p" (720p par défaut) |
| aspect_ratio | string | Facultatif | Rapport d'aspect : "adaptive" (par défaut), "16:9", "9:16", "1:1", etc. |
| image_url | string | Facultatif | URL de l'image de référence (image-to-video) |
| image_urls | string[] | Facultatif | Tableau de plusieurs URL d'images de référence |
| video_url | string | Facultatif | URL de la vidéo de référence (édition vidéo / video-to-video) |
| video_urls | string[] | Facultatif | Tableau de plusieurs URL de vidéos de référence (max 3) |
| video_durations | number[] | Facultatif | Tableau des durées par vidéo en secondes, par ex. [3, 5] |
| input_video_duration | number | Facultatif | Durée totale de la vidéo d'entrée en secondes (alternative à video_durations) |
| audio_url | string | Facultatif | URL de l'audio de référence (musique de fond / SFX) |
| audio_urls | string[] | Facultatif | Tableau de plusieurs URL d'audios de référence (max 3) |
| generate_audio | boolean | Facultatif | Indiquez s’il faut générer l’audio, par défaut true |
| watermark | boolean | Facultatif | Indiquez s’il faut ajouter un filigrane, par défaut false |
| content | array | Facultatif | Tableau d’assets multimédias. Chaque élément : { type: "image_url", image_url: { url }, role }. Rôles pris en charge : first_frame (max 1), last_frame (max 1), reference_image, reference_video, reference_audio |
Vous pouvez combiner librement texte, images, vidéos et audio comme entrée. Notez les limites suivantes :
L’utilisation la plus basique — décrivez une scène en texte pour générer une vidéo.
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
}'Réponse :
{
"id": "xxxxxx-task-id",
"object": "video.generation.task",
"model": "doubao-seedance-2.0",
"status": "queued",
"created": 1719900000
}La génération vidéo est asynchrone — interrogez le statut jusqu’à la fin.
# 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"Tâche en cours :
{
"id": "YOUR_TASK_ID",
"object": "video.generation.task",
"model": "doubao-seedance-2.0",
"status": "running",
"created": 1719900000
}Tâche terminée (URL de la vidéo reçue) :
{
"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)Format recommandé : [Sujet] + [Action] + [Environnement/Arrière-plan] + [Caméra/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"Inscrivez-vous sur TokenHub et commencez dès maintenant à utiliser l’API de génération vidéo Seedance 2.0
© 2026 TokenHub · Powered by ByteDance Seedance 2.0 · support@tokenhub.store