Mjara Docs
Safety & Control

Token Management

Arif AI includes a built-in token management system that tracks AI usage per user and enforces configurable quotas to control costs.

How It Works

Every interaction with the AI consumes tokens — both for the input (your messages and context) and the output (the AI's response). Arif AI tracks this usage per user and enforces limits based on configurable tiers.

Usage Tiers

TierDefault QuotaDescription
Free10,000 tokens/monthTrial users
Default500,000 tokens/monthStandard users
Premium1,000,000 tokens/monthPower users

Administrators can create custom tiers and assign them to specific roles or users.

Token Tracking

Each API call returns token usage information:

{
  "tokens_used": {
    "input": 150,
    "output": 50,
    "total": 200
  }
}

Users can view their current usage in the chat widget when Show Token Usage is enabled in settings.

Quota Enforcement

When a user reaches their token quota:

  1. The system returns a rate limit error (HTTP 429)
  2. The user is informed that they've reached their limit
  3. Usage resets at the beginning of the next quota period (monthly by default)

On this page