Case study
MarginFront
Prove your AI pays. Every model call metered, priced, tied to a customer, and carried into the month's close.
90-second version
- AI companies charge for outcomes and pay for tokens. The two numbers live in different systems, so nobody knows which customers are profitable.
- The platform, end to end: it meters every model call across 1,100+ models and tools, ties each one to what the customer was charged, and closes the month into a locked, balanced journal.
- 6× customer growth in 60 days (2 to 12 companies), zero churn.

Problem
One prospect report burns a search call, an LLM call, and an email send. The customer sees one line on the invoice. Those two facts live in different systems, so the question that decides the company (which customers are we making money on) has no answer anyone trusts. Founders price off a hunch, over-serve their heaviest accounts, and find out at the close that the plan that won the deal loses money every time it runs. Then the books get built by hand, because the finance stack was designed for seats and subscriptions, not for a model call that costs a different amount on Tuesday.
Non-obvious insight
Pricing an agent product is not a Stripe problem, it's an attribution problem. Put one agent call, its model cost, its tool costs, its customer, and its invoice line in a single row, and the pricing model falls out of the table. The billing unit is whatever the customer reads on the invoice, and that choice is the whole design. Bill by the report and a 15-page report is one billable event. Bill by the page and the same call is 15. Same work, same cost, different invoice. Build the attribution layer first and margin by customer, margin by agent, and what the month closes at all become queries instead of projects.
Bets I made
- The unit of analysis is the agent call, not the customer and not the month.
- Attribute cost at ingest, not at reconciliation. Chasing cost data after the fact is where every startup gets this wrong.
- Stay product-agnostic and model-agnostic on purpose: one catalog of 1,100+ models and tools, LLM and not, so a team that swaps providers keeps its margin history. Cost tracking, revenue attribution, the books, and AI ROI across the company sit in one table, whether the unit is a single usage event or a long chain of services billed as one outcome. Nobody I've found does all four in one place, and an agent checks 10+ competitors every Monday.
- Integration is the funnel. An npm package for your own engineers' coding-agent spend, an SDK and REST API for the code your customers pay for, an MCP server for everything else. A customer who never opens the site is still a customer.
- Run the company on the same kind of agent fleet the product bills for. Every feature goes out through a line of specialist agents, gated by a human ✓ in Slack. The whole fleet is documented at /agents.
What shipped
- The platform, end to end: cost metering across 1,100+ models and tools, live margin by customer and by agent, audit-ready monthly closes.
- 6× customer growth in 60 days (2 to 12 companies), zero churn.
- Every model call priced from the provider's own usage data and tagged to the agent, the customer, the task, and the model. One event can carry a whole chain of services and still bill as one outcome.
- A close you can lock: charges classified to a chart of accounts, the month sealed, a balanced journal out the other side. Invoices collect through Stripe or PayPal; the journal exports to QuickBooks or NetSuite. Four labels of revenue (Agent-Earned, Revenue, Billed, Collected), each with its own margin, so the founder and the accountant stop meaning different things by the word revenue.
- Three doors in: the code-cost-clarity npm package for your team's own Claude Code and Codex spend, the SDK and REST API for the product your customers pay for, the MCP server for running the whole account from an AI assistant without opening the site.
Evals and instrumentation
Every attributed call ties back to a provider's own usage line, within a stated tolerance, before it reaches a dashboard. Margin reconciles against Stripe at the monthly close. Events never drop: each one lands priced, or flagged as waiting on a model the catalog hasn't learned yet, or flagged as missing the token counts, and the dashboard says which. Where there is no priced usage, the number reads blank rather than $0, because a zero that isn't real is the kind of thing an auditor finds three months later. The fleet that ships the product gets graded too: the Coach agent scores the pipeline against a 120-point rubric on the 1st and 15th.

What broke
The first builds tried to model every provider's billing quirks up front. One provider worked. Two was harder. By three the abstraction was worse than the problem it replaced. The fix was to stop pretending providers agree with each other: take each one as a raw feed, keep its own rates as the source of truth, and normalize once at the attribution layer. That is also why the model catalog is a table you can query and not a code path you have to redeploy. Second failure: margin dashboards nobody opened, because they lived somewhere the founder wasn't. The daily margin digest now lands in Slack.
What's next
A plan-recommendation loop that reads your last 30 days of attributed events and proposes the pricing model. Then public agent-economics benchmarks, so a founder setting a price has something real to compare against instead of a competitor's marketing page.

