# Credit-Based Billing for AI and SaaS Products

> Issue, manage, and track credit entitlements across subscriptions, one-time purchases, and usage-based billing. Rollover, overage, and expiration controls are built in.

- **URL**: https://dodopayments.com/billing/credit-based-billing
- **Product area**: Billing
- **Documentation**: https://docs.dodopayments.com/billing/credit-based-billing

## The Problem

### **Credit-Based Pricing**   Is a Nightmare to Build In-House

Managing credit balances, handling rollover logic, tracking overages, syncing with meters, and keeping an accurate ledger across subscriptions, one-time purchases, and usage-based plans requires custom infrastructure most teams don't have the time or resources to build.


## The Solution

### Issue Credits, Track Balances, Bill Overages. All Automated.

Dodo Payments handles the full credit lifecycle, from issuance to consumption to expiry. Attach credits to any product type, deduct automatically from usage meters, and let customers track their balances in real-time through the customer portal.


## Features

### Custom Credit Types

Define credits in your own units like API calls, AI tokens, compute hours, or fiat currency, with configurable precision up to 3 decimal places.

### Automatic Meter Deduction

Link credits to usage meters and let the system deduct automatically. A background worker processes events every minute using FIFO ordering.

### Rollover & Expiry Controls

Configure how unused credits carry forward. Set rollover percentages, timeframes, max rollover counts, and custom expiration periods.

### Overage Pricing

Let customers keep using your product after credits run out. Choose to forgive, bill, or carry over the deficit automatically.

### Full Audit Trail

Every credit operation (grants, deductions, rollovers, expirations, overages) is recorded in a comprehensive ledger with balance snapshots.

### Customer Self-Service Portal

Customers can view their credit balances, switch between credit types, and see full transaction history, all without contacting support.


## Who This Is For

- AI companies billing by tokens or API calls
- SaaS platforms with metered features and credit packs
- Developer tool companies selling consumable credit bundles
- Marketplaces offering prepaid balances to buyers

## Use Cases

- Issue credits when a customer subscribes, deduct automatically as they consume API calls
- Sell credit packs as one-time purchases with automatic rollover at renewal
- Bill overages when customers exceed their included credit allocation
- Let customers track balances and transaction history via the self-service portal

## FAQ

### What types of credits can I define?

You can create custom credit types in any unit -- API calls, AI tokens, compute hours, or fiat currency -- with configurable precision up to 3 decimal places.

### How does credit rollover work?

You configure rollover percentages, timeframes, and max rollover counts. Unused credits carry forward based on your rules, and expired credits are automatically removed.

### What happens when a customer runs out of credits?

You choose the overage behavior: forgive the deficit, bill the customer for excess usage, or carry the deficit forward to the next billing cycle.

### Can credits be attached to both subscriptions and one-time purchases?

Yes. Credits can be issued through any product type -- subscriptions, one-time purchases, or usage-based plans -- and tracked in a unified ledger.

### What problem does credit-based pricing is a nightmare to build in-house solve?

Managing credit balances, handling rollover logic, tracking overages, syncing with meters, and keeping an accurate ledger across subscriptions, one-time purchases, and usage-based plans requires custom infrastructure most teams don't have the time or resources to build.

### How does Dodo Payments solve this?

Dodo Payments handles the full credit lifecycle, from issuance to consumption to expiry. Attach credits to any product type, deduct automatically from usage meters, and let customers track their balances in real-time through the customer portal.


## Related Pages

**Related features:** [Usage-Based Billing](https://dodopayments.com/billing/usage-based-billing) | [Subscriptions](https://dodopayments.com/billing/subscriptions) | [One-Time Payments](https://dodopayments.com/billing/one-time-payments)
**Section:** [Billing](https://dodopayments.com/billing)
**Documentation:** [API Documentation](https://docs.dodopayments.com/billing/credit-based-billing)
**See also:** [Usage-Based Billing](https://dodopayments.com/billing/usage-based-billing) | [Subscription Billing](https://dodopayments.com/billing/subscriptions) | [License Key Management](https://dodopayments.com/distribution/license-keys) | [Reporting & Analytics](https://dodopayments.com/payments/reporting-and-analytics)

---

## About Dodo Payments

Dodo Payments is the billing & payments platform for AI-first and SaaS companies, operating as a Merchant of Record in 220+ countries.

**Other Billing features:** [Usage-Based Billing](https://dodopayments.com/billing/usage-based-billing) | [Subscriptions](https://dodopayments.com/billing/subscriptions) | [One-Time Payments](https://dodopayments.com/billing/one-time-payments)

- [All Products](https://dodopayments.com) | [Documentation](https://docs.dodopayments.com) | [Pricing](https://dodopayments.com/pricing) | [Dashboard](https://app.dodopayments.com)