curl https://www.samuraiapi.in/v1/audio/speech \
-H "Authorization: Bearer $SAMURAI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "tts-1-hd",
"voice": "nova",
"input": "The way of the samurai is found in death.",
"speed": 0.9
}' \
--output speech.mp3
from pathlib import Path
response = client.audio.speech.create(
model="tts-1-hd",
voice="nova",
input="The way of the samurai is found in death.",
speed=0.9
)
response.stream_to_file(Path("speech.mp3"))
Binary audio file (MP3)
Content-Type: audio/mpeg
Audio
Create Speech
Convert text to natural-sounding audio. Choose from 6 voices and 5 audio formats.
POST
/
audio
/
speech
curl https://www.samuraiapi.in/v1/audio/speech \
-H "Authorization: Bearer $SAMURAI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "tts-1-hd",
"voice": "nova",
"input": "The way of the samurai is found in death.",
"speed": 0.9
}' \
--output speech.mp3
from pathlib import Path
response = client.audio.speech.create(
model="tts-1-hd",
voice="nova",
input="The way of the samurai is found in death.",
speed=0.9
)
response.stream_to_file(Path("speech.mp3"))
Binary audio file (MP3)
Content-Type: audio/mpeg
Voice preset. Options:
alloy, echo, fable, onyx, nova, shimmer.alloy— neutral, versatileecho— male, authoritativefable— British accent, storytellingonyx— deep, powerfulnova— female, friendlyshimmer— female, soft
curl https://www.samuraiapi.in/v1/audio/speech \
-H "Authorization: Bearer $SAMURAI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "tts-1-hd",
"voice": "nova",
"input": "The way of the samurai is found in death.",
"speed": 0.9
}' \
--output speech.mp3
from pathlib import Path
response = client.audio.speech.create(
model="tts-1-hd",
voice="nova",
input="The way of the samurai is found in death.",
speed=0.9
)
response.stream_to_file(Path("speech.mp3"))
Binary audio file (MP3)
Content-Type: audio/mpeg