1. Install the SDK
pylva-sdk, but the runtime import is pylva.
2. Create an Agent SDK key
Sign in to the Pylva dashboard and create an Agent SDK key. Store the plaintext key asPYLVA_API_KEY in your runtime secret store. The key is shown once.
3. Initialize the SDK
TypeScript
Python
https://api.pylva.com. Self-hosted deployments can pass an endpoint override.
4. Attribute calls to a customer and step
TypeScript
Python
5. Check the dashboard
After events arrive, use the dashboard to review:- Total cost and cost by customer.
- Expensive agent steps.
- Unknown pricing tasks that need a pricing rule.
- Rule events, warnings, and alerts.
Production checklist
- Use opaque
customer_idvalues. - Use stable
steplabels such asretrieve_context,evaluate, orsummarize. - Do not send prompts, completions, emails, phone numbers, or raw messages in telemetry metadata.
- Configure pricing for any non-LLM metrics before relying on margin reports.