Agents & Indicators

Understanding agents and indicators is fundamental to using Paygent effectively. They’re the building blocks of how Paygent tracks and bills for AI usage.

Scenario: Meet Sarah, who runs an e-commerce AI platform. Her system has a customer support chatbot, a product recommendation engine, and an email generator. Each of these does different things, costs different amounts, and provides different value. How does she track them separately?

Solution: With Paygent, Sarah defines each AI component as an Agent and each action as an Indicator:

Tracking Agents and Indicators
1// Customer Support Chatbot (Agent)
2await paygentClient.sendUsage(
3 'customer-support-bot', // Agent ID
4 'customer-123', // Customer ID
5 'message-sent', // Indicator (action performed)
6 usageData
7);
8
9// Product Recommendation Engine (Agent)
10await paygentClient.sendUsage(
11 'recommendation-engine', // Different Agent
12 'customer-123',
13 'recommendations-generated', // Different Indicator
14 usageData
15);
16
17// Email Generator (Agent)
18await paygentClient.sendUsage(
19 'email-generator', // Another Agent
20 'customer-123',
21 'email-composed', // Another Indicator
22 usageData
23);

Now Sarah can see exactly how much each AI component costs and which actions her customers use most.

Result: Sarah can now track that her chatbot handles 10,000 messages/month, recommendations generate 50,000 suggestions, and the email tool creates 2,000 emails. She bills customers accurately based on what they actually use.


🤖 What is an Agent?

An Agent is a distinct AI component or workflow in your application. Think of it as “who is doing the work.”

Examples:

  • Customer support chatbot
  • Code review assistant
  • Content generator
  • Data analyzer

⚡ What is an Indicator?

An Indicator is a specific action performed by an agent. Think of it as “what work was done.”

Examples:

  • message-sent
  • article-generated
  • code-reviewed
  • report-created

Best Practice: Choose descriptive agent names and indicator names that clearly describe what’s happening. This makes your usage data easy to understand and analyze later.

Good: customer-support-bot + message-sent

Avoid: agent1 + action