Voice Generation

Convert text to natural-sounding speech. Voice selection, speed control, streaming, and SSML.

FairStack offers 17 voice models with 168+ preset voices. From budget TTS at $0.001/request to premium ElevenLabs quality.

Basic TTS

curl -X POST https://api.fairstack.ai/v1/generations/voice \
  -H "Authorization: Bearer $FAIRSTACK_API_KEY" \
  -d '{'{'}"model": "cosyvoice2", "prompt": "Hello world", "voice": "alloy"}'

Voice selection

List available voices:

curl https://api.fairstack.ai/v1/voices

Voices vary by model. FairStack Voice v1 and IndexTTS2 support zero-shot voice cloning. ElevenLabs has its own voice library.

Speed and format

Control speech speed (0.5x to 2.0x) and output format (mp3, wav, ogg):

{'{'}
  "model": "cosyvoice2",
  "prompt": "Speak slowly and clearly",
  "voice": "alloy",
  "speed": 0.8,
  "output_format": "mp3"
}

Next steps