From Dev.to
OpenAI API key exposed in the browser: NEXT_PUBLIC_, VITE_ and dangerouslyAllowBrowser
The client said undefined, so the key got a prefix. Then the SDK refused to run in the browser, so it got a flag: "use client"; const openai = new OpenAI({ apiKey: process.env.NEXT_PUBLIC_OPENAI_API...