audiostringrequired
Input audio URL.
heygen/lipsync/precisionHeyGen v3 Lipsync (precision) replaces the speech in a video and re-syncs the speaker's lips to the new audio.
Try the model
Customize your input with more control.
What would you like to do next?
Select an example to load its inputs and result into the playground.
{
"audio": "https://static.sandbase.ai/examples/3c0d2094-8315-4f9f-bfbd-1a209d8ab9e0/input/733399b2-2dc9-4da1-93ed-5b156997b3c6.mp3",
"video": "https://static.sandbase.ai/examples/3c0d2094-8315-4f9f-bfbd-1a209d8ab9e0/input/c517493c-b3d5-4f92-be2f-684336862d50.mp4"
}HeyGen Lipsync (precision) replaces the speech in a video and re-syncs the speaker's lips to new audio. Precision gives the best sync.
| Field | Type | Default | Notes |
|---|---|---|---|
video | video URL, required | — | Video with the speaker. |
audio | audio URL, required | — | New speech. |
disable_music_track | boolean | false | Drop background music. |
enable_caption | boolean | false | Burn in captions. |
enable_dynamic_duration | boolean | true | Adjust video length to the new audio. |
enable_speech_enhancement | boolean | false | Clean up the new speech. |
end_time | number | — | Optional end of the section. |
start_time | number | — | Optional start of the section to sync (seconds). |
$0.10 per output second. The quote before submission assumes 5 seconds.
| Output | Price |
|---|---|
| 5s | $0.50 |
| 30s | $3.00 |
| 60s | $6.00 |
Failed runs are not charged.
Related: heygen/lipsync/speed, sync/lipsync/3.0/video-to-video.
Start building
Submit this model through the SandBase Unified Run API.
# The quoted heredoc keeps Unicode and shell metacharacters unchanged.
result=$(curl --fail-with-body --silent \
-X POST "https://api.sandbase.ai/v1/run" \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
-H "Content-Type: application/json" \
--data-binary @- <<'SANDBASE_JSON'
{
"model": "heygen/lipsync/precision",
"audio": "https://v3.fal.media/files/rabbit/Ql3ade3wEKlZXRQLRbhxm_tts.mp3",
"video": "https://media.sandbase.ai/files/922d1013-9018-4956-a39d-d0859149ba76/0.mp4",
"enable_caption": false,
"disable_music_track": false,
"enable_dynamic_duration": true,
"enable_speech_enhancement": false
}
SANDBASE_JSON
)
run_id=$(printf '%s' "$result" | jq -r .id)
for attempt in $(seq 1 120); do
status=$(printf '%s' "$result" | jq -r .status)
case "$status" in completed|failed|timeout) break ;; esac
sleep 2
result=$(curl --fail-with-body --silent \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
"https://api.sandbase.ai/v1/run/$run_id")
done
status=$(printf '%s' "$result" | jq -r .status)
[ "$status" = completed ] || { echo "Generation ended: $status" >&2; exit 1; }
printf '%s\n' "$result"Create a SandBase API key and set it in your server environment. All requests use Bearer authentication.
export SANDBASE_API_KEY="YOUR_API_KEY"Keep the key on your server. Do not expose it in browser code or commit it to a repository.
POST to /v1/run with this model ID and its inputs. The request example above includes submission and polling.
Use the returned run ID to poll until the status is completed, failed or timeout. Read output only after completed.
curl "https://api.sandbase.ai/v1/run/$RUN_ID" \
-H "Authorization: Bearer $SANDBASE_API_KEY"Pass a publicly accessible file URL in the model’s image, video or audio field. Supported formats and limits are shown beside each Playground input.
Use the upload or replace control on supported image fields in the Playground. Video URL fields accept a hosted driving video; they do not imply video-upload support.
audiostringrequiredInput audio URL.
videostringrequiredInput video URL.
end_timenumberEnd time (seconds) for partial lipsync.
Minimum: 0
start_timenumberStart time (seconds) for partial lipsync.
Minimum: 0
enable_captionbooleanBurn in captions.
Default: false
disable_music_trackbooleanRemove background music from the source video.
Default: false
enable_dynamic_durationbooleanAllow the video length to follow the new audio.
Default: true
enable_speech_enhancementbooleanEnhance the replacement audio.
Default: false
{
"model": "heygen/lipsync/precision",
"audio": "https://v3.fal.media/files/rabbit/Ql3ade3wEKlZXRQLRbhxm_tts.mp3",
"video": "https://media.sandbase.ai/files/922d1013-9018-4956-a39d-d0859149ba76/0.mp4",
"enable_caption": false,
"disable_music_track": false,
"enable_dynamic_duration": true,
"enable_speech_enhancement": false
}A completed run exposes its result in output. The following is the model’s saved example, not a new generation.
[
{
"poster": "https://static.sandbase.ai/examples/posters/160849037f6b829828c6.jpg",
"source": "heygen schema mirror",
"source_url": "https://heygen.example/",
"url": "https://static.sandbase.ai/examples/3c0d2094-8315-4f9f-bfbd-1a209d8ab9e0/output/2c878a19-1725-4c94-adc2-1a59986d8302.mp4"
}
]