
Install the openai extra, then set both TEENAGEWORKS_API_KEY and OPENAI_API_KEY. The OpenAI key remains necessary for calls that are not rerouted.
Linux / Mac / Windows
python -m pip install "teenageworks[openai]"Python
from teenageworks import patch_openai
patch_openai()Python
from openai import OpenAI
client = OpenAI()
speech = client.audio.speech.create(
model="gpt-4o-mini-tts",
voice="alloy",
input="This speech call is routed to Teen V1.",
instructions="Young, warm, conversational narrator",
response_format="mp3",
)instructions maps to request-time voice_description. The patch also accepts voice_description, reference audio, and the canonical or legacy transcript name directly. Inline voice-modelling fields do not use the OpenAI voice ID.
teen-v1tts-1tts-1-hdgpt-4o-mini-ttsgpt-4o-mini-tts-2025-12-15Unknown speech models pass through to OpenAI. Non-speech resources are never rerouted.
The patch covers tested synchronous and asynchronous clients, module-level speech access, raw responses, and streaming-response wrappers.
Review translated parametersOn this page