Abrechnung nach Verbrauch und nutzungsbasierte Preise
Berechnen Sie Kunden nur die tatsächliche Nutzung, indem Sie Verbrauchsdaten an Stripe melden, verbrauchsabhängige Preise konfigurieren und nutzungsbasierte Preisstufen für Ihr KI-SaaS entwickeln
Abrechnung nach Verbrauch und nutzungsbasierte Preise ist eine kostenlose AI Powered SaaS: Stripe + Auth + Billing + Deploy-Lektion auf CoddyKit. Dies ist Lektion 4 von 4. Du kannst die komplette Lektion unten kostenlos lesen – dann übst du sie direkt im Browser mit einem integrierten Code-Editor und einem KI-Tutor rund um die Uhr. Sie ist Teil des AI Powered SaaS: Stripe + Auth + Billing + Deploy-Lernpfads, und dein Fortschritt wird über Web und CoddyKit-App synchronisiert. Der AI Powered SaaS: Stripe + Auth + Billing + Deploy-Kurs umfasst insgesamt 4 Lektionen.
Teile dieser Lektion wurden noch nicht übersetzt und werden auf Englisch angezeigt.
Why Usage-Based Pricing?
Flat subscriptions do not fit products where cost scales with consumption — like AI tokens or API calls. Metered billing charges customers for actual usage, aligning revenue with cost.
Licensed vs Metered Prices
Stripe prices come in two usage types:
- Licensed: a fixed quantity (e.g. 5 seats)
- Metered: quantity reported over time and billed at period end
Creating a Metered Price
Define a recurring price with usage_type: metered. Stripe sums reported usage for each billing cycle.
await stripe.prices.create({
product: productId,
currency: 'usd',
recurring: { interval: 'month', usage_type: 'metered' },
unit_amount: 2
});Subscribing Without a Quantity
For metered items you do not set a quantity at subscription time — Stripe learns it from usage reports.
await stripe.subscriptions.create({
customer: customerId,
items: [{ price: meteredPriceId }]
});Reporting Usage
As customers consume the product, report usage against the subscription item. Use action: increment to add to the running total.
await stripe.subscriptionItems.createUsageRecord(itemId, {
quantity: 1000,
timestamp: Math.floor(Date.now() / 1000),
action: 'increment'
});When to Report
Report at the moment usage happens — for example, after each AI completion count its tokens. Buffer high-frequency events and flush periodically to avoid hitting API limits.
async function onAiCall(itemId, tokens) {
await reportUsage(itemId, tokens);
}Idempotent Reporting
Avoid double-counting on retries by sending an idempotency key. Stripe ignores duplicate requests with the same key.
await stripe.subscriptionItems.createUsageRecord(
itemId,
{ quantity: 1000, action: 'increment' },
{ idempotencyKey: 'usage-' + eventId }
);Tiered Pricing
You can combine metering with tiers: the first 10,000 units cost more per unit, additional units less. Stripe computes the blended total automatically.
recurring: { usage_type: 'metered' },
billing_scheme: 'tiered',
tiers_mode: 'graduated'Showing Usage to Customers
Customers want transparency. Fetch the current period's usage and display it in their dashboard so there are no billing surprises.
const summaries = await stripe.subscriptionItems.listUsageRecordSummaries(itemId);Combining Plans
Many SaaS use a hybrid model: a fixed monthly base fee (licensed) plus metered overage. Add both prices as separate items on one subscription.
items: [
{ price: baseFeePriceId },
{ price: meteredPriceId }
]Best Practices
Run metered billing reliably:
- Use metered prices for consumption-based products
- Report usage with increment and idempotency keys
- Consider tiered pricing for volume
- Show usage to customers for transparency
Quick Check
Test your metered billing knowledge.
Recap
You added usage-based billing:
- Create
meteredprices and subscribe without a quantity - Report usage with
incrementand idempotency keys - Use tiered pricing and hybrid base-plus-overage models
- Surface usage to customers for transparency
Your AI SaaS now charges fairly for what users consume.
Häufig gestellte Fragen
Ist die Lektion „Abrechnung nach Verbrauch und nutzungsbasierte Preise“ kostenlos?
Ja — der vollständige Text von „Abrechnung nach Verbrauch und nutzungsbasierte Preise“ ist hier im Web kostenlos zu lesen. Um sie interaktiv zu üben (integrierter Code-Editor und 24/7 KI-Tutor) und den Rest des AI Powered SaaS: Stripe + Auth + Billing + Deploy-Kurses freizuschalten, upgrade auf CoddyKit PRO. Der AI Powered SaaS: Stripe + Auth + Billing + Deploy-Kurs umfasst insgesamt 4 Lektionen.
Was lerne ich in „Abrechnung nach Verbrauch und nutzungsbasierte Preise“?
Berechnen Sie Kunden nur die tatsächliche Nutzung, indem Sie Verbrauchsdaten an Stripe melden, verbrauchsabhängige Preise konfigurieren und nutzungsbasierte Preisstufen für Ihr KI-SaaS entwickeln Du übst AI Powered SaaS: Stripe + Auth + Billing + Deploy mit praktischem Code, den du direkt im Browser ausführst, und ein 24/7 KI-Tutor beantwortet deine Fragen während du die Lektion bearbeitest.
Brauche ich Erfahrung, um AI Powered SaaS: Stripe + Auth + Billing + Deploy zu starten?
Keine Vorkenntnisse erforderlich. AI Powered SaaS: Stripe + Auth + Billing + Deploy auf CoddyKit ist für Anfänger bis fortgeschrittene Lernende strukturiert, sodass du hier starten oder von Anfang an beginnen und in deinem eigenen Tempo voranschreiten kannst. Dies ist Lektion 4 von 4.
Wie lange dauert die Lektion „Abrechnung nach Verbrauch und nutzungsbasierte Preise“?
Die meisten CoddyKit-Lektionen dauern etwa 5–10 Minuten. Jede ist kompakt und interaktiv, sodass du stetig Fortschritte machst und genau dort weitermachst, wo du aufgehört hast – im Web und in der App.
Kann ich in dieser AI Powered SaaS: Stripe + Auth + Billing + Deploy-Lektion Code schreiben und ausführen?
Ja. Jede AI Powered SaaS: Stripe + Auth + Billing + Deploy-Lektion enthält einen integrierten Code-Editor, sodass du echten Code direkt in deinem Browser schreibst und ausführst und sofort KI-Feedback erhältst — ohne lokale Einrichtung erforderlich.
Alle Lektionen in diesem Kurs
- Abonnementverwaltung
- Stripe-Webhooks verarbeiten
- Kundenportal und Abrechnungshistorie
- Abrechnung nach Verbrauch und nutzungsbasierte Preise