curl -X POST "https://t.ato2.nodesms.com/v1/audio/speech" \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "tts-1",
"input": "The quick brown fox jumped over the lazy dog.",
"voice": "alloy"
}' \
--output speech.mp3
from openai import OpenAI
client = OpenAI(
api_key="sk-xxxxxx",
base_url="https://t.ato2.nodesms.com/v1"
)
response = client.audio.speech.create(
model="tts-1",
voice="alloy",
input="The quick brown fox jumped over the lazy dog."
)
response.stream_to_file("speech.mp3")
(audio binary data, Content-Type: audio/mpeg)
Audio Speech
Convert text to audio
POST
/
v1
/
audio
/
speech
curl -X POST "https://t.ato2.nodesms.com/v1/audio/speech" \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "tts-1",
"input": "The quick brown fox jumped over the lazy dog.",
"voice": "alloy"
}' \
--output speech.mp3
from openai import OpenAI
client = OpenAI(
api_key="sk-xxxxxx",
base_url="https://t.ato2.nodesms.com/v1"
)
response = client.audio.speech.create(
model="tts-1",
voice="alloy",
input="The quick brown fox jumped over the lazy dog."
)
response.stream_to_file("speech.mp3")
(audio binary data, Content-Type: audio/mpeg)
Headers
string
required
Bearer token authentication. Format:
Authorization: Bearer sk-xxxxxxBody
Format:application/json
string
required
Model ID
string
required
Text to convert, up to 4096 characters
string
required
Voice, allowed values:
alloy, echo, fable, onyx, nova, shimmerstring
default:"mp3"
Audio output format, allowed values:
mp3, opus, aac, flac, wav, pcmnumber
default:"1"
Speech speed, range
0.25 to 4Response
200 Success
Format:audio/mpeg
file
Audio fileFormat:
binarycurl -X POST "https://t.ato2.nodesms.com/v1/audio/speech" \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "tts-1",
"input": "The quick brown fox jumped over the lazy dog.",
"voice": "alloy"
}' \
--output speech.mp3
from openai import OpenAI
client = OpenAI(
api_key="sk-xxxxxx",
base_url="https://t.ato2.nodesms.com/v1"
)
response = client.audio.speech.create(
model="tts-1",
voice="alloy",
input="The quick brown fox jumped over the lazy dog."
)
response.stream_to_file("speech.mp3")
(audio binary data, Content-Type: audio/mpeg)
Last modified on October 28, 2026
Was this page helpful?