Runway Yaratıcı Paket
Gen-2, Gen-3 ve Gen4 modelleri ile profesyonel görsel animasyonu. Sinematik kalitede sonuçlar.
✓ Gen-2, Gen-3, Gen4 modelleri
✓ Görsel animasyonu
✓ Hareket kontrolü
✓ HD kalite
Kimlik Doğrulama
Runway platformuna Doitong API üzerinden erişmek için Doitong API anahtarınızı kullanın. Bu anahtarı GraphQL mutasyonuna veya REST API başlıklarına ekleyin.
// GraphQL Header
{
"Authorization": "Bearer YOUR_API_KEY"
}
// REST Header
"X-API-Key": "YOUR_API_KEY"
Hızlı Başlangıç
Runway Gen4 API ile birkaç dakika içinde başlayın. İlk text to video içeriğinizi oluşturmak için bu basit adımları izleyin.
1. Adım: API Anahtarınızı Alın
Bir Doitong hesabı oluşturun ve API anahtarı oluşturmak için panelinize gidin.
2. Adım: İlk İsteğinizi Gönderin
İlk API çağrınızı yapmak için aşağıdaki kod örneklerinden birini kullanın.
curl -X POST https://api.doitong.com/graphql \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Idempotency-Key: unique-request-id-123" \
-d '{
"query": "mutation Generate($input: GenerateInput!) { generate(input: $input) { id status type provider url metadata creditCost } }",
"variables": {
"input": {
"type": "VIDEO",
"provider": "runway",
"input": {
"text": "A serene landscape with mountains and a lake at sunset"
},
"options": {
"duration": 5,
"aspectRatio": "16:9"
}
}
}
}'
const response = await fetch('https://api.doitong.com/graphql', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer YOUR_API_KEY',
'Idempotency-Key': 'unique-request-id-123'
},
body: JSON.stringify({
query: `
mutation Generate($input: GenerateInput!) {
generate(input: $input) {
id
status
type
provider
url
metadata
creditCost
}
}
`,
variables: {
input: {
type: 'VIDEO',
provider: 'runway',
input: {
text: 'A serene landscape with mountains and a lake at sunset'
},
options: {
duration: 5,
aspectRatio: '16:9'
}
}
}
})
});
const data = await response.json();
console.log('Result:', data.data.generate);
import requests
import json
url = "https://api.doitong.com/graphql"
headers = {
"Content-Type": "application/json",
"Authorization": "Bearer YOUR_API_KEY"
}
query = """
mutation Generate($input: GenerateInput!) {
generate(input: $input) {
id
status
type
provider
url
metadata
creditCost
}
}
"""
variables = {
"input": {
"type": "VIDEO",
"provider": "runway",
"input": {
"text": "A serene landscape with mountains and a lake at sunset"
},
"options": {
"duration": 5,
"aspectRatio": "16:9"
}
}
}
response = requests.post(url, json={
"query": query,
"variables": variables
}, headers=headers)
data = response.json()
print("Result:", data["data"]["generate"])
mutation Generate($input: GenerateInput!) {
generate(input: $input) {
id
status
type
provider
url
metadata
creditCost
createdAt
}
}
# Variables
{
"input": {
"type": "VIDEO",
"provider": "runway",
"input": {
"text": "A serene landscape with mountains and a lake at sunset"
},
"options": {
"duration": 5,
"aspectRatio": "16:9",
"version": "gen-4",
"quality": "high"
}
}
}
Fiyatlandırma
Runway Gen4 API, kredi tabanlı bir fiyatlandırma modeli kullanır. Krediler, oluşturulan içeriğin karmaşıklığına ve süresine göre tüketilir.
| Özellik | Kredi | Açıklama |
|---|---|---|
| Standart Mod | 100-200 Kredi | Standart kalitede 5-10 saniyelik video |
| Pro Mod | 300-500 Kredi | Profesyonel kalitede 5-10 saniyelik video |
API Uç Noktaları
Runway Gen4 API hizmetine birleşik GraphQL uç noktamız üzerinden erişilebilir.
GraphQL Uç Noktası
POST https://api.doitong.com/graphql
REST Uç Noktası
POST https://api.doitong.com/v1/text_to_video
Parametreler
Runway Gen4 API istekleri için kullanılabilir parametreler:
| Parametre | Tür | Zorunlu | Açıklama |
|---|---|---|---|
service |
Metin (String) | Yes | Hizmet tanımlayıcı: "runway" |
prompt |
Metin (String) | Yes | Oluşturulacak içeriğin metin açıklaması |
duration |
Tam Sayı (Integer) | No | Saniye cinsinden video süresi (varsayılan: 5) |
aspectRatio |
Metin (String) | No | En boy oranı: "16:9", "9:16", "1:1" (varsayılan: "16:9") |
version |
Metin (String) | No | Model version: "gen-2", "gen-3", "gen-4" |
webhookUrl |
Metin (String) | No | Tamamlanma bildirimlerinin gönderileceği URL |
Yanıt Formatı
Tüm API yanıtları tutarlı bir format izler:
Başarılı Yanıt
{
"data": {
"generatevideo": {
"id": "abc123xyz",
"status": "processing",
"url": null,
"webhookUrl": "https://your-webhook.com/callback",
"createdAt": "2024-01-01T00:00:00Z"
}
}
}
Tamamlanmış Yanıt
{
"data": {
"generatevideo": {
"id": "abc123xyz",
"status": "completed",
"url": "https://cdn.doitong.com/outputs/abc123xyz.mp4",
"duration": 5,
"createdAt": "2024-01-01T00:00:00Z"
}
}
}
Hata Yönetimi
API, standart HTTP durum kodlarını kullanır ve ayrıntılı hata mesajları döndürür.
Yaygın Hata Kodları
| Durum Kodu | Hata Türü | Açıklama |
|---|---|---|
| 400 | Bad Request | Invalid parameters or malformed request |
| 401 | Unauthorized | Missing or invalid API key |
| 402 | Payment Required | Insufficient credits |
| 429 | Too Many Requests | Rate limit exceeded |
| 500 | Internal Server Error | Server error, please retry |
Hata Yanıt Formatı
{
"errors": [
{
"message": "Insufficient credits for this operation",
"extensions": {
"code": "INSUFFICIENT_CREDITS",
"creditsRequired": 100,
"creditsAvailable": 50
}
}
]
}
Webhook'lar
text to video oluşturma işleminiz tamamlandığında gerçek zamanlı bildirimler alın.
Webhook Kurulumu
Include a <code>webhookUrl</code> parameter in your request to receive a POST notification when processing is complete.
Webhook Verisi (Payload)
{
"id": "abc123xyz",
"status": "completed",
"url": "https://cdn.doitong.com/outputs/abc123xyz.mp4",
"service": "runway",
"createdAt": "2024-01-01T00:00:00Z",
"completedAt": "2024-01-01T00:01:00Z",
"metadata": {
"duration": 5,
"width": 1920,
"height": 1080
}
}
Webhook Güvenliği
Tüm webhook istekleri doğrulama için bir imza başlığı içerir:
X-Doitong-Signature: sha256=abc123...
İstek Limitleri
Adil kullanım ve sistem kararlılığını sağlamak için aşağıdaki limitler geçerlidir:
| Plan | İstek/Dakika | Eşzamanlı İşlemler | Günlük Limit |
|---|---|---|---|
| Ücretsiz | 10 | 1 | 100 |
| Başlangıç | 30 | 3 | 1,000 |
| Pro | 60 | 10 | 10,000 |
| Kurumsal | Özel | Özel | Sınırsız |
X-RateLimit-Limit: Maximum requests per windowX-RateLimit-Remaining: Requests remainingX-RateLimit-Reset: Window reset timestamp
En İyi Uygulamalar
1. Komutlarınızı Optimize Edin
En iyi sonuçlar için net ve açıklayıcı komutlar (prompt) yazın:
- Be specific about visual elements, style, and mood
- Include details about lighting, camera angles, and composition
- Avoid contradictory or impossible requests
2. Asenkron İşlemleri Yönetin
Oluşturma işlemi asenkrondur. Uygun sorgulama (polling) veya webhook mekanizmalarını kurun:
// Polling example
async function pollStatus(jobId) {
let status = 'processing';
while (status === 'processing') {
await sleep(2000); // Wait 2 seconds
const result = await checkJobStatus(jobId);
status = result.status;
}
return result;
}
3. Hata Kurtarma
Üstel geri çekilme (exponential backoff) ile yeniden deneme mantığını uygulayın:
async function retryWithBackoff(fn, maxRetries = 3) {
for (let i = 0; i < maxRetries; i++) {
try {
return await fn();
} catch (error) {
if (i === maxRetries - 1) throw error;
await sleep(Math.pow(2, i) * 1000);
}
}
}
4. Kredi Kullanımını İzleyin
Kesinti yaşamamak için kredi tüketiminizi takip edin:
- Check credit balance before large batch operations
- Set up alerts for low credit thresholds
- Implement credit-aware request queuing
Başlamaya Hazır mısınız?
Harika içerikler oluşturmak için Runway Gen4 API kullanan binlerce geliştiriciye katılın