> 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.

# Best Practices

Follow these best practices to get the most out of Paygent.

## 1. Use Descriptive Names

Choose clear, descriptive names for agents and indicators that make your data easy to understand.

| ✓ Good                     | ✗ Avoid  |
| -------------------------- | -------- |
| `customer-support-chatbot` | `agent1` |
| `ticket-resolved`          | `action` |

## 2. Track at the Right Granularity

Track each significant AI operation, but don't over-track minor steps.

* ✓ **Track:** Each chat completion, content generation, embedding creation
* ✗ **Don't track:** Token counting operations, validation checks, internal processing

## 3. Use Environment Variables

Never hardcode API keys. Always use environment variables.

```typescript
// ✓ Good
const client = PaygentClient.newClient(process.env.PAYGENT_API_KEY);

// ✗ Never do this
const client = PaygentClient.newClient('pk_live_abc123...');
```

## 4. Monitor Your Usage

Regularly check your Paygent dashboard to understand usage patterns, identify anomalies, and optimize costs.