◉RORK LABJP
●MCP — Rork now lets you add and manage your own MCP servers inside Plugins (11/21)●2.5 ROUTE — From 12/1, apps calling gemini-2.5-flash are routed to 3.5 Flash-Lite and billed at its rates (9 days left)●CHANNEL — Users report Android notification channel reads and writes failing in Expo Go●NEW — New: three clues to check before replying to a stuck-on-splash review●EXPORT — Export your projects before you downgrade or cancel a plan●SONNET 4.5 — Apps that call Sonnet 4.5 through the API should switch before it retires on 11/30●MCP — Rork now lets you add and manage your own MCP servers inside Plugins (11/21)●2.5 ROUTE — From 12/1, apps calling gemini-2.5-flash are routed to 3.5 Flash-Lite and billed at its rates (9 days left)●CHANNEL — Users report Android notification channel reads and writes failing in Expo Go●NEW — New: three clues to check before replying to a stuck-on-splash review●EXPORT — Export your projects before you downgrade or cancel a plan●SONNET 4.5 — Apps that call Sonnet 4.5 through the API should switch before it retires on 11/30
Articles/Dev Tools
⬡ Dev Tools/2026-04-26Advanced

Usage-Based Billing for Rork AI Apps with Stripe Meter — Charge by API Calls and Tokens, Not Flat Rates

Implement usage-based billing in your Rork AI app with Stripe Meter — server-side reporting, identifier-based de-duplication, retry queues, aggregation with a self-built monthly cap, and metered vs prepaid credits, with what was verified and what wasn't.

Stripe20Meter BillingUsage-Based PricingCloudflare Workers26AI MonetizationSubscription23Indie Dev40

✦ Premium Article

There was a night I put two users side by side in a spreadsheet. One sends 50 messages a month to an AI chat feature; the other sends 200 a day. I assumed a cost of 3 yen per call — a placeholder — and the second user's cost came to more than 18,000 yen a month. Charging both the same flat fee stopped making sense right there, on paper.

A flat subscription is easy to explain, but for AI features it tends to make light users carry heavy ones. That is where Stripe's Meter Billing (usage-based billing) earns a look: you send usage as events, and Stripe handles the per-period aggregation and the invoice.

This guide walks through wiring Meter Billing into a Rork AI app, focusing on the server side. Along the way I'll point out a design flaw in my own first draft, and I've tried to separate what I actually ran from what I could not verify.

Why AI Apps Need Usage-Based Billing

Flat pricing has a structural skew. In AI apps, per-user usage routinely differs by 10× to 100× or more, so a 50-message user and a 200-a-day user paying the same amount means your cost grows with every heavy user you win.

Usage-based billing gives you three things:

  • Fairness — users pay in proportion to what they use, and you stop absorbing cost growth alone.
  • A low entry plan — "300 yen base plus usage" lowers the door for people who just want to try it.
  • A billing foundation that extends to API and B2B offerings.

Whether churn actually improves depends on your app and your prices; I have no evidence that adopting it guarantees retention. What I'd check first is the relationship between your unit cost and your unit price.

How Stripe Meter Billing Fits Together

A meter setup has three parts:

  • Meter — defines what you count, with a Sum, Count, or Last aggregation.
  • Meter Event — the usage report your server sends to Stripe.
  • Price with Meter — a price billed on the meter's aggregate for the period.

The flow:

Rork app → your backend (Cloudflare Workers): AI request
    ↓
Workers authenticates the user, calls the AI, decides the usage after success
    ↓
Workers → stripe.billing.meterEvents.create()
    ↓
Stripe aggregates per billing period and invoices

The one point to hold onto: the server that calls the AI counts the usage and reports it. My first draft had the app report "what it used". That means shipping a shared key inside the app, and any user could stop reporting — or send events against someone else's customer ID.

Count where you spend. The moment reporting is delegated to the client, the basis for the invoice rests on trust alone.

✦

Thank you for reading this far.

Continue Reading

What follows includes implementation code, benchmarks, and practical content we hope you'll find useful. This site runs without ads — server and development costs are supported entirely by members like you. If it's been helpful, we'd be truly grateful for your support.

WHAT YOU'LL LEARN
✦Retry design with Cloudflare Queues and a Durable Object that reuses a pre-decided identifier (logic exercised against a mock)
✦Why Stripe has no hard usage cap per its docs, and how to enforce a monthly cap yourself
✦A prepaid-credits vs. metered-billing comparison with App Store review boundaries for choosing your model
Secure payment via Stripe · Cancel anytime
✦

Unlock This Article

Get full access to the rest of this article. Buy once, read anytime. This site is ad-free — your support goes directly toward keeping it running.

or
Unlock all articles with Membership →
Share

Thank You for Reading

Rork Lab is ad-free, supported entirely by members like you. We publish practical guides daily with implementation code, benchmarks, and production-ready patterns. If you've found it useful, we'd love to have you on board.

  • ✦Copy-paste ready implementation code
  • ✦New advanced guides published daily
  • ✦$5/mo or $10 for lifetime access
View Membership →

Related Articles

⬡ Dev Tools2026-10-20
Why Redeploying Doesn't Fix the Application Error You See Right After a Deploy
Right after I swapped a secret, every page showed Application error. Stale HTML was calling a JS file that no longer existed. Here are a detection script, a build-version check for the edge cache, and a once-only auto-reload, all run and verified.
⬡ Dev Tools2026-08-17
When an Expo UI drop-in swap actually removes a dependency
Expo UI went stable in SDK 56 with drop-in replacements for eight community packages. Swapping one import does not always shrink your dependency list. Here is how to decide which swaps actually pay off, straight from the dependency graph.
⬡ Dev Tools2026-08-14
Your lockfile's dev/prod split won't tell you which licenses your app must credit
A record of classifying every dependency in a production project to decide what belongs on an app's license screen, and where the copyleft findings and the actual shipped artifact turned out to disagree.