Skip to content

Speech from Text

The Speech from Text card converts written text into spoken audio using ElevenLabs. You can use an existing voice, design a new one from a description, or clone a voice from an audio sample.

Use canonical generation_type: "speech_from_text" for all speech generation. Choose the voice path with data.voice_method.

Methoddata.voice_methodDescription
My Voicesmy_voicesUse an existing saved voice by ID.
Design Voicedesign_voiceCreate a new voice from a text description.
Clone Voiceclone_voiceClone a voice from an audio sample.

Use an existing ElevenLabs voice to generate speech.

POST /v1/autocontentengine/{id}/cells/{cell_id}/generate?agent_id={agent_id}
FieldTypeRequiredDescription
generation_typestringYes"speech_from_text".
data.scriptstringYesThe text to convert to speech.
data.voice_methodstringYes"my_voices".
data.voice_idstringYesSaved voice ID.
data.languagestringNoLanguage code, for example "en".
data.speednumberNoPlayback speed.
Terminal window
curl -X POST "https://api.gen.pro/v1/autocontentengine/101/cells/3000/generate?agent_id=42" \
-H "X-API-Key: your-api-key" \
-H "Content-Type: application/json" \
-d '{
"generation_type": "speech_from_text",
"data": {
"script": "Welcome back to another episode of our series.",
"voice_method": "my_voices",
"voice_id": "pNInz6obpgDQGcFmaJgB"
}
}'

Create a brand-new voice from a text description and use it to generate speech.

POST /v1/autocontentengine/{id}/cells/{cell_id}/generate?agent_id={agent_id}
FieldTypeRequiredDescription
generation_typestringYes"speech_from_text".
data.scriptstringYesThe text to convert to speech.
data.voice_methodstringYes"design_voice".
data.namestringYesA name for the new voice.
data.languagestringYesLanguage code (e.g., "en").
data.genderstringYes"male" or "female".
data.voice_promptstringYesA description of the voice characteristics (e.g., "warm, friendly narrator with a slight British accent").
Terminal window
curl -X POST "https://api.gen.pro/v1/autocontentengine/101/cells/3000/generate?agent_id=42" \
-H "X-API-Key: your-api-key" \
-H "Content-Type: application/json" \
-d '{
"generation_type": "speech_from_text",
"data": {
"script": "Welcome back to another episode of our series.",
"voice_method": "design_voice",
"name": "Friendly Narrator",
"language": "en",
"gender": "male",
"voice_prompt": "warm, friendly narrator with a slight British accent"
}
}'

Clone a voice from an audio sample and use the clone to generate speech.

POST /v1/autocontentengine/{id}/cells/{cell_id}/generate?agent_id={agent_id}
FieldTypeRequiredDescription
generation_typestringYes"speech_from_text".
data.scriptstringYesThe text to convert to speech.
data.voice_methodstringYes"clone_voice".
data.namestringYesA name for the cloned voice.
data.audio_resource_idstringYesContent resource ID for the voice sample.
data.languagestringYesLanguage code (e.g., "en").
data.genderstringYes"male" or "female".
Terminal window
curl -X POST "https://api.gen.pro/v1/autocontentengine/101/cells/3000/generate?agent_id=42" \
-H "X-API-Key: your-api-key" \
-H "Content-Type: application/json" \
-d '{
"generation_type": "speech_from_text",
"data": {
"script": "Welcome back to another episode of our series.",
"voice_method": "clone_voice",
"name": "My Custom Voice",
"audio_resource_id": "audio_res_123",
"language": "en",
"gender": "male"
}
}'

These options can be added to the data object for any voice method:

FieldTypeDefaultDescription
enhance_voicebooleanfalseApply post-processing to enhance audio clarity.

All voice methods return a generation ID. Poll Check generation status until complete. The finished generation includes the audio URL in output_resources.

{
"id": 9000,
"status": "completed",
"output_resources": [
{
"id": 1500,
"url": "https://cdn.gen.pro/outputs/voiceover-abc123.mp3",
"object_type": "audio",
"type": "output"
}
]
}

FieldTypeDescription
autoGeneratebooleanAuto-trigger generation when the script cell changes.

Voice method, voice ID, language, and gender are passed in the generation data parameter, not stored as cell attributes.