> ## Documentation Index
> Fetch the complete documentation index at: https://docs.hingnet.com.cn/llms.txt
> Use this file to discover all available pages before exploring further.

# 音色快速复刻（Voice Cloning）

> 与 MiniMax /v1/voice_clone 保持一致的官方接口

概述

* 路径：`POST /minimaxi/v1/voice_clone`
* 媒介类型：`application/json`
* 适用场景：IP 复刻、音色克隆等需要快速复刻某一音色的场景。

## 快速开始：三步完成音色复刻

1. 上传待复刻音频，获取 `file_id`

```bash theme={null}
curl -X POST "$BASE_URL/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_clone`
* `file.filename`：原始文件名

2. （可选）上传示例音频，获取 `prompt_audio` 的 `file_id`

```bash theme={null}
curl -X POST "$BASE_URL/minimaxi/v1/files/upload" \
  -H "Authorization: Bearer $TOKEN" \
  -F "purpose=prompt_audio" \
  -F "file=@/path/to/short-sample.mp3"
```

3. 调用音色快速复刻接口，完成音色克隆并获取试听音频

请求字段（对齐 MiniMax 官方 /v1/voice\_clone）

* `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`：状态描述

示例：带试听音频返回

```bash theme={null}
curl -X POST "$BASE_URL/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
  }'
```
