
AI
Agent SDK: bill the dollar cost of LLM calls, margin built in
Anh-Tho Chuong • 1 min read
Jan 26
/3 min read
AI products don't behave like normal SaaS. Per-inference and per-token costs mean a flat monthly plan can quietly run unprofitable, one heavy customer at a time. Most of the mistakes below come from the same root cause: pricing modeled on the old SaaS playbook, applied to a cost structure that doesn't work that way. This guide lists the seven most common pitfalls, how to fix each one, and a checklist to test before you ship.
1. Copying generic SaaS pricing models
Flat-rate or per-seat logic assumes a marginal user costs close to nothing. AI breaks that. A single heavy user routing to your most expensive model can cost more than they pay.
Fix: map a real value metric (tokens, API calls, predictions, model endpoints) to the price. Use hybrid models: a base subscription plus pay-as-you-go overage. Starter at $49/mo covering 50k tokens, then $0.002/token beyond that, for example. Validate the numbers against real usage telemetry before you commit to a tier structure. See 6 Proven Pricing Models for AI SaaS for worked examples.
2. Underestimating LLM and infrastructure costs
GPU and LLM inference costs are variable and the tail is expensive. Get the margin math wrong and your best account becomes your worst one.
Fix: instrument cost per model and per endpoint, and attach it to the billing event, not just the usage count. Add tiered rates or model-class surcharges so premium-model traffic carries its own cost. Make sure your billing layer can store cost tags, not just usage counts, so you can reconcile revenue against actual cloud spend.
3. Charging on the wrong metric
Billing by seat when the value scales with usage (API calls, documents processed) misaligns price and cost from day one.
Fix: pick one primary value metric per product. Don't split attention across three metrics that all try to capture the same thing. Build usage bundles around how customers actually consume the product, not around what's easiest to track.
4. Building brittle, manual billing infrastructure
Homegrown billing breaks on the second edge case: proration, tax, multi-entity invoicing, credit notes. What was a spreadsheet becomes a support queue.
Fix: adopt a metering-first billing platform built for event throughput and flexible pricing rules, not one bolted onto a payments API. Automate invoice generation, proration, and tax handling from the start. If margin visibility is the goal, Lago AI now handles revenue forecasting and churn signals on top of the same usage data, so you're not building that layer yourself either.
5. Ignoring usage volatility
A single batch job or a spike in agent loops can generate a bill nobody predicted, on either side of the contract.
Fix: quotas, rate limits, and prepaid credits absorb the spike before it becomes a surprise invoice. Cap overage pricing so the worst case is a known number, not an open-ended bill.
6. Poor packaging and unclear ROI
If a customer can't answer "what does $500 buy me," the price doesn't stick, no matter how well it's calculated.
Fix: lead with outcomes, not units. Publish real breakpoints and sample invoices so the customer can do the math themselves before they're surprised by it.
7. Not testing the billing flow before launch
Pricing that works on a spreadsheet can break in production: wrong proration, missed refunds, an accounting export that doesn't reconcile.
Fix: run end-to-end billing simulations with real sample customers before launch. Validate invoices, refunds, and the accounting export, not just the price calculation.
For the underlying question of what unit to price on, see Pricing AI: A Unit-Based Problem? For the mechanics of usage-based billing at scale, see SaaS Billing Systems That Handle Complex Pricing Models.
Ready to fix your AI pricing? Book a demo to see how Lago handles metering, hybrid pricing, and margin visibility in one system.