How to Manage Claude Tokens
Advanced Techniques

Monitoring spend

You can't optimize what you don't measure

Every API response includes token counts in the usage field — log these from day one.

What to track

  • Input tokens per request
  • Output tokens per request
  • Cache read/write tokens (if using prompt caching)
  • Cost per request, per user, per feature

Useful fields: response.usage.input_tokens, response.usage.output_tokens, response.usage.cache_read_input_tokens.

Tools

Airtable + n8n for lightweight logging, PostHog or Mixpanel for product analytics. The Anthropic console also shows usage dashboards at the account level.

operator note

Set spend alerts in the Anthropic console. A runaway prompt can spike costs fast — alerts give you time to catch it before it becomes a real bill.

Changelog · 1
  • Initial release — 5 sections, 11 lessons.