Skip to main content
POST
/
langchain
/
v1
/
audio
/
speech
Create speech (LangChain - OpenAI TTS)
curl --request POST \
  --url http://localhost:8080/langchain/v1/audio/speech \
  --header 'Content-Type: application/json' \
  --data '
{
  "model": "tts-1",
  "input": "<string>",
  "voice": "alloy",
  "response_format": "mp3",
  "speed": 2.125,
  "stream_format": "sse",
  "fallbacks": [
    "<string>"
  ]
}
'
"<string>"

Body

application/json
model
string
required

Model identifier (e.g., tts-1, tts-1-hd)

Example:

"tts-1"

input
string
required

Text to convert to speech

voice
enum<string>

Voice to use

Available options:
alloy,
echo,
fable,
onyx,
nova,
shimmer
response_format
enum<string>
Available options:
mp3,
opus,
aac,
flac,
wav,
pcm
speed
number
Required range: 0.25 <= x <= 4
stream_format
enum<string>

Set to 'sse' for streaming

Available options:
sse
fallbacks
string[]

Response

Successful response

The response is of type file.