This page requires Python familiarity. It covers programmatic voice configuration from Python functions. The PolyAI platform supports flexible voice selection for external providers such as ElevenLabs, Cartesia, Rime, PlayHT, Minimax, Hume, and Google TTS.Documentation Index
Fetch the complete documentation index at: https://polyai-mintlify-3b299f94.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
Provider classes
When picking models, adjusting stability, or accessing third-party providers – use provider-specific TTSVoice classes.Example: ElevenLabs
eleven_monolingual_v1, eleven_multilingual_v1, eleven_turbo_v2, eleven_turbo_v2_5, eleven_flash_v2_5, and eleven_v3. The default is eleven_turbo_v2_5. See ElevenLabs for details on each model.
Example: Cartesia
Some Cartesia voices are faster than expected at the default speed. Test your chosen voice at
speed=0.0 before deploying, and adjust toward -1.0 if the output is too fast.EmotionKind:ANGER,POSITIVITY,SURPRISEEmotionIntensity:LOWEST,LOW,HIGH,HIGHEST
sonic-3 or sonic-3.5), the following additional parameters are supported:
volume(float, optional) – controls output volume (e.g. 0.5–2.0).emotion(str, optional) – emotion string (e.g."happy"). Sonic 3 models support a 10-emotion set.language(str, optional) – language code (e.g."en").speed– on Sonic 3 models, the effective speed range is0.6–1.5.
sonic-3.5 is the latest Cartesia model and inherits all Sonic 3 behavior. Use it for the most natural, expressive output; fall back to sonic-3 or sonic if you need an earlier model for parity with existing voices.
Example: Rime
Example: Minimax
Example: Hume
Example: Google TTS
Example: Custom provider
Voice randomization
UseVoiceWeighting to randomly select a voice based on weighted probabilities:
- Weights must sum to 1.0.
- Voices without explicit weights share the remaining probability equally.
Cache behavior
- Changing
model_iddoes not automatically invalidate cached audio. - To reset cached audio:
- Go to Channels > Voice > Audio management and delete existing cache entries.
- Or, create a new voice entry with a different voice ID.
Language codes
When configuring a voice, make sure the language code in theprovider_voice_id matches your deployment’s locale. An incorrect language code (e.g. en-GB instead of en-IE) can cause the TTS provider to render a different accent or voice than expected, even when the correct voice ID is set.
Additional options
- stability – controls tone variability across runs (ElevenLabs).
- speed – adjusts speech rate (ElevenLabs:
0.7–1.2; PlayHT:0.1–5.0; other providers may differ). - randomize_voice() – supports external providers for weighted selection.

