واجهة برمجة التطبيقات للمطورين

منصّة Lipsync API

أنشئ فيديوهات مزامنة الشفاه برمجياً عبر واجهة REST القوية

مفاتيح API

إدارة مفاتيح المصادقة الخاصة بك

امنح المفتاح اسماً يسهل تذكره (اختياري)

يتطلب تسجيل الدخول

يرجى تسجيل الدخول لإنشاء مفاتيح API وإدارتها.

أسعار تناسبك

ابدأ بخطط مرنة وتنافسية

تسعير API

ادفع حسب الاستخدام

ملاحظة: أرصدة API وأرصدة المستخدم منفصلة وغير قابلة للاستبدال.

السعر
الأرصدة
لكل رصيد

ملاحظات:

الحد الأدنى للاقتطاع: 5 ثوانٍ لكل عملية إنشاء
دقة 480p: رصيدَان لكل ثانية
دقة 720p: 4 أرصدة لكل ثانية
lipsync-video: إذا كان الفيديو أطول من الصوت سيتم اقتطاعه؛ وإذا كان الصوت أطول سيتم تمديده تلقائياً. الفوترة تعتمد على طول الصوت عند الاقتطاع وعلى طول الفيديو عند التمديد.
lipsync-image-multi: إذا كانت القيمة "meanwhile"، تُستخدم أطول مدة صوت؛ وإلا فتُستخدم مجموع مدة "left_audio" و"right_audio".
مثال 1:
صوت مدته 3 ثوانٍ بدقة 720p = 5 ث × 4 = 20 رصيداً
(تطبق حد الاقتطاع الأدنى)
مثال 2:
صوت مدته 10 ثوانٍ بدقة 480p = 10 × 2 = 20 رصيداً

المصادقة

أمّن طلبات API الخاصة بك

ضمِّن مفتاح API في ترويسة Authorization لجميع الطلبات:

Authorization: Bearer sk_XXXX_YYYY

نقاط النهاية المتاحة

نقاط نهاية RESTful

POST/api/v1/lipsync-video

استبدال الصوت في فيديو موجود مع الحفاظ على مزامنة الشفاه

POST/api/v1/lipsync-image

صورة + صوت → فيديو أفاتار لمتحدث واحد

POST/api/v1/lipsync-image-multi

صورة + صوتان → أفاتار لعدة متحدثين (حوار/محادثة)

GET/api/v1/jobs/{requestId}

استعلم عن حالة المهمة واسترجع النتيجة

المعلمات التفصيلية

مواصفات كاملة لنقاط النهاية

تتشارك جميع نقاط النهاية بنيةً عامة: باراميتر webhook اختياري ومعلمات formState خاصة بكل نموذج.

POST /api/v1/lipsync-video

يستبدل الصوت في فيديو موجود مع الحفاظ على تزامن الشفاه

معلمات المستوى الأعلى:
webhookاختياري

عنوان URL لرد النداء (HTTPS). سنرسل النتيجة عبر POST عند الاكتمال.

formStateمطلوب

كائن يحتوي جميع معلمات الإنشاء (انظر أدناه).

معلمات formState:
videoمطلوب

عنوان URL عام للفيديو المصدر (MP4، MOV، إلخ)

audioمطلوب

عنوان URL عام للصوت (MP3، WAV، إلخ)

resolutionاختياري

"480p" أو "720p" (الافتراضي: 480p)

mask_imageاختياري

عنوان URL عام لصورة القناع (يقيّد منطقة مزامنة الشفاه)

promptاختياري

نص إرشادي للنمط

seedاختياري

بذرة عددية للتكرارية

Async Workflow

Choose how to receive your results

All API calls are asynchronous. You have two options to retrieve results:

Option 1: Webhook (Recommended)

Provide a webhook URL in the JSON body. We will POST the result to your endpoint when the job completes.

Benefits:
  • No need to poll repeatedly
  • Instant notification when job completes
  • More efficient for long-running jobs (30-120 seconds typical)

Option 2: Polling

Omit the webhook parameter and use the returned requestId to poll GET /api/v1/jobs/{requestId} every 5-10 seconds until status is "completed".

Use when:
  • You cannot expose a public webhook endpoint
  • Testing or debugging

Example with Webhook:

POST /api/v1/lipsync-image
Authorization: Bearer sk_XXXX_YYYY
Content-Type: application/json

{
  "webhook": "https://your-app.example.com/webhooks/lipsync",
  "formState": {
    "image": "https://.../face.png",
    "audio": "https://.../voice.mp3",
    "resolution": "720p",
    "seed": 42
  }
}

// Immediate Response:
{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "status": "processing"
}

// Later, when job completes, we POST to your webhook:
POST https://your-app.example.com/webhooks/lipsync
Content-Type: application/json

{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "model": "lipsync-image",
  "status": "completed",
  "output": "https://.../result.mp4",
  "error": "",
  "executionTime": 12345,
  "timings": null
}

Example without Webhook (Polling):

// Step 1: Submit job (no webhook parameter)
POST /api/v1/lipsync-image
Authorization: Bearer sk_XXXX_YYYY
Content-Type: application/json

{
  "formState": {
    "image": "https://.../face.png",
    "audio": "https://.../voice.mp3",
    "resolution": "720p"
  }
}

// Immediate Response:
{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "status": "processing"
}

// Step 2: Poll for status (repeat every 5-10 seconds)
GET /api/v1/jobs/550e8400-e29b-41d4-a716-446655440000
Authorization: Bearer sk_XXXX_YYYY

// Response while processing:
{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "model": "lipsync",
  "status": "processing",
  "output": null,
  "error": "",
  "executionTime": null,
  "timings": null
}

// Response when completed:
{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "model": "lipsync-image",
  "status": "completed",
  "output": "https://.../result.mp4",
  "error": "",
  "executionTime": 12345,
  "timings": null
}

// Response if failed:
{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "model": "lipsync-image",
  "status": "failed",
  "output": null,
  "error": "Invalid audio format",
  "executionTime": null,
  "timings": null
}

Complete Code Examples

Ready-to-use integration examples

Node.js with Webhook (Recommended)

import fetch from 'node-fetch';
import express from 'express';

const API_KEY = 'Bearer sk_XXXX_YYYY';
const BASE_URL = 'https://lipsync.studio/api/v1';

// Set up webhook server to receive results
const app = express();
app.use(express.json());

app.post('/webhooks/lipsync', (req, res) => {
  const { id, status, output, error, model } = req.body;
  
  console.log('✅ Job update received!');
  console.log('Job ID:', id);
  console.log('Model:', model);
  console.log('Status:', status);
  if (status === 'completed') {
    console.log('Video URL:', output);
  } else if (status === 'failed') {
    console.error('Error:', error);
  }
  
  // TODO: Save output URL to your database, send notification, etc.
  
  res.status(200).json({ received: true });
});

app.listen(3000, () => {
  console.log('Webhook server listening on port 3000');
});

// Submit job with webhook
async function submitJobWithWebhook() {
  const webhookUrl = 'https://your-public-domain.com/webhooks/lipsync';
  
  const res = await fetch(`${BASE_URL}/lipsync-image`, {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
      'Authorization': API_KEY
    },
    body: JSON.stringify({
      webhook: webhookUrl,
      formState: {
        image: 'https://example.com/portrait.jpg',
        audio: 'https://example.com/speech.mp3',
        resolution: '720p'
      }
    })
  });
  
  const data = await res.json();
  console.log('Job submitted:', data.id);
  console.log('Waiting for webhook callback...');
  
  // You don't need to poll! The result will be POSTed to your webhook.
}

submitJobWithWebhook();