cd /news/ai-tools/in-browser-llm-router-without-exposi… · home › topics › ai-tools › article
[ARTICLE · art-181462] src=aifoc.us ↗ pub= topic=ai-tools verified=true sentiment=↑ positive

in-browser LLM router without exposing API keys to every page

A developer built an in-browser LLM routing pattern using the MessageChannel API and entangled Port API, demonstrated through the side project port-authority.dev, to let client-side web apps call language models without exposing API keys to every page. The work responds to a previously highlighted problem that any browser-based app calling a language model must otherwise embed or expose its keys. The post details inter-frame communication patterns, including delegated discovery between apps that do not know about each other.

recommendation

Keep model API keys in a single trusted broker frame and route requests from untrusted pages over MessageChannel ports rather than embedding credentials in each client-side app.

more in playbook: Securing agents and AI tools
by read1 min views2 publishedDec 3, 2026

A forewarning, this is a really long post, but I think you will like it.

I have a very soft spot for the MessageChannel API. I think it’s magical, and I’ve been building a side-passion project port-authority.dev that aims to showcase some of the patterns for inter-site or inter-frame communication that is enabled by the entangled Port API. It enables some experiences that I think most web developers don’t know, including features like delegated discovery and subsequent communication between two apps that don’t know about each other. During the development of this project it enabled me to answer a problem that I found in “calling apis from the browser shouldn’t mean exposing keys” which highlighted the problem for anyone building a client-side web app that calls a language model, you have to either:

── more in #ai-tools 4 stories · sorted by recency
── more on @messagechannel 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
→ Live at https://your-agent.zahid.host ✓
Get free account → Pricing
from €0/mo · no card required
LIVE [news/in-browser-llm-route…] indexed:0 read:1min 2026-12-03 · —