> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.withpaygent.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.withpaygent.com/_mcp/server.

# 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`**

```typescript title="Tracking Agents and Indicators"
// Customer Support Chatbot (Agent)
await paygentClient.sendUsage(
  'customer-support-bot',     // Agent ID
  'customer-123',              // Customer ID
  'message-sent',              // Indicator (action performed)
  usageData
);

// Product Recommendation Engine (Agent)
await paygentClient.sendUsage(
  'recommendation-engine',     // Different Agent
  'customer-123',
  'recommendations-generated', // Different Indicator
  usageData
);

// Email Generator (Agent)
await paygentClient.sendUsage(
  'email-generator',           // Another Agent
  'customer-123',
  'email-composed',            // Another Indicator
  usageData
);
```

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`

> **Tip**
>
> **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`