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

# 复刻音色

复刻音色，本 API 可以基于之前上传的 WAV、MP3文件，复制一个新的音色，用于 [TTS 生成音频](https://platform.stepfun.com/docs/zh/api-reference/audio/create-audio.md)，或者用于 [Realtime 实时语音对话](https://platform.stepfun.com/docs/zh/guides/developer/realtime.md)。

### 请求地址

`POST https://api.stepfun.com/v1/audio/voices`

> [!NOTE]
>
> Step Plan 场景请使用 `POST https://api.stepfun.com/step_plan/v1/audio/voices`

### 请求参数

* `model` `string` ***required***\
  &#x20;需要使用的模型名称，可选项有 `stepaudio-2.5-tts`、`step-tts-2`、`step-tts-mini`。

* `text` `string` **optional**\
  音频源文件对应的文本内容，如不传递，则调用系统 ASR 进行解析；为保证效果，建议传入。

* `file_id` `string` ***required*** \
  &#x20;用于复刻音色的音频源文件的 File ID。File ID 可以通过 [上传文件](https://platform.stepfun.com/docs/zh/api-reference/files/create.md)
  获取，上传时，purpose 必须为 storage，支持文件格式为 mp3, wav。音频的时长范围应在 5 \~ 10 秒内;

### 请求响应

* `id` `string`\
  &#x20;音色 ID，可用于后续的音频生成。

* `object` `string`\
  &#x20;文件类型，固定为 audio.voice

* `duplicated` `boolean`\
  &#x20;是否重复请求。如果用户二次消费，则新增此字段，告诉用户已经创建过了。

### 示例

> [tab] curl
>
> ```bash theme={"theme":{"light":"light-plus","dark":"dark-plus"}}
> curl -L 'https://api.stepfun.com/v1/audio/voices' \
> -H 'Content-Type: application/json' \
> -H "Authorization: Bearer $STEP_API_KEY" \
> -d '{
>     "file_id":"file-Ckyl3cV09A",
>     "model":"step-tts-mini",
>     "text":"智能阶跃，十倍每一个人的可能"
> }'
> ```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.