Client-side AI demos without a backend
Ship an interactive demo or prototype that calls a model straight from the browser — without standing up a bespoke backend just to hide a key.
The problem
A demo that calls OpenAI directly from the browser needs the key in the page. The moment it is public, a scraper finds it, and you are into a billing surprise and a key-rotation sprint. Building a whole backend for a throwaway prototype is overkill.
With Perishable
Run npx perishable-proxy next to the demo. The proxy holds the key; the browser SDK requests a short-lived, fingerprint-bound session. The demo works from a static page, and the secret never ships in the bundle.
Step by step
proxyStart perishable-proxy with your key in server-side env.
sdkDrop client.PerishableOpenAI into the page and point it at the proxy URL.
entropyinitEntropyCollection gates session minting on real input.
shipDeploy the static demo; the key stays behind the proxy.
Outcome
- A public demo with no key in the bundle
- No custom backend to build or maintain
- Casual scraping and key extraction defeated
Try it on your app
Follow the quickstart or read the request flow.