Monetize your Software in Minutes.

Revstack is the open-source Billing OS for modern SaaS. Define your pricing and entitlements in code, eliminate the webhook hell, and control your revenue from a centralized infrastructure.

revstack.config.ts
typescript
import { defineConfig } from "@revstack/core";
export default defineConfig({
features: [
{
slug: "seats",
name: "Team Seats",
type: "metered",
unit_type: "count",
},
],
plans: [
{
slug: "pro",
name: "Pro",
type: "paid",
status: "active",
prices: [
{
amount: 2900,
currency: "USD",
billing_interval: "monthly",
},
],
features: {
seats: { value_limit: 5, is_hard_limit: true },
api_calls: { value_limit: 100000, reset_period: "monthly" },
},
},
],
});
Terminal
bash
$ npx revstack push
✓ Connected to Revstack
✓ Validated revstack.config.ts (Strict Mode)
✓ Synced 1 Plan & 2 Features
🚀 Push complete!

A Developer Experience you'll actually love

From codebase to first revenue in a few minutes. Define your pricing model, deploy it to the edge, and start checking entitlements without ever leaving your IDE.

Billing as Code

Define your truth in code

Your codebase is the single source of truth. Define plans, entitlements, addons, and coupons in a type-safe config file that lives alongside your app, gets reviewed in PRs, and versions naturally.

revstack.config.ts
typescript
import { defineConfig } from "@revstack/core";
export default defineConfig({
plans: [
{
slug: "pro",
name: "Pro",
type: "paid",
status: "active",
prices: [
{
amount: 2900,
currency: "USD",
billing_interval: "monthly",
},
],
features: {
api_calls: { value_limit: 100000, reset_period: "monthly" },
},
},
],
features: [
{
slug: "api_calls",
name: "AI Tokens",
type: "metered",
unit_type: "currency",
},
],
});
Deploy

Push and pull your changes

A single CLI command validates your billing configuration and syncs it to the Revstack Engine. Payment provider resources are created on-demand during checkouts, keeping your payment provider dashboard clean.

Terminal
typescript
$ npx revstack push
✓ Connected to Revstack Cloud
✓ Validated revstack.config.ts (Strict Mode)
✓ Synced 4 Plans & 12 Features
🚀 Push complete!
Access Control

Gate any feature in one line

Check who has access to what, and how much they can use. The entitlements engine responds in sub-milliseconds, works in any runtime—React Server Components, API routes, or background workers.

app/api/export/route.ts
typescript
import { revstack } from "@/lib/revstack";
export async function POST(req: Request) {
const access = await revstack.entitlements.check({
feature: "pdf_export",
userId: "usr_123"
});
if (!access.granted) {
return Response.json(
{ error: "Upgrade to Pro to unlock this." },
{ status: 403 }
);
}
return Response.json({ ok: true });
}
Payments

Charge through any provider

Generate high-converting checkout sessions without building payment forms. Revstack handles proration, taxes, and provider routing under the hood—whether your customer pays via Stripe, PayPal, or Paddle.

app/api/checkout/route.ts
typescript
import { revstack } from "@/lib/revstack";
import { redirect } from "next/navigation";
export async function POST(req: Request) {
const session = await revstack.checkout.create({
plan: "pro",
userId: "usr_123",
successUrl: "https://app.com/welcome",
});
// Revstack routes to the right provider
redirect(session.url);
}
Zero Webhooks

No more webhook configuration

Stop maintaining fragile webhook endpoints. Revstack manages the subscription lifecycle—upgrades, downgrades, cancellations, and renewals—so you can query the current state directly instead of reacting to events.

app/dashboard/page.tsx
typescript
// No more api calls to your payment provider ❌
// Just query the current state ✅
import { revstack } from "@/lib/revstack";
// Get the current user from your auth provider.
const user = await getUser();
const sub = await revstack.subscriptions.get(user.id);
if (sub.status === "past_due") {
return renderGracePeriodWarning();
}
console.log(`Renews at: ${sub.currentPeriodEnd}`);

Robust primitives for complex SaaS.

Built on a foundation of event sourcing and edge computing. Revstack abstracts the chaos of billing states, webhooks, and limits into clean, predictable APIs.

const access = await revstack.check({
  feature: "api_calls",
  customerId: user.id
});

if (!access.granted) {
  return Response.json(
    { error: "Upgrade" },
    { status: 403 }
  );
}

Edge-Ready Entitlements

Check user access in sub-milliseconds globally. Block unauthorized features before your API even boots.

// revstack.config.ts
providers: [
  stripe({
    secretKey: env.STRIPE_KEY
  }),
  polar({
    accessToken: env.POLAR_KEY
  })
]

Agnostic Gateway

Switch between payment providers without touching your codebase. We normalize every webhook into a single truth.

await revstack.meter({
  feature: "api_calls",
  customerId: user.id,
  value: 1
});

// Batched & aggregated
// automatically at the edge

High-Throughput Metering

Ingest millions of AI tokens, API requests, or gigabytes per second. Batched, aggregated, and synced automatically.

const access = await revstack.check({
  feature: "api_calls",
  // userId is undefined
  // → auto-fingerprint
});

// guest_fp_a7f3d2e1
// → Default Guest Plan

Anonymous Fingerprinting

Stop trial abuse natively. Track guests via device telemetry and seamlessly merge their usage when they finally sign up.

const session = await revstack
  .checkout.create({
    plan: "pro_monthly",
    customerId: user.id,
    successUrl: "/dashboard",
    cancelUrl: "/pricing"
  });

Hosted Checkout

Drop-in, high-converting payment pages. Fully localized, tax-compliant, and optimized for your pricing model.

const portal = await revstack
  .portal.create({
    customerId: user.id,
    returnUrl: "/settings"
  });

// → Hosted billing UI

Self-Serve Portal

Give your users a zero-code dashboard to upgrade plans, manage seats, and download invoices without asking support.

// Wallet type entitlement
// Auto-deducts on usage
await revstack.streamText({
  model: openai("gpt-4"),
  entitlementKey: "ai_credits",
  customerId: user.id
});

Prepaid Wallets

Let users buy AI credits or API tokens upfront. Auto-deduct usage in real-time and gracefully fallback to plan overages.

// revstack.config.ts
plans: [{
  name: "Pro",
  price: { monthly: 29 },
  entitlements: [
    boolean("analytics"),
    metered("api_calls", 10000)
  ]
}]

Centralized Billing in Code

Define pricing tiers, feature limits, discount coupons, addons and overages in a single TypeScript config. Push to the engine and sync instantly.

$ docker pull revstack/engine

$ docker run -d \
  -e DATABASE_URL=... \
  -e REVSTACK_KEY=... \
  -p 3000:3000 \
  revstack/engine

100% Open Engine

Deploy the core engine on your own AWS/GCP infrastructure. Audit the code, own your data, and avoid vendor lock-in.

Launch complex pricing in minutes.

Don't reinvent the wheel. Start with production-ready architectures for B2B SaaS, AI wrappers, or metered APIs. One command scaffolds your entire pricing logic, ready to be deployed.

AI Agents & Credits

Pre-configured for token metering, prompt limits, and auto-refilling wallets for AI wrappers.

$npx revstack init--template=ai-credits

Per-Seat B2B SaaS

Ready for pro-rated team members, role-based access control (RBAC), and enterprise SSO limits.

$npx revstack init--template=b2b-seats

Cloud & Pay-As-You-Go

Pure metered billing. Track gigabytes, compute hours, or API requests with tiered volume pricing.

$npx revstack init--template=payg-infra

Hybrid (Base + Overages)

Fixed monthly platform fees combined with usage-based overages. The standard for scaling SaaS.

$npx revstack init--template=hybrid-saas

Marketplace Platform

Take a percentage cut of transactions combined with flat monthly merchant subscriptions.

$npx revstack init--template=marketplace

PLG & Freemium

Generous free tiers with strict usage limits, gated power-ups, and automated upsell logic.

$npx revstack init--template=plg-freemium
Key Icon

Entitlements as Primitives. Control anything.

Features aren't just booleans. Revstack treats entitlements as typed primitives: Boolean, Metered (Count, Wallet, Bytes, Seconds), Static, and JSON. They remain dormant until attached to a Plan, giving you the context to safely gate routes, issue AWS signed URLs, or trigger custom executions like Slack VIP invites.

JSON
Metered
Boolean

Active Plan

Founding Member

vip_community_accessapi_callsai_credits

Resolved Value · JSON Primitive

Granted
{
  workspaceId: "T123",
  channelName: "#pro-founders"
}
app/api/slack-invite/route.ts
typescript
import { revstack } from "@/lib/revstack";
import { slack } from "@/lib/slack";
export async function POST(req: Request) {
const { userId } = await req.json();
// 1. Resolve the entitlement within the context of the user's current plan
const access = await revstack.entitlements.resolve({
feature: "vip_community_access",
customerId: userId
});
if (!access.granted) {
return Response.json({ error: "Upgrade required" }, { status: 403 });
}
// 2. The entitlement is a JSON primitive.
// We extract the plan-specific payload securely configured in Revstack.
const { workspaceId, channelName } = access.value;
// e.g., { workspaceId: "T123", channelName: "#pro-founders" }
// 3. Execute custom business logic using the secure context
const inviteUrl = await slack.admin.createInvite(
workspaceId, channelName, userId
);
return Response.json({ inviteUrl });
}
Lock Icon

Bring your own Identity.

Revstack is entirely agnostic by design. Whether you use Supabase, Clerk, Auth0, or a custom solution, simply pass the user ID to our SDKs to check entitlements across any frontend or backend framework.

app/providers.tsx
typescript
'use client';
import { RevstackProvider } from "@revstack/react";
import { useAuth } from "@clerk/nextjs";
export function AppProviders({ children }) {
const { getToken } = useAuth();
return (
<RevstackProvider
config={{
publicKey: process.env.NEXT_PUBLIC_REVSTACK_KEY,
// Seamless auth resolution
getToken: () => getToken(),
}}
>
{children}
</RevstackProvider>
);
}

The end of Webhook Hell.

Stripe, Paddle, LemonSqueezy, or PayPal—they all converge into a single, unified API. Stop maintaining brittle endpoint handlers. We absorb the payment events, normalize the logic, and orchestrate the entire subscription lifecycle for you.

Stripe logo
Stripe
Polar logo
Polar
LemonSqueezy logo
LemonSqueezy
Paddle logo
Paddle
PayPal logo
PayPal
Braintree logo
Braintree
Adyen logo
Adyen
Mollie logo
Mollie
Square logo
Square
Razorpay logo
Razorpay
Revstack EngineUnified API
Normalizes WebhookstoStandardized Events
Client SDKs
Server SDKs
Hosted Checkout Icon

High-converting Hosted Checkout.

High-converting, hosted checkout sessions. Stop rebuilding payment forms and let Revstack handle the complex edge cases under the hood: global tax calculation, prorations, discounts, and 3D Secure routing.

checkout.ts
typescript
import { revstack } from "@/lib/revstack";
// Get the current user from your auth provider.
const user = await getUser();
// Create a checkout session.
const session = await revstack.checkout.create({
customerId: user.id,
planId: "pro_monthly",
successUrl: "https://yourapp.com/dashboard",
});
// Redirect the user.
return redirect(session.url);
Revstack Hosted Checkout Interface
Billing Portal Icon

Self-Serve Billing Portal.

Drop-in subscription management. Give your users a fully white-labeled portal to handle upgrades, payment methods, and invoice histories. Zero frontend code or maintenance required from your team.

Revstack Billing Portal Interface
portal.ts
typescript
import { revstack } from "@/lib/revstack";
// Get the current user from your auth provider.
const user = await getUser();
// Generate a secure, one-time link to the billing portal.
const session = await revstack.portal.create({
customerId: user.id,
returnUrl: "https://yourapp.com/dashboard",
});
// Let your users manage upgrades, downgrades, invoices, and more.
return redirect(session.url);
Fingerprint Icon

Anonymous usage, fully metered.

Protect your compute and unit economics from free-tier abuse. Revstack natively integrates with Fingerprint to assign Default Guest Plans to unauthenticated traffic, silently tracking and metering usage before they even sign up.

Anonymous Device

UA: Chrome/120 • macOS

Generated Guest ID

guest_fp_a7f3d2e1

3/10tries left
Assigned to Default Guest Plan
app/api/generate/route.ts
typescript
import { revstack } from "@/lib/revstack";
// If no userId is passed, Revstack automatically fingerprints
// the device and applies the 'guest' plan limits.
const access = await revstack.check({
feature: "api_calls",
// userId: is left undefined
});
if (!access.granted) {
return new Response("Sign up to continue using this feature.", {
status: 403
});
}
Wallet Icon

Prepaid Wallets

Built for the AI and API economy. Issue custom Prepaid Wallets (like "AI Tokens" or "Compute Hours"). Revstack natively drains prepaid balances first, smoothly failing over to standard plan billing only when credits hit zero.

wallets.ts
typescript
import { revstack } from "@/lib/revstack";
// 1. User buys a one-time top-up of 50,000 credits
await revstack.wallets.credit({
customerId: "usr_123",
walletId: "ai_tokens",
amount: 50000
});
// 2. Report usage later. Revstack deducts from the wallet FIRST.
// If the wallet is empty, it automatically bills the plan's overage rate.
const tx = await revstack.metering.record({
customerId: "usr_123",
feature: "ai_tokens",
amount: 4500
});
console.log(`Remaining balance: ${tx.remainingWalletBalance}`);

Available Balance

45,500

AI Tokens

Usage this period4,500 / 50,000

Auto-fallback active

Bills $0.02 / 1k tokens on overage

AI Icon

Auto-metering for the Vercel AI SDK.

Stop manually counting tokens and writing complex billing logic. Define a wallet entitlement in your plan, set your margin, and Revstack automatically tracks token consumption, resolves the model's live pricing, and deducts the cost from your customer's credit balance.

Plan: Pro

AI Credits Feature Active

Type: Wallet

10,000

Credit Limit

0.8

Margin

Stream Completed · GPT-4 Turbo

Tracked

450

Prompt Tokens

120

Completion Tokens

Credit Deduction

Model Cost

$0.008

Margin

× 1.8

Final Cost

$0.015

−15 credits

deducted from AI Credits

Remaining

9,985

Formula

(promptTokens × inputPrice + completionTokens × outputPrice) × (1 + margin)

Model pricing is resolved automatically by Revstack per million tokens.

Flexible Overage

If configured, customers can exceed their credit limit up to the overage cap you set for that plan.

Auto-Rejection

The SDK blocks AI execution when the customer has no credits and overage is not allowed or the limit is reached.

lib/revstack.ts
typescript
import { trackUsage } from "@revstackhq/next/server";
import { createRevstackAI } from "@revstackhq/ai";
export const revstack = createRevstackAI(
{ secretKey: process.env.REVSTACK_SECRET_KEY! },
trackUsage
);
app/api/chat/route.ts
typescript
import { revstack } from "@/lib/revstack";
import { openai } from "@ai-sdk/openai";
import { getUser } from "@/lib/auth";
export async function POST(req: Request) {
const { messages } = await req.json();
// Get the current user from your auth provider.
const user = await getUser();
// Drop-in replacement for Vercel's streamText
const result = await revstack.streamText({
model: openai("gpt-4-turbo"),
messages,
// Revstack tracks usage and bills this entitlement
entitlementKey: "ai_credits",
customerId: user.id, // If not provided, track usage as guest user
});
return result.toDataStreamResponse();
}

Pricing that scales with your infrastructure.

Revstack Cloud officially launches on April 20th exclusively for Founding Members. The public launch will be announced at a later date. Secure your lifetime license today or join the waitlist!

Standard pricing coming soon

Hobby

$0/mo

Perfect for side projects.

Pro

$63/mo

The standard for serious SaaS.

Teams

$159/mo

For growing organizations.

Business

$479/mo

For high-volume operations.

Enterprise

Custom

For custom enterprise architecture.

Core Limits
Revenue LimitUnlimitedUnlimitedUnlimitedUnlimitedUnlimited
Subscriptions1002,50010,00050,000Custom
Customers5,00025,000100,000500,000Custom
Events10k250k1M5MUnlimited
Members1Up to 5Up to 10UnlimitedUnlimited
Providers2510UnlimitedUnlimited
Fees
Success Tax (% of Revenue)0%0%0%0%0%
Features & Support
Advanced Payment Orchestration
Remove Revstack Badge
Point-in-time RecoveryCustom
Enterprise SSO
On-premise deployment
SupportCommunityPriority EmailPriority EmailDedicated SlackCustom SLAs

Self-Hosted Open Source

Prefer to manage your own servers? Deploy the Revstack™ Engine via Docker in minutes.

Stop wrestling with webhooks. Start monetizing.

Adopt the Billing-as-Code standard. Join the waitlist for our public launch, or skip the line and secure your Lifetime access today.