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

Usage-based billing template with included amounts and overage at period end. Two plans (Starter, Pro) tracking API calls, storage, and email sends. Overage for usage above included limits is charged at the end of each billing period.

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

Developers

  • Documentation
  • Templates
  • GitHub

Resources

  • Blog
  • Changelog
  • Pricing

AI

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

Learn

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

Company

  • About
  • Open Source
  • Terms
  • Privacy
XLinkedInGitHub