This endpoint allows users to replace a specific time segment of an audio clip using a textual prompt and optional lyrics. The inpainting operation blends new audio content into the selected range, guided by user-defined style and voice preferences.
To use the inpaint feature, upload a song and specify the lyrics you want to replace in the field βlyrics_section_to_replaceβ. For best results, also provide the complete song lyrics in the lyrics.
| Parameter | Type | Required | Description |
|---|---|---|---|
audio_file | UploadFile | Optional | Upload the input audio file. Required if audio_url is not provided. |
audio_url | String | Optional | Public/S3/YouTube URL of the input audio. Required if audio_file is not provided. |
prompt | String | Required | Prompt describing how the replacement should sound. Example: βReplace this part with an opera-style vocal.β |
replace_start_at | Float | Required | Start time (in seconds) of the segment to replace. |
replace_end_at | Float | Required | End time (in seconds) of the segment to replace. |
lyrics | String | Optional | Original lyrics of song. |
lyrics_section_to_replace | String | Optional | Lyrics to be used for the replaced portion(optional, max 3000 characters) |
gender | String | Optional | Voice style for vocal generation. One of: male, female, neutral. |
webhook_url | String | Optional | Callback URL for async response. |
π‘ Note: You must provide eitheraudio_fileoraudio_urlβ at least one is required.
content-type: multipart/form-data
π Replace{path_to_your_audio_file},api_key, andwebhook_urlbefore executing.
Webhook responses include detailed metadata including task_id, conversion_id, audio files (conversion_path), lyrics etc.
prompt, replace_start_at, or replace_end_at, or neither audio_file nor audio_url provided.URL or S3 path to the input audio.
"https://mybucket.s3.amazonaws.com/song.mp3"
A description of how the replacement should sound.
"Replace this part with an opera-style vocal."
Time in seconds to start replacing audio.
12.5
Time in seconds to stop replacing audio.
20
Uploaded input audio file.
Lyrics to be used for inpainting.
"This is where my story begins"
Lyrics to be used for the replaced portion(optional, max 3000 characters)
2000Voice style for the inpainted segment.
male, female, neutral "male"
Callback URL for async processing results.
"https://example.com/webhook"