跳转到主要内容
POST
/
v1
/
audio
/
speech
文本转语音
curl --request POST \
  --url https://api.ldx.dev/v1/audio/speech \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "model": "tts-1",
  "input": "<string>",
  "voice": "alloy",
  "response_format": "mp3",
  "speed": 1
}
'
"<string>"

Documentation Index

Fetch the complete documentation index at: https://docs.liandanxia.io/llms.txt

Use this file to discover all available pages before exploring further.

授权

Authorization
string
header
必填

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

请求体

application/json
model
string
必填
示例:

"tts-1"

input
string
必填

要转换的文本

Maximum string length: 4096
voice
enum<string>
必填
可用选项:
alloy,
echo,
fable,
onyx,
nova,
shimmer
response_format
enum<string>
默认值:mp3
可用选项:
mp3,
opus,
aac,
flac,
wav,
pcm
speed
number
默认值:1
必填范围: 0.25 <= x <= 4

响应

200 - audio/mpeg

成功生成音频

The response is of type file.