Skip to main content

voiceGeneration

Converts text to speech using the ElevenLabs TTS API. Returns the generated audio as a base64-encoded MP3 string. The voice_id is expected to come from the external_id field of a trained weight — the typical upstream chain is getWeightsvoiceGeneration.

Concurrency is capped at 5 simultaneous API calls. Retries up to 3 times with exponential backoff (base 1s, multiplier 2×, max 16s).

Parameters

ParamTypeRequiredConstraintsDescription
textstringYes1–50,000 charsText to convert to speech
voice_idstringYesElevenLabs voice ID, sourced from Weight.external_id
modelstringNo (default: eleven_turbo_v2_5)TTS model: eleven_turbo_v2_5, eleven_multilingual_v2, eleven_flash_v2_5
stabilityfloatNo (default: 0.5)0.0–1.0Voice stability. Higher = more consistent
similarity_boostfloatNo (default: 0.75)0.0–1.0Voice similarity boost. Higher = closer to original voice
stylefloatNo (default: 0.0)0.0–1.0Voice expressiveness
use_speaker_boostbooleanNo (default: true)Enable speaker boost for better clarity

Output

FieldTypeDescription
audio_base64stringBase64-encoded MP3 audio data
audio_formatstringAlways "mp3"
character_countintegerNumber of characters processed by the API
voice_idstringVoice ID used for generation
model_usedstringTTS model used for generation

Example

{
"id": "tts",
"type": "voiceGeneration",
"data": {
"label": "Voice Generation",
"isExecuted": false,
"handles": ["inputs", "outputs"],
"schema": {},
"params": {
"text": { "value": "{{ $input.text }}", "isExpression": true, "isAttachedToInputNode": false },
"voice_id": { "value": "{{ @getWeights.weight.external_id }}", "isExpression": true, "isAttachedToInputNode": false },
"model": { "value": "eleven_turbo_v2_5", "isExpression": false, "isAttachedToInputNode": false },
"stability": { "value": 0.5, "isExpression": false, "isAttachedToInputNode": false },
"similarity_boost": { "value": 0.75, "isExpression": false, "isAttachedToInputNode": false }
},
"inputs": [], "outputs": [], "errors": []
},
"position": { "x": 300, "y": 0 },
"isSelected": false,
"isDragging": false
}