Protecting OpenRouter / Ollama access from the client
Expose an OpenRouter or local Ollama endpoint to a front end without handing clients a credential or a wide-open gateway URL.
The problem
OpenRouter keys and self-hosted Ollama gateways are just as leakable as an OpenAI key when a browser calls them directly. A public gateway URL with no session control is an open invitation to abuse.
With Perishable
Point OPENAI_BASE_URL at OpenRouter or your Ollama instance and put Perishable in front. The same fingerprint, entropy, JWT, and rate-limit machinery applies, so clients get bounded, expiring access instead of a raw endpoint.
Step by step
base-urlSet OPENAI_BASE_URL to the OpenRouter or Ollama endpoint.
proxyStart perishable-proxy with the upstream credential in env.
sessionClients receive fingerprint-bound, short-lived JWTs — no raw URL.
guardRate limits keep a single client from monopolising the gateway.
Outcome
- OpenRouter / Ollama reachable from the browser, safely
- No credential or raw gateway URL in client code
- Uniform session and rate-limit controls across providers
Try it on your app
Follow the quickstart or read the request flow.