Runway Image Animation API

Professional image animation with cinema-quality results

✓ Cinema quality

✓ 16:9/9:16

✓ Pro tools

✓ Motion control

ਪ੍ਰਮਾਣਿਕਤਾ

Doitong API ਰਾਹੀਂ Runway Image-to-Video API ਤੱਕ ਪਹੁੰਚਣ ਲਈ, ਆਪਣੀ Doitong API key ਦੀ ਵਰਤੋਂ ਕਰੋ। ਇਸਨੂੰ GraphQL mutation ਜਾਂ REST API headers ਵਿੱਚ ਸ਼ਾਮਲ ਕਰੋ।

ਮਹੱਤਵਪੂਰਨ: ਆਪਣੀ Doitong API key ਨੂੰ ਸੁਰੱਖਿਅਤ ਰੱਖੋ ਅਤੇ ਇਸਨੂੰ ਕਦੇ ਵੀ ਕਲਾਇੰਟ-ਸਾਈਡ ਕੋਡ ਵਿੱਚ ਜ਼ਾਹਰ ਨਾ ਕਰੋ। ਹਮੇਸ਼ਾ ਆਪਣੇ ਬੈਕਐਂਡ ਸਰਵਰ ਤੋਂ API ਕਾਲਾਂ ਕਰੋ।
// GraphQL Header
{
  "Authorization": "Bearer YOUR_API_KEY"
}

// REST Header
"X-API-Key": "YOUR_API_KEY"

ਤੁਰੰਤ ਸ਼ੁਰੂਆਤ

ਸਿਰਫ਼ ਕੁਝ ਮਿੰਟਾਂ ਵਿੱਚ Runway Image-to-Video API ਨਾਲ ਸ਼ੁਰੂਆਤ ਕਰੋ। ਆਪਣੀ ਪਹਿਲੀ image to video ਬਣਾਉਣ ਲਈ ਇਹਨਾਂ ਸਧਾਰਨ ਕਦਮਾਂ ਦੀ ਪਾਲਣਾ ਕਰੋ।

ਕਦਮ 1: ਆਪਣੀ API Key ਪ੍ਰਾਪਤ ਕਰੋ

Doitong ਖਾਤੇ ਲਈ ਸਾਈਨ ਅੱਪ ਕਰੋ ਅਤੇ API key ਬਣਾਉਣ ਲਈ ਆਪਣੇ ਡੈਸ਼ਬੋਰਡ 'ਤੇ ਜਾਓ।

ਕਦਮ 2: ਆਪਣੀ ਪਹਿਲੀ ਬੇਨਤੀ ਕਰੋ

ਆਪਣੀ ਪਹਿਲੀ API ਕਾਲ ਕਰਨ ਲਈ ਹੇਠਾਂ ਦਿੱਤੇ ਕੋਡ ਉਦਾਹਰਨਾਂ ਵਿੱਚੋਂ ਇੱਕ ਦੀ ਵਰਤੋਂ ਕਰੋ।

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-i2v",
        "input": {
          "image": "https://example.com/your-image.jpg"
        },
        "options": {
          "duration": 5,
          "motionIntensity": "medium"
        }
      }
    }
  }'
const response = await fetch('https://api.doitong.com/graphql', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Authorization': 'Bearer YOUR_API_KEY'
  },
  body: JSON.stringify({
    query: `
      mutation AnimateImage($input: ImageAnimationInput!) {
        animateImage(input: $input) {
          id
          status
          url
        }
      }
    `,
    variables: {
      input: {
        service: 'runway-i2v',
        imageUrl: 'https://example.com/your-image.jpg',
        duration: 5,
        motionIntensity: 'medium'
      }
    }
  })
});

const data = await response.json();
console.log('Animated Video:', data.data.animateImage);
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-i2v",
        "input": {
            "imageUrl": "https://example.com/your-image.jpg"
        },
        "options": {
            "duration": 5,
            "motionIntensity": "medium"
        }
    }
}

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-i2v",
    "input": {
      "imageUrl": "https://example.com/your-image.jpg"
    },
    "options": {
      "duration": 5,
      "motionIntensity": "medium",
      "version": "gen-4"
    }
  }
}

ਕੀਮਤਾਂ

Runway Image-to-Video API ਕ੍ਰੈਡਿਟ-ਅਧਾਰਤ ਕੀਮਤ ਮਾਡਲ ਦੀ ਵਰਤੋਂ ਕਰਦਾ ਹੈ। ਬਣਾਈ ਗਈ ਸਮੱਗਰੀ ਦੀ ਜਟਿਲਤਾ ਅਤੇ ਮਿਆਦ ਦੇ ਅਧਾਰ 'ਤੇ ਕ੍ਰੈਡਿਟ ਵਰਤੇ ਜਾਂਦੇ ਹਨ।

ਵਿਸ਼ੇਸ਼ਤਾ ਕ੍ਰੈਡਿਟ ਵੇਰਵਾ
ਬੁਨਿਆਦੀ ਵਰਤੋਂ 10-50 ਕ੍ਰੈਡਿਟ ਸਟੈਂਡਰਡ ਕੁਆਲਿਟੀ ਅਤੇ ਮਿਆਦ
ਪ੍ਰੀਮੀਅਮ ਵਰਤੋਂ 100-500 ਕ੍ਰੈਡਿਟ ਉੱਚ ਗੁਣਵੱਤਾ ਅਤੇ ਵਿਸਤ੍ਰਿਤ ਵਿਸ਼ੇਸ਼ਤਾਵਾਂ

API ਐਂਡਪੁਆਇੰਟਸ

Runway Image-to-Video API ਸਾਡੇ ਯੂਨੀਫਾਈਡ GraphQL ਐਂਡਪੁਆਇੰਟ ਰਾਹੀਂ ਉਪਲਬਧ ਹੈ।

GraphQL ਐਂਡਪੁਆਇੰਟ

POST https://api.doitong.com/graphql

REST ਐਂਡਪੁਆਇੰਟ

POST https://api.doitong.com/v1/image_to_video

ਪੈਰਾਮੀਟਰ

Runway Image-to-Video API ਬੇਨਤੀਆਂ ਲਈ ਉਪਲਬਧ ਪੈਰਾਮੀਟਰ:

ਪੈਰਾਮੀਟਰ ਕਿਸਮ ਲੋੜੀਂਦਾ ਵੇਰਵਾ
service String Yes ਸਰਵਿਸ ਆਈਡੈਂਟੀਫਾਇਰ: "runway-i2v"
prompt String Yes ਕੀ ਜਨਰੇਟ ਕਰਨਾ ਹੈ ਉਸਦਾ ਟੈਕਸਟ ਵੇਰਵਾ
duration Integer No ਸੈਕਿੰਡਾਂ ਵਿੱਚ ਵੀਡੀਓ ਦੀ ਮਿਆਦ (ਡਿਫੌਲਟ: 5)
aspectRatio String No ਐਸਪੈਕਟ ਰੇਸ਼ੋ: "16:9", "9:16", "1:1" (ਡਿਫੌਲਟ: "16:9")
version String No Model version: "gen-2", "gen-3", "gen-4"
webhookUrl String No ਮੁਕੰਮਲ ਹੋਣ ਦੀਆਂ ਨੋਟੀਫਿਕੇਸ਼ਨਾਂ ਪ੍ਰਾਪਤ ਕਰਨ ਲਈ URL

ਜਵਾਬ ਫਾਰਮੈਟ

ਸਾਰੀਆਂ API ਪ੍ਰਤੀਕਿਰਿਆਵਾਂ ਇੱਕ ਨਿਰੰਤਰ ਫਾਰਮੈਟ ਦੀ ਪਾਲਣਾ ਕਰਦੀਆਂ ਹਨ:

ਸਫਲਤਾਪੂਰਵਕ ਜਵਾਬ

{
  "data": {
    "imagevideo": {
      "id": "abc123xyz",
      "status": "processing",
      "url": null,
      "webhookUrl": "https://your-webhook.com/callback",
      "createdAt": "2024-01-01T00:00:00Z"
    }
  }
}

ਮੁਕੰਮਲ ਹੋਇਆ ਜਵਾਬ

{
  "data": {
    "imagevideo": {
      "id": "abc123xyz",
      "status": "completed",
      "url": "https://cdn.doitong.com/outputs/abc123xyz.mp4",
      "duration": 5,
      "createdAt": "2024-01-01T00:00:00Z"
    }
  }
}

ਗਲਤੀ ਪ੍ਰਬੰਧਨ

API ਸਟੈਂਡਰਡ HTTP ਸਟੇਟਸ ਕੋਡਾਂ ਦੀ ਵਰਤੋਂ ਕਰਦਾ ਹੈ ਅਤੇ ਵਿਸਤ੍ਰਿਤ ਗਲਤੀ ਸੁਨੇਹੇ ਵਾਪਸ ਕਰਦਾ ਹੈ।

ਆਮ ਗਲਤੀ ਕੋਡ

ਸਟੇਟਸ ਕੋਡ ਗਲਤੀ ਦੀ ਕਿਸਮ ਵੇਰਵਾ
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

ਗਲਤੀ ਜਵਾਬ ਫਾਰਮੈਟ

{
  "errors": [
    {
      "message": "Insufficient credits for this operation",
      "extensions": {
        "code": "INSUFFICIENT_CREDITS",
        "creditsRequired": 100,
        "creditsAvailable": 50
      }
    }
  ]
}

Webhooks

ਜਦੋਂ ਤੁਹਾਡੀ image to video ਬਣ ਕੇ ਤਿਆਰ ਹੋ ਜਾਵੇ, ਤਾਂ ਰੀਅਲ-ਟਾਈਮ ਨੋਟੀਫਿਕੇਸ਼ਨ ਪ੍ਰਾਪਤ ਕਰੋ।

Webhooks ਸੈੱਟਅੱਪ ਕਰਨਾ

Include a <code>webhookUrl</code> parameter in your request to receive a POST notification when processing is complete.

Webhook ਪੇਲੋਡ

{
  "id": "abc123xyz",
  "status": "completed",
  "url": "https://cdn.doitong.com/outputs/abc123xyz.mp4",
  "service": "runway-i2v",
  "createdAt": "2024-01-01T00:00:00Z",
  "completedAt": "2024-01-01T00:01:00Z",
  "metadata": {
    "duration": 5,
    "width": 1920,
    "height": 1080
  }
}

Webhook ਸੁਰੱਖਿਆ

ਸਾਰੀਆਂ webhook ਬੇਨਤੀਆਂ ਵਿੱਚ ਪੁਸ਼ਟੀਕਰਨ ਲਈ ਇੱਕ ਸਿਗਨੇਚਰ ਹੈਡਰ ਸ਼ਾਮਲ ਹੁੰਦਾ ਹੈ:

X-Doitong-Signature: sha256=abc123...

ਦਰ ਸੀਮਾਵਾਂ

ਨਿਰਪੱਖ ਵਰਤੋਂ ਅਤੇ ਸਿਸਟਮ ਸਥਿਰਤਾ ਨੂੰ ਯਕੀਨੀ ਬਣਾਉਣ ਲਈ, ਹੇਠ ਲਿਖੀਆਂ ਦਰ ਸੀਮਾਵਾਂ ਲਾਗੂ ਹੁੰਦੀਆਂ ਹਨ:

ਪਲਾਨ ਬੇਨਤੀਆਂ/ਮਿੰਟ ਸਮਾਨੰਤਰ ਕੰਮ ਰੋਜ਼ਾਨਾ ਸੀਮਾ
ਮੁਫ਼ਤ 10 1 100
Starter 30 3 1,000
Pro 60 10 10,000
Enterprise ਕਸਟਮ ਕਸਟਮ ਅਸੀਮਤ
ਦਰ ਸੀਮਾ ਹੈਡਰ: ਮੌਜੂਦਾ ਸੀਮਾ ਸਥਿਤੀ ਲਈ ਜਵਾਬ ਹੈਡਰ ਚੈੱਕ ਕਰੋ:
  • X-RateLimit-Limit: Maximum requests per window
  • X-RateLimit-Remaining: Requests remaining
  • X-RateLimit-Reset: Window reset timestamp

ਵਧੀਆ ਅਭਿਆਸ

1. ਆਪਣੇ ਪ੍ਰੋਂਪਟਾਂ ਨੂੰ ਅਨੁਕੂਲ ਬਣਾਓ

ਵਧੀਆ ਨਤੀਜਿਆਂ ਲਈ ਸਪਸ਼ਟ ਅਤੇ ਵਰਣਨਯੋਗ ਪ੍ਰੋਂਪਟ ਲਿਖੋ:

  • Be specific about visual elements, style, and mood
  • Include details about lighting, camera angles, and composition
  • Avoid contradictory or impossible requests

2. ਅਸਿੰਕ੍ਰੋਨਸ ਪ੍ਰੋਸੈਸਿੰਗ ਨੂੰ ਸੰਭਾਲੋ

ਜਨਰੇਸ਼ਨ ਅਸਿੰਕ੍ਰੋਨਸ ਹੈ। ਸਹੀ ਪੋਲਿੰਗ ਜਾਂ webhooks ਲਾਗੂ ਕਰੋ:

// 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. ਗਲਤੀ ਰਿਕਵਰੀ

ਐਕਸਪੋਨੈਂਸ਼ੀਅਲ ਬੈਕਆਫ ਦੇ ਨਾਲ ਰੀਟ੍ਰਾਈ ਲੋਜਿਕ ਲਾਗੂ ਕਰੋ:

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. ਕ੍ਰੈਡਿਟ ਵਰਤੋਂ ਦੀ ਨਿਗਰਾਨੀ ਕਰੋ

ਰੁਕਾਵਟਾਂ ਤੋਂ ਬਚਣ ਲਈ ਆਪਣੇ ਕ੍ਰੈਡਿਟ ਦੀ ਖਪਤ ਨੂੰ ਟ੍ਰੈਕ ਕਰੋ:

  • Check credit balance before large batch operations
  • Set up alerts for low credit thresholds
  • Implement credit-aware request queuing

ਸ਼ੁਰੂ ਕਰਨ ਲਈ ਤਿਆਰ ਹੋ?

ਸ਼ਾਨਦਾਰ ਸਮੱਗਰੀ ਬਣਾਉਣ ਲਈ Runway Image-to-Video API ਦੀ ਵਰਤੋਂ ਕਰਨ ਵਾਲੇ ਹਜ਼ਾਰਾਂ ਡਿਵੈਲਪਰਾਂ ਵਿੱਚ ਸ਼ਾਮਲ ਹੋਵੋ

API Key ਪ੍ਰਾਪਤ ਕਰੋ ਕੀਮਤਾਂ ਦੇਖੋ