Integrations

UsageGate + Resend

Resend sends email. UsageGate enforces entitlements on every request. Same Next.js SaaS stack — they do not replace each other.

UsageGate does not send mail. Put Resend on signup and receipts. Put UsageGate on the expensive route.

UsageGate is the entitlements layer for your SaaS, with any payment gateway. See how to build a SaaS and payments architecture.

The three calls

app/api/generate/route.ts
import { GateClient } from "@usagegate/sdk";

const gate = new GateClient(process.env.USAGEGATE_KEY!);

// Spend one credit first; only do the work if it succeeded.
const spent = await gate.consume(userId, "ai_credits", 1);
if (!spent.success) {
  return Response.json({ error: "Upgrade to keep going" }, { status: 402 });
}

Env

.env.local
USAGEGATE_KEY=gk_live_…

Then Get started — plan table, key, Stripe or another gateway.

Also in this stack

Payment gateway: Stripe, Paystack, or Paddle. UsageGate is not the processor.

Ship paid plans this afternoon.

Less time on billing and usage infrastructure, more time on your product.

The minute you sign up, you get

  • A workspace with a ready-made Free, Starter and Pro plan table
  • An API key in one click, plus a copy-paste snippet for your stack
  • A Stripe webhook URL, or a one-call hook for any other gateway
  • 50,000 checks a month on us, before you pay anything