Know what every customer actually costs you.
Capture model calls, agent steps, retries, and non-LLM usage. Attribute cost per customer in real time. React before the bill lands. Bill through Stripe Connect.
Not a dashboard.
A cost system that reacts.
Discover
Use the CLI and integration guide to identify LLM providers and declared non-LLM cost sources before production rollout.
Track
Stream tokens, tool calls, agent steps, retries, and configured usage metrics to the same customer-level cost view.
React
Use rules for alerts, budget hard-stops, model routing, failover, and margin recommendations.
Bill
Connect Stripe, generate invoices, and expose usage to end customers through a white-label portal.
You are blind to
30-60% of your agent cost.
LLM-only view
actual per-customer cost: unknown
Pylva view
acme.co · today · $0.46
Rules that run before the call,
not after the bill.
rule budget_limit { mode pre-call when customer.daily_spend >= 50 then block with PylvaBudgetExceeded}Blocks runaway spend before the provider call. Events still reconcile back to server truth.
Five minutes to first cost.
Thirty to full pipeline.
// 1. installpnpm add @pylva/sdk// 2. init - auto-patches openai / @anthropic-ai/sdk / aiimport { init, track } from "@pylva/sdk";import OpenAI from "openai";init({ apiKey: process.env.PYLVA_API_KEY });const openai = new OpenAI();// 3. wrap your agent run with customer + step contextawait track(user.id, { step: "draft" }, async () => { await openai.chat.completions.create({ ... });});A usage portal
under your brand.
Hi, Morgan
May 2026One tool
instead of three.
| Spreadsheet + provider dashboard | Helicone / Langfuse | Build in-house | Pylva | |
|---|---|---|---|---|
| Automatic LLM cost capture | Yes | Yes | Yes | Yes |
| Non-LLM cost tracking | No | No | No | Yes |
| Step-level cost per customer | No | No | No | Yes |
| Pre-call budget enforcement | No | No | Yes | Yes |
| Model routing per step | No | No | Yes | Yes |
| Stripe Connect billing | No | No | No | Yes |
| White-label customer portal | No | No | No | Yes |
| Open core, self-hostable | No | Yes | Yes | Yes |
Built for long questions.
Specific enough to cite.
LLM Benchmark Guide for AI Agents: Compare Models for Production
Use LLM benchmarks to shortlist models, then compare real agent workflows for quality, reliability, latency, and cost before production.
LLM Cost Tracking For AI Agents
How to implement LLM cost tracking for AI agents by customer, workflow, step, model, provider, retry, and request before the provider invoice arrives.
Non-LLM Cost Tracking For AI Agents
How to track search, speech, vector database, workflow, and other non-LLM API costs next to model spend.
Per-Customer AI Cost Attribution: See AI Cost By Customer, Plan, And Workflow
How to attribute AI agent cost by customer, plan, workflow, model, retry, tool call, and non-LLM usage before margins drift.
Pricing Tiers for AI Products: How to Structure Usage-Based Plans
How AI product teams structure Free, Starter, Pro, Scale, and Enterprise pricing tiers around included usage, overages, customer value, and margin.
What Is AI Observability?
AI observability explained for teams running LLM apps, RAG systems, and AI agents in production, including what to track, how it differs from traditional observability, and where AI cost observability fits.
RAG Pipeline Monitoring: Metrics, Costs, and Failure Points for AI Apps
Learn how to monitor RAG pipelines across retrieval, context assembly, model calls, tools, latency, quality, token usage, and customer-level AI cost observability.
LLM Orchestration Monitoring: Track Agent Workflows, Tool Calls, and Cost Across Steps
Learn how to monitor LLM orchestration across agent runs, workflow steps, model calls, tool calls, retries, fallbacks, latency, token usage, non-LLM costs, and customer-level attribution.
OpenAI Usage Monitoring for AI Products: Track API Usage by Customer, Workflow, and Cost
How AI product teams monitor OpenAI API usage, token usage, API key usage, customer and workflow cost, budgets, billing context, and AI cost observability.
Claude Token Counter for AI Agent Builders
How to count Claude input tokens before an API call, compare token counts with context and rate limits, and hand off from token estimates to customer-level Claude cost tracking.
LLM Context Windows for AI Agents: How Context Size Affects Cost
Learn what an LLM context window contains, why agent context grows across retrieval, tools, and retries, and how to measure its cost by customer and workflow step.
AI Token Pricing: Calculate and Plan Costs for AI Agents
Learn how AI token pricing works, how to estimate variable model costs before launch, and how to validate spend by customer, workflow, model, and step.
LangGraph Tracing: How to Track Token Usage in LangGraph
How to use LangGraph tracing to track token usage by graph node, run, customer, model, status, retries, and usage metadata before turning traces into cost records.
LangSmith Pricing vs LangGraph Runtime Cost: What You Actually Pay
Compare current LangSmith pricing with the model, tool, retry, deployment, and infrastructure costs created by production LangGraph agents.
LangGraph Multi Agent Example: Track Cost Across Agents, Tools, and Customers
A production-minded LangGraph multi agent example with supervisor routing, specialist agents, shared state, cost telemetry, customer attribution, tool usage, and privacy-safe metadata.
LangGraph Tool Calling Cost Tracking
How to track LangGraph tool calling cost by customer, graph node, run, tool name, metric, status, retries, and billable usage without sending tool inputs or outputs.
What Is Metered Billing? Metered vs Usage-Based Billing for AI Products
If you are building an AI product and trying to figure out how to charge for it, you have probably run into the term "metered." This page breaks down what metered billing actually means, how it compares to flat pricing and usage-based billing, and when it makes sense for AI SaaS products.
Pre-Call Budget Enforcement For AI Agents
How AI agent teams check customer and workflow budgets before supported provider calls, then warn, route, or hard-stop spend safely.
Metronome Billing for AI Products: When to Use Metronome, Stripe, or an AI Usage Layer
How AI product teams should evaluate Metronome billing, Stripe Billing, custom metering, and AI-specific usage infrastructure before turning usage into invoices.
Usage Based Billing For AI Agents: Turn Usage Into Profitable Invoices
How AI agent companies can meter LLM and non-LLM usage, price it server-side, review margin, and generate customer-ready billing records.
Billing Structure for AI SaaS: How to Design Usage-Based Billing Architecture
How AI SaaS teams design billing structure, usage metering, pricing logic, review workflows, and billing handoff before invoices reach customers.
Usage-Based Pricing Examples for AI Products
Concrete usage-based pricing examples for AI products, including token billing, API calls, workflow runs, agent minutes, credits, overages, and hybrid subscription-plus-usage models.
Report Usage, Not Cost
Why AI agent instrumentation should emit raw usage metrics while the backend calculates dollars.
Inspect the code. Run it on your infrastructure.
Pylva’s SDKs and core backend are MIT-licensed. Run them on your infrastructure when compliance or control requires it. Enterprise modules in src/ee are source-available under ELv2.
git clone https://github.com/pylva/pylva.git cd pylva docker compose -f docker/docker-compose.yml up -d pnpm install pnpm db:setup && pnpm db:seed pnpm dev
Start free.
Pay only when you grow.
Free
For first instrumentation and small prototypes.
- 100k events / mo
- 10 customers
- Basic dashboards
Pro
Most popularFor teams turning agent usage into customer cost visibility.
14-day free trial
- 1M events / mo
- Customer billing portal
- Webhooks
Scale
For production agent businesses with billing and automation needs.
14-day free trial
- 10M events / mo
- Advanced rules engine
- White-label portal
Enterprise
For teams beyond Scale-tier limits with procurement or custom pricing needs.
- Unlimited event volume
- Unlimited customers
- Unlimited retention
Frequently asked
How does Pylva integrate with my agent?
Install the TypeScript or Python SDK, create an Agent SDK key, and send cost-shaped events from your runtime. SDK failures are handled so your host agent does not fail because Pylva is unavailable.
Do you read my prompts or completions?
No. Pylva expects cost-shaped telemetry only: model, tokens, step name, customer ID, and configured usage metrics. Do not send prompts, completions, emails, or raw user messages.
Can I bill my customers through Pylva?
Yes. Stripe Connect, invoice drafts, and the customer portal are part of the billing surface for builders who want customer-facing usage and billing workflows.
What about non-LLM costs?
Use reportUsage / report_usage to track API calls, lookups, executions, or any custom metric. Non-LLM sources can be priced and shown alongside model costs.
Can I self-host it?
The SDKs and core backend are MIT licensed. Enterprise-only modules live under src/ee and are licensed under ELv2.
Your customers' costs are streaming somewhere.
Make them visible.
Five minutes with the SDK. A real cost picture once events arrive.