Справочник API
Текст в видео
Создавайте видео из текстовых промптов с помощью Seedance 2.0 Open API.
Если не передавать mediaUrls, эндпоинт работает в режиме чистого text-to-video.
Endpoint
POST /api/open/v1/video/generationsПример запроса
curl --request POST \
--url https://www.seedance2.ink/api/open/v1/video/generations \
--header 'Authorization: Bearer sd2_live_your_api_key' \
--header 'Content-Type: application/json' \
--data '{
"model": "seedance-2.0",
"prompt": "A river flowing through an autumn forest, aerial view, cinematic motion",
"aspectRatio": "16:9",
"duration": 5,
"resolution": "720p",
"webhookUrl": "https://your-app.com/webhooks/seedance",
"metadata": {
"projectId": "proj_1001",
"sceneId": "scene_08"
}
}'Успешный ответ
{
"success": true,
"requestId": "req_1234567890",
"status": "queued",
"creditsCharged": 40
}Поля запроса
| Field | Type | Required | Description |
|---|---|---|---|
model | string | Yes | Одно из значений: seedance-2.0, seedance-2.0-fast, seedance-1.5-pro. |
prompt | string | Yes | Текстовая инструкция на естественном языке для целевого видео. |
aspectRatio | string | No | Одно из значений: 16:9, 9:16, 1:1. |
duration | integer | No | seedance-2.0 и seedance-2.0-fast поддерживают 4-15 секунд, seedance-1.5-pro только 5 или 10 секунд. |
resolution | string | No | Одно из значений: 480p, 720p, 1080p. |
webhookUrl | string | No | Callback URL для получения финального результата. |
metadata | object | No | Пользовательские метаданные, сохраняемые вместе с запросом. |
Проверка результата
curl https://www.seedance2.ink/api/open/v1/video/generations/req_1234567890 \
--header 'Authorization: Bearer sd2_live_your_api_key'{
"success": true,
"requestId": "req_1234567890",
"status": "succeeded",
"model": "seedance-2.0",
"prompt": "A river flowing through an autumn forest, aerial view, cinematic motion",
"duration": 5,
"aspectRatio": "16:9",
"output": {
"type": "video",
"url": "https://pub-your-bucket.r2.dev/open-api-results/req_1234567890.mp4"
},
"error": null
}Отмена задачи
curl --request POST \
--url https://www.seedance2.ink/api/open/v1/video/generations/req_1234567890/cancel \
--header 'Authorization: Bearer sd2_live_your_api_key'{
"success": true,
"requestId": "req_1234567890",
"status": "cancelled"
}Примечания
creditsChargedрассчитывается в момент принятия задачи.output.urlвозвращается только когдаstatusравенsucceeded.- Если вам нужны push-уведомления вместо polling, настройте Webhook.