API Hızlı Başlangıç
Görselden videoya bir üretim oluşturun ve durumunu sorgulayın.
1. Kimlik bilgilerini ayarlayın
export SEEDANCE_BASE_URL="https://api.seedance2video.io/v1"
export SEEDANCE_API_KEY="sd_live_replace_me"Key'i yalnızca sunucu taraflı bir secret manager'da veya n8n Credential'da saklayın.
2. Üretim oluşturun
Girdi host'u kullanılmadan önce API Key'iniz için onaylanmış olmalıdır.
curl --request POST "$SEEDANCE_BASE_URL/videos" \
--header "Authorization: Bearer $SEEDANCE_API_KEY" \
--header "Idempotency-Key: order-10086-shot-1" \
--header "Content-Type: application/json" \
--data '{
"model": "seedance-2.0-pro",
"mode": "image-to-video",
"prompt": "Özne yavaşça kameraya doğru döner.",
"inputs": [{
"type": "image",
"url": "https://media.example.com/reference.png"
}],
"parameters": {
"duration_seconds": 5,
"resolution": "720p",
"aspect_ratio": "16:9",
"generate_audio": true
}
}'API, üretimin id, status, status_url ve billing.cost_credits alanlarıyla birlikte 202 Accepted döndürür. Ücretlendirme, PC ile aynı hesaplamayı ve kredi tüketim sırasını kullanır.
3. Aynı üretimin durumunu sorgulayın
curl "$SEEDANCE_BASE_URL/generations/GENERATION_ID" \
--header "Authorization: Bearer $SEEDANCE_API_KEY"retry_after_seconds veya Retry-After header'ına uyun. Durum queued ya da processing iken sorgulamaya devam edin.
4. Tamamlanan URL'yi okuyun
{
"status": "completed",
"output": {
"urls": ["https://.../completed-video.mp4"],
"video_url": "https://.../completed-video.mp4"
},
"billing": {
"unit": "credits",
"cost_credits": 355,
"policy": "same_as_pc"
}
}Oluşturma isteği zaman aşımına uğrarsa tamamen aynı body ve Idempotency-Key ile yeniden deneyin. Yeni bir Key ile otomatik olarak yeni istek oluşturmayın.