- AI模型API中文文档
- 小爱接口和支持模型列表
- 购买地址
- 人工客服
- 常用 教程合集
- API的介绍及使用教程点击内涵链接
- 示例代码大全
- 聊天接口(Chat)
- 向量生成(Embeddings)
- 文生图片(Images)
- 音频(Audio)
TTS文本转语音
POST
https://xiaoai.plus/v1/audio/speech
请求参数
Header 参数
Authorization
string
可选
默认值:
Bearer {{YOUR_API_KEY}}
Body 参数application/json
model
string
必需
示例值:
tts-1-hdtts-1
input
string
必需
voice
string
必需
response_format
string
可选
speed
number
可选
示例
{
"model": "tts-1",
"input": "The quick brown fox jumped over the lazy dog.",
"voice": "alloy"
}
示例代码
Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://xiaoai.plus/v1/audio/speech' \
--header 'Authorization: Bearer sk-xxx' \
--header 'Content-Type: application/json' \
--data-raw '{
"model": "tts-1",
"input": "The quick brown fox jumped over the lazy dog.",
"voice": "alloy"
}'
返回响应
🟢200成功
application/json
Body
object {0}
示例
{}