Skip to main content
POST
/
v1
/
audio
/
speech
文本转音频
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"
}
'
{}
通过该端点,您可以使用指定的模型和语音将文本转换为语音。

请求正文

  • model`(字符串): 用于文本到语音转换的模型。
  • input`(字符串): 要转换为语音的输入文本。
  • voice (字符串): 用于语音合成的声音。 示例
{
  "model": "tts-1",
  "input": "The quick brown fox jumped over the lazy dog.",
  "voice": "alloy"
}

Authorizations

Authorization
string
header
required

Bearer token authentication. Use your DeerAPI key.

Body

application/json
model
string
default:gpt-5.2
required

可用的 TTS 模型之一:tts-1 或 tts-1-hd

input
string
default:Hello
required

要生成音频的文本。最大长度为4096个字符。

voice
string
default:example
required

生成音频时使用的语音。支持的语音有:alloy、echo、fable、onyx、nova 和 shimmer。

response_format
string

默认为 mp3 音频的格式。支持的格式有:mp3、opus、aac 和 flac。

speed
number

默认为 1 生成的音频速度。选择0.25到4.0之间的值。1.0是默认值。

Response

200 - application/json

Successful Response

The response is of type object.