Entwickler-API

Lipsync API-Plattform

Erzeuge Lip-Sync-Videos programmatisch mit unserer leistungsstarken REST-API

API-Schlüssel

Verwalte deine Authentifizierungsschlüssel

Gib einen einprägsamen Namen an (optional)

Anmeldung erforderlich

Bitte melde dich an, um API-Schlüssel zu erstellen und zu verwalten.

Preise, die zu dir passen

Starte mit flexiblen und wettbewerbsfähigen Tarifen

API-Preise

Pay-as-you-go

Hinweis: API-Credits und Benutzer-Credits sind unabhängig und nicht austauschbar.

Preis
Credits

Hinweise:

Mindestabrechnung: 5 Sekunden pro Generierung
480p: 2 Credits pro Sekunde
720p: 4 Credits pro Sekunde
lipsync-image/video/multi 1080p: 6 Credits pro Sekunde, mindestens 30 Credits
lipsync-image/video/multi 2k: 7 Credits pro Sekunde, mindestens 35 Credits
lipsync-image/video/multi 4k: 8 Credits pro Sekunde, mindestens 40 Credits
talking-avatar: 720p/1080p/2k/4k kosten 4/6/8/9 Credits pro aufgerundeter Audiosekunde
lipsync-video: Ist das Video länger als das Audio, wird es gekürzt; ist das Audio länger, wird automatisch verlängert. Abrechnung: beim Kürzen nach Audiolänge, beim Verlängern nach Videolänge.
lipsync-image-multi: Bei "meanwhile" erfolgt die Abrechnung nach der maximalen Audiolänge; sonst nach Summe von "left_audio" und "right_audio".
Beispiel 1:
3 Sekunden Audio in 720p = 5 s × 4 = 20 Credits
(Mindestabrechnung gilt)
Beispiel 2:
10 Sekunden Audio in 480p = 10 × 2 = 20 Credits

Authentifizierung

Schütze deine API-Anfragen

Füge den API-Schlüssel in allen Anfragen im Authorization-Header ein:

Authorization: Bearer sk_XXXX_YYYY

Verfügbare Endpunkte

RESTful API-Endpunkte

POST/api/v1/lipsync-video

Video-zu-Video mit Audiotausch (Lip-Sync beibehalten)

POST/api/v1/lipsync-image

Bild + Audio → Einsprecher-Avatar

POST/api/v1/talking-avatar

Bild + Audio + Prompt -> Talking Avatar mit steuerbarer Mimik und Bewegung

POST/api/v1/lipsync-image-multi

Bild + zwei Audios → Mehrsprecher-Avatar (Gespräch/Dialog)

GET/api/v1/jobs/{requestId}

Jobstatus abfragen und Ergebnis abrufen

Aktueller API-Umfang

Eingaben, Datenschutz, Modellabdeckung und Produktionshinweise

Eingaben basieren auf URLs

Die öffentliche API akzeptiert derzeit Medien-URLs in JSON. Direkter multipart-Dateiupload und Asset-Upload-Endpunkte sind noch nicht verfügbar. Signierte oder temporäre URLs werden unterstützt, solange unsere Worker und der Generierungsanbieter sie während der Jobausführung abrufen können.

API-Ausgaben sind privat

API-Jobs werden mit privater Sichtbarkeit gespeichert. Der Web-Schalter Public gilt nicht für API-Anfragen, und derzeit gibt es keinen API-Parameter, um eine Generierung zu veröffentlichen.

Modellauswahl

Wählen Sie den Workflow über den Endpunkt: lipsync-image, lipsync-video oder lipsync-image-multi. Verwenden Sie talking-avatar für das Bildmodell mit Mimik- und Bewegungssteuerung.

Noch keine OpenAPI-Datei

Diese Seite ist die aktuelle API-Referenz. Eine maschinenlesbare OpenAPI/Swagger-Spezifikation ist derzeit nicht veröffentlicht.

Nicht unterstützte Steuerelemente

Seitenverhältnis, guidance scale und audio guidance sind für die aktuellen Lip-Sync-Endpunkte nicht als API-Parameter verfügbar.

Batch-Jobs

Senden Sie eine API-Anfrage pro Generierung. Bei großen Produktionsbatches müssen Eingabe-URLs bis zum Abschluss gültig bleiben; kontaktieren Sie den Support vor sehr hoher Parallelität.

Detaillierte Parameter

Vollständige Endpunktspezifikationen

Alle Endpunkte teilen eine gemeinsame Struktur: optionaler webhook und modellspezifische formState-Parameter.

POST /api/v1/lipsync-video

Ersetzt die Tonspur eines bestehenden Videos unter Beibehaltung des Lip-Syncs

Top-Level-Parameter:
webhookoptional

Deine Callback-URL (HTTPS). Wir senden das Ergebnis per POST nach Abschluss.

formStateerforderlich

Objekt mit allen Generierungsparametern (siehe unten).

formState-Parameter:
videoerforderlich

Öffentliche URL des Quellvideos (MP4, MOV, etc.)

audioerforderlich

Öffentliche URL des Audios (MP3, WAV, etc.)

resolutionerforderlich

"360p", "480p", "720p", "1080p", "2k" oder "4k"

mask_imageoptional

Öffentliche URL des Maskenbilds (beschränkt den Lip-Sync-Bereich)

promptoptional

Text für Stilvorgaben

seedoptional

Ganzzahliger Seed für Reproduzierbarkeit

Asynchroner Workflow

Wähle, wie du Ergebnisse erhältst

Alle API-Aufrufe sind asynchron. Sie haben zwei Möglichkeiten, Ergebnisse abzurufen:

Bei 1080p-, 2k- und 4k-Jobs geben Webhook- und Polling-Antworten nur das finale hochskalierte Video zurück.

Option 1: Webhook (Empfohlen)

Gib eine webhook-URL im JSON an. Wir senden das Ergebnis per POST nach Abschluss.

Webhook-URLs müssen öffentliche HTTPS-URLs sein. Wenn die Zustellung fehlschlägt, versuchen wir es bis zu 5 Mal mit exponentiellem Backoff erneut.

Vorteile:
  • Kein wiederholtes Polling nötig
  • Sofortige Benachrichtigung bei Abschluss
  • Effizienter für lang laufende Jobs (typisch 30–120 s)

Option 2: Polling

Lass webhook weg und nutze die zurückgegebene requestId, um alle 5–10 s GET /api/v1/jobs/{requestId} abzufragen, bis der Status "completed" ist.

Verwenden, wenn:
  • Kein öffentlicher Webhook-Endpunkt bereitgestellt werden kann
  • Testen oder Debugging

Beispiel mit 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:
{
  "requestId": "550e8400-e29b-41d4-a716-446655440000",
  "status": "processing",
  "message": "Task submitted successfully. Use requestId to query job status."
}

// 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
}

Talking Avatar Anfragebeispiel:

POST /api/v1/talking-avatar
Authorization: Bearer sk_XXXX_YYYY
Content-Type: application/json

{
  "webhook": "https://your-app.example.com/webhooks/lipsync",
  "formState": {
    "image": "https://.../character.png",
    "audio": "https://.../speech.mp3",
    "prompt": "Warm presentation style, natural facial expression, subtle head motion",
    "resolution": "1080p"
  }
}

// Completed webhook or polling response:
{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "model": "talking-avatar",
  "status": "completed",
  "output": "https://.../result.mp4",
  "error": "",
  "executionTime": 12345,
  "timings": null
}

Beispiel ohne 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:
{
  "requestId": "550e8400-e29b-41d4-a716-446655440000",
  "status": "processing",
  "message": "Task submitted successfully. Use requestId to query job status."
}

// 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-image",
  "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": "Generation failed. Please try again later.",
  "executionTime": null,
  "timings": null
}

Vollständige Codebeispiele

Sofort nutzbare Integrationsbeispiele

01Node.js mit Webhook (Empfohlen)

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.requestId);
  console.log('Waiting for webhook callback...');
  
  // You don't need to poll! The result will be POSTed to your webhook.
}

submitJobWithWebhook();