curl --request POST \
--url https://api.kie.ai/api/v1/generate/mashup \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"uploadUrlList": [
"https://example.com/audio1.mp3",
"https://example.com/audio2.mp3"
],
"customMode": true,
"model": "V4",
"callBackUrl": "https://example.com/callback",
"prompt": "A calm and relaxing piano track with soft melodies",
"style": "Jazz",
"title": "Relaxing Piano",
"instrumental": true,
"vocalGender": "m",
"styleWeight": 0.61,
"weirdnessConstraint": 0.72,
"audioWeight": 0.65
}
'import requests
url = "https://api.kie.ai/api/v1/generate/mashup"
payload = {
"uploadUrlList": ["https://example.com/audio1.mp3", "https://example.com/audio2.mp3"],
"customMode": True,
"model": "V4",
"callBackUrl": "https://example.com/callback",
"prompt": "A calm and relaxing piano track with soft melodies",
"style": "Jazz",
"title": "Relaxing Piano",
"instrumental": True,
"vocalGender": "m",
"styleWeight": 0.61,
"weirdnessConstraint": 0.72,
"audioWeight": 0.65
}
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({
uploadUrlList: ['https://example.com/audio1.mp3', 'https://example.com/audio2.mp3'],
customMode: true,
model: 'V4',
callBackUrl: 'https://example.com/callback',
prompt: 'A calm and relaxing piano track with soft melodies',
style: 'Jazz',
title: 'Relaxing Piano',
instrumental: true,
vocalGender: 'm',
styleWeight: 0.61,
weirdnessConstraint: 0.72,
audioWeight: 0.65
})
};
fetch('https://api.kie.ai/api/v1/generate/mashup', 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/generate/mashup",
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([
'uploadUrlList' => [
'https://example.com/audio1.mp3',
'https://example.com/audio2.mp3'
],
'customMode' => true,
'model' => 'V4',
'callBackUrl' => 'https://example.com/callback',
'prompt' => 'A calm and relaxing piano track with soft melodies',
'style' => 'Jazz',
'title' => 'Relaxing Piano',
'instrumental' => true,
'vocalGender' => 'm',
'styleWeight' => 0.61,
'weirdnessConstraint' => 0.72,
'audioWeight' => 0.65
]),
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/generate/mashup"
payload := strings.NewReader("{\n \"uploadUrlList\": [\n \"https://example.com/audio1.mp3\",\n \"https://example.com/audio2.mp3\"\n ],\n \"customMode\": true,\n \"model\": \"V4\",\n \"callBackUrl\": \"https://example.com/callback\",\n \"prompt\": \"A calm and relaxing piano track with soft melodies\",\n \"style\": \"Jazz\",\n \"title\": \"Relaxing Piano\",\n \"instrumental\": true,\n \"vocalGender\": \"m\",\n \"styleWeight\": 0.61,\n \"weirdnessConstraint\": 0.72,\n \"audioWeight\": 0.65\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/generate/mashup")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"uploadUrlList\": [\n \"https://example.com/audio1.mp3\",\n \"https://example.com/audio2.mp3\"\n ],\n \"customMode\": true,\n \"model\": \"V4\",\n \"callBackUrl\": \"https://example.com/callback\",\n \"prompt\": \"A calm and relaxing piano track with soft melodies\",\n \"style\": \"Jazz\",\n \"title\": \"Relaxing Piano\",\n \"instrumental\": true,\n \"vocalGender\": \"m\",\n \"styleWeight\": 0.61,\n \"weirdnessConstraint\": 0.72,\n \"audioWeight\": 0.65\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.kie.ai/api/v1/generate/mashup")
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 \"uploadUrlList\": [\n \"https://example.com/audio1.mp3\",\n \"https://example.com/audio2.mp3\"\n ],\n \"customMode\": true,\n \"model\": \"V4\",\n \"callBackUrl\": \"https://example.com/callback\",\n \"prompt\": \"A calm and relaxing piano track with soft melodies\",\n \"style\": \"Jazz\",\n \"title\": \"Relaxing Piano\",\n \"instrumental\": true,\n \"vocalGender\": \"m\",\n \"styleWeight\": 0.61,\n \"weirdnessConstraint\": 0.72,\n \"audioWeight\": 0.65\n}"
response = http.request(request)
puts response.read_body{
"code": 200,
"msg": "success",
"data": {
"taskId": "5c79****be8e"
}
}Generate Mashup Music
Create mashup music by combining multiple audio tracks using AI models.
curl --request POST \
--url https://api.kie.ai/api/v1/generate/mashup \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"uploadUrlList": [
"https://example.com/audio1.mp3",
"https://example.com/audio2.mp3"
],
"customMode": true,
"model": "V4",
"callBackUrl": "https://example.com/callback",
"prompt": "A calm and relaxing piano track with soft melodies",
"style": "Jazz",
"title": "Relaxing Piano",
"instrumental": true,
"vocalGender": "m",
"styleWeight": 0.61,
"weirdnessConstraint": 0.72,
"audioWeight": 0.65
}
'import requests
url = "https://api.kie.ai/api/v1/generate/mashup"
payload = {
"uploadUrlList": ["https://example.com/audio1.mp3", "https://example.com/audio2.mp3"],
"customMode": True,
"model": "V4",
"callBackUrl": "https://example.com/callback",
"prompt": "A calm and relaxing piano track with soft melodies",
"style": "Jazz",
"title": "Relaxing Piano",
"instrumental": True,
"vocalGender": "m",
"styleWeight": 0.61,
"weirdnessConstraint": 0.72,
"audioWeight": 0.65
}
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({
uploadUrlList: ['https://example.com/audio1.mp3', 'https://example.com/audio2.mp3'],
customMode: true,
model: 'V4',
callBackUrl: 'https://example.com/callback',
prompt: 'A calm and relaxing piano track with soft melodies',
style: 'Jazz',
title: 'Relaxing Piano',
instrumental: true,
vocalGender: 'm',
styleWeight: 0.61,
weirdnessConstraint: 0.72,
audioWeight: 0.65
})
};
fetch('https://api.kie.ai/api/v1/generate/mashup', 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/generate/mashup",
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([
'uploadUrlList' => [
'https://example.com/audio1.mp3',
'https://example.com/audio2.mp3'
],
'customMode' => true,
'model' => 'V4',
'callBackUrl' => 'https://example.com/callback',
'prompt' => 'A calm and relaxing piano track with soft melodies',
'style' => 'Jazz',
'title' => 'Relaxing Piano',
'instrumental' => true,
'vocalGender' => 'm',
'styleWeight' => 0.61,
'weirdnessConstraint' => 0.72,
'audioWeight' => 0.65
]),
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/generate/mashup"
payload := strings.NewReader("{\n \"uploadUrlList\": [\n \"https://example.com/audio1.mp3\",\n \"https://example.com/audio2.mp3\"\n ],\n \"customMode\": true,\n \"model\": \"V4\",\n \"callBackUrl\": \"https://example.com/callback\",\n \"prompt\": \"A calm and relaxing piano track with soft melodies\",\n \"style\": \"Jazz\",\n \"title\": \"Relaxing Piano\",\n \"instrumental\": true,\n \"vocalGender\": \"m\",\n \"styleWeight\": 0.61,\n \"weirdnessConstraint\": 0.72,\n \"audioWeight\": 0.65\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/generate/mashup")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"uploadUrlList\": [\n \"https://example.com/audio1.mp3\",\n \"https://example.com/audio2.mp3\"\n ],\n \"customMode\": true,\n \"model\": \"V4\",\n \"callBackUrl\": \"https://example.com/callback\",\n \"prompt\": \"A calm and relaxing piano track with soft melodies\",\n \"style\": \"Jazz\",\n \"title\": \"Relaxing Piano\",\n \"instrumental\": true,\n \"vocalGender\": \"m\",\n \"styleWeight\": 0.61,\n \"weirdnessConstraint\": 0.72,\n \"audioWeight\": 0.65\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.kie.ai/api/v1/generate/mashup")
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 \"uploadUrlList\": [\n \"https://example.com/audio1.mp3\",\n \"https://example.com/audio2.mp3\"\n ],\n \"customMode\": true,\n \"model\": \"V4\",\n \"callBackUrl\": \"https://example.com/callback\",\n \"prompt\": \"A calm and relaxing piano track with soft melodies\",\n \"style\": \"Jazz\",\n \"title\": \"Relaxing Piano\",\n \"instrumental\": true,\n \"vocalGender\": \"m\",\n \"styleWeight\": 0.61,\n \"weirdnessConstraint\": 0.72,\n \"audioWeight\": 0.65\n}"
response = http.request(request)
puts response.read_body{
"code": 200,
"msg": "success",
"data": {
"taskId": "5c79****be8e"
}
}Usage Guide
- This endpoint creates mashup music from up to 2 uploaded audio files
- Combines elements from multiple tracks into a cohesive new composition
- You can control detail level with custom mode and instrumental settings
Parameter Details
-
uploadUrlListis required and must contain exactly 2 audio file URLs -
In Custom Mode (
customMode: true):- Character limits vary by model:
- V4:
prompt3000 characters,style200 characters - V4_5 & V4_5PLUS:
prompt5000 characters,style1000 characters - V4_5ALL:
prompt5000 characters,style1000 characters - V5:
prompt5000 characters,style1000 characters
- V4:
titlelength limit: 80 characters (all models)
- Character limits vary by model:
-
In Non-custom Mode (
customMode: false):promptlength limit: 500 charactersinstrumental: whether to generate instrumental music- Other parameters should be left empty
Developer Notes
- Recommendation for new users: Start with
customMode: falsefor simpler usage - Generated files are retained for 14 days
- Callback process has three stages:
text(text generation),first(first track complete),complete(all tracks complete) - Uploaded audio files must be publicly accessible URLs
- The
uploadUrlListmust contain exactly 2 audio file URLs for mashup generation
Optional parameters
vocalGender(string): Vocal gender preference. Usemfor male,ffor female. Note: This parameter only takes effect whencustomModeistrue. Based on practice, this parameter can only increase the probability but cannot guarantee adherence to male/female voice instructions.styleWeight(number): Strength of adherence to style. Note: This parameter only takes effect whencustomModeistrue. Range 0–1, up to 2 decimals. Example:0.61.weirdnessConstraint(number): Controls creative deviation. Note: This parameter only takes effect whencustomModeistrue. Range 0–1, up to 2 decimals. Example:0.72.audioWeight(number): Balance weight for audio features. Note: This parameter only takes effect whencustomModeistrue. Range 0–1, up to 2 decimals. Example:0.65.
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
Array of audio file URLs to mashup. Must contain exactly 2 URLs. Each URL must be publicly accessible.
2 elements[
"https://example.com/audio1.mp3",
"https://example.com/audio2.mp3"
]
Determines if advanced parameter customization is enabled.
- If
true: Allows detailed control with specific requirements forstyleandtitlefields. - If
false: Simplified mode where onlypromptis required and other parameters are ignored.
true
The AI model version to use for generation.
- Required for all requests.
- Available options:
V5: Superior musical expression, faster generation.V4_5PLUS: V4.5+ delivers richer sound, new ways to create, max 8 min.V4_5: V4.5 enables smarter prompts, faster generations, max 8 min.V4_5ALL: V4.5ALL enables smarter prompts, faster generations, max 8 min.V4: V4 improves vocal quality, max 4 min.
V4, V4_5, V4_5PLUS, V4_5ALL, V5 "V4"
The URL to receive music generation task completion updates. Required for all music generation requests.
- System will POST task status and results to this URL when generation completes
- Callback process has three stages:
text(text generation),first(first track complete),complete(all tracks complete) - Note: Some cases may skip
textandfirststages and returncompletedirectly - Your callback endpoint should accept POST requests with JSON payload containing task results and audio URLs
- For detailed callback format and implementation guide, see Music Generation Callbacks
- Alternatively, use the Get Music Details endpoint to poll task status
- To ensure callback security, see Webhook Verification Guide for signature verification implementation
"https://example.com/callback"
A description of the desired audio content.
- In Custom Mode (
customMode: true): Required ifinstrumentalisfalse. The prompt will be strictly used as the lyrics and sung in the generated track. Character limits by model:- V4: Maximum 3000 characters
- V4_5 & V4_5PLUS: Maximum 5000 characters
- V4_5ALL: Maximum 5000 characters
- V5: Maximum 5000 characters
Example: "A calm and relaxing piano track with soft melodies"
- In Non-custom Mode (
customMode: false): Always required. The prompt serves as the core idea, and lyrics will be automatically generated based on it (not strictly matching the input). Maximum 500 characters.
Example: "A short relaxing piano tune"
"A calm and relaxing piano track with soft melodies"
Music style specification for the generated audio.
- Only available and required in Custom Mode (
customMode: true). Defines the genre, mood, or artistic direction. - Character limits by model:
- V4: Maximum 200 characters
- V4_5 & V4_5PLUS: Maximum 1000 characters
- V4_5ALL: Maximum 1000 characters
- V5: Maximum 1000 characters
- Common examples: Jazz, Classical, Electronic, Pop, Rock, Hip-hop, etc.
"Jazz"
Title for the generated music track.
- Only available and required in Custom Mode (
customMode: true). - Max length: 80 characters.
- Will be displayed in player interfaces and filenames.
"Relaxing Piano"
Determines if the audio should be instrumental (no lyrics).
- In Custom Mode (
customMode: true):- If
true: Onlystyleandtitleare required. - If
false:style,title, andpromptare required (with prompt used as the exact lyrics).
- If
- In Non-custom Mode (
customMode: false): No impact on required fields (prompt only).
true
Vocal gender preference for the singing voice.
- Only available in Custom Mode (
customMode: true). Optional. Use 'm' for male and 'f' for female. Based on practice, this parameter can only increase the probability but cannot guarantee adherence to male/female voice instructions.
m, f "m"
Strength of adherence to the specified style.
- Only available in Custom Mode (
customMode: true). Optional. Range 0–1, up to 2 decimal places.
0 <= x <= 1Must be a multiple of 0.010.61
Controls experimental/creative deviation.
- Only available in Custom Mode (
customMode: true). Optional. Range 0–1, up to 2 decimal places.
0 <= x <= 1Must be a multiple of 0.010.72
Balance weight for audio features vs. other factors.
- Only available in Custom Mode (
customMode: true). Optional. Range 0–1, up to 2 decimal places.
0 <= x <= 1Must be a multiple of 0.010.65
Response
Request successful
Response Status Codes
- 200: Success - Request has been processed successfully
- 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
- 451: Unauthorized - Failed to fetch the image. Kindly verify any access limits set by you or your service provider
- 455: Service Unavailable - System is currently undergoing maintenance
- 500: Server Error - An unexpected error occurred while processing the request
200, 401, 402, 404, 409, 422, 429, 451, 455, 500 Error message when code != 200
"success"
Show child attributes
Show child attributes
