Accede a los modelos de generación de video Seedance 2.0 de ByteDance a través de la API unificada de TokenHub. Compatible con text-to-video, image-to-video, edición de video, generación guiada por audio y más. Esta guía te acompaña en todo el proceso de integración.
th-xxxxxxxxxxxx...)https://tokenhub.store/api/v1Todas las solicitudes requieren un API Key en la cabecera:
Authorization: Bearer th-your-api-keyPOST/videos/generationsCrea una tarea de generación de video; devuelve el ID de la tarea
GET/videos/generations/{task_id}Consulta el estado de la tarea; devuelve la URL del video si tiene éxito
| ID del modelo | Resolución | Tasa de salida | Descripción |
|---|---|---|---|
| doubao-seedance-2.0 | 720p | $0.20/s | Flagship model, highest quality |
| 480p | $0.12/s | Calidad estándar, rentable | |
| doubao-seedance-2.0-fast | 720p | $0.16/s | Fast model, quicker generation |
| 480p | $0.10/s | La opción más económica |
Detalles de facturación:
Ejemplo: doubao-seedance-2.0 (720p), video de entrada de 5s + salida de 10s → costo = (5+10)×$0.20 = $3.00
| Parámetro | Tipo | Obligatorio | Descripción |
|---|---|---|---|
| model | string | Obligatorio | ID del modelo, por ejemplo "doubao-seedance-2.0" |
| prompt | string | Obligatorio | Texto descriptivo del video. Los prompts en inglés suelen dar mejores resultados |
| duration | number | Opcional | Duración del video (seg), rango 4–15, predeterminado 5 |
| resolution | string | Opcional | "480p" o "720p" (predeterminado 720p) |
| aspect_ratio | string | Opcional | Relación de aspecto: "adaptive" (predeterminado), "16:9", "9:16", "1:1", etc. |
| image_url | string | Opcional | URL de imagen de referencia (image-to-video) |
| image_urls | string[] | Opcional | Matriz de varias URL de imágenes de referencia |
| video_url | string | Opcional | URL de video de referencia (edición de video / video-to-video) |
| video_urls | string[] | Opcional | Matriz de varias URL de videos de referencia (máx. 3) |
| video_durations | number[] | Opcional | Matriz de duraciones por video en segundos, por ejemplo [3, 5] |
| input_video_duration | number | Opcional | Duración total del video de entrada en segundos (alternativa a video_durations) |
| audio_url | string | Opcional | URL de audio de referencia (música de fondo / SFX) |
| audio_urls | string[] | Opcional | Matriz de varias URL de audio de referencia (máx. 3) |
| generate_audio | boolean | Opcional | Si se debe generar audio, valor predeterminado: true |
| watermark | boolean | Opcional | Si se debe añadir marca de agua, valor predeterminado: false |
| content | array | Opcional | Matriz de recursos multimedia. Cada elemento: { type: "image_url", image_url: { url }, role }. Roles admitidos: first_frame (máx. 1), last_frame (máx. 1), reference_image, reference_video, reference_audio |
Puedes combinar libremente texto, imágenes, videos y audio como entrada. Ten en cuenta los siguientes límites:
El uso más básico: describe una escena en texto para generar un video.
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
}'Respuesta:
{
"id": "xxxxxx-task-id",
"object": "video.generation.task",
"model": "doubao-seedance-2.0",
"status": "queued",
"created": 1719900000
}La generación de video es asíncrona: consulta el estado hasta que se complete.
# 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"Tarea en progreso:
{
"id": "YOUR_TASK_ID",
"object": "video.generation.task",
"model": "doubao-seedance-2.0",
"status": "running",
"created": 1719900000
}Tarea completada (URL del video recibida):
{
"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)Formato recomendado: [Sujeto] + [Acción] + [Entorno/Fondo] + [Cámara/Estilo]
"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"Regístrate en TokenHub y empieza a usar la API de generación de videos Seedance 2.0 ahora
© 2026 TokenHub · Powered by ByteDance Seedance 2.0 · support@tokenhub.store