Margin intelligence

See what customer makes you money on AI, and who loses it.

Lancelot matches each customer’s AI cost to what they pay you in Stripe or RevenueCat, so you see your margin customer by customer.

Lancelot customer list showing AI cost against what each customer pays
Works with
1

hour between updates, and a refresh when you open the page.

70+

OpenAI, Anthropic and Google models priced at current rates.

30%

margin or more is healthy. Below that, a customer is at risk.

90

days of daily AI cost on every customer’s page.

Northwind LabsPro · $49 · NovemberExample
Revenue
$49.00
AI cost
$156.00
Margin this month−$107.00
ThenLancelot’s agent works out why and fixes it at the level you set.
Northwind LabsBy feature · NovemberExample
document-chat
$109.20
Other features
$46.80
document-chat70%
Comes fromThe tag your app sends with each call, like “chat” or “summarize”.
Northwind LabsBy model · NovemberExample
Claude Opus
$124.80
Other models
$31.20
Claude Opus80%
The fixSwitch the customer to a cheaper model you’ve approved.

Your AI bill and Stripe never meet. Lancelot puts them side by side.

3

customers in this example cost more in AI than they pay.

AI cost · November
$1,437.02
Example
45 other customers
$1,066.82
Atlas Legal
$88.20
Kite & Co
$126.00
Northwind Labs
$156.00

See which features and models drive your AI cost.

Feature economics, model mix, free-tier share and a month-end forecast, on one page.

The Insights screen in Lancelot on a sample workspace

Add the SDK and a Stripe key. Margins update every hour.

01

Tag each call.

The SDK for Node or Python sends token counts, the model, the customer and the feature.

02

Reads Stripe, never writes.

Lancelot reads your plans and invoices with a read-only key.

03

No prompts stored.

Your prompts and your AI’s answers stay in your app.

How the numbers work. For your CTO or finance lead.

What each status means

Underwater

Costs more in AI than they pay this month.

At risk

Margin under 30% of what they pay.

Healthy

Margin of 30% or more.

Free

On a free plan: all cost, no revenue.

Trial

On a trial.

Unmatched

AI usage from someone Lancelot can’t find in Stripe or RevenueCat. It never counts as losing money.

Revenue

Stripe

A read-only restricted key. Active plans count as a monthly figure, and invoices count when paid, after discounts and before tax.

RevenueCat

App Store and Google Play revenue, net of the store’s cut. Weekly and annual plans convert to a monthly figure, and trials count as free.

Currencies

Converted to USD at that day’s ECB rate.

Matching

By the customer or user ID in Stripe’s metadata, or by email.

AI cost

Sources

The Lancelot SDK for Node or Python, the events API, OpenTelemetry, or a gateway. OpenRouter sends each call as it happens, and Lancelot reads your Helicone logs.

Model prices

Current rates for more than 70 OpenAI, Anthropic and Google models, including cached tokens, cache writes and long-context pricing. A model with no price gets flagged, never guessed.

Your AI bill

Connect your OpenAI or Anthropic bill to see how much of it Lancelot ties to customers.

Customer profitability, in the app

Customers table

Filter by status, plan, paying or free, and agent action. Sort by revenue, AI cost, margin or margin %, worst first, with a 30-day cost trend on every row.

Customer page

90 days of daily AI cost against what their plan pays, cost by feature and model, every fix with an Undo, and manual Throttle, Pause AI and Switch model controls.

Insights

Feature economics, weekly model mix, the free-tier share over 12 weeks, and a month-end forecast with a low and a high estimate.

CSV exportGrowth+

Customers and margins, for your own spreadsheet.

Products

Each product has its own margins and counts only its own Stripe products. Founder includes 1, Growth 2, Scale and Enterprise unlimited.

Test data

Usage sent with a test key stays apart from live numbers and never sends alerts.

Questions about margin intelligence

How do you calculate AI cost per customer?

Your app tags each AI call with a customer ID through the Lancelot SDK. Lancelot prices every call at the model’s current rates, including cached tokens and long-context pricing, and adds them up per customer for the month. Margin is what that customer paid you minus that cost.

The customer’s active plan from Stripe or RevenueCat, which Lancelot converts to a monthly figure. Stripe invoices count when paid, after discounts and excluding tax. RevenueCat revenue is net of the App Store or Google Play cut.

Lancelot matches customers by the ID in Stripe’s metadata or by email. Anyone it can’t match shows as Unmatched, never as losing money, so a missing match won’t skew your margins.

Yes. Lancelot reads App Store and Google Play revenue through RevenueCat, net of the store’s cut. Lancelot converts weekly and annual plans to a monthly figure, and trials count as free users.

Every hour, and again when you open the page.

More than 70 OpenAI, Anthropic and Google models, at current rates, including cached tokens, cache writes and long-context pricing. If a model has no price yet, Lancelot flags it instead of guessing.

Token counts, the model, the customer and the feature tag for each call. Lancelot never stores your prompts or your AI’s answers.

Helicone and Langfuse show what a user costs you. Lancelot also shows what that user pays you, so you see the margin, and its agent acts on customers who lose you money. Many teams use both.

Yes. Growth and higher plans can export the margin table to CSV.

Yes. Connect your OpenAI or Anthropic bill and Lancelot shows how much of the bill it attributes to customers, so finance can reconcile the two.