Skip to main content

语音合成 TTS

POST /v1/audio/speech
参数类型必填说明
modelstringtts-1tts-1-hd
inputstring待合成的文本
voicestringalloyechofableonyxnovashimmer
response_formatstringmp3opusaacflac
speednumber0.25 ~ 4.0
curl https://your-domain.com/v1/audio/speech \
  -H "Authorization: Bearer sk-xxxx" \
  -H "Content-Type: application/json" \
  -d '{"model":"tts-1","input":"你好","voice":"alloy"}' \
  --output speech.mp3

语音识别 STT

POST /v1/audio/transcriptions multipart/form-data 上传:
字段必填说明
file音频文件
modelwhisper-1
languageISO-639-1
response_formatjsontextsrtvtt
curl https://your-domain.com/v1/audio/transcriptions \
  -H "Authorization: Bearer sk-xxxx" \
  -F file="@audio.mp3" \
  -F model="whisper-1"