DeerAPI 文本转音频 API(POST /v1/audio/speech)支持选择 tts-1 模型与 voice 声线,将 input 文本快速转换为语音输出。
curl --request POST \
--url https://api.deerapi.com/v1/audio/speech \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "tts-1",
"input": "The quick brown fox jumped over the lazy dog.",
"voice": "alloy"
}
'{}voice (字符串): 用于语音合成的声音。
示例{
"model": "tts-1",
"input": "The quick brown fox jumped over the lazy dog.",
"voice": "alloy"
}
Bearer token authentication. Use your DeerAPI key.
可用的 TTS 模型之一:tts-1 或 tts-1-hd
要生成音频的文本。最大长度为4096个字符。
生成音频时使用的语音。支持的语音有:alloy、echo、fable、onyx、nova 和 shimmer。
默认为 mp3 音频的格式。支持的格式有:mp3、opus、aac 和 flac。
默认为 1 生成的音频速度。选择0.25到4.0之间的值。1.0是默认值。
Successful Response
The response is of type object.
curl --request POST \
--url https://api.deerapi.com/v1/audio/speech \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "tts-1",
"input": "The quick brown fox jumped over the lazy dog.",
"voice": "alloy"
}
'{}