Back to Blog
billing
credits
stripe

Understanding the Credit System

January 10, 2025Team

One of the key features of Sigma Starter is its credit-based billing system. This article explains how it works and how you can customize it for your needs.

What Are Credits?

Credits are a virtual currency used to perform actions in your SaaS. Instead of unlimited usage, users purchase or earn credits that are consumed when they use premium features.

Why Use Credits?

Credits offer several advantages over traditional subscription models:

  • Fair pricing - Users pay for what they use
  • Flexibility - Easy to add new features with different costs
  • Predictable costs - You can estimate server costs per credit
  • Upselling opportunities - Users can purchase more credits when needed

How It Works

When a user signs up, they receive trial credits based on your configuration:

typescript

// config/features.ts

export const features = {

trialCredits: 50, // Credits for new users

}

Each action in your app can have a credit cost. Use the withCreditCheck helper:

typescript

import { withCreditCheck } from '@/actions/credits'

await withCreditCheck(spaceId, 5, 'AI Generation', async () => {

// Your expensive operation here

})

Subscription Tiers

You can configure different subscription tiers with different credit allocations:

  • Starter - 500 credits/month
  • Pro - 2,000 credits/month
  • Enterprise - Unlimited

Credits reset each billing cycle, encouraging users to use their allocation.

Customization Tips

Consider these factors when setting credit costs:

  • Server/API costs per operation
  • Value delivered to the user
  • Competition pricing
  • User expectations

Start conservative and adjust based on user feedback!