Python
import requests
url = "https://api.wav.com/api/public/v1/inpaint"
headers = {"Authorization": "<API_KEY>"}
data = {
"prompt": "Add a soft guitar solo here",
"replace_start_at": 12.5,
"replace_end_at": 20.0,
"lyrics": "This is where my story begins",
"lyrics_section_to_replace": "New lyrics",
"gender": "",
"num_outputs": 2,
"title": "My Generated Track",
"generate_album_cover": false,
"lyrics_timestamps": false,
"webhook_url": "https://example.com/webhook"
}
# Option 1: audio_url
data["audio_url"] = "<YOUR_AUDIO_URL>"
response = requests.post(url, headers=headers, data=data)
# Option 2: File Upload
# with open("song.mp3", "rb") as f:
# files = {"audio_file": f}
# response = requests.post(url, headers=headers, data=data, files=files)
print(response.json())curl --request POST \
--url https://api.wav.com/api/public/v1/inpaint \
--header 'Authorization: <api-key>' \
--header 'Content-Type: multipart/form-data' \
--form 'audio_url=<string>' \
--form 'prompt=Replace this part with an opera-style vocal.' \
--form replace_start_at=15 \
--form replace_end_at=60 \
--form 'audio_file=<string>' \
--form 'lyrics=This is where my story begins' \
--form 'lyrics_section_to_replace=<string>' \
--form gender= \
--form num_outputs=123 \
--form 'title=<string>' \
--form generate_album_cover=false \
--form lyrics_timestamps=false \
--form webhook_url=https://example.com/webhookconst form = new FormData();
form.append('audio_url', '<string>');
form.append('prompt', 'Replace this part with an opera-style vocal.');
form.append('replace_start_at', '15');
form.append('replace_end_at', '60');
form.append('audio_file', '<string>');
form.append('lyrics', 'This is where my story begins');
form.append('lyrics_section_to_replace', '<string>');
form.append('gender', '');
form.append('num_outputs', '123');
form.append('title', '<string>');
form.append('generate_album_cover', 'false');
form.append('lyrics_timestamps', 'false');
form.append('webhook_url', 'https://example.com/webhook');
const options = {method: 'POST', headers: {Authorization: '<api-key>'}};
options.body = form;
fetch('https://api.wav.com/api/public/v1/inpaint', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.wav.com/api/public/v1/inpaint",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"audio_url\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"prompt\"\r\n\r\nReplace this part with an opera-style vocal.\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"replace_start_at\"\r\n\r\n15\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"replace_end_at\"\r\n\r\n60\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"audio_file\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"lyrics\"\r\n\r\nThis is where my story begins\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"lyrics_section_to_replace\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"gender\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"num_outputs\"\r\n\r\n123\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"title\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"generate_album_cover\"\r\n\r\nfalse\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"lyrics_timestamps\"\r\n\r\nfalse\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"webhook_url\"\r\n\r\nhttps://example.com/webhook\r\n-----011000010111000001101001--",
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: multipart/form-data; boundary=---011000010111000001101001"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.wav.com/api/public/v1/inpaint"
payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"audio_url\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"prompt\"\r\n\r\nReplace this part with an opera-style vocal.\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"replace_start_at\"\r\n\r\n15\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"replace_end_at\"\r\n\r\n60\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"audio_file\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"lyrics\"\r\n\r\nThis is where my story begins\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"lyrics_section_to_replace\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"gender\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"num_outputs\"\r\n\r\n123\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"title\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"generate_album_cover\"\r\n\r\nfalse\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"lyrics_timestamps\"\r\n\r\nfalse\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"webhook_url\"\r\n\r\nhttps://example.com/webhook\r\n-----011000010111000001101001--")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "multipart/form-data; boundary=---011000010111000001101001")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.wav.com/api/public/v1/inpaint")
.header("Authorization", "<api-key>")
.header("Content-Type", "multipart/form-data; boundary=---011000010111000001101001")
.body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"audio_url\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"prompt\"\r\n\r\nReplace this part with an opera-style vocal.\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"replace_start_at\"\r\n\r\n15\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"replace_end_at\"\r\n\r\n60\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"audio_file\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"lyrics\"\r\n\r\nThis is where my story begins\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"lyrics_section_to_replace\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"gender\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"num_outputs\"\r\n\r\n123\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"title\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"generate_album_cover\"\r\n\r\nfalse\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"lyrics_timestamps\"\r\n\r\nfalse\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"webhook_url\"\r\n\r\nhttps://example.com/webhook\r\n-----011000010111000001101001--")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.wav.com/api/public/v1/inpaint")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'multipart/form-data; boundary=---011000010111000001101001'
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"audio_url\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"prompt\"\r\n\r\nReplace this part with an opera-style vocal.\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"replace_start_at\"\r\n\r\n15\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"replace_end_at\"\r\n\r\n60\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"audio_file\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"lyrics\"\r\n\r\nThis is where my story begins\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"lyrics_section_to_replace\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"gender\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"num_outputs\"\r\n\r\n123\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"title\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"generate_album_cover\"\r\n\r\nfalse\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"lyrics_timestamps\"\r\n\r\nfalse\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"webhook_url\"\r\n\r\nhttps://example.com/webhook\r\n-----011000010111000001101001--"
response = http.request(request)
puts response.read_body{
"success": true,
"message": "Inpaint request submitted successfully",
"task_id": "070093dd-f1e9-4d7e-a6b3-ab6ecd237e38",
"conversion_id_1": "7cac10af-9007-449f-b3ab-f60b05d23309",
"conversion_id_2": "e85848c9-8feb-4cd8-85ef-456651a697b5",
"is_flagged": false,
"reason": "",
"eta": 123,
"status": "IN_QUEUE",
"credit_estimate": 0.12,
"error_message": "",
"error_message_detail": "",
"missing_input_fields": "",
"predicted_user_intent": ""
}{
"success": false,
"error_code": "INSUFFICIENT_CREDITS",
"message": ""
}{
"success": false,
"error_code": "UNPROCESSABLE_CONTENT",
"message": ""
}{
"success": false,
"error_code": "INTERNAL_SERVER_ERROR",
"message": ""
}Conversion Endpoints
Inpaint
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.
POST
/
v1
/
inpaint
Python
import requests
url = "https://api.wav.com/api/public/v1/inpaint"
headers = {"Authorization": "<API_KEY>"}
data = {
"prompt": "Add a soft guitar solo here",
"replace_start_at": 12.5,
"replace_end_at": 20.0,
"lyrics": "This is where my story begins",
"lyrics_section_to_replace": "New lyrics",
"gender": "",
"num_outputs": 2,
"title": "My Generated Track",
"generate_album_cover": false,
"lyrics_timestamps": false,
"webhook_url": "https://example.com/webhook"
}
# Option 1: audio_url
data["audio_url"] = "<YOUR_AUDIO_URL>"
response = requests.post(url, headers=headers, data=data)
# Option 2: File Upload
# with open("song.mp3", "rb") as f:
# files = {"audio_file": f}
# response = requests.post(url, headers=headers, data=data, files=files)
print(response.json())curl --request POST \
--url https://api.wav.com/api/public/v1/inpaint \
--header 'Authorization: <api-key>' \
--header 'Content-Type: multipart/form-data' \
--form 'audio_url=<string>' \
--form 'prompt=Replace this part with an opera-style vocal.' \
--form replace_start_at=15 \
--form replace_end_at=60 \
--form 'audio_file=<string>' \
--form 'lyrics=This is where my story begins' \
--form 'lyrics_section_to_replace=<string>' \
--form gender= \
--form num_outputs=123 \
--form 'title=<string>' \
--form generate_album_cover=false \
--form lyrics_timestamps=false \
--form webhook_url=https://example.com/webhookconst form = new FormData();
form.append('audio_url', '<string>');
form.append('prompt', 'Replace this part with an opera-style vocal.');
form.append('replace_start_at', '15');
form.append('replace_end_at', '60');
form.append('audio_file', '<string>');
form.append('lyrics', 'This is where my story begins');
form.append('lyrics_section_to_replace', '<string>');
form.append('gender', '');
form.append('num_outputs', '123');
form.append('title', '<string>');
form.append('generate_album_cover', 'false');
form.append('lyrics_timestamps', 'false');
form.append('webhook_url', 'https://example.com/webhook');
const options = {method: 'POST', headers: {Authorization: '<api-key>'}};
options.body = form;
fetch('https://api.wav.com/api/public/v1/inpaint', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.wav.com/api/public/v1/inpaint",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"audio_url\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"prompt\"\r\n\r\nReplace this part with an opera-style vocal.\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"replace_start_at\"\r\n\r\n15\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"replace_end_at\"\r\n\r\n60\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"audio_file\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"lyrics\"\r\n\r\nThis is where my story begins\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"lyrics_section_to_replace\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"gender\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"num_outputs\"\r\n\r\n123\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"title\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"generate_album_cover\"\r\n\r\nfalse\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"lyrics_timestamps\"\r\n\r\nfalse\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"webhook_url\"\r\n\r\nhttps://example.com/webhook\r\n-----011000010111000001101001--",
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: multipart/form-data; boundary=---011000010111000001101001"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.wav.com/api/public/v1/inpaint"
payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"audio_url\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"prompt\"\r\n\r\nReplace this part with an opera-style vocal.\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"replace_start_at\"\r\n\r\n15\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"replace_end_at\"\r\n\r\n60\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"audio_file\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"lyrics\"\r\n\r\nThis is where my story begins\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"lyrics_section_to_replace\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"gender\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"num_outputs\"\r\n\r\n123\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"title\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"generate_album_cover\"\r\n\r\nfalse\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"lyrics_timestamps\"\r\n\r\nfalse\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"webhook_url\"\r\n\r\nhttps://example.com/webhook\r\n-----011000010111000001101001--")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "multipart/form-data; boundary=---011000010111000001101001")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.wav.com/api/public/v1/inpaint")
.header("Authorization", "<api-key>")
.header("Content-Type", "multipart/form-data; boundary=---011000010111000001101001")
.body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"audio_url\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"prompt\"\r\n\r\nReplace this part with an opera-style vocal.\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"replace_start_at\"\r\n\r\n15\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"replace_end_at\"\r\n\r\n60\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"audio_file\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"lyrics\"\r\n\r\nThis is where my story begins\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"lyrics_section_to_replace\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"gender\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"num_outputs\"\r\n\r\n123\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"title\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"generate_album_cover\"\r\n\r\nfalse\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"lyrics_timestamps\"\r\n\r\nfalse\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"webhook_url\"\r\n\r\nhttps://example.com/webhook\r\n-----011000010111000001101001--")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.wav.com/api/public/v1/inpaint")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'multipart/form-data; boundary=---011000010111000001101001'
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"audio_url\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"prompt\"\r\n\r\nReplace this part with an opera-style vocal.\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"replace_start_at\"\r\n\r\n15\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"replace_end_at\"\r\n\r\n60\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"audio_file\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"lyrics\"\r\n\r\nThis is where my story begins\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"lyrics_section_to_replace\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"gender\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"num_outputs\"\r\n\r\n123\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"title\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"generate_album_cover\"\r\n\r\nfalse\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"lyrics_timestamps\"\r\n\r\nfalse\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"webhook_url\"\r\n\r\nhttps://example.com/webhook\r\n-----011000010111000001101001--"
response = http.request(request)
puts response.read_body{
"success": true,
"message": "Inpaint request submitted successfully",
"task_id": "070093dd-f1e9-4d7e-a6b3-ab6ecd237e38",
"conversion_id_1": "7cac10af-9007-449f-b3ab-f60b05d23309",
"conversion_id_2": "e85848c9-8feb-4cd8-85ef-456651a697b5",
"is_flagged": false,
"reason": "",
"eta": 123,
"status": "IN_QUEUE",
"credit_estimate": 0.12,
"error_message": "",
"error_message_detail": "",
"missing_input_fields": "",
"predicted_user_intent": ""
}{
"success": false,
"error_code": "INSUFFICIENT_CREDITS",
"message": ""
}{
"success": false,
"error_code": "UNPROCESSABLE_CONTENT",
"message": ""
}{
"success": false,
"error_code": "INTERNAL_SERVER_ERROR",
"message": ""
}Body
multipart/form-data
- Option 1
- Option 2
Response
Successfully initiated inpaint task

