Set Limits
First, you need to enable the Insights feature. Go to the dashboard of AI Engine and check the corresponding option:

This will add a new tab in AI Engine settings. Now you can go to the "Insights" tab. Here, you will find a list of all the queries that are being made to your chatbot. You can also set limits here.
By the way, if you want to see the logs of any of these queries, you will need to go to the "Settings" tab and enable the "Queries Data" option.
Once you have enabled the limits, you have different settings that you can tweak, such as the number and type of credits (Queries, Tokens, and Dollars). You can also set the timeframe for each of these limits to reset.

Be careful, there are three different settings tabs here: User, Guests, and System. Take a look at the message that will be sent by the chatbot when the user reaches its limit for each of those.
The "System" setting will apply to every type of user. It's kind of like your website's maximum limit, so make sure to set this up correctly as well.


If you want to customize the limits based on your users’ roles or any meta data please refer to our documentation on the matter : https://meowapps.com/ai-engine/faq/#limits-users-customers
How to check user’s usage
The usage is not a value you can see directly, as it’s not a meta that’s stored per user—it’s calculated on the fly whenever your user makes a query. The system compares the number of queries in the user’s history to the max credits allowed over the specified timeframe.
You can visualize that by using the following shortcodes:
[mwai_stats display="debug"] [mwai_stats_current display="usage"]

Non credits limitation
If you are looking for ways to block access from different parameters, such as time (only available from 2 p.m to 4 p.m), currently, there are no out-of-the-box features to accomplish this. However, you can achieve it yourself by using AI Engine filters. By using the mwai_ai_allowed($allowed, $query, $limits) function, you can check the timing of the user's query and return an error message if the timeframe is not suitable for you.
You can also come up with a solution on the client side. Using JavaScript, you can check the current time and then select the chatbot using its ID to disable it. You can do this by either hiding it or disabling the input with CSS, or even deleting the DOM element.
Can I use a membership plugin?
You can define a limit on the number of credits (queries, tokens, or dollars) a user can spend over a given time frame (month, day, year). When a query is made, the plugin checks the history of queries during that period and verifies whether the number of queries, tokens, or dollars exceeds the chosen value. That’s it.
The plugin doesn’t need to know whether you’re using a third-party plugin to manage roles or access—it just needs to know the number of credits you allow to be used. This value can be dynamically adjusted using filters:
- mwai_stats_credits($credits, $userId) → modifies the number of credits (allows you to create your own system)
- mwai_stats_coins($price, $stats, $atts) → modifies the coins (lets you convert the price you personally pay to OpenAI into your own system of coins that you share with your users)
So in your case, you can use the mwai_stats_credits filter to fetch the user’s metadata and return its value. This will override the credits you set manually in the Limits settings. Then, when the plugin checks the query history over the timeframe, it will compare the number of credits (X—your WooCommerce metadata) against the credits used in recent queries.
Let's assume your user has a corresponding "custom_credits" value. When a user purchases credits, you just need to add them to this number.
add_filter( 'mwai_stats_credits', function ( $credits, $userId ) {
$user = get_userdata( $userId );
if ( !empty( $user->custom_credits ) ) {
$credits = $user->custom_credits;
}
return $credits;
}, 10, 2);
Go read our documentation over there : FAQ | Meow Apps ! 🐈
Rolling Window: Limits are based on the queries made in the preceding period, continuously updating. For example, within the last day up to the current moment. Ideal to avoid sudden spikes in number of queries.
Fixed Window: Limits are based on a defined calendar period, resetting at the start of each new period. For instance, limits reset daily at midnight. Ideal for predictable usage patterns.
Subscription Window: Limits reset based on the anniversary of the user's first query, e.g., monthly on the same day as the first ever query. This day can be overriden through a WordPress filter. Ideal for subscription-based services.
What if my user renew/change its subscription before the time period?
This code assumes you have a way to check the user's previous role and a way to know if a subscription has been renewed or not. But you can get the gist of the idea used here.
add_filter('mwai_stats_credits', function ($credits, $userId) {
$roles_credits = array(
'free' => 1,
'trial' => 5,
'pro' => 10,
//...
);
$user = get_userdata( $userId );
// Get the stored role (current/previous role)
$stored_role = get_user_meta( $userId, 'role', true );
$user_credits = $roles_credits[ $stored_role ];
// Check if the user has changed roles
if ( $user->roles[0] != $stored_role ) {
// Update the stored role
update_user_meta( $userId, 'role', $user->roles[0] );
} else if ( get_user_meta( $userId, 'renew', true ) == 'yes' ) {
// If the user has not changed roles and the 'renew' field is 'yes', add the new credits
$user_credits += $roles_credits[ $user->roles[0] ];
update_user_meta( $userId, 'renew', 'no' );
}
return $user_credits;
}, 10, 2);