亮色模式
Create speech
POST
https://api.openai.com/v1/audio/speechCreates a model response for the given chat conversation. Learn more in the text generation, vision, and audio guides.
Request
Header 参数
Authorization
string
必需
示例值:
Bearer $OPENAI_API_KEY
Content-Type
string
必需
示例值:
application/json
Body 参数application/json
model
string
必需
One of the available TTS models: tts-1
or tts-1-hd
input
string
必需
The text to generate audio for. The maximum length is 4096 characters.
voice
string
必需
The voice to use when generating the audio. Supported voices are alloy
, echo
, fable
, onyx
, nova
, and shimmer
. Previews of the voices are available in the Text to speech guide.
示例
{
"model": "tts-1",
"input": "The quick brown fox jumped over the lazy dog.",
"voice": "alloy"
}
Request samples
返回响应
Success(200)
HTTP Code: 200
Content Type : JSONapplication/json
The audio file content.
数据结构
object {0}
示例
未设置
最后修改时间: 10 天前