Documentation
How UsageGate works
UsageGate is the control plane for your SaaS. You define who gets which features and how many credits. We enforce that in your backend in milliseconds — and refill balances when your Stripe says someone paid.
Who is who
| Role | Example | What they do here |
|---|---|---|
| You (UsageGate customer) | Acme AI founder | Sign up, draw rules, connect Stripe, drop in the SDK |
| Your end users | Maya in Acme's app | Never log into UsageGate — your app asks us about them |
The loop in one picture
- 1You
Draw rules
Plan → Feature → Limit
- 2You
Connect Stripe
Webhook + signing secret
- 3You
Ship the SDK
canAccess · consume · grant
- 4Maya
Uses your product
Your backend asks UsageGate
- 5Maya
Upgrades
Stripe fires invoice.paid
- 6UsageGate
Refills credits
Set balance + resetAt = period end
- 7UsageGate
Period ends
Effective balance reads as 0 until next invoice
- 8You
Watch the dashboard
Balances and burns
What you configure vs what we enforce
- You configure — plans, feature keys, limits, Stripe prices, which end-user id your app uses
- We enforce — allow / deny, atomic credit burn, period expiry from Stripe's
current_period_end, Stripe refill idempotency - You keep — your Stripe account, your login system, your product UI
Start here
- Read the customer journey (Acme AI story)
- Follow the quickstart
- Read how billing periods work (Stripe owns the clock)
- Or paste the AI setup prompt into Cursor / Claude / Copilot
