Pylva

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.

Works with every stackLangGraphCrewAIMastraOpenAI AgentsPydantic AIVercel AI SDK
01Discover.
02Track.
03React.
04Bill.
The product

Not a dashboard.
A cost system that reacts.

Dashboards get checked after damage is done. Pylva is built around cost signals that can trigger rules, billing, and customer-facing usage views.
01

Discover

Use the CLI and integration guide to identify LLM providers and declared non-LLM cost sources before production rollout.

Cost Source Checklist
review before go-live
02

Track

Stream tokens, tool calls, agent steps, retries, and configured usage metrics to the same customer-level cost view.

per customer
per step, per model, per run
03

React

Use rules for alerts, budget hard-stops, model routing, failover, and margin recommendations.

pre-call
SDK-side enforcement
04

Bill

Connect Stripe, generate invoices, and expose usage to end customers through a white-label portal.

Stripe Connect
builder-owned payouts
The wedge

You are blind to
30-60% of your agent cost.

A real agent calls search, speech, vector databases, inference APIs, and workflow tools. Pylva tracks configured non-LLM usage next to model calls.

LLM-only view

LLM$0.18
ElevenLabs TTSmissing
Pineconemissing
Serpermissing
Deepgrammissing

actual per-customer cost: unknown

Pylva view

LLM$0.18
ElevenLabs TTS$0.13
Pinecone$0.07
Serper$0.05
Deepgram$0.03

acme.co · today · $0.46

React

Rules that run before the call,
not after the bill.

Pre-call rules run in the SDK for budget hard-stops, model routing, and failover. Post-call rules handle alerts, anomaly detection, and margin diagnosis.
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.

Install

Five minutes to first cost.
Thirty to full pipeline.

One SDK for TypeScript and Python. Track LLM usage automatically through wrappers, then add configured non-LLM usage with reportUsage.
// 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({ ... });});
Bill

A usage portal
under your brand.

Hosted portal links let end customers inspect usage and invoices without seeing anyone else's data.
usage.acme.co

Hi, Morgan

May 2026
You used $47.50 of your $100 monthly budget.13 days left
LLM calls$38.30
ElevenLabs$6.20
Pinecone$3.00
vs. the status quo

One tool
instead of three.

Most teams stitch together provider dashboards, observability tools, and billing scripts. Pylva is built for the combined workflow.
Pylva feature comparison
Spreadsheet + provider dashboardHelicone / LangfuseBuild in-housePylva
Automatic LLM cost captureYesYesYesYes
Non-LLM cost trackingNoNoNoYes
Step-level cost per customerNoNoNoYes
Pre-call budget enforcementNoNoYesYes
Model routing per stepNoNoYesYes
Stripe Connect billingNoNoNoYes
White-label customer portalNoNoNoYes
Open core, self-hostableNoYesYesYes
Source library

Built for long questions.
Specific enough to cite.

Google AI Mode and answer engines reward clear source pages that answer narrow implementation questions. These pages cover the cost, control, and billing workflows Pylva is built for.
Guides

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.

Guides

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.

Guides

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.

Guides

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.

Guides

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.

Guides

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.

Guides

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.

Guides

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.

Guides

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.

Guides

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.

Guides

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.

Guides

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.

Guides

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.

Guides

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.

Guides

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.

Guides

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.

Guides

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.

Guides

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.

Guides

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.

Guides

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.

Guides

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.

Guides

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.

Concepts

Report Usage, Not Cost

Why AI agent instrumentation should emit raw usage metrics while the backend calculates dollars.

Open-source core

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.

$ your-machine
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
Pricing

Start free.
Pay only when you grow.

You pay Pylva for cost infrastructure. Your customers pay you for what they use through your billing flow. The full comparison includes limits, retention, rules, webhooks, and support.

Free

For first instrumentation and small prototypes.

$0/moUSD
  • 100k events / mo
  • 10 customers
  • Basic dashboards
Start free

Pro

Most popular

For teams turning agent usage into customer cost visibility.

$49/moUSD

14-day free trial

  • 1M events / mo
  • Customer billing portal
  • Webhooks
Start Pro trial

Scale

For production agent businesses with billing and automation needs.

$199/moUSD

14-day free trial

  • 10M events / mo
  • Advanced rules engine
  • White-label portal
Start Scale trial

Enterprise

For teams beyond Scale-tier limits with procurement or custom pricing needs.

Custom
  • Unlimited event volume
  • Unlimited customers
  • Unlimited retention
Contact sales
FAQ

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.

Get started

Your customers' costs are streaming somewhere.
Make them visible.

Five minutes with the SDK. A real cost picture once events arrive.