# 声音复刻PRO API Documentation

> 声音复刻PRO：根据原音频克隆音色，返回音色ID，可供语音合成PRO使用。音频要求 5～60 秒（推荐 10～30 秒），mp3/wav/m4a，采样率≥16kHz，文件≤10MB。

## Overview

This document describes how to call the **声音复刻PRO** API.

- **Model / path slug**: `audio/audiocopypro`
- **Task type**: `sync` (`sync` = synchronous, `async` = create task then poll / callback)
- **HTML docs**: `/doc/29`

## Authentication

All API requests require your platform API key as the query parameter `key`:

```
?key=YOUR_API_KEY
```

Get API Key:
1. Sign in to the console
2. Open [API Key Management](/user/key) and create or copy your key
3. Append `key=YOUR_API_KEY` to the request URL (or pass it in form/JSON when the endpoint accepts it)

---

## API Information

- **URL**: `POST http://apis.xiaobao.ink/api/audio/audiocopypro`
- **Content-Type**: `application/json` (request body commonly `application/json` or `application/x-www-form-urlencoded` for POST)
- **HTTP Method**: `POST`

### Request Parameters

| Parameter | Required | Description |
|-----------|----------|-------------|
| `audio_url` | Yes | https://example.com/demo.mp3 |

> **Note**: `key` (API key) is required for authenticated calls even if omitted from the parameter list above.

### Request Example

```
http://apis.xiaobao.ink/api/audio/audiocopypro?key=你的密钥
```

## Details

## 请求HEADER：

| 名称 | 值 |
| --- | --- |
| Content-Type | application/x-www-form-urlencoded;charset=utf-8 或 application/json |

## 接口说明：

声音复刻PRO用于将原人声克隆为可复用的音色ID。克隆成功后，将返回的 `voice` 传入「语音合成PRO」即可用该音色朗读文本。

**关联接口：**语音合成PRO `/api/audio/audiosavepro`、声音设计PRO `/api/audio/sounddesignpro`

## 计费说明：

按次计费，默认 **200 点/次**（约 2 元/次）。免费额度以控制台配置为准（文档参考免费 3 次）。

## 请求参数说明：

| 名称 | 必填 | 类型 | 示例值 | 说明 |
| --- | --- | --- | --- | --- |
| key | 是 | string | 你的平台密钥 | 接口密钥，在控制台→密钥管理查看 |
| audio_url | 是 | string | https://xx.mp3 | 音频URL（5秒-60秒，推荐10-30秒）。支持 mp3、wav、m4a；采样率须≥16kHz；文件大小10MB以内；支持单/双声道。语种：中文普通话、地方官话、英文、法语、德语、日语、韩语、俄语、葡萄牙语、泰语、印尼语、越南语等 |

## 录音友情提示：

- 请确保音频内容清晰流畅不卡顿
- 录制过程确保环境安静，没有明显环境噪音
- 录制过程中只能有一个人的声音，避免其它人声
- 不要长时间不说话，保证语速平稳
- 不要声音语调时高时低，保持音量均衡
- 不得进行混响特效处理，不得带背景音乐和音效
- 须为原音录制，不得对音频切分、合并或剪辑

## 朗读文本参考：

**知识分享：**早上醒来，窗外的鸟儿在歌唱。阳光透过树叶，洒在温暖的床单上。

**情感博主：**当我们遇到挫折，父母总是第一个伸出援手，给予我们鼓励和支持。

## 返回参数说明：

| 名称 | 类型 | 说明 |
| --- | --- | --- |
| code | int | 状态码 |
| msg | string | 状态信息 |
| data | object | 结果数据 |
| - voice | string | 音色ID；超过1年未使用的音色ID将被清除 |
| - power_cost | number | 本次扣点 |
| exec_time | float | 执行耗时 |
| ip | string | 客户端IP |

## 错误码：

| 错误码 | 类型 | 说明 |
| --- | --- | --- |
| 403 | int | 没有权限（密钥无效等） |
| 400 | int | 参数传递不正确 / 业务失败 |
| 500 | int | 服务器内部错误 |

## Response Example

```json
{
    "code": 200,
    "msg": "声音克隆成功",
    "data": {
        "voice": "voice-68e021aa448346fb8cc0575a163229eb",
        "power_cost": 200
    },
    "exec_time": 2.579,
    "ip": "1.2.3.4"
}
```

## Error Codes

| 错误码 | 类型 | 说明 |
| --- | --- | --- |
| 403 | int | 没有权限（密钥无效等） |
| 400 | int | 参数传递不正确 / 业务失败 |
| 500 | int | 服务器内部错误 |

## Usage Flow

1. Obtain your API Key from the console
2. Call the endpoint with `key` and required parameters
3. Parse the JSON (or binary) response according to the examples above

---

_Generated for AI / LLM consumption. Source of truth: `api_list` (same as HTML `/doc/{id}`)._
