Skip to content

OpenAI TTS ​

音频接口用于文本转语音(TTS),将文本内容转换为自然语音。

语音合成 ​

http
POST /v1/audio/speech
bash
curl --location --request POST 'https://neolink.com/api/v1/audio/speech' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <API Key>' \
--data-raw '{
    "model": "<Model ID>",
    "input": "你好,我是语音转换模型",
    "voice": "alloy",
    "response_format": "mp3"
  }'
python
import requests

url = "https://neolink.com/api/v1/audio/speech"

headers = {
"Authorization": "Bearer <API Key>"
}

files = {
"model": (None, "<Model ID>"),
"input": (None, "你好,我是语音转换模型"),
"voice": (None, "alloy"),
"response_format": (None, "mp3"),
}

response = requests.post(url, headers=headers, files=files)

print(response.status_code)
print(response.text)

支持模型Id:

  • tts-1
  • tts-1-1106
  • tts-1-hd
  • tts-1-hd-1106