Documentation

Token Tracking

Ignitra tracks every AI API call per user — token counts, costs, and enforces daily/monthly limits.

How It Works

  1. User sends a message
  2. Usage limits are checked (daily + monthly)
  3. If within limits → AI generates response
  4. After response → tokens are recorded in the database
  5. Cost is calculated based on the model's pricing

Plan Limits

Configure limits in src/config/plans.ts:

  • Free: 10,000 tokens/day, 100,000/month
  • Starter: 100,000 tokens/day, 1,000,000/month
  • Pro: 500,000 tokens/day, 5,000,000/month
  • Enterprise: Unlimited

Usage Dashboard

Users can view their usage at /dashboard/usage:

  • Today's token count and cost
  • Monthly token count and cost
  • 30-day usage chart
  • Model breakdown

Customizing Limits

To change limits for a specific plan, edit src/config/plans.ts. When a user's Stripe subscription changes, their limits are automatically updated via the webhook handler.

Token Tracking | Ignitra Docs