使用我们强大的 REST API 以编程方式生成唇形同步视频
管理你的 API 认证密钥
给你的 API 密钥起一个易记的名称(可选)
需要登录
请登录以创建和管理 API 密钥。
以灵活与具竞争力的套餐开始使用
注意:API 点数与用户点数彼此独立,不能互相转换。
保障你的 API 请求安全
请在所有请求中将你的 API 密钥放入 Authorization 请求头:
Authorization: Bearer sk_XXXX_YYYY
RESTful API 接口
/api/v1/lipsync-video视频换音频(在现有视频中替换音频并保持唇形同步)
/api/v1/lipsync-image图片 + 音频 → 单人说话头像视频
/api/v1/lipsync-image-multi图片 + 双音频 → 多人对话头像视频
/api/v1/jobs/{requestId}查询任务状态并获取结果
完整的接口规范
所有接口共享相同结构,支持可选的 webhook 参数及按模型定义的 formState 参数。
在保持唇形同步的前提下,将现有视频中的音频替换为新的音频
webhook可选你的回调 URL(HTTPS)。任务完成后我们会向此地址发送 POST。
formState必填包含全部生成参数的对象(见下文)。
video必填源视频的公共 URL(MP4、MOV 等)
audio必填语音/替换音频的公共 URL(MP3、WAV 等)
resolution可选“480p”或“720p”(默认:480p)
mask_image可选遮罩图片的公共 URL(限制唇形同步作用区域)
prompt可选用于风格指导的文本提示
seed可选用于复现的整数随机种子
Choose how to receive your results
All API calls are asynchronous. You have two options to retrieve results:
Provide a webhook URL in the JSON body. We will POST the result to your endpoint when the job completes.
Omit the webhook parameter and use the returned requestId to poll GET /api/v1/jobs/{requestId} every 5-10 seconds until status is "completed".
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
}// 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
}Ready-to-use integration examples
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();