OpenAI patch
1. Install and configure
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.
python -m pip install "teenageworks[openai]"2. Patch before creating the client
from teenageworks import patch_openai
patch_openai()3. Keep the existing OpenAI call
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.",
response_format="mp3",
)Use a TeenageWorks voice ID directly, or pass reference_audio and reference_audio_format to clone a voice. For a clone, the provider voice ID is ignored. OpenAI instructions is not applied and emits a warning if supplied.
Routed model IDs
teen-v1tts-1tts-1-hdgpt-4o-mini-ttsgpt-4o-mini-tts-2025-12-15
Unknown 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 parameters