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

# Minimax 兼容音色克隆

## 说明

使用 Minimax 兼容格式生成克隆音色。调用前请先通过 [上传文件](/api-reference/endpoint/files/upload) 获取 `file_id`。

* **生成链路**：上传音频获取 `file_id` → 调用本接口生成音色 ID → 在 TTS 接口中使用该音色。
* **音色 ID**：本接口使用 `voice_id` 作为自定义音色 ID，生成后继续在 `voice_setting.voice_id` 中传入。
* **克隆模型**：当前使用 `sensenova-tts-2.0-clone`。

## 调用示例

### 1. 上传参考音频

```bash theme={null}
curl -X POST https://api.senseaudio.cn/v1/files/upload \
  -H "Authorization: <API_KEY>" \
  -F "purpose=voice_clone" \
  -F "file=@/path/to/voice.wav"
```

上传成功后，从返回结果中读取 `file.file_id`：

```json theme={null}
{
  "file": {
    "file_id": "file-KQGDEegFNcaWhpNWdoiPZj",
    "filename": "voice.wav",
    "bytes": 228778,
    "purpose": "voice_clone"
  }
}
```

### 2. 生成克隆音色

```bash theme={null}
curl --request POST \
  --url https://api.senseaudio.cn/v1/voice_clone \
  --header 'Authorization: Bearer <API_KEY>' \
  --header 'Content-Type: application/json' \
  --data '{
    "file_id": "file-KQGDEegFNcaWhpNWdoiPZj",
    "model": "sensenova-tts-2.0-clone",
    "text": "你好，这是我的 Minimax 兼容克隆音色试听。",
    "voice_id": "wenrou_yujie_minimax_001"
  }'
```

## 使用克隆音色

生成成功后，将 `voice_id` 传入 [语音合成 HTTP](/api-reference/endpoint/tts/synthesize)：

```json theme={null}
{
  "model": "sensenova-tts-2.0",
  "text": "你好，这是使用 Minimax 兼容克隆音色生成的音频。",
  "voice_setting": {
    "voice_id": "wenrou_yujie_minimax_001"
  }
}
```
