What happens when a demo calls the AI
The demo page never talks to the AI provider directly. It sends its request to ai-demo-lab.com/api/claude, a small proxy that adds the API key server-side and forwards the request. The key is stored as an encrypted secret and never appears in any page, script or browser.
The building blocks
-
Static hosting Cloudflare Pages
Every page on this site is a plain HTML file. No server to maintain, no database, no framework. Deployment is a folder upload; HTTPS comes built in.
-
API proxy Cloudflare Worker · ~40 lines
A single serverless function routed on
/api/*. It accepts requests from this domain only, attaches the key, calls the Anthropic API and returns the response as-is. -
AI model Anthropic API · Claude
Pay-per-use, prepaid, with a monthly spending cap. A typical demo run costs a few cents.
-
In-browser processing JavaScript
File parsing and every figure you see computed (allocations, totals, limit checks) happen locally in your browser. The AI is only asked to write narrative, never to calculate.
Guard rails
Requests to the proxy are only accepted from this domain. Spending on the AI account is capped monthly. The demos run on synthetic data only, nothing is stored server-side, and the site is excluded from search engine indexing.