列出可用音色、用一段样本复刻你自己的音色、或用一句文字描述设计全新音色,然后在任何 TTS 调用里使用。覆盖 Minimax(复刻 / 设计 / 系统音色)和 ElevenLabs 自定义音色。
⚠️ 计费提示:复刻 / 设计出的音色,第一次用于 TTS 时会额外收取一次性 ¥9.9 启用费(系统预设音色无此费用)。
拿到 voice_id 后,把它填进 TTS 调用即可。系统音色免费、即用;account 来源会返回你自己复刻 / 设计 / 自定义的音色。
# Minimax system voices (optionally filter by language)
curl "https://apimodels.app/api/v1/minimax/voices?language=English" \
-H "Authorization: Bearer $API_KEY"
# ElevenLabs / preset voices
curl "https://apimodels.app/api/v1/audio/voices?pageNum=1&pageSize=30" \
-H "Authorization: Bearer $API_KEY"
# Voices on your own account (cloned / designed / custom)
curl "https://apimodels.app/api/v1/voices?source=account" \
-H "Authorization: Bearer $API_KEY"{
"voices": [
{ "voice_id": "English_Graceful_Lady", "name": "Graceful Lady", "language": "English" },
{ "voice_id": "male-qn-qingse", "name": "Qingse", "language": "Chinese" }
],
"total": 2
}准备一段清晰的人声样本(建议 10 秒-5 分钟、无背景噪音)。上传拿到 file_id → 复刻成你指定的 voice_id → 在 TTS 里使用。
# Step 1 — upload your voice sample (10s-5min clean audio)
curl -X POST https://apimodels.app/api/v1/minimax/files \
-H "Authorization: Bearer $API_KEY" \
-F "purpose=voice_clone" \
-F "file=@my-voice-sample.mp3"
# -> { "file": { "file_id": 123456789, ... } }# Step 2 — clone it into a new voice_id (must start with a letter, >= 8 chars)
curl -X POST https://apimodels.app/api/v1/minimax/voice/clone \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"file_id": 123456789,
"voice_id": "myBrandVoice01"
}'| 字段 | 必填 | 类型 | 说明 |
|---|---|---|---|
| file_id | 是 | number | 步骤 1 上传返回的文件 ID |
| voice_id | 是 | string | 你给新音色起的 ID,需以字母开头、≥ 8 位 |
# Step 3 — use the cloned voice in TTS
curl -X POST https://apimodels.app/api/v1/minimax/tts \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "minimax-speech-02-turbo",
"text": "This sentence is spoken in my own cloned voice.",
"voice_setting": { "voice_id": "myBrandVoice01", "speed": 1.0 }
}'cURL
# Step 2 — clone it into a new voice_id (must start with a letter, >= 8 chars)
curl -X POST https://apimodels.app/api/v1/minimax/voice/clone \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"file_id": 123456789,
"voice_id": "myBrandVoice01"
}'Python
import os, requests
API = "https://apimodels.app/api/v1"
H = {"Authorization": f"Bearer {os.environ['API_KEY']}"}
# 1) Upload the sample
file_id = requests.post(
f"{API}/minimax/files",
headers=H,
data={"purpose": "voice_clone"},
files={"file": open("my-voice-sample.mp3", "rb")},
).json()["file"]["file_id"]
# 2) Clone -> your new voice_id
requests.post(
f"{API}/minimax/voice/clone",
headers={**H, "Content-Type": "application/json"},
json={"file_id": file_id, "voice_id": "myBrandVoice01"},
)
# 3) Speak with it
audio = requests.post(
f"{API}/minimax/tts",
headers={**H, "Content-Type": "application/json"},
json={
"model": "minimax-speech-02-turbo",
"text": "This sentence is spoken in my own cloned voice.",
"voice_setting": {"voice_id": "myBrandVoice01"},
},
)
print(audio.json())Node.js
const API = "https://apimodels.app/api/v1";
const H = { Authorization: `Bearer ${process.env.API_KEY}` };
import fs from "node:fs";
// 1) Upload the sample
const form = new FormData();
form.append("purpose", "voice_clone");
form.append("file", new Blob([fs.readFileSync("my-voice-sample.mp3")]), "sample.mp3");
const { file } = await fetch(`${API}/minimax/files`, { method: "POST", headers: H, body: form })
.then((r) => r.json());
// 2) Clone -> your new voice_id
await fetch(`${API}/minimax/voice/clone`, {
method: "POST",
headers: { ...H, "Content-Type": "application/json" },
body: JSON.stringify({ file_id: file.file_id, voice_id: "myBrandVoice01" }),
});
// 3) Speak with it
const audio = await fetch(`${API}/minimax/tts`, {
method: "POST",
headers: { ...H, "Content-Type": "application/json" },
body: JSON.stringify({
model: "minimax-speech-02-turbo",
text: "This sentence is spoken in my own cloned voice.",
voice_setting: { voice_id: "myBrandVoice01" },
}),
}).then((r) => r.json());
console.log(audio);只用一句文字描述就能生成一个全新音色,适合没有录音样本的场景。生成后同样得到一个 voice_id,在 TTS 里使用。
# Create a brand-new voice from a text description (no sample needed)
curl -X POST https://apimodels.app/api/v1/minimax/voice/design \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"prompt": "A warm, calm middle-aged male narrator with a slight British accent",
"preview_text": "Welcome to the evening news.",
"voice_id": "designedVoice01"
}'| 字段 | 必填 | 类型 | 说明 |
|---|---|---|---|
| prompt | 是 | string | 对目标音色的文字描述(性别、年龄、口音、语气等) |
| preview_text | 否 | string | 用于生成试听的文本 |
| voice_id | 是 | string | 你给新音色起的 ID |
用一个可公开访问的音频 URL(或先用 Files API 上传)创建 ElevenLabs 自定义音色。voice_url 与 video_id 二选一。
# ElevenLabs-style custom voice from a hosted audio URL (or video_id)
curl -X POST https://apimodels.app/api/v1/audio/voices/custom \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"voice_name": "My Narrator",
"voice_url": "https://r2.apimodels.app/uploads/.../sample.mp3"
}'| 字段 | 必填 | 类型 | 说明 |
|---|---|---|---|
| voice_name | 是 | string | 音色名称 |
| voice_url | 二选一 | string | 可公开访问的样本音频 URL |
| video_id | 二选一 | string | 已上传素材的 ID(代替 voice_url) |
| callback_url | 否 | string | 完成后的回调地址 |