Skip to content
DashboardGet API Key

Generate lip sync from URLs

client.lipsync.generate(LipsyncGenerateParams { inputs, disable_active_speaker_detection, reference_id } body, RequestOptionsoptions?): LipsyncGenerate { request_id, status }
POST/v1/lipsync/generate

Starts a lip sync job from exactly one remote video URL and one remote audio URL. The response includes a request identifier to poll later.

ParametersExpand Collapse
body: LipsyncGenerateParams { inputs, disable_active_speaker_detection, reference_id }
inputs: Array<Input>

Exactly one video input and one audio input (order does not matter).

type: "video" | "audio"

Type of input media.

One of the following:
"video"
"audio"
url: string

URL of the media resource.

formaturi
disable_active_speaker_detection?: boolean

Disable active speaker detection and use max-face lipsync preprocessing.

reference_id?: string

Optional client-provided identifier for later retrieval.

ReturnsExpand Collapse
LipsyncGenerate { request_id, status }
request_id: string

Identifier of the created lip sync request.

formatuuid
status: "success"

Current state of the newly created request.

Generate lip sync from URLs

import Chamelaion from 'chamelaion';

const client = new Chamelaion({
  apiKey: process.env['CHAMELAION_API_KEY'], // This is the default and can be omitted
});

const lipsyncGenerate = await client.lipsync.generate({
  inputs: [
    { type: 'video', url: 'https://cdn.example.com/episodes/42.mp4' },
    { type: 'audio', url: 'https://cdn.example.com/dubs/42-japanese.wav' },
  ],
  reference_id: 'dub-episode-42',
});

console.log(lipsyncGenerate.request_id);
{
  "status": "success",
  "request_id": "6f82a2d8-a6d4-4e8a-a0fa-e8b09823a2d8"
}
{
  "error": "invalid request body"
}
{
  "error": "content-type must be application/json"
}
{
  "error": "expected exactly one video input"
}
{
  "error": "expected exactly one audio input"
}
{
  "error": "input type must be \"video\" or \"audio\""
}
{
  "error": "missing authorization header"
}
{
  "error": "invalid authorization format"
}
{
  "error": "missing token"
}
{
  "error": "invalid token"
}
{
  "error": "unauthorized"
}
{
  "error": "token limit reached"
}
{
  "error": "rate limit exceeded"
}
{
  "error": "internal error"
}
Returns Examples
{
  "status": "success",
  "request_id": "6f82a2d8-a6d4-4e8a-a0fa-e8b09823a2d8"
}
{
  "error": "invalid request body"
}
{
  "error": "content-type must be application/json"
}
{
  "error": "expected exactly one video input"
}
{
  "error": "expected exactly one audio input"
}
{
  "error": "input type must be \"video\" or \"audio\""
}
{
  "error": "missing authorization header"
}
{
  "error": "invalid authorization format"
}
{
  "error": "missing token"
}
{
  "error": "invalid token"
}
{
  "error": "unauthorized"
}
{
  "error": "token limit reached"
}
{
  "error": "rate limit exceeded"
}
{
  "error": "internal error"
}