AI payment infrastructure UsageFlow
Usage-based billing for AI, with Stripe
Charge customers for the AI they actually use. UsageFlow counts it per customer, stops calls at zero, and reports the same usage to your Stripe meter.
Free: 1 workflow with live policy. No credit card.
Invoices built from estimates don't hold up
Most teams start by guessing usage, or by building a metering pipeline that someone has to maintain. Either way the number on the invoice can drift from what the customer actually consumed.
UsageFlow counts usage at runtime and reports it to Stripe as meter events, so what you limit and what you invoice come from the same numbers.
Without a shared count
Three places, three answers.
app shows 7,400 credits app enforces a different counter Stripe charges an estimate
With one count
The same number everywhere.
app shows the ledger app enforces the ledger Stripe charges the ledger, as meter events
Who does what
UsageFlow doesn't take payments and doesn't replace Stripe. Each part has one job.
| Part | Its job |
|---|---|
| Your app | Sells the plans and packs, and decides what a credit costs. |
| UsageFlow | Counts usage per customer, enforces the limit at runtime and reports usage. The same balance can also change which model runs as it drops. |
| Stripe | Charges the card and stays your system of record for invoices. |
Your customers never see UsageFlow. They see your credits and your checkout.
Connect Stripe in four steps
UsageFlow reports executed usage to Stripe as meter events. Your app never talks to Stripe for this.
-
Add your Stripe API key
In the Console, under Integrations. UsageFlow uses the key you configure.
-
Add a Stripe meter effect to your policy
Effects run whenever a tier matches. By default the effect reports the call's amount.
-
Set the Stripe event name
Choose the meter event, such as
token_usedorapi_request. -
Match the customer
Use the same identity you use in Stripe, so the Stripe customer can be found. If none matches, that usage is not reported.
What Stripe receivesmeter event token_used customer cus_ABC123 value 5,247
Pricing models you can build
UsageFlow has no fixed plans of its own. You combine your own facts and rules.
These numbers are examples. You set your own in the Console.
What this doesn't do
Stripe does both. UsageFlow reports the usage that Stripe bills on.
The Stripe effect looks up the customer for the identity you send. Use the same identity in both places.
Add your Stripe API key in the Console before the effect can report anything.
Keep going
Questions about AI usage billing
Straight answers for the category questions.
What is usage-based billing for AI?
Charging customers for the AI they actually use, such as tokens or credits, instead of a flat fee. It needs an accurate count of usage per customer and a way to report that count to your billing system.
Does UsageFlow replace Stripe?
No. Stripe charges the card and stays your system of record for invoices. UsageFlow counts usage per customer, enforces limits at runtime and reports usage to Stripe as meter events.
How does usage get matched to a Stripe customer?
UsageFlow looks up the Stripe customer for the identity you send with each call. Use the same identity you use in Stripe. If none matches, that usage is not reported.
Can I sell credit packs?
Yes. Your app sells the plans and packs and decides what a credit costs. UsageFlow keeps the count and enforces the limit, and Stripe charges the card.
What happens when a customer runs out?
The call is blocked before it reaches the AI provider, so it costs you nothing, and your app can show a prompt to buy more.
What does it cost?
The free plan includes one workflow with live policy and needs no credit card.
Bill for what your customers actually use
Free: 1 workflow with live policy. No credit card. TypeScript, Python and Go, with OpenAI and Anthropic.