
Keep credentials on the server and use the OpenAI-compatible base URL.
TypeScript
import OpenAI from "openai";
const client = new OpenAI({
apiKey: process.env.TEENAGEWORKS_API_KEY,
baseURL: "https://api.teenage.works/v1",
});Avoid exposing TEENAGEWORKS_API_KEY in browser code.
Name keys after their deployment and revoke them when that deployment is retired.
Manage API keysTypeScript
const audio = await client.audio.speech.create({
model: "teen-v1",
voice: "voice_support_01",
input: "Your order is ready.",
instructions: "Clear, warm, and concise.",
});
On this page