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 data
AI cost
$745.82
29,288 requests
Net revenue
$908.23
after store fees and tax
AI cost / revenue
82.1%
Margin after AI
$162.40

Daily AI cost and net revenue

Why limits need cost data

AI apps lose money on users they can't see

  1. 1

    Flat price, variable cost

    Everyone pays $9.99. One user costs you $0.20 in AI, another $25.

  2. 2

    Two bills that never meet

    Your AI bill shows tokens. Your billing system shows payments. Neither shows the user.

  3. 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.

See what this looks like in a dashboard →

The solution

FiscaLLM joins them, per user

1

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.

2

Shows your real margin

Per user, per plan, per free trial, and which model or feature drives the bill.

3

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 day
  • trial30 AI calls a day
  • pro_monthly500 AI calls a month
  • paid$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.

How to limit AI usage per plan →·Reference →

For your product

Watch one request

Nothing sits between your app and the AI. Usage and revenue are reported on the side.

  1. Your app
    a user asks for something
  2. Your backend
    meter.trackOpenAI(res, { userId })
  3. AI provider
    OpenAI · Anthropic · Gemini
  4. FiscaLLM$6.90
    cost, revenue and margin per user
  5. RevenueCat or Stripe
    purchases 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

  1. 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 })
  2. 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/…
  3. 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

01

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.

02

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.

03

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.

04

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.

05

Switch the expensive feature

Find the feature and model behind the bill; move it to a cheaper model.

06

Fix trials that don't pay off

Know what each trial and each conversion costs.

07

Catch runaway loops

By email, Slack or webhook, when a user goes over budget or burns a huge number of tokens in 5 minutes.

08

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 →
worker.ts
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" });