For apps that call AI
What each user costs you in AI, against what they pay.
One line after each AI call in your backend. Revenue from RevenueCat, Stripe or a CSV. Then limits per plan, margin per user and alerts when someone costs more than they pay. Free and open source.
Demo
Last 30 days
Sample dataDaily AI cost and net revenue
Cost by model
- anthropic/claude-sonnet-5-5$554.36
- google/gemini-3.8-flash$88.28
- fal/flux-pro$56.00
- openai/gpt-5-mini$47.18
Cost by feature
- chat$642.64
- image$56.00
- summary$47.18
Why limits need cost data
AI apps lose money on users they can't see
- 1
Flat price, variable cost
Everyone pays $9.99. One user costs you $0.20 in AI, another $25.
- 2
Two bills that never meet
Your AI bill shows tokens. Your billing system shows payments. Neither shows the user.
- 3
You find out too late
All you see is one big AI bill at the end of the month.
Light user
$9.99 / month- Pays you
- $7.49
- Costs you in AI
- $0.20
- Margin
- $7.29
Heavy user
$9.99 / month- Pays you
- $7.49
- Costs you in AI
- $25.00
- Margin
- −$17.51
Same plan, same price. Without FiscaLLM, both look the same.
The solution
FiscaLLM joins them, per user
Joins cost and revenue, per user
One line in your backend reports AI usage. RevenueCat, Stripe (with 12 months of history) or a CSV upload reports payments.
Shows your real margin
Per user, per plan, per free trial, and which model or feature drives the bill.
Warns you, and can say no
Email, Slack or webhook alerts when a user goes over budget or loops. Mark a budget as Block and your backend can refuse them.
Limits by plan
One check before each AI call. Allow, or paywall.
You decide what each plan gets. FiscaLLM tracks who has used what.
1. Set what each plan gets
free10 AI calls a daytrial30 AI calls a daypro_monthly500 AI calls a monthpaid$8.00 of AI a month
Plans come from RevenueCat or Stripe. A product's own limit overrides "paid".
2. Ask before each AI call
const { allow, limits } = await meter.check(userId);
if (!allow) return paywall();
// → { allow: true, plan: "free",
// limits: [{ period: "day", limit: 10,
// used: 7, remaining: 3,
// resetsAt: "…T00:00:00Z" }] }Also plain HTTP: POST /api/v1/check. TypeScript and Python SDKs.
No quota table, no reset job
FiscaLLM already counts every AI call per user and already knows their plan. A limit is one row of settings.
A number your app can show
Each check returns used, remaining and the reset time, so the app shows "3 left today" before the paywall, not an error after.
Change limits without a release
Tighten the free plan or loosen Pro from the dashboard. No deploy, no app review.
For your product
Watch one request
Nothing sits between your app and the AI. Usage and revenue are reported on the side.
- Your appa user asks for something
- Your backendmeter.trackOpenAI(res, { userId })
- AI providerOpenAI · Anthropic · Gemini
- FiscaLLM$6.90cost, revenue and margin per user
- RevenueCat or Stripepurchases and renewals
A user asks your app for something.
Engineer? See exactly how it works →·Or try the live demo →
Set up in ten minutes
- 01
Track AI calls on your backend
Add one line after each AI request. The SDK reports token counts in the background and never slows or breaks your response.
meter.trackOpenAI(res, { userId }) - 02
Connect your revenue
Press Connect RevenueCat, connect Stripe and import the last 12 months, or upload a CSV from any billing system. Purchases, renewals, trials and refunds count net of fees and tax.
https://fiscallm.com/api/webhooks/rc/… - 03
Set limits, see margins
Give each plan its AI allowance and ask before each call. The dashboard shows who is at a limit and what every user, plan and trial costs against what it earns.
meter.check(userId) → 3 left today
What you can do with it
Turn the numbers into decisions
Turn free users into subscribers
The Limits page lists who has used up their plan today. They are the users most likely to pay for more.
Price plans on real numbers
See which plan loses money once AI is paid for, and set its limit from what a call really costs.
Cap heavy users
Mark a budget as Block, and meter.check(userId) tells your backend to refuse the user or use a cheaper model. A capped user stays capped even if FiscaLLM goes down.
See what failed jobs cost you
Credits refunded on a failed render, or a timeout never reconciled: the Jobs page shows what you paid the provider anyway, per user.
Switch the expensive feature
Find the feature and model behind the bill; move it to a cheaper model.
Fix trials that don't pay off
Know what each trial and each conversion costs.
Catch runaway loops
By email, Slack or webhook, when a user goes over budget or burns a huge number of tokens in 5 minutes.
A Monday email
Last week's margin and who lost you money.
For developers
One line per AI call
TypeScript and Python SDKs with zero dependencies. OpenAI, Anthropic, Gemini, streaming, images and voice.
- ✓Reads only the model name and token counts from res, never the answer text
- ✓Never throws, never blocks your response
- ✓Batches in the background with waitUntil
- ✓Retries are de-duplicated, so nothing counts twice
- ✓Or let your AI assistant set it up with our setup skill
Already tracing? Skip the SDK and send usage from OpenTelemetry, the Vercel AI SDK or LiteLLM. Agents can read prices and margins through the MCP server.
Read the docs →import { createMeter } from "fiscallm";
const meter = createMeter({
apiKey: env.FISCALLM_KEY,
waitUntil: ctx.waitUntil.bind(ctx),
});
const res = await openai.chat.completions
.create({ model, messages });
// that's it
meter.trackOpenAI(res, { userId, feature: "chat" });