Commet
  • Pricing
Log InTry out
Templates

Metered Template

Usage-based billing with included amounts and end-of-period overage. Track API calls, storage, and email sends.

Live DemoSource
Metered Template

Next.js SaaS template for products that charge by usage — API calls, storage, email sends. Two plans (Starter, Pro) with included usage amounts per feature.

Usage above the included limits is billed as overage at the end of each billing period. Your customers keep a predictable base price and pay more only when they use more.

Stack: Next.js 16, Better Auth, Drizzle ORM, PostgreSQL, Commet SDK

Quick Start

commet create my-app -t metered
cd my-app
pnpm install
pnpm dev

What's Included

  • Two plans with monthly and yearly prices
  • Three metered features: API Calls, Storage, Email Sends
  • Included usage per plan with overage billing
  • Usage tracking via Commet SDK
  • Usage overview dashboard showing current vs included
  • Customer billing portal
  • Pricing page with included amounts

Key Files

  • lib/auth/auth.ts — Better Auth + Commet plugin with usage module
  • lib/payments/commet.ts — Checkout session creation
  • app/(dashboard)/dashboard/page.tsx — Usage overview with current vs included
  • app/pricing/page.tsx — Dynamic pricing with included amounts
  • app/api/commet/portal/route.ts — Customer portal redirect

Learn More

  • Consumption Models — Metered model details
  • Track Usage
  • Customer Portal

Run commet create my-app -t metered to start from this template, or browse the source on GitHub.

Developers

  • Documentation
  • Templates
  • GitHub

Frameworks

  • Next.js
  • Remix
  • Nuxt
  • SvelteKit
  • Astro
  • Express
  • Hono
  • Django
  • FastAPI

Resources

  • Blog
  • Changelog
  • Pricing

AI

  • Agents
  • MCP Server
  • Agent Skills
  • Claude Code
  • Codex
  • Cursor

Learn

  • Guides
  • Glossary
  • Solutions
  • Billing for AI Models
  • Comparison

Compare

  • Stripe alternative
  • Orb alternative
  • Recurly alternative
  • Paddle alternative
  • Chargebee alternative
  • Lago alternative

Company

  • About
  • Open Source
  • Terms
  • Privacy

Countries

  • Mexico
  • Argentina
  • Colombia
  • Chile
  • Peru
  • Ecuador
  • Uruguay
  • Paraguay
  • Bolivia
  • Panama
  • El Salvador
  • Brazil
System statusXLinkedInGitHub