1. Measure: track cost and margin per user
Everything starts here, and almost everyone skips it. Your provider bill is a single number that cannot see your users, so it cannot tell you which customer to upsell, which to cap, or which is eating a month of margin on a cheap plan. The only place that answer exists is your side, built from the token counts the provider already returns on every response. Until you attribute cost to a user, every other decision in this guide is a guess.
Start by tagging each call with a stable user identifier and recording token counts, then turn tokens into dollars with current provider pricing. Read how to track AI costs per user for the full method, and how to get OpenAI cost per user when your bill is a single account total. Once you have per-user cost, the number that actually matters is margin, so learn to calculate gross margin per user (plan revenue minus AI cost) and watch it for a full month before you change anything, because usage is spiky and a single week will lie to you. To see the shape of these numbers on a realistic dataset without wiring anything up, open the live demo. For a sense of the actual dollar figures before you measure your own, see the cost-per-user benchmark.
2. Price: set prices that survive a variable cost
Traditional SaaS runs 80 to 90 percent gross margins. AI-first products sit closer to 50 to 60 percent, because inference is a direct variable cost sitting against every dollar you collect. That gap is not a temporary inefficiency you can optimize away, it is structural, and understanding why is what stops you from pricing like a database company. Start with why AI SaaS margins are structurally lower and why your heaviest user can be your least profitable one.
The deeper problem is the pricing model itself. A flat monthly subscription fixes your revenue while your cost moves with usage, so the two halves no longer match and no amount of growth fixes a per-unit mismatch. Read why flat subscriptions break for AI products for the three fixes that hold your margin: price the base from real cost, add a usage or credit component, and cap the tail. If you want to model whether your current plan actually clears its costs, run your numbers through the break-even calculator.
3. Reduce: cut cost per call without hurting quality
Once you can see cost per user, the next lever is spending less per call for the same output. The biggest lever is model choice: a frontier model on a task a cheaper model handles just as well is pure waste. Start with the overview in how to reduce your OpenAI costs, which covers the three real causes of a runaway bill and the fixes that do not degrade output.
Then get specific. Most teams overpay by defaulting every feature to an expensive model, so compare GPT-5 vs GPT-4o-mini and route each feature to the cheapest model that passes a blind quality test. If your workload is output-heavy or price-sensitive enough to consider switching providers, the full 2026 price table in DeepSeek vs OpenAI vs Gemini cost shows a spread of more than 200x from cheapest to frontier on input tokens, and why output tokens usually dominate the real bill.
4. Control: cap the worst case
Reducing average cost is not enough, because averages hide the users who are underwater. AI usage follows a long tail, and the tail is where your losses live. The single most important property a pricing model for an AI product can have is a known ceiling: a per-user cap that turns your worst case from unbounded loss into a number you chose. Read how to set spending caps per user for the pattern that blocks the call or silently downgrades a heavy user to a cheaper model once they cross their plan limit.
Autonomous agents make this urgent. A human power user is bounded by hours in the day; an agent your customer wires up against your API is not, and it can loop, retry, and fan out thousands of calls while the account still pays one flat fee. Learn to detect and stop agent reasoning loops before they cost you thousands, and read how to manage AI agent costs end to end when a single task fans out into dozens of model calls with variable, spiky cost per run.
5. Learn: what the big players got wrong
The teams with the most resources still got caught by the same mistake, which tells you it is structural rather than a matter of being careful. Uber burned its entire 2026 AI budget in four months, and Microsoft cut a costly AI coding tool for thousands of engineers. Read what Uber and Microsoft learned about AI costs for the lesson that applies to any SaaS reselling AI on a flat plan: measure per unit, and bound the worst case, before the bill teaches you the hard way.
Doing all of this without a data project
You can build the per-user logging, the pricing tables, the per-plan rollups, the loop detection, and the caps yourself. It is a real data project, and it goes stale every time a provider reprices. Or you can wrap your existing OpenAI, Anthropic, or Gemini client with Weckr in two lines and get all of it as a byproduct of the calls you already make: cost and margin per user and per feature, model and pricing recommendations, loop detection, and per-plan spending caps that enforce themselves. Cost is recomputed server side from current pricing, so it never drifts when a provider changes rates.
The fastest way to understand what that looks like is to click through the seeded dashboard at useweckr.com/demo, no signup required. The free tier covers 50k requests a month and Pro is $49/mo, so most teams can validate their unit economics before they pay anything.
FAQ
What is AI cost and margin management?
AI cost and margin management is the practice of measuring what each user costs you in LLM inference, comparing it to what that user pays, and acting on the gap. It has four parts: measure cost and margin per user, price so revenue covers variable cost, reduce cost per call where you can, and cap the worst case so a single user or agent cannot run your bill past their subscription. Traditional SaaS never needed this because serving one more user cost almost nothing; AI products need it because every call is a real bill.
Why do AI SaaS products have lower margins than traditional SaaS?
Traditional B2B SaaS runs 80 to 90 percent gross margins because the marginal cost of serving a user is near zero. AI products run closer to 50 to 60 percent because inference is a direct variable cost that scales with usage. A heavy user does not just engage more, they cost more, in direct proportion, against the same fixed subscription price. That is the structural reason AI margins are lower and why per-user cost tracking matters.
How do I know if a specific customer is profitable on my AI product?
Compute margin per user: the revenue that user pays you for the period minus the sum of their AI cost for that period. If it is negative, that user costs you more than they pay. You cannot see this from your OpenAI or Anthropic bill because the provider only shows account-level totals and has no idea who your users are. You have to attribute cost to a userId on every call, which is the first step in this guide.
Can I fix AI margins by just raising prices?
Not on its own. Raising the base price helps the average user but does nothing about the distribution: AI usage has a long tail, so a few users can cost ten or twenty times the median. Unless you also cap the worst case or add usage-based pricing, those outliers stay unprofitable no matter how high the flat price is. The durable fix combines pricing from real cost with per-user spending caps.
What is the fastest way to start managing AI cost per user?
Attribute cost to a userId on every LLM call, then watch margin per user for one month before changing anything. You can build the logging, pricing tables, and rollups yourself, or wrap your existing OpenAI, Anthropic, or Gemini client with Weckr in two lines and get per-user cost, margin, and spending caps as a byproduct of the calls you already make. See it on seeded data, no signup, at useweckr.com/demo.
Start with the number that decides everything
Every move in this guide depends on one thing: knowing what each customer actually costs you. Measure that first, and pricing, cost reduction, and caps all become decisions instead of guesses. See your real cost and margin per user, per feature, and per call on the seeded dashboard at useweckr.com/demo, then wrap your client and watch it on your own data.