The AI Token plumbing issue
The Lago Agent SDK has been released to streamline token usage billing for AI features. It addresses the repetitive task of token extraction and billing across various AI model providers. By normalizing the data from different providers, it simplifies the integration process for businesses adding AI functionalities.
- ▪The Lago Agent SDK includes libraries for Python and TypeScript to facilitate token usage billing.
- ▪Many teams have been building similar token-extraction middleware for AI features, leading to inefficiencies.
- ▪The SDK automates the token attribution process, allowing for easier billing across different AI model providers.
Opening excerpt (first ~120 words) tap to expand
All articlesMay 26/Product/5 min readAI Billing is (mostly) token plumbingRaffi SarkissianShare onWhy we built the Lago Agent SDK, and what we're shipping next.We just released the Lago Agent SDK. Two libraries, Python and TypeScript. They wrap your LLM client and send token usage to Lago for billing. That's the surface.The point is what you stop doing.The token plumbingEvery team that shipped an AI feature in the last 18 months built the same thing. Smart search, inbox triage, meeting summaries, coding agents, vibe-coded apps. All of them ended up writing token-extraction middleware.The middleware is the same job, repeated everywhere. Call an LLM. Parse the response for token counts. Attribute the call to a customer. Send the count to a billing system.
…
Excerpt limited to ~120 words for fair-use compliance. The full article is at Lago.