reportUsage or report_usage.
Integration matrix
| Stack | Package or entrypoint | Capture path |
|---|---|---|
| TypeScript OpenAI | @pylva/sdk | Auto-instrumentation |
| TypeScript Anthropic | @pylva/sdk | Auto-instrumentation |
| TypeScript Vercel AI | @pylva/sdk | Auto-instrumentation |
| Python OpenAI | pylva-sdk, import pylva | Auto-instrumentation |
| Python Anthropic | pylva-sdk, import pylva | Auto-instrumentation |
| LangGraph or LangChain | PylvaCallbackHandler | Callback instrumentation |
| Non-LLM tools | reportUsage or report_usage | Manual usage reporting |
| Unsupported provider path | reportUsage, report_usage, or custom integration | Manual usage reporting |
What Pylva captures
Pylva captures cost-shaped metadata:- Provider and model.
- Token counts when the provider or framework exposes them.
- Latency and status.
customer_idandstep_name.- Metric and metric value for non-LLM usage.
Which path should I use?
Use auto-instrumentation when your runtime calls a supported provider client directly. Use the callback path when LangGraph or LangChain owns the model call. UsereportUsage or report_usage when the cost comes from a custom tool, non-LLM service, or unsupported provider path.
Avoid double counting
Use one capture path for the same model call.- Do not use provider auto-instrumentation and a framework callback for the same call.
- Do not manually report a provider call that the SDK already captures.
- Manually report only usage that is not already captured.