> ## Documentation Index
> Fetch the complete documentation index at: https://docs.pylva.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Pylva Cost Infrastructure Docs

> Install Pylva, attribute AI cost by customer and agent step, enforce budget controls, and bill from trusted usage data.

Pylva is cost infrastructure for AI agent businesses. It helps you build coverage for LLM and non-LLM cost sources, track spend by customer and agent step, react before spend runs away, and bill customers from usage data.

## What Pylva does

Pylva gives engineering and operations teams a cost layer for production agents:

* Capture LLM calls from OpenAI, Anthropic, and Vercel AI through the SDK.
* Report non-LLM usage such as search requests, speech characters, vector lookups, and workflow executions.
* Attribute usage to `customer_id` and `step_name` so cost reports map to customers and product workflows.
* Price usage on the server from builder-owned pricing tables instead of trusting application code to send dollars.
* Enforce cost controls with budget limits, routing rules, failover rules, alerts, and recommendations.

## Start here

1. [Choose a plan](https://pylva.com/pricing) - start a 14-day Pro or Scale trial, or contact sales for Enterprise. Sign in with GitHub, Google, or a magic link during checkout.
2. [Quickstart](quickstart) - mint a key, install the SDK, and send your first event.
3. [Set up with an AI agent](setup-with-ai) - hand the whole integration to Claude Code, Cursor, or another coding agent with one prompt.
4. [TypeScript SDK](sdks/typescript) - auto-instrument Node.js agent runtimes.
5. [Python SDK](sdks/python) - auto-instrument Python agent runtimes.
6. [Cost attribution](concepts/cost-attribution) - choose stable customer and step identifiers.
7. [API overview](api/overview) - understand the SDK-facing HTTP surface.

On Pylva Cloud? [Plans and limits](plans-and-limits) covers tiers, event caps, and upgrades.

Need to know whether all costs are covered? See [Cost Source Discovery](concepts/cost-source-discovery).

Prefer to self-host or inspect the data path? See [Open Source And Hosted](concepts/open-source-and-hosted).

Want to control spend after telemetry is flowing? See [Controls Workflow](concepts/controls-workflow).

Need alerts in Slack, email, or your own systems? See [Alert Delivery And Webhooks](concepts/alert-delivery-and-webhooks).

Want to understand the billing loop? See [Billing Workflow](concepts/billing-workflow).

Need to share usage with end-users? See [Customer Portal](concepts/customer-portal).

## Core model

Pylva is SDK-first. Your application keeps calling model and tool providers directly. The SDK emits cost-shaped telemetry in the background, and the backend calculates cost from your pricing tables.

| Layer     | Responsibility                                                                           |
| --------- | ---------------------------------------------------------------------------------------- |
| SDK       | Capture usage, attach customer context, report telemetry, enforce cached pre-call rules. |
| Backend   | Validate events, price usage, store events, evaluate post-call rules, reconcile budgets. |
| Dashboard | Configure keys, pricing, rules, alerts, invoices, and customer-facing portal links.      |

## Privacy posture

Pylva does not need prompt text, completions, raw tool arguments, emails, phone numbers, or user messages. Use opaque identifiers and stable labels for all telemetry fields. See [Privacy and PII](concepts/privacy-and-pii) before sending production data.
