跳转到主要内容
POST
/
v1
/
audio
/
speech
curl --request POST \
  --url 'https://api.elkapi.com/v1/audio/speech' \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "model": "tts-1",
  "input": "今天天气真好,适合出去散步。",
  "voice": "alloy",
  "response_format": "mp3"
}'
"string"

Documentation Index

Fetch the complete documentation index at: https://docs.elkapi.com/llms.txt

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

curl --request POST \
  --url 'https://api.elkapi.com/v1/audio/speech' \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "model": "tts-1",
  "input": "今天天气真好,适合出去散步。",
  "voice": "alloy",
  "response_format": "mp3"
}'
"string"

Authorizations

Authorization
string
必填
所有接口均需要使用 Bearer Token 进行认证。在请求头中添加:
Authorization: Bearer YOUR_API_KEY

Body

model
string
默认值:"tts-1"
必填
示例:tts-1
input
string
必填
要转换的文本
voice
string
必填
可选值:alloyechofableonyxnovashimmer
response_format
string
默认值:"mp3"
可选值:mp3opusaacflacwavpcm
speed
number
默认值:"1"