This backend mints ephemeral Realtime client secrets and proxies image generation so the Unity sample never sees the parent API key.
- Copy
.env.exampleto.envand setOPENAI_API_KEY. - Install dependencies:
npm install - Start the server:
npm start
The server listens on http://localhost:3000 by default (override with PORT).
GET /healthPOST /realtime/client-secret- Body:
{ "session": { ... }, "expires_after_seconds": 600 }or{ "expires_after": { "anchor": "created_at", "seconds": 600 }, "session": { ... } } - Returns the OpenAI client secret response.
- Body:
POST /images/generations- Proxies the OpenAI Images API and forces
response_formattob64_json.
- Proxies the OpenAI Images API and forces