
Install the elevenlabs extra, then set both TEENAGEWORKS_API_KEY and the ElevenLabs credential used by your application. The provider credential remains necessary for calls that pass through.
Linux / Mac / Windows
python -m pip install "teenageworks[elevenlabs]"Python
from teenageworks import patch_elevenlabs
patch_elevenlabs()Python
from elevenlabs.client import ElevenLabs
client = ElevenLabs()
chunks = client.text_to_speech.convert(
voice_id="provider-voice-id",
text="This call is routed to Teen V1.",
model_id="eleven_multilingual_v2",
voice_description="Young, warm, conversational narrator",
output_format="mp3_44100_128",
)The patched method accepts custom request-time voice_description and reference fields. When one is supplied, the provider voice ID is not used for the TeenageWorks request.
teen-v1, models beginning with eleven_, and the omitted provider default route to TeenageWorks. Unknown custom model IDs pass through to ElevenLabs.
The patch covers tested synchronous and asynchronous convert() and stream() methods, supported persistent text-input sockets, and raw-response variants.
On this page