跳到主要内容
AI
MarkdownLLMs.txt

语音合成

使用 MiniMax Speech HD 系列模型可以把文本生成语音。音色管理接口可以查询系统音色,也可以通过声音克隆或声音设计创建可复用的私有 voice_id

When To Use It

  • 为短视频、广告、课程、旁白或数字人生成语音。
  • 使用系统公共音色。
  • 克隆或设计私有音色,再把返回的 voice_id 用在语音任务中。

Supported Models

模型类型推荐场景
minimax-speech-2.8-hd文本转语音自然短口播、情绪旁白、广告、数字人语音。
minimax-speech-02-hd文本转语音有声书、课程讲解、客服播报、新闻播报、长文本旁白。

Endpoint

POST /v1/audio/tasks
GET /v1/audio/tasks/{task_id}
GET /v1/audio/voices
POST /v1/audio/voices/clone
POST /v1/audio/voices/design

Authentication

Authorization: Bearer sk-***
Content-Type: application/json

Speech Request Parameters

参数类型必填说明
modelstringminimax-speech-2.8-hdminimax-speech-02-hd
textstring需要合成的文本。
voice_idstring公共或私有音色 ID。
speednumber模型支持时控制语速。
volumenumber模型支持时控制音量。
pitchnumber模型支持时控制音高。
formatstring输出格式,例如 mp3wav
languagestring多语言文本的语言提示。
audio_settingobject模型支持时透传的高级音频设置。

Speech Request Example

curl -X POST "{BASE_URL}/v1/audio/tasks" \
-H "Authorization: Bearer sk-***" \
-H "Content-Type: application/json" \
-d '{
"model": "minimax-speech-2.8-hd",
"text": "Welcome back. Today we will introduce a faster way to build AI applications.",
"voice_id": "voice_xxx",
"format": "mp3",
"speed": 1
}'

Submit Response

{
"task_id": "task_xxx",
"status": "queued",
"model": "minimax-speech-2.8-hd",
"created_at": 1773980459
}

Query Task Status

curl "{BASE_URL}/v1/audio/tasks/task_xxx" \
-H "Authorization: Bearer sk-***"
{
"task_id": "task_xxx",
"status": "succeeded",
"progress": "100%",
"output": {
"audio_url": "https://example.com/speech.mp3"
},
"error": null
}

Voice Management

查询可用音色:

curl "{BASE_URL}/v1/audio/voices" \
-H "Authorization: Bearer sk-***"

通过参考音频克隆音色:

curl -X POST "{BASE_URL}/v1/audio/voices/clone" \
-H "Authorization: Bearer sk-***" \
-H "Content-Type: application/json" \
-d '{
"name": "brand-narrator",
"audio_url": "https://example.com/reference.wav"
}'

通过文本描述设计音色:

curl -X POST "{BASE_URL}/v1/audio/voices/design" \
-H "Authorization: Bearer sk-***" \
-H "Content-Type: application/json" \
-d '{
"name": "warm-host",
"description": "Warm, clear, young adult narrator for product explainers"
}'

后续语音任务中使用返回的 voice_id

Billing Notes

语音生成按生成音频用量计费。声音克隆和声音设计会创建可复用私有音色,可能单独计费。精确价格应以当前产品价格页为准。

Common Errors

  • 缺少 textvoice_id
  • 传入当前账户不可见的私有 voice_id
  • 文本过长但没有拆分为多个任务。
  • 输出格式不支持。
  • 余额不足或 API Key 已禁用。