Generate Persona
curl --request POST \
--url https://api.kie.ai/api/v1/generate/generate-persona \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"taskId": "5c79****be8e",
"audioId": "e231****-****-****-****-****8cadc7dc",
"name": "Electronic Pop Singer",
"description": "A modern electronic music style pop singer, skilled in dynamic rhythms and synthesizer tones",
"vocalStart": 12.5,
"vocalEnd": 25.8,
"style": "Electronic Pop"
}
'import requests
url = "https://api.kie.ai/api/v1/generate/generate-persona"
payload = {
"taskId": "5c79****be8e",
"audioId": "e231****-****-****-****-****8cadc7dc",
"name": "Electronic Pop Singer",
"description": "A modern electronic music style pop singer, skilled in dynamic rhythms and synthesizer tones",
"vocalStart": 12.5,
"vocalEnd": 25.8,
"style": "Electronic Pop"
}
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',
name: 'Electronic Pop Singer',
description: 'A modern electronic music style pop singer, skilled in dynamic rhythms and synthesizer tones',
vocalStart: 12.5,
vocalEnd: 25.8,
style: 'Electronic Pop'
})
};
fetch('https://api.kie.ai/api/v1/generate/generate-persona', 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/generate-persona",
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',
'name' => 'Electronic Pop Singer',
'description' => 'A modern electronic music style pop singer, skilled in dynamic rhythms and synthesizer tones',
'vocalStart' => 12.5,
'vocalEnd' => 25.8,
'style' => 'Electronic Pop'
]),
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/generate-persona"
payload := strings.NewReader("{\n \"taskId\": \"5c79****be8e\",\n \"audioId\": \"e231****-****-****-****-****8cadc7dc\",\n \"name\": \"Electronic Pop Singer\",\n \"description\": \"A modern electronic music style pop singer, skilled in dynamic rhythms and synthesizer tones\",\n \"vocalStart\": 12.5,\n \"vocalEnd\": 25.8,\n \"style\": \"Electronic Pop\"\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/generate-persona")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"taskId\": \"5c79****be8e\",\n \"audioId\": \"e231****-****-****-****-****8cadc7dc\",\n \"name\": \"Electronic Pop Singer\",\n \"description\": \"A modern electronic music style pop singer, skilled in dynamic rhythms and synthesizer tones\",\n \"vocalStart\": 12.5,\n \"vocalEnd\": 25.8,\n \"style\": \"Electronic Pop\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.kie.ai/api/v1/generate/generate-persona")
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 \"name\": \"Electronic Pop Singer\",\n \"description\": \"A modern electronic music style pop singer, skilled in dynamic rhythms and synthesizer tones\",\n \"vocalStart\": 12.5,\n \"vocalEnd\": 25.8,\n \"style\": \"Electronic Pop\"\n}"
response = http.request(request)
puts response.read_body{
"code": 200,
"msg": "success",
"data": {
"personaId": "a1b2****c3d4",
"name": "Electronic Pop Singer",
"description": "A modern electronic music style pop singer, skilled in dynamic rhythms and synthesizer tones"
}
}Suno API
Generate Persona
Create a personalized music Persona based on generated music, giving the music a unique identity and characteristics.
POST
/
api
/
v1
/
generate
/
generate-persona
Generate Persona
curl --request POST \
--url https://api.kie.ai/api/v1/generate/generate-persona \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"taskId": "5c79****be8e",
"audioId": "e231****-****-****-****-****8cadc7dc",
"name": "Electronic Pop Singer",
"description": "A modern electronic music style pop singer, skilled in dynamic rhythms and synthesizer tones",
"vocalStart": 12.5,
"vocalEnd": 25.8,
"style": "Electronic Pop"
}
'import requests
url = "https://api.kie.ai/api/v1/generate/generate-persona"
payload = {
"taskId": "5c79****be8e",
"audioId": "e231****-****-****-****-****8cadc7dc",
"name": "Electronic Pop Singer",
"description": "A modern electronic music style pop singer, skilled in dynamic rhythms and synthesizer tones",
"vocalStart": 12.5,
"vocalEnd": 25.8,
"style": "Electronic Pop"
}
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',
name: 'Electronic Pop Singer',
description: 'A modern electronic music style pop singer, skilled in dynamic rhythms and synthesizer tones',
vocalStart: 12.5,
vocalEnd: 25.8,
style: 'Electronic Pop'
})
};
fetch('https://api.kie.ai/api/v1/generate/generate-persona', 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/generate-persona",
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',
'name' => 'Electronic Pop Singer',
'description' => 'A modern electronic music style pop singer, skilled in dynamic rhythms and synthesizer tones',
'vocalStart' => 12.5,
'vocalEnd' => 25.8,
'style' => 'Electronic Pop'
]),
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/generate-persona"
payload := strings.NewReader("{\n \"taskId\": \"5c79****be8e\",\n \"audioId\": \"e231****-****-****-****-****8cadc7dc\",\n \"name\": \"Electronic Pop Singer\",\n \"description\": \"A modern electronic music style pop singer, skilled in dynamic rhythms and synthesizer tones\",\n \"vocalStart\": 12.5,\n \"vocalEnd\": 25.8,\n \"style\": \"Electronic Pop\"\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/generate-persona")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"taskId\": \"5c79****be8e\",\n \"audioId\": \"e231****-****-****-****-****8cadc7dc\",\n \"name\": \"Electronic Pop Singer\",\n \"description\": \"A modern electronic music style pop singer, skilled in dynamic rhythms and synthesizer tones\",\n \"vocalStart\": 12.5,\n \"vocalEnd\": 25.8,\n \"style\": \"Electronic Pop\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.kie.ai/api/v1/generate/generate-persona")
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 \"name\": \"Electronic Pop Singer\",\n \"description\": \"A modern electronic music style pop singer, skilled in dynamic rhythms and synthesizer tones\",\n \"vocalStart\": 12.5,\n \"vocalEnd\": 25.8,\n \"style\": \"Electronic Pop\"\n}"
response = http.request(request)
puts response.read_body{
"code": 200,
"msg": "success",
"data": {
"personaId": "a1b2****c3d4",
"name": "Electronic Pop Singer",
"description": "A modern electronic music style pop singer, skilled in dynamic rhythms and synthesizer tones"
}
}Usage Guide
- Use this endpoint to create Personas (music characters) for generated music
- Requires the taskId from music generation related endpoints (generate, extend, cover, upload-extend, mashup) and audio ID
- Customize the Persona name and description to give music unique personality
- Generated Personas can be used for subsequent music creation and style transfer
Parameter Details
taskId: Required parameter, can be obtained from the following endpoints:- Generate Music (
/api/v1/generate) - Extend Music (
/api/v1/generate/extend) - Upload And Cover Audio (
/api/v1/generate/upload-cover) - Upload And Extend Audio (
/api/v1/generate/upload-extend)
- Generate Music (
audioId: Required parameter, specifies the audio ID to create Persona forname: Required parameter, assigns an easily recognizable name to the Personadescription: Required parameter, describes the Persona’s musical characteristics, style, and personality
Developer Notes
- Important: Ensure the music generation task is fully completed before calling this endpoint. If the music is still generating, this endpoint will return a failure
- Model Requirement: Persona generation only supports taskId from music generated with models above v3_5 (v3_5 itself is not supported)
- It is recommended to provide detailed descriptions for Personas to better capture musical characteristics
- The returned
personaIdcan be used in subsequent music generation requests to create music with similar style characteristics - You can apply the
personaIdto the following endpoints: - Each audio ID can only generate a Persona once
Parameter Example
{
"taskId": "5c79****be8e",
"audioId": "e231****-****-****-****-****8cadc7dc",
"name": "Electronic Pop Singer",
"description": "A modern electronic music style pop singer, skilled in dynamic rhythms and synthesizer tones"
}
Ensure that the music generation task corresponding to the taskId is complete and the audioId is within the valid range.
Providing detailed and specific descriptions for Personas helps the system more accurately capture musical style characteristics.
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 original music generation task. This can be a taskId returned from any of the following endpoints:
- Generate Music (/api/v1/generate)
- Extend Music (/api/v1/generate/extend)
- Upload And Cover Audio (/api/v1/generate/upload-cover)
- Upload And Extend Audio (/api/v1/generate/upload-extend)
- Generate Mashup Music (/api/v1/generate/mashup)
Example:
"5c79****be8e"
Start time (in seconds) for Persona analysis segment extraction. Used to specify the time point in the audio from which to extract the segment for Persona analysis. Must be less than vocalEnd, and vocalEnd - vocalStart must be between 10–30 seconds. Defaults to 0.0.
Required range:
x >= 0Must be a multiple of 0.01Example:
12.5
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 - Persona already exists for this music
- 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 music data. 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
Available options:
200, 401, 402, 404, 409, 422, 429, 451, 455, 500 