Token Tracking
Ignitra tracks every AI API call per user — token counts, costs, and enforces daily/monthly limits.
How It Works
- User sends a message
- Usage limits are checked (daily + monthly)
- If within limits → AI generates response
- After response → tokens are recorded in the database
- 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.