What FiscaLLM covers, and what it doesn't
In short: FiscaLLM adds up the cost of every AI call you report for each user, and sets it next to what that user pays. It is only as complete as what you report. This page lists what is handled for you, what you must do yourself, and what is out of scope, so you can judge whether it fits before you install it.
AI calls
Handled for you
- Helpers for OpenAI (Chat Completions and Responses), Anthropic (Messages) and Gemini (
generateContent). They read only the model name and the token counts from the response. - OpenAI-compatible APIs (Groq, OpenRouter, DeepSeek, Together and similar) through the same helper with a provider name.
- Streaming:
trackStream for SDK streams and trackSSE for raw fetch streams. OpenAI Chat Completions streams need stream_options: { include_usage: true }, otherwise there is no usage to read, and the SDK says so once. - Non-token usage: images, seconds of video, minutes of audio and characters of speech, with price variants such as a resolution.
- Reasoning and thinking tokens are part of the output tokens the providers report, so they are counted.
- Embeddings responses are read the same way (input tokens only).
You have to handle
- Agents and tool loops. FiscaLLM records one event per call you report. If one user action makes five model calls, report all five with the same
userId (use feature to group them). Calls you do not report are not counted. - Retries. If a retry or a failed attempt is billed by the provider, report each attempt that returned usage. FiscaLLM de-duplicates only repeated delivery of the same event (the SDK's retry of its own upload), never two separate calls.
- Calls that fail without a usage block. If the provider still bills for them, they are an undercount we cannot see.
- Other languages. There are TypeScript and Python SDKs. Anything else can use the HTTP API.
- A backend. It needs a server between your app and the provider. Apps that call a provider straight from the phone are not covered.
Pricing and accuracy
- Cost is token counts × list prices, with separate rates for input, cached input, cache writes and output, and higher-price tiers for long prompts where the provider has them.
- The built-in price table covers 100+ models from OpenAI, Anthropic and Google, including speech, image and video models. It is maintained by hand. Each price has an effective date, so changing a price never rewrites history.
- Models without a price (other providers, new releases, embedding models) are stored and shown as unpriced, never as $0. You can pass an exact
costUsd, or set your own price or a percentage discount in Settings. - It does not read your invoice. Expect small differences from things we cannot see: batch discounts, committed-use or enterprise discounts, regional pricing, free credits and taxes. Set a discount in Settings if you have one.
- Not applied: batch and fast-tier prices, regional or US-only uplifts (about +10%), Anthropic 1-hour cache writes (priced as 5-minute writes) and promotional prices.
- On 18 October 2026 we checked the built-in prices against the providers' pricing pages (OpenAI, Anthropic, Google text models): they matched, and eight legacy OpenAI models were added. Details and how to check your own numbers: ACCURACY.md. A comparison against real invoices over several weeks is not published yet, so please check the first week of numbers against your provider's usage page. Overview has a "Download CSV" on cost by model for that.
Revenue
- RevenueCat through a webhook: purchases, renewals, trials, refunds, cancellations, expirations, plan changes and user ID aliases. Revenue is counted net of store fees and tax. Past subscribers can be imported once.
- Stripe (beta) through a webhook: paid invoices, trials, auto-renew switched off, ended subscriptions and refunds. USD only, and what you keep is estimated with Stripe's standard fee, not read from Stripe. Tested against sample payloads, not yet against many real accounts.
- Any other billing system (your own App Store or Play server notifications, Paddle and so on) through the revenue API, one call per payment, refund or cancellation.
- Not built yet: direct App Store and Google Play connections, and non-USD currencies.
- Annual plans are counted when the payment arrives, so a user can look very profitable in the month they paid and the opposite afterwards. View annual users over 90 days or more.
- Amounts are in USD. Users with AI cost and no subscription are shown as free or unmatched, which is expected for free users.
What it does not do
- It never reads, stores or sends prompts, responses or any message content.
- It is not an observability tool: no traces, latency, evaluations or prompt management. Tools like Langfuse and Helicone do that.
- It blocks nothing by itself. Alerts only report. To refuse a user over budget, mark the budget as Block and call
meter.check in your backend; it fails open and is based on cost already recorded, so a user can go slightly over before being refused. - Hosted use is limited to 100,000 events per app per month. Self-hosting has no limit.
Reliability
- The SDK never throws and never waits on the network on your request path. It batches in the background and retries once.
- If FiscaLLM is unreachable, those events are dropped and your app is unaffected.
- Kill switch: set the environment variable
FISCALLM_DISABLED=1 (or pass disabled: true / disabled=True) and the SDK does nothing at all: no events, no network calls, streams and responses pass through untouched. - You can delete all of an app's data in one click, and self-host if you prefer to keep everything on your own servers.
Found something that is wrong or missing? Open an issue. See how it works and the docs.