API reference · KwaiVGI

kwaivgi/kling-video/lipsync/text-to-video

Integrate this model through SandBase's unified API, with production-ready schemas and examples.

VIDEOAsyncOpen model
Production endpoint

Send your first request

OpenAI-compatible endpoint with unified authentication and usage tracking.

POSThttps://api.sandbase.ai/v1/run
Model IDkwaivgi/kling-video/lipsync/text-to-video
01

Input Schema

5 parameters · 0 required · 5 optional

ParameterTypeRequiredDescription
textstringOptionalText content for lip-sync video generation. Max 120 characters. · Max length: 120
videostringOptionalThe URL of the video to generate the lip sync for. Supports .mp4/.mov, ≤100MB, 2-60s, 720p/1080p only, width/height 720–1920px. If validation fails, an error is returned.
voice_idstringOptionalVoice ID to use for speech synthesis · Options: genshin_vindi2, zhinen_xuesheng, AOT, ai_shatang, genshin_klee2, genshin_kirara, ai_kaiya, oversea_male1, ai_chenjiahao_712, girlfriend_4_speech02, chat1_female_new-3, chat_0407_5-1, cartoon-boy-07, uk_boy1, cartoon-girl-01, PeppaPig_platform, ai_huangzhong_712, ai_huangyaoshi_712, ai_laoguowang_712, chengshu_jiejie, you_pingjing, calm_story1, uk_man2, laopopo_speech02, heainainai_speech02, reader_en_m-v1, commercial_lady_en_f-v1, tiyuxi_xuedi, tiexin_nanyou, girlfriend_1_speech02, girlfriend_2_speech02, zhuxi_speech02, uk_oldman3, dongbeilaotie_speech02, chongqingxiaohuo_speech02, chuanmeizi_speech02, chaoshandashu_speech02, ai_taiwan_man2_speech02, xianzhanggui_speech02, tianjinjiejie_speech02, diyinnansang_DB_CN_M_04-v2, yizhipiannan-v1, guanxiaofang-v2, tianmeixuemei-v1, daopianyansang-v1, mengwa-v1
genshin_vindi2zhinen_xueshengAOTai_shatanggenshin_klee2genshin_kiraraai_kaiyaoversea_male1ai_chenjiahao_712girlfriend_4_speech02chat1_female_new-3chat_0407_5-1cartoon-boy-07uk_boy1cartoon-girl-01PeppaPig_platformai_huangzhong_712ai_huangyaoshi_712ai_laoguowang_712chengshu_jiejieyou_pingjingcalm_story1uk_man2laopopo_speech02heainainai_speech02reader_en_m-v1commercial_lady_en_f-v1tiyuxi_xueditiexin_nanyougirlfriend_1_speech02girlfriend_2_speech02zhuxi_speech02uk_oldman3dongbeilaotie_speech02chongqingxiaohuo_speech02chuanmeizi_speech02chaoshandashu_speech02ai_taiwan_man2_speech02xianzhanggui_speech02tianjinjiejie_speech02diyinnansang_DB_CN_M_04-v2yizhipiannan-v1guanxiaofang-v2tianmeixuemei-v1daopianyansang-v1mengwa-v1
voice_speednumberOptionalSpeech rate for Text to Video generation · Min: 0.8 · Max: 2 · Default: 1
voice_languagestringOptionalThe voice language corresponding to the Voice ID · Options: zh, en · Default: "en"
zhen
02

Output Schema

FieldTypeDescription
idstringUnique identifier for the generation task
statusstringTask status: pending, running, completed, failed, timeout
modelstringModel used for the generation
outputsarrayArray of output items
outputs[].urlstringURL of the generated artifact
outputs[].content_typestringMIME type (e.g. image/png, video/mp4)
errorobject | nullError details if failed, null on success
error.typestringMachine-readable error type code
error.messagestringHuman-readable error description

Async Workflow

This model uses asynchronous execution. Submit a request and poll for the result.

  1. Submit — POST to /v1/run, receive an id
  2. Poll — GET /v1/run/{id} until status is completed, failed, or timeout
  3. Retrieve — Read outputs from the completed response
03

Code Examples

Ready-to-run snippets

const apiKey = process.env.SANDBASE_API_KEY;
const response = await fetch("https://api.sandbase.ai/v1/run", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${apiKey}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "model": "kwaivgi/kling-video/lipsync/text-to-video",
    "text": "Mental health is as important as physical health, shaping our emotions, thoughts, and daily interactions.",
    "video": "https://static.sandbase.ai/examples/kwaivgi/kling-video/lipsync/text-to-video/input_video_0.mp4",
    "voice_id": "genshin_klee2",
    "voice_speed": 1,
    "voice_language": "en"
  }),
});

if (!response.ok) throw new Error(await response.text());
let result = await response.json();
for (let attempt = 0; attempt < 120 && !["completed", "failed", "timeout"].includes(result.status); attempt++) {
  await new Promise((resolve) => setTimeout(resolve, 2_000));
  const poll = await fetch(`https://api.sandbase.ai/v1/run/${result.id}`, {
    headers: { Authorization: `Bearer ${apiKey}` },
  });
  if (!poll.ok) throw new Error(await poll.text());
  result = await poll.json();
}
if (result.status !== "completed") throw new Error(`Generation ended: ${result.status}`);
console.log(result);