In short: FiscaLLM reads your Stripe payments and puts them next to what each customer costs you in OpenAI, Anthropic and Gemini tokens. You see which customers are profitable, which plans and trials lose money, and get an alert when a paying customer starts costing more than they pay. Free and open source (MIT).
| Stripe event | What happens in FiscaLLM |
|---|---|
invoice.paid | A payment: first payment, renewal, or the conversion after a free trial |
customer.subscription.created | A free trial starts: AI cost begins, revenue is $0 |
customer.subscription.updated | Auto-renew switched off counts as a cancellation |
customer.subscription.deleted | The subscription ended |
charge.refunded | Only the new part of each refund is subtracted, so partial refunds are never counted twice |
charge.dispute.closed | A lost dispute (chargeback) is subtracted like a refund; a won one changes nothing |
What you keep is the payment minus tax minus Stripe's fee. Save a read-only restricted key and the fee is Stripe's exact fee from the balance transaction, and payments in any currency count at the USD amount Stripe settled. Without a key the fee is estimated (2.9% + $0.30) and only USD counts. Plan changes mid-cycle use the subscription line, not proration lines, and tax is read on every Stripe API version.
subscription_data: { metadata: { user_id } } at checkout. Report AI usage under the same ID with one line per call, for example meter.trackOpenAI(res, { userId }).Tested end to end against Stripe test clocks: a trial that converts and renews, a partial refund, two lost disputes and a cancellation, checked to the cent. Step-by-step details are in the Stripe docs, and the reasoning behind each number in how to track AI cost per customer against Stripe revenue.
| Tool | Price | Open source | Stripe |
|---|---|---|---|
| FiscaLLM | Free | Yes, MIT (server, dashboard and SDKs) | Per end user: payments, trials, cancellations, refunds and lost disputes from a webhook, 12 months of history, Stripe's exact fee and any currency with a read-only key |
| MarginDash | Hosted plans; see its pricing page | No | Stripe connection with a per-customer P&L |
| MarginMeter | See its site | Not stated | Read-only key; company-level margin from balance transactions, net of refunds, disputes and tax |
| Weckr | Hobby free (50,000 requests a month), Pro $49 a month (1M requests a month) | SDKs are MIT; the service is hosted | Not mentioned on its site |
Not on Stripe? FiscaLLM also connects RevenueCat in one click, takes a revenue CSV from Paddle or Lemon Squeezy, or any billing system through the revenue API.
Open the demo dashboard (sample data, no sign-up) or start free.
No. Stripe knows what each customer paid, not what their usage cost you at OpenAI, Anthropic or Google. FiscaLLM records AI cost per user from your backend and joins it to Stripe payments by user ID.
Set metadata.user_id on the Stripe subscription or customer to the same user ID your backend sends with AI usage. Without it, the Stripe customer ID is used, so you can also report AI usage under the cus_ ID.
With a saved read-only restricted key, yes: FiscaLLM reads the fee and the settled USD amount from Stripe's balance transaction. Without a key it estimates the standard 2.9% + $0.30 and counts USD payments only.
Yes, with a saved read-only key: a payment in EUR, GBP or any other currency counts at the USD amount Stripe actually settled. Refunds and disputes use the same rate as the payment.
Lost disputes are subtracted like refunds, against the same payment, so a refund and a dispute on one charge are never counted twice. Won disputes change nothing. Tracing a dispute back to its customer needs the read-only key.
Yes. Paste a read-only restricted key to import the last 12 months of paid invoices, refunds, current trials and ended subscriptions. An invoice is counted once whether it arrives by webhook or import, so re-running is safe.
Nothing. FiscaLLM is free and open source (MIT). Use the hosted service at fiscallm.com or self-host it so your revenue data never leaves your servers.