Why Monetizing Agents Needs Different Infrastructure - John Yeo and Charlie Lamb, Autumn

Mastra
627 views •

John Yeo, CTO of Autumn, and founding engineer Charlie Lamb take the stage at the TypeScript AI Conference in London to show why billing turned into a distributed systems problem and what they did about it. Autumn builds billing for AI companies. Billing used to mean a monthly subscription. Now it means credits, usage limits, and metering, with a balance check before every user request. "You've hit your usage limit" looks trivial from the outside. In practice, it breaks in three places. If you track credits in a single balance column, it can break as soon as pricing gets more complicated. Every promo code, rollover, and expiry can turn into another column, another migration, and more application logic. Throughput can break too, because recalculating a balance from a ledger on every request is too slow. And concurrency is the worst of the three, because an agent firing five requests at once will overdraft a balance that only covers one. You'll see how they tackled this through a row per balance, a ledger paired with a counter in Redis, and lock and release, which estimates the cost up front and settles the difference afterward. You'll also see two ideas that keep pricing changes cheap! Recorded at the TypeScript AI Conference in London, July 23, 2026, presented by Mastra. 🔗 MENTIONED IN THIS TALK Autumn: https://useautumn.com Autumn on GitHub: https://github.com/useautumn/autumn 📚 MASTRA RESOURCES https://mastra.ai https://x.com/mastra_ai https://mastra.ai/community/discord https://github.com/mastra-ai Learn Mastra: https://mastra.ai/learn https://mastra.ai/books/principles-of-building-ai-agents https://mastra.ai/books/patterns-of-building-ai-agents WHAT IS MASTRA Mastra is an open-source TypeScript framework designed for building and shipping AI-powered applications and agents with minimal friction. It supports the full lifecycle of agent development — from prototype to production. CHAPTERS 00:00 Intro 00:23 How billing changed for AI 01:30 You've hit your usage limit 02:03 The simplest possible system 02:40 Where a single balance column breaks 03:19 A row per balance 04:02 The ledger and the counter 05:21 Throughput, concurrency, atomicity 05:42 Why queues don't work here 06:29 Lock and release 07:50 Billing is relational 09:18 Hierarchical config 10:23 Wrapping up

Keyboard shortcuts

On. Switch them off if they collide with your assistive tools; ? still opens this sheet.

Go to

Press g then the letter.

  • gh Latest
  • gs Sources
  • gm Media
  • gv Videos
  • gp Podcasts
  • gc Calendar
  • gd Decoder
  • gz Dataviz
  • ga Datasets
  • gb Blog
  • gk Markets
  • gj Careers
  • gn Prompt Notebook

On this page

  • / Focus search, where there is one
  • t Back to top
  • ? This list
  • Esc Close