Hedra கதாபாத்திர அனிமேஷன்

சரியான ஆடியோ ஒத்திசைவுடன் கூடிய கதாபாத்திர அனிமேஷன். இயற்கையான உணர்ச்சிகள் மற்றும் அசைவுகளுடன் உருவப்படங்களுக்கு உயிர் கொடுங்கள்.

✓ கதாபாத்திர அனிமேஷன்

✓ ஆடியோ ஒத்திசைவு

✓ உருவப்படங்கள்

✓ உணர்ச்சி கட்டுப்பாடு

அங்கீகாரம்

Doitong API மூலம் Hedra-ஐ அணுக, உங்கள் Doitong API கீயைப் பயன்படுத்தவும். இதை GraphQL மியூட்டேஷன் அல்லது REST API ஹெடர்களில் சேர்க்கவும்.

முக்கியமானது: உங்கள் Doitong API கீயைப் பாதுகாப்பாக வைத்திருங்கள்; அதை ஒருபோதும் கிளையண்ட்-சைட் குறியீட்டில் பகிர வேண்டாம். எப்போதும் உங்கள் பேக்கெண்ட் சர்வரிலிருந்து API அழைப்புகளை மேற்கொள்ளுங்கள்.
// GraphQL Header
{
  "Authorization": "Bearer YOUR_API_KEY"
}

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

விரைவான தொடக்கம்

சில நிமிடங்களில் Hedra Lip Sync API-ஐப் பயன்படுத்தத் தொடங்குங்கள். உங்கள் முதல் avatar-ஐ உருவாக்க இந்த எளிய வழிமுறைகளைப் பின்பற்றவும்.

படி 1: உங்கள் API கீயைப் பெறுங்கள்

Doitong கணக்கிற்குப் பதிவு செய்து, API கீயை உருவாக்க உங்கள் டேஷ்போர்டிற்குச் செல்லவும்.

படி 2: உங்கள் முதல் கோரிக்கையை அனுப்பவும்

உங்கள் முதல் API அழைப்பை மேற்கொள்ள கீழே உள்ள குறியீடு உதாரணங்களில் ஒன்றைப் பயன்படுத்தவும்.

curl -X POST https://api.doitong.com/graphql \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{
    "query": "mutation Generate($input: GenerateInput!) { generate(input: $input) { id status type provider url metadata creditCost } }",
    "variables": {
      "input": {
        "type": "AVATAR",
        "provider": "hedra",
        "input": {
          "text": "Hello, welcome to our platform!",
          "avatarId": "professional-1"
        },
        "options": {
          "voice": "en-US-neural"
        }
      }
    }
  }'
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 GenerateAvatar($input: AvatarGenerationInput!) {
        generateAvatar(input: $input) {
          id
          status
          videoUrl
        }
      }
    `,
    variables: {
      input: {
        service: 'hedra',
        text: 'Hello, welcome to our platform!',
        avatarId: 'professional-1',
        voice: 'en-US-neural'
      }
    }
  })
});

const data = await response.json();
console.log('Avatar Video:', data.data.generateAvatar);
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": "AVATAR",
        "provider": "hedra",
        "input": {
            "text": "Hello, welcome to our platform!",
            "avatarId": "professional-1"
        },
        "options": {
            "voice": "en-US-neural"
        }
    }
}

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": "AVATAR",
    "provider": "hedra",
    "input": {
      "text": "Hello, welcome to our platform!",
      "avatarId": "professional-1"
    },
    "options": {
      "voice": "en-US-neural",
      "language": "en",
      "version": "hedra-1.0"
    }
  }
}

கட்டண விவரம்

Hedra Lip Sync API கிரெடிட் அடிப்படையிலான கட்டண முறையைப் பயன்படுத்துகிறது. உருவாக்கப்பட்ட உள்ளடக்கத்தின் சிக்கல் மற்றும் கால அளவைப் பொறுத்து கிரெடிட்கள் பயன்படுத்தப்படும்.

அம்சம் கிரெடிட்கள் விளக்கம்
குறுகிய வீடியோ 50-100 கிரெடிட்கள் 30 வினாடிகள் வரை
நீண்ட வீடியோ 200-500 கிரெடிட்கள் 30 வினாடிகள் முதல் 2 நிமிடங்கள் வரை

API எண்ட்பாயிண்டுகள்

Hedra Lip Sync API எங்களின் ஒருங்கிணைந்த GraphQL எண்ட்பாயிண்ட் மூலம் கிடைக்கிறது.

GraphQL எண்ட்பாயிண்ட்

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

REST எண்ட்பாயிண்ட்

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

அளவுருக்கள் (Parameters)

Hedra Lip Sync API கோரிக்கைகளுக்கான அளவுருக்கள்:

அளவுரு வகை கட்டாயம் விளக்கம்
service ஸ்ட்ரிங் Yes சேவை அடையாளங்காட்டி: "hedra"
version ஸ்ட்ரிங் No Model version: "hedra-1.0"
webhookUrl ஸ்ட்ரிங் No முடிவு அறிவிப்புகளைப் பெறுவதற்கான URL

பதில் வடிவம் (Response Format)

அனைத்து API பதில்களும் சீரான வடிவத்தைப் பின்பற்றுகின்றன:

வெற்றிகரமான பதில்

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

பூர்த்தி செய்யப்பட்ட பதில்

{
  "data": {
    "avatar": {
      "id": "abc123xyz",
      "status": "completed",
      "url": "https://cdn.doitong.com/outputs/abc123xyz.mp3",
      "duration": null,
      "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)

உங்கள் avatar உருவாக்கம் முடிந்ததும் உடனுக்குடன் அறிவிப்புகளைப் பெறுங்கள்.

வெப்ஹூக்குகளை அமைத்தல்

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

வெப்ஹூக் பேலோட்

{
  "id": "abc123xyz",
  "status": "completed",
  "url": "https://cdn.doitong.com/outputs/abc123xyz.mp3",
  "service": "hedra",
  "createdAt": "2024-01-01T00:00:00Z",
  "completedAt": "2024-01-01T00:01:00Z",
  "metadata": {
    "duration": null,
    "width": null,
    "height": null
  }
}

வெப்ஹூக் பாதுகாப்பு

அனைத்து வெப்ஹூக் கோரிக்கைகளும் சரிபார்ப்பிற்கான சிக்னேச்சர் ஹெடரைக் கொண்டிருக்கும்:

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

வேகக் கட்டுப்பாடுகள்

நியாயமான பயன்பாடு மற்றும் கணினி நிலைத்தன்மையை உறுதிப்படுத்த, பின்வரும் வேகக் கட்டுப்பாடுகள் பொருந்தும்:

திட்டம் கோரிக்கைகள்/நிமிடம் ஒரே நேரத்தில் நடக்கும் பணிகள் தினசரி வரம்பு
இலவசம் 10 1 100
ஸ்டார்ட்டர் 30 3 1,000
புரோ 60 10 10,000
என்டர்பிரைஸ் தனிப்பயன் தனிப்பயன் வரம்பற்றது
ரேட் லிமிட் ஹெடர்கள்: தற்போதைய வரம்பு நிலையை அறிய பதில் ஹெடர்களைச் சரிபார்க்கவும்:
  • 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. ஏசின்க் (Async) செயலாக்கத்தைக் கையாளுதல்

உருவாக்கம் ஒத்திசைவற்றது (Asynchronous). முறையான போலிங் (polling) அல்லது வெப்ஹூக்குகளைச் செயல்படுத்தவும்:

// 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. பிழை மீட்பு

எக்ஸ்போனென்ஷியல் பேக்-ஆஃப் (exponential backoff) முறையுடன் மீண்டும் முயற்சிக்கும் லாஜிக்கைச் செயல்படுத்தவும்:

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

தொடங்கத் தயாரா?

அற்புதமான உள்ளடக்கத்தை உருவாக்க Hedra Lip Sync API-ஐப் பயன்படுத்தும் ஆயிரக்கணக்கான டெவலப்பர்களுடன் இணையுங்கள்

API கீயைப் பெறுங்கள் கட்டணங்களைப் பார்க்க