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

# Manual vs Automatic Tracking

Understanding when to use manual tracking versus automatic tracking helps you choose the best approach for your application.

## Detailed Comparison

| Feature         | Manual Tracking                 | Automatic Tracking (Wrapper)   |
| --------------- | ------------------------------- | ------------------------------ |
| Code Complexity | \~40 lines per API call         | \~15 lines total setup         |
| Token Counting  | Extract from API response       | Automatic via wrapper          |
| Error Prone     | Can forget to track calls       | Impossible to miss             |
| Flexibility     | Full control over data          | Standardized tracking          |
| Setup Time      | 5-10 min per integration        | 2 min one-time setup           |
| Maintenance     | Update code for each call       | Zero ongoing maintenance       |
| Best For        | Custom providers, special cases | OpenAI, Gemini, standard usage |
| Code Reduction  | Baseline                        | \~60% less code                |

---

## ✓ Use Manual When:

* Using a provider without automatic wrapper support
* Want granular control over what's tracked
* Building custom AI solutions

## ✓ Use Automatic When:

* Want minimal code and setup
* Need reliable, consistent tracking
* Building standard AI applications (Recommended!)

> **Tip**
>
> **Recommendation.** For most users, **automatic tracking** is the best choice. It's simpler, more reliable, and easier to maintain. Only use manual tracking if you have specific requirements that automatic tracking doesn't support.