Basic Usage
Here is how you track AI usage across different languages. For Python, Paygent provides automatic instrumentation. For Node.js and Go, use manual tracking methods.
Python
Node.js
Go
The simplest way to track AI usage in Python is by initializing Paygent at the start of your application. This automatically instruments supported LLM clients.
main.py
Understanding the Parameters:
- Agent ID: Identifies which AI component performed the work (e.g., “chatbot-agent”)
- Customer ID: Identifies which customer used the service
- Indicator: Describes what action was performed (e.g., “message-sent”)
- Usage Data: Contains the model info and token counts
