Add a feature to automatically notify users when their AI token consumption reaches a predefined threshold.
Provide an option to create a notification template with a dynamic variable for the current AI token consumption percentage.
For example:
- Admin creates an alert template.
- The template can contain a variable such as
{{token_usage_percentage}}. - The system continuously monitors AI token consumption.
- When usage reaches 80%, the system automatically triggers the configured WhatsApp template message to the user.
"⚠️ Your AI token usage has reached {{token_usage_percentage}}%. Please consider upgrading or adding more tokens to continue using AI services without interruption."
When usage reaches 80%, the user receives:
"⚠️ Your AI token usage has reached 80%. Please consider upgrading or adding more tokens to continue using AI services without interruption."
The admin should be able to configure:
- Alert threshold (e.g., 80%, 90%, 95%)
- WhatsApp template
- Dynamic token usage variable
- Recipient/user
- Alert frequency
The system should avoid sending the same alert repeatedly for the same threshold.
For example:
- At 80% → Send alert once
- At 90% → Send alert once
- At 95% → Send alert once
This will help users understand their remaining AI token balance and take action before reaching the token limit.