Introduction
Welcome to LensAI - Metrics and attribution for AI agents and applications
Introduction to LensAI
What LensAI Is
LensAI is a comprehensive metrics and attribution platform specifically designed for AI agents and applications. Unlike traditional analytics tools, LensAI provides deep visibility into the unique economics of AI systems, helping you track and optimize the metrics that matter most for AI-powered businesses.
At its core, LensAI captures and analyzes five critical dimensions of your AI operations: costs (what you spend on LLMs, APIs, and compute), human value (the tangible benefit delivered to users), revenue (what customers pay), goals and outcomes (whether your AI achieves its intended objectives), and unit economics (the profitability and efficiency of each interaction). By bringing these metrics together in a single platform, LensAI gives you the complete financial and operational picture of your AI systems at a glance.
The platform works by proxying your AI traffic and enriching it with business context. Every LLM call, tool invocation, and agent interaction becomes a traceable event that can be attributed to specific customers, sessions, and agents. This attribution layer transforms raw operational data into actionable business intelligence, allowing you to answer critical questions like "Which agents are profitable?", "What's our margin per customer?", and "Are our AI investments delivering ROI?"
Who It's For
LensAI is built for teams that need to understand and optimize the business performance of their AI systems. Whether you're an indie developer building your first AI-powered SaaS product, a growing startup scaling AI features, or an enterprise team managing complex multi-agent systems, LensAI helps you make data-driven decisions about your AI investments.
Indie developers and small teams use LensAI to keep AI costs under control while maximizing the value delivered to users. When every dollar of API spend matters, LensAI helps you identify which features and usage patterns are sustainable and which need optimization. You can track costs in real-time, set budget alerts, and understand exactly which customer interactions are profitable.
SaaS teams and product organizations leverage LensAI to optimize AI-powered features and prove their business impact. Product managers can track value delivery for AI features, while engineering teams monitor performance and costs. Finance teams get the cost attribution and revenue mapping they need to accurately forecast AI spending and calculate unit economics. Marketing and sales can demonstrate clear ROI when selling AI-powered features to customers.
How It Works
LensAI operates as an intelligent proxy layer between your application and AI service providers. Instead of calling OpenAI, Anthropic, or other LLM providers directly, you route your requests through LensAI. This architecture allows LensAI to capture complete traces of every interaction without requiring changes to your existing code or business logic.
When a request flows through the LensAI proxy, several things happen automatically. First, the request is enriched with context—customer IDs, session identifiers, metadata, and any custom attributes you've defined. Then, LensAI forwards the request to your chosen provider (OpenAI, Anthropic, Google, etc.) and captures the response. During this process, LensAI measures costs (based on tokens and model pricing), latency, success rates, and other operational metrics. Finally, the response is returned to your application unchanged, ensuring your users experience no difference in behavior or performance.
The real power comes from LensAI's event and trace model. Every interaction generates structured events that capture not just the API call itself, but the full business context: which customer made the request, which agent handled it, what goals were achieved, what value was delivered, and what revenue can be attributed to it. These events are stored, indexed, and aggregated in real-time, powering dashboards and reports that show your AI economics at every level—from individual requests to customer cohorts to company-wide metrics.
Integration is straightforward: sign up for a LensAI account, create an agent, configure your API keys for the providers you use, and update your code to route requests through the LensAI proxy endpoint. Once integrated, you immediately gain visibility into costs and performance. As you add business context (customer mappings, revenue data, goal definitions), your analytics become progressively richer and more actionable.
Core Ideas
Understanding a few key concepts will help you get the most out of LensAI. These ideas form the foundation of how the platform models and measures your AI systems.
Agent: In LensAI, an agent represents a distinct AI-powered capability or workflow in your application. An agent might be a customer support chatbot, a code generation assistant, a content recommendation engine, or any other AI-powered feature. Each agent can use one or more LLMs, call various tools and APIs, and serve specific business purposes. LensAI tracks costs, performance, and outcomes separately for each agent, allowing you to understand which agents deliver value and which need optimization.
Session: A session groups related interactions into a coherent conversation or task. For example, a customer support conversation might involve multiple messages back and forth, each generating separate API calls, but all belonging to the same session. By tracking sessions, LensAI can measure the total cost and value of complete customer interactions, not just individual API calls. Sessions are also where you can attribute outcomes and goals—did this support session resolve the customer's issue? Did this onboarding conversation lead to activation?
Event: An event is any significant occurrence in your AI system—an LLM request and response, a tool call, a goal achieved, revenue recorded.
Cost: Cost represents what you pay to AI providers, tool APIs, and other services to power your agents. LensAI automatically calculates costs based on token usage, model pricing, and provider rates. Costs are attributed to agents, customers, sessions, and time periods, giving you complete visibility into where your AI spending goes. Cost tracking includes not just LLM tokens, but also API calls to external tools, compute resources, and any other metered usage you configure.
Value (Human Value): Value measures the tangible benefit your AI delivers to users, expressed in business terms whenever possible. While costs are automatically tracked, value requires you to define what constitutes meaningful outcomes for your users. For a customer support agent, value might be measured as successful issue resolutions or time saved. LensAI encourages USD-denominated value metrics when possible (e.g., "$X in customer time saved" or "$Y in prevented churn"), making it easy to compare value against costs and calculate ROI.
Revenue: Revenue tracks what customers pay for your app. LensAI supports both manual revenue attribution (you explicitly map payments to sessions or customers) and automatic attribution (based on usage patterns and pricing models). Revenue data is essential for calculating margins and unit economics. When you know the cost and revenue for each customer or session, you can identify profitable segments, optimize pricing, and make informed decisions about feature development and go-to-market strategy.
Goal and Outcome: Goals represent the specific objectives your agents are designed to achieve. Did the customer support agent resolve the issue? Did the sales assistant qualify the lead? Did the content generator produce accepted copy? Each achieved goal contributes to the overall value calculation and helps you understand which agents and patterns are truly effective.
Together, these concepts form a comprehensive model of your AI systems that goes far beyond simple usage metrics. LensAI doesn't just tell you how many tokens you consumed or how many API calls you made—it tells you whether your AI is profitable, which customers and use cases deliver the best margins, and where you should focus optimization efforts. This business-first approach to AI analytics is what makes LensAI essential for teams that need to prove and improve the ROI of their AI investments.