Convert to WAV Format
curl --request POST \
--url https://api.kie.ai/api/v1/wav/generate \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"taskId": "5c79****be8e",
"audioId": "e231****-****-****-****-****8cadc7dc",
"callBackUrl": "https://api.example.com/callback"
}
'import requests
url = "https://api.kie.ai/api/v1/wav/generate"
payload = {
"taskId": "5c79****be8e",
"audioId": "e231****-****-****-****-****8cadc7dc",
"callBackUrl": "https://api.example.com/callback"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
taskId: '5c79****be8e',
audioId: 'e231****-****-****-****-****8cadc7dc',
callBackUrl: 'https://api.example.com/callback'
})
};
fetch('https://api.kie.ai/api/v1/wav/generate', 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.kie.ai/api/v1/wav/generate",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'taskId' => '5c79****be8e',
'audioId' => 'e231****-****-****-****-****8cadc7dc',
'callBackUrl' => 'https://api.example.com/callback'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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.kie.ai/api/v1/wav/generate"
payload := strings.NewReader("{\n \"taskId\": \"5c79****be8e\",\n \"audioId\": \"e231****-****-****-****-****8cadc7dc\",\n \"callBackUrl\": \"https://api.example.com/callback\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
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.kie.ai/api/v1/wav/generate")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"taskId\": \"5c79****be8e\",\n \"audioId\": \"e231****-****-****-****-****8cadc7dc\",\n \"callBackUrl\": \"https://api.example.com/callback\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.kie.ai/api/v1/wav/generate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"taskId\": \"5c79****be8e\",\n \"audioId\": \"e231****-****-****-****-****8cadc7dc\",\n \"callBackUrl\": \"https://api.example.com/callback\"\n}"
response = http.request(request)
puts response.read_body{
"code": 200,
"msg": "success",
"data": {
"taskId": "5c79****be8e"
}
}WAV Conversion
Convert to WAV Format
Convert an existing music track to high-quality WAV format.
POST
/
api
/
v1
/
wav
/
generate
Convert to WAV Format
curl --request POST \
--url https://api.kie.ai/api/v1/wav/generate \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"taskId": "5c79****be8e",
"audioId": "e231****-****-****-****-****8cadc7dc",
"callBackUrl": "https://api.example.com/callback"
}
'import requests
url = "https://api.kie.ai/api/v1/wav/generate"
payload = {
"taskId": "5c79****be8e",
"audioId": "e231****-****-****-****-****8cadc7dc",
"callBackUrl": "https://api.example.com/callback"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
taskId: '5c79****be8e',
audioId: 'e231****-****-****-****-****8cadc7dc',
callBackUrl: 'https://api.example.com/callback'
})
};
fetch('https://api.kie.ai/api/v1/wav/generate', 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.kie.ai/api/v1/wav/generate",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'taskId' => '5c79****be8e',
'audioId' => 'e231****-****-****-****-****8cadc7dc',
'callBackUrl' => 'https://api.example.com/callback'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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.kie.ai/api/v1/wav/generate"
payload := strings.NewReader("{\n \"taskId\": \"5c79****be8e\",\n \"audioId\": \"e231****-****-****-****-****8cadc7dc\",\n \"callBackUrl\": \"https://api.example.com/callback\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
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.kie.ai/api/v1/wav/generate")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"taskId\": \"5c79****be8e\",\n \"audioId\": \"e231****-****-****-****-****8cadc7dc\",\n \"callBackUrl\": \"https://api.example.com/callback\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.kie.ai/api/v1/wav/generate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"taskId\": \"5c79****be8e\",\n \"audioId\": \"e231****-****-****-****-****8cadc7dc\",\n \"callBackUrl\": \"https://api.example.com/callback\"\n}"
response = http.request(request)
puts response.read_body{
"code": 200,
"msg": "success",
"data": {
"taskId": "5c79****be8e"
}
}Usage Guide
- Use this endpoint to obtain WAV format files from your generated music
- WAV files provide uncompressed audio for professional editing and processing
- Converted files maintain the full quality of the original audio
Parameter Details
taskIdidentifies the original music generation taskaudioIdspecifies which audio track to convert when multiple variations exist
Developer Notes
- Generated WAV files are retained for 14 days
- WAV files are typically 5-10 times larger than MP3 equivalents
- Processing time may vary depending on the length of the original audio
Authorizations
All APIs require authentication via Bearer Token.
Get API Key:
- Visit API Key Management Page to get your API Key
Usage: Add to request header: Authorization: Bearer YOUR_API_KEY
Note:
- Keep your API Key secure and do not share it with others
- If you suspect your API Key has been compromised, reset it immediately in the management page
Body
application/json
Unique identifier of the music generation task. This should be a taskId returned from either the "Generate Music" or "Extend Music" endpoints.
Example:
"5c79****be8e"
Unique identifier of the specific audio track to convert. This ID is returned in the callback data after music generation completes.
Example:
"e231****-****-****-****-****8cadc7dc"
The URL to receive WAV conversion task completion updates. Required for all WAV conversion requests.
- System will POST task status and results to this URL when WAV conversion completes
- Callback includes the high-quality WAV file download URL
- Your callback endpoint should accept POST requests with JSON payload containing the WAV file location
- For detailed callback format and implementation guide, see WAV Conversion Callbacks
- Alternatively, use the Get WAV Details endpoint to poll task status
- To ensure callback security, see Webhook Verification Guide for signature verification implementation
Example:
"https://api.example.com/callback"
Response
Request successful
Response status code
- 200: Success - Request has been processed successfully
- 400: Format Error - The parameter is not in a valid JSON format.
- 401: Unauthorized - Authentication credentials are missing or invalid
- 402: Insufficient Credits - Account does not have enough credits to perform the operation
- 404: Not Found - The requested resource or endpoint does not exist
- 409: Conflict - WAV record already exists
- 422: Validation Error - The request parameters failed validation checks
- 429: Rate Limited - Request limit has been exceeded for this resource
- 455: Service Unavailable - System is currently undergoing maintenance
- 500: Server Error - An unexpected error occurred while processing the request Build Failed - Audio wav generation failed
Available options:
200, 400, 401, 402, 404, 409, 422, 429, 455, 500 Error message when code != 200
Example:
"success"
Show child attributes
Show child attributes
