MiniMaxi voice clone
curl --request POST \
--url https://xuwuai.com/minimaxi/v1/voice_clone \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{}'import requests
url = "https://xuwuai.com/minimaxi/v1/voice_clone"
payload = {}
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({})
};
fetch('https://xuwuai.com/minimaxi/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://xuwuai.com/minimaxi/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([
]),
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://xuwuai.com/minimaxi/v1/voice_clone"
payload := strings.NewReader("{}")
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://xuwuai.com/minimaxi/v1/voice_clone")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{}")
.asString();require 'uri'
require 'net/http'
url = URI("https://xuwuai.com/minimaxi/v1/voice_clone")
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 = "{}"
response = http.request(request)
puts response.read_body{}语音合成
音色快速复刻(Voice Cloning)
与 MiniMax /v1/voice_clone 保持一致的官方接口
POST
/
minimaxi
/
v1
/
voice_clone
MiniMaxi voice clone
curl --request POST \
--url https://xuwuai.com/minimaxi/v1/voice_clone \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{}'import requests
url = "https://xuwuai.com/minimaxi/v1/voice_clone"
payload = {}
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({})
};
fetch('https://xuwuai.com/minimaxi/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://xuwuai.com/minimaxi/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([
]),
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://xuwuai.com/minimaxi/v1/voice_clone"
payload := strings.NewReader("{}")
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://xuwuai.com/minimaxi/v1/voice_clone")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{}")
.asString();require 'uri'
require 'net/http'
url = URI("https://xuwuai.com/minimaxi/v1/voice_clone")
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 = "{}"
response = http.request(request)
puts response.read_body{}概述
响应体中的:
- 路径:
POST /minimaxi/v1/voice_clone - 媒介类型:
application/json - 适用场景:IP 复刻、音色克隆等需要快速复刻某一音色的场景。
快速开始:三步完成音色复刻
- 上传待复刻音频,获取
file_id
curl -X POST "https://xuwuai.com/minimaxi/v1/files/upload" \
-H "Authorization: Bearer $TOKEN" \
-F "purpose=voice_clone" \
-F "file=@/path/to/audio.mp3"
file.file_id:后续传给POST /minimaxi/v1/voice_clonefile.filename:原始文件名
- (可选)上传示例音频,获取
prompt_audio的file_id
curl -X POST "https://xuwuai.com/minimaxi/v1/files/upload" \
-H "Authorization: Bearer $TOKEN" \
-F "purpose=prompt_audio" \
-F "file=@/path/to/short-sample.mp3"
- 调用音色快速复刻接口,完成音色克隆并获取试听音频
file_id:必填,需要复刻音色的音频文件file_id,通过POST /minimaxi/v1/files/upload获取voice_id:必填,目标克隆音色的voice_id,需满足官方命名规范clone_prompt:可选,示例音频与文本,用于增强相似度和稳定性prompt_audio:示例音频的file_id(通过purpose=prompt_audio上传获得)prompt_text:示例音频对应文本
text:可选,复刻试听文本(官方限制 ≤ 1000 字符)model:当传入text时必填,试听所用语音模型(如speech-2.8-hd、speech-2.8-turbo等)language_boost:可选,小语种/方言增强,支持Chinese、English、...、auto等枚举need_noise_reduction:可选,是否开启降噪need_volume_normalization:可选,是否开启音量归一化aigc_watermark:可选,是否在试听音频末尾添加 AIGC 水印节奏
input_sensitive:可选,输入音频命中风控时返回,包含type等信息demo_audio:若传入text与model,则返回试听音频链接base_resp:基础返回信息status_code:状态码(0 为成功)status_msg:状态描述
curl -X POST "https://xuwuai.com/minimaxi/v1/voice_clone" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"file_id": 1234567890,
"voice_id": "MiniMax001",
"text": "近年来,人工智能在国内迎来高速发展期...",
"model": "speech-2.8-hd",
"need_noise_reduction": true,
"need_volume_normalization": true
}'
Authorizations
Authorization: Bearer
Body
application/json
The body is of type object.
Response
200 - application/json
OK
The response is of type object.