DEV Community

Cover image for How I Built an AI Billing Firewall for OpenRouter and Supabase
FOKRUL ISLAM
FOKRUL ISLAM

Posted on

How I Built an AI Billing Firewall for OpenRouter and Supabase

AI Aggregator platforms face a common problem: unexpected API costs.

A spam attack, bad prompt loop, or runaway agent can generate hundreds of dollars in OpenRouter charges before anyone notices.

To solve this, I built Aivora Gatekeeper — an AI Billing Firewall for OpenRouter-powered applications.

Features

  • Usage quota enforcement
  • Workspace budget caps
  • Cost estimation before requests
  • OpenRouter request gating
  • Subscription-tier limits
  • Analytics dashboard
  • JWT/RBAC foundation
  • 67 automated tests

Why I Built It

Without protection, AI aggregator platforms can accumulate significant API costs from abuse, spam, or misconfigured agents.

Aivora Gatekeeper sits between users and AI providers, enforcing budgets and quotas before requests reach OpenRouter.

Tech Stack

  • Next.js
  • Supabase
  • OpenRouter
  • FastAPI
  • TypeScript
  • Python

GitHub

https://github.com/fokrulanthro16-eng/aivora-gatekeeper

Live Demo

https://aivora-gatekeeper.vercel.app

Feedback is welcome.

Top comments (0)