Skip to content
Platform / Docs / Text to speech Pro API

API Reference

Text to speech Pro API

POST tts-pro-api ID 31

Higher-fidelity text to speech. Can be paired with Voice cloning Pro.

POST https://xiaoapis.com/api/audio/audiosavepro

Overview

  • 文本转语音
  • 对接复刻音色
  • 异步任务

Use cases

  • 专业配音
  • 批量合成
  • 数字人驱动
Conventions
  • Gateway · https://xiaoapis.com
  • Auth · send key (query or JSON body, as this API specifies)
  • Response · JSON. Check the business code and the HTTP status, not only HTTP 200

Authentication

Send the platform API key (query parameter key or JSON field key, as this page specifies). Create one in API key management.

POST https://xiaoapis.com/api/audio/audiosavepro
Content-Type: application/json

{
  "key": "YOUR_API_KEY"
}

Request example

https://xiaoapis.com/api/audio/audiosavepro?key=你的密钥

Details

请求HEADER:

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

接口说明:

文本语音合成接口:将文本转为音频。音色ID通过「声音复刻PRO」或「声音设计PRO」获取。

关联接口:声音复刻PRO /api/audio/audiocopypro、声音设计PRO /api/audio/sounddesignpro

计费说明:

按量计费:默认 200 点/万字(约 2 元/万字)。字符统计:1个中文=2字符,1个英文字母、1个标点或句中空格=1字符。扣点公式:ceil(计费字符 × 单价 / 10000),至少 1 点。

默认返回转存后的 audio_url;若传 base64=true,则返回音频 Base64。

请求参数说明:

名称必填类型示例值说明
key是string你的平台密钥接口密钥,在控制台→密钥管理查看
text是string我像小草一样在发芽。文本内容,单次不超过2000计费字符;建议使用中文符号;支持识别中小学常见数学表达式
voice是stringvoice-68e021aa448346fb8cc0575a163229eb音色ID,通过声音复刻PRO / 声音设计PRO 返回
format否stringmp3音频格式,默认mp3,支持 mp3、wav、pcm
sample_rate否string22050采样率:8000 / 16000 / 22050 / 24000 / 44100 / 48000
volume否string50音量调整(0~100),默认50
rate否string1.0语速调整(0.5~2),默认1.0
pitch否string1.0音调调整(0.5~2),默认1.0
base64否stringtrue不传或空:返回 audio_url;传 true:返回 Base64 编码

返回参数说明:

名称类型说明
codeint状态码
msgstring状态信息
dataobject结果数据
- audio_urlstring音频地址(未传 base64 时)
- base64string音频 Base64(base64=true 时)
- formatstring音频格式
- sample_rateint采样率
- billable_charsint本次计费字符数
- power_costnumber本次扣点
exec_timefloat执行耗时
ipstring客户端IP

错误码:

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

Response example

{"code":200,"msg":"语音合成成功","data":{"audio_url":"https://xiaoapis.com/upload/audio/2026/07/15/ttspro_xxx.mp3","format":"mp3","sample_rate":22050,"billable_chars":20,"power_cost":1},"exec_time":1.2,"ip":"1.2.3.4"}

Error codes

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

FAQ

PRO 与标准 TTS 如何选择?

按音质、功能与价格对照文档与控制台选择;能力字段不完全相同。

能否用复刻音色?

可以,按文档将复刻结果标识传入合成参数。

怎么调用?

提交文案、音色与 Key,异步查询结果。

返回什么?

音频地址及任务状态等,见返回示例。

适合数字人吗?

适合。将合成音频作为数字人驱动音频即可。

Full console doc (with the debugger):/doc/31