- 在线调用-使用说明
- 基础模型
- 大语言模型 LLM
- 语音识别 ASR
- 语音合成 TTS
- 图片生成 Images Generations
- 视频合成 Video Generations
- RAG模型
- 音色处理 voice processing
- 图生图 Image to Image
- 智能体
- 聊天机器人V3 AI角色(socket)
- AI桌面助手 V1 AI角色
- socket Device认证
- 对话数据
百度 短文本合成
POST
https://api.mindcraft.com.cn/v1/audio/speech
请求参数
Header 参数
Authorization
string
认证信息
示例值:
Bearer {{api_key}}
Body 参数application/json
model
enum<string>
模型选择
枚举值:
BD_TTS_realtime_zh
示例值:
BD_TTS_realtime_zh
voice_id
enum<integer>
必需
枚举值:
013450035118106103110111540034106411541194105411741004103414442784143414041294149425442064226
示例值:
0
text
string
语音合成文案
speed
integer
声音语速
>= 0<= 15
默认值:
5
volume
integer
声音音量
>= 0<= 15
默认值:
5
output_format
enum<string>
音频格式
枚举值:
mp3pcmwav
示例值:
mp3
audio_sample_rate
enum<integer>
合成声音的采样率
枚举值:
80001600024000
picth
integer
声音语调
>= 0<= 15
默认值:
5
示例
{
"model": "BD_TTS_realtime_zh",
"voice_id": "0",
"text": "你好啊,你叫什么名字",
"speed": 5,
"volume": 5,
"output_format": "mp3",
"audio_sample_rate": 16000
}
示例代码
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://api.mindcraft.com.cn/v1/audio/speech' \
--header 'Authorization: Bearer ' \
--header 'Content-Type: application/json' \
--data-raw '{
"model": "BD_TTS_realtime_zh",
"voice_id": "0",
"text": "你好啊,你叫什么名字",
"speed": 5,
"volume": 5,
"output_format": "mp3",
"audio_sample_rate": 16000
}'
返回响应
🟢200成功
application/octet-stream
Body
id
string
请求ID
category
string
TTS 类型
model
string
必需
voice_id
string
TTS 音色
data
object
必需
category
string
TTS 类型
model
string
必需
voice_id
string
TTS 音色
word_count
integer
必 需
audio_file
string
音频链接
subtitle_file
string
必需
audio_length
integer
必需
audio_size
integer
必需
audio_sample_rate
integer
必需
bitrate
integer
必需
usage_characters
integer
必需