curl --request POST \
--url https://api.minimax.io/v1/voice_clone \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: <content-type>' \
--data '
{
"file_id": 123456789,
"voice_id": "<voice_id>",
"clone_prompt": {
"prompt_audio": 987654321,
"prompt_text": "This voice sounds natural and pleasant."
},
"text": "A gentle breeze sweeps across the soft grass(breath), carrying the fresh scent along with the songs of birds.",
"model": "speech-2.8-hd",
"text_validation": "This voice sounds natural and pleasant.",
"accuracy": 0.7,
"need_noise_reduction": false,
"need_volume_normalization": false,
"aigc_watermark": false
}
'import requests
url = "https://api.minimax.io/v1/voice_clone"
payload = {
"file_id": 123456789,
"voice_id": "<voice_id>",
"clone_prompt": {
"prompt_audio": 987654321,
"prompt_text": "This voice sounds natural and pleasant."
},
"text": "A gentle breeze sweeps across the soft grass(breath), carrying the fresh scent along with the songs of birds.",
"model": "speech-2.8-hd",
"text_validation": "This voice sounds natural and pleasant.",
"accuracy": 0.7,
"need_noise_reduction": False,
"need_volume_normalization": False,
"aigc_watermark": False
}
headers = {
"Content-Type": "<content-type>",
"Authorization": "Bearer <token>"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': '<content-type>', Authorization: 'Bearer <token>'},
body: JSON.stringify({
file_id: 123456789,
voice_id: '<voice_id>',
clone_prompt: {
prompt_audio: 987654321,
prompt_text: 'This voice sounds natural and pleasant.'
},
text: 'A gentle breeze sweeps across the soft grass(breath), carrying the fresh scent along with the songs of birds.',
model: 'speech-2.8-hd',
text_validation: 'This voice sounds natural and pleasant.',
accuracy: 0.7,
need_noise_reduction: false,
need_volume_normalization: false,
aigc_watermark: false
})
};
fetch('https://api.minimax.io/v1/voice_clone', 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.minimax.io/v1/voice_clone",
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([
'file_id' => 123456789,
'voice_id' => '<voice_id>',
'clone_prompt' => [
'prompt_audio' => 987654321,
'prompt_text' => 'This voice sounds natural and pleasant.'
],
'text' => 'A gentle breeze sweeps across the soft grass(breath), carrying the fresh scent along with the songs of birds.',
'model' => 'speech-2.8-hd',
'text_validation' => 'This voice sounds natural and pleasant.',
'accuracy' => 0.7,
'need_noise_reduction' => false,
'need_volume_normalization' => false,
'aigc_watermark' => false
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: <content-type>"
],
]);
$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.minimax.io/v1/voice_clone"
payload := strings.NewReader("{\n \"file_id\": 123456789,\n \"voice_id\": \"<voice_id>\",\n \"clone_prompt\": {\n \"prompt_audio\": 987654321,\n \"prompt_text\": \"This voice sounds natural and pleasant.\"\n },\n \"text\": \"A gentle breeze sweeps across the soft grass(breath), carrying the fresh scent along with the songs of birds.\",\n \"model\": \"speech-2.8-hd\",\n \"text_validation\": \"This voice sounds natural and pleasant.\",\n \"accuracy\": 0.7,\n \"need_noise_reduction\": false,\n \"need_volume_normalization\": false,\n \"aigc_watermark\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "<content-type>")
req.Header.Add("Authorization", "Bearer <token>")
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.minimax.io/v1/voice_clone")
.header("Content-Type", "<content-type>")
.header("Authorization", "Bearer <token>")
.body("{\n \"file_id\": 123456789,\n \"voice_id\": \"<voice_id>\",\n \"clone_prompt\": {\n \"prompt_audio\": 987654321,\n \"prompt_text\": \"This voice sounds natural and pleasant.\"\n },\n \"text\": \"A gentle breeze sweeps across the soft grass(breath), carrying the fresh scent along with the songs of birds.\",\n \"model\": \"speech-2.8-hd\",\n \"text_validation\": \"This voice sounds natural and pleasant.\",\n \"accuracy\": 0.7,\n \"need_noise_reduction\": false,\n \"need_volume_normalization\": false,\n \"aigc_watermark\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.minimax.io/v1/voice_clone")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = '<content-type>'
request["Authorization"] = 'Bearer <token>'
request.body = "{\n \"file_id\": 123456789,\n \"voice_id\": \"<voice_id>\",\n \"clone_prompt\": {\n \"prompt_audio\": 987654321,\n \"prompt_text\": \"This voice sounds natural and pleasant.\"\n },\n \"text\": \"A gentle breeze sweeps across the soft grass(breath), carrying the fresh scent along with the songs of birds.\",\n \"model\": \"speech-2.8-hd\",\n \"text_validation\": \"This voice sounds natural and pleasant.\",\n \"accuracy\": 0.7,\n \"need_noise_reduction\": false,\n \"need_volume_normalization\": false,\n \"aigc_watermark\": false\n}"
response = http.request(request)
puts response.read_body{
"input_sensitive": false,
"input_sensitive_type": 0,
"demo_audio": "",
"extra_info": {
"audio_length": 11124,
"audio_sample_rate": 32000,
"audio_size": 179926,
"bitrate": 128000,
"word_count": 18,
"usage_characters": 18
},
"base_resp": {
"status_code": 0,
"status_msg": "success"
}
}Voice Clone
Use this API for rapid voice cloning. If a cloned voice is not used within 7 days, the system will delete it.
curl --request POST \
--url https://api.minimax.io/v1/voice_clone \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: <content-type>' \
--data '
{
"file_id": 123456789,
"voice_id": "<voice_id>",
"clone_prompt": {
"prompt_audio": 987654321,
"prompt_text": "This voice sounds natural and pleasant."
},
"text": "A gentle breeze sweeps across the soft grass(breath), carrying the fresh scent along with the songs of birds.",
"model": "speech-2.8-hd",
"text_validation": "This voice sounds natural and pleasant.",
"accuracy": 0.7,
"need_noise_reduction": false,
"need_volume_normalization": false,
"aigc_watermark": false
}
'import requests
url = "https://api.minimax.io/v1/voice_clone"
payload = {
"file_id": 123456789,
"voice_id": "<voice_id>",
"clone_prompt": {
"prompt_audio": 987654321,
"prompt_text": "This voice sounds natural and pleasant."
},
"text": "A gentle breeze sweeps across the soft grass(breath), carrying the fresh scent along with the songs of birds.",
"model": "speech-2.8-hd",
"text_validation": "This voice sounds natural and pleasant.",
"accuracy": 0.7,
"need_noise_reduction": False,
"need_volume_normalization": False,
"aigc_watermark": False
}
headers = {
"Content-Type": "<content-type>",
"Authorization": "Bearer <token>"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': '<content-type>', Authorization: 'Bearer <token>'},
body: JSON.stringify({
file_id: 123456789,
voice_id: '<voice_id>',
clone_prompt: {
prompt_audio: 987654321,
prompt_text: 'This voice sounds natural and pleasant.'
},
text: 'A gentle breeze sweeps across the soft grass(breath), carrying the fresh scent along with the songs of birds.',
model: 'speech-2.8-hd',
text_validation: 'This voice sounds natural and pleasant.',
accuracy: 0.7,
need_noise_reduction: false,
need_volume_normalization: false,
aigc_watermark: false
})
};
fetch('https://api.minimax.io/v1/voice_clone', 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.minimax.io/v1/voice_clone",
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([
'file_id' => 123456789,
'voice_id' => '<voice_id>',
'clone_prompt' => [
'prompt_audio' => 987654321,
'prompt_text' => 'This voice sounds natural and pleasant.'
],
'text' => 'A gentle breeze sweeps across the soft grass(breath), carrying the fresh scent along with the songs of birds.',
'model' => 'speech-2.8-hd',
'text_validation' => 'This voice sounds natural and pleasant.',
'accuracy' => 0.7,
'need_noise_reduction' => false,
'need_volume_normalization' => false,
'aigc_watermark' => false
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: <content-type>"
],
]);
$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.minimax.io/v1/voice_clone"
payload := strings.NewReader("{\n \"file_id\": 123456789,\n \"voice_id\": \"<voice_id>\",\n \"clone_prompt\": {\n \"prompt_audio\": 987654321,\n \"prompt_text\": \"This voice sounds natural and pleasant.\"\n },\n \"text\": \"A gentle breeze sweeps across the soft grass(breath), carrying the fresh scent along with the songs of birds.\",\n \"model\": \"speech-2.8-hd\",\n \"text_validation\": \"This voice sounds natural and pleasant.\",\n \"accuracy\": 0.7,\n \"need_noise_reduction\": false,\n \"need_volume_normalization\": false,\n \"aigc_watermark\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "<content-type>")
req.Header.Add("Authorization", "Bearer <token>")
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.minimax.io/v1/voice_clone")
.header("Content-Type", "<content-type>")
.header("Authorization", "Bearer <token>")
.body("{\n \"file_id\": 123456789,\n \"voice_id\": \"<voice_id>\",\n \"clone_prompt\": {\n \"prompt_audio\": 987654321,\n \"prompt_text\": \"This voice sounds natural and pleasant.\"\n },\n \"text\": \"A gentle breeze sweeps across the soft grass(breath), carrying the fresh scent along with the songs of birds.\",\n \"model\": \"speech-2.8-hd\",\n \"text_validation\": \"This voice sounds natural and pleasant.\",\n \"accuracy\": 0.7,\n \"need_noise_reduction\": false,\n \"need_volume_normalization\": false,\n \"aigc_watermark\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.minimax.io/v1/voice_clone")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = '<content-type>'
request["Authorization"] = 'Bearer <token>'
request.body = "{\n \"file_id\": 123456789,\n \"voice_id\": \"<voice_id>\",\n \"clone_prompt\": {\n \"prompt_audio\": 987654321,\n \"prompt_text\": \"This voice sounds natural and pleasant.\"\n },\n \"text\": \"A gentle breeze sweeps across the soft grass(breath), carrying the fresh scent along with the songs of birds.\",\n \"model\": \"speech-2.8-hd\",\n \"text_validation\": \"This voice sounds natural and pleasant.\",\n \"accuracy\": 0.7,\n \"need_noise_reduction\": false,\n \"need_volume_normalization\": false,\n \"aigc_watermark\": false\n}"
response = http.request(request)
puts response.read_body{
"input_sensitive": false,
"input_sensitive_type": 0,
"demo_audio": "",
"extra_info": {
"audio_length": 11124,
"audio_sample_rate": 32000,
"audio_size": 179926,
"bitrate": 128000,
"word_count": 18,
"usage_characters": 18
},
"base_resp": {
"status_code": 0,
"status_msg": "success"
}
}Authorizations
HTTP: Bearer Auth
- Security Scheme Type: http
- HTTP Authorization Scheme:
Bearer API_key, can be found in Account Management>API Keys.
Headers
Body
Voice clone request parameters
The file_id of the audio to be cloned, obtained through the File Upload API.
Uploaded files must comply with the following rules:
- Accepted audio formats: mp3, m4a, wav
- Audio duration: at least 10 seconds, no longer than 5 minutes
- File size: no larger than 20 MB
- If this parameter is used, both child attributes (prompt_audio, prompt_text) are required
The voice_id of the cloned voice. Example: "MiniMax001". When defining a custom voice_id, note the following rules:
- Length range: [8, 256]
- Must start with an English letter
- Can contain letters, digits,
-, and_ - Cannot end with
-or_ - Must not duplicate an existing
voice_id, otherwise an error will occur
Optional preview text, up to 1000 characters. The cloned voice will be used to read the text, and an audio preview link will be returned. Note: Preview requests are charged based on character count, consistent with T2A pricing.
- Interjection tags: Only supported when using
speech-2.8-hdorspeech-2.8-turbomodels. Supported interjections:(laughs),(chuckle),(coughs),(clear-throat),(groans),(breath),(pant),(inhale),(exhale),(gasps),(sniffs),(sighs),(snorts),(burps),(lip-smacking),(humming),(hissing),(emm),(whistles),(sneezes),(crying),(applause).
Controls whether recognition for specific minority languages and dialects is enhanced. Default is null. If the language type is unknown, set to "auto" and the model will automatically detect it.
Chinese, Chinese,Yue, English, Arabic, Russian, Spanish, French, Portuguese, German, Turkish, Dutch, Ukrainian, Vietnamese, Indonesian, Japanese, Italian, Korean, Thai, Polish, Romanian, Greek, Czech, Finnish, Hindi, Bulgarian, Danish, Hebrew, Malay, Persian, Slovak, Swedish, Croatian, Filipino, Hungarian, Norwegian, Slovenian, Catalan, Nynorsk, Tamil, Afrikaans, auto Optional. The expected transcript of the cloning sample audio (matching the content of file_id or clone_prompt.prompt_audio). When provided, the audio is sent to ASR and the recognized text is compared against text_validation. If the similarity is below accuracy, the request is rejected with status code 1043 (The asr similarity check failed). Maximum length: 200 characters.
200Response
Successful response