Skip to main content
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
Binary audio file (MP3)
Content-Type: audio/mpeg
model
string
required
TTS model. tts-1 (faster, lower quality) or tts-1-hd (slower, higher fidelity).
input
string
required
Text to convert to speech. Maximum 4096 characters.
voice
string
required
Voice preset. Options: alloy, echo, fable, onyx, nova, shimmer.
  • alloy — neutral, versatile
  • echo — male, authoritative
  • fable — British accent, storytelling
  • onyx — deep, powerful
  • nova — female, friendly
  • shimmer — female, soft
response_format
string
default:"mp3"
Audio format. Options: mp3, opus, aac, flac, wav. Use opus for lowest latency.
speed
number
default:"1.0"
Playback speed. Range: 0.25 to 4.0. 1.0 = normal speed.
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
Binary audio file (MP3)
Content-Type: audio/mpeg