If you want your users to be able to upload PDF files, you have 2 choices:
Use an OpenAI Assistant — Learn how to use Assistants. In AI Engine, you can enable the File Search option in your chatbot settings, which allows the assistant to accept files for discussion threads.
The Assistants are getting deprecated by OpenAI, so this will no longer be supported. Use a regular chatbot with File Upload instead.
Use a File Compatible Model – Most models are now able to handle file upload directly. If the model you have selected is compatible, you can tick the “File Upload” option.
Upload Images
This is now the same process as File Upload. If the model is only compatible with images, you will get the following message.
Uploaded media have to be stored on your WordPress server first so they can be sent through in the chatbot query. As for replies, if they contain a file or an image, that file also needs to be saved on your server so your users can download it.
You can go to Settings > Files and Media to modify how these files should be handled on your server.
Upload multiple files
Not all models are compatible with multi-file upload. If not, you will probably get an error if you try to send multiple files in a single query. Go to your chatbot settings, and under the threshold section, you can select the maximum number of files that can be uploaded per message.
Knowledge (Embeddings)
If you need your chatbot to rely on specific information and not only on its general AI training, AI Engine can help you build a knowledge base for tailored responses. Please read this documentation to get started: Knowledge Base.
Create & Edit Images
Chatbot
You can choose to set your chatbot to “image” mode and it will generate images for each message you send.
If you want your chatbot to work with text responses and generate images only when asked, the recommended method is to use the Chat Mode with Image Generation tool, compatible with most recent models.
If your model is compatible, you can simply select it and it will be used automatically, just like function calling. This approach runs entirely on OpenAI’s side ( or Google / Anthropic ), so you won’t have any control over it, there are no settings to customize or tweak the results. However, it’s a free and straightforward solution.
If you are using a model that cannot run the out-of-the-box Image Generation tool, you can also use function calling to let the chatbot generate the image by itself by creating your own logic.
Yes, it is really just two lines of code, and now any chatbot can generate images:
function generate_image( $prompt ) {
global $mwai;
return $mwai->simpleImageQuery( $prompt );
}
AI Forms
If you need to tailor your users’ prompts with predefined choices, using AI Forms might be the best solution. You can learn everything about them in this documentation: Your First Form.
To generate Images with forms you just need to select a model that generates images instead of a regular text-based model:
You can try it yourself below: the prompt is already predefined; it should generate something that looks familiar…
Dashboard
First, in the AI Engine dashboard, make sure to enable the Images Generator feature.
This will add a new button that will bring you to the image generation dashboard in the top right corner of the AI Engine dashboard.
Once on the Images Generator, different settings will be available:
1. Number of images: You have the option to generate images in batches. You can also use the Continuous option to add the previously generated images to the current ones.
2. Prompt input: Describe the image you wish to generate.
3. Templates: When you have entered some prompts you don’t want to lose, you can save them and reuse them later as templates. Switch to edit mode to update/add new ones. You already have some ready for you.
4. Images: Once generated, the images will be displayed at the bottom of the page, under the prompt area.
Image Edits
For models that are compatible (right now only the OpenAI GPT Image 1), you can also do image editing. To do this, go to your media library, select an image, and use the “Edit” menu (with the magic wand icon). This will open the image in the AI Engine Image Editor tool.
Image Edits In Chatbot
You can also enable image editing behavior within a discussion thread by taking advantage of OpenAI Tools. If you’re using a vision-enabled model, you can create a workflow where the model first visualizes the image, generates a description of it, and then uses your prompt along with that description to generate a new image that appears as an edit of the original.
Managing 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 enable the 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, you can use the PHP Filters such as mwai_stats_credits and mwai_stats_coins. See the examples below.
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:
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.
Rather than using filters, you can completely overwrite the chatbot shortcode so that it only displays under specific conditions — such as within a certain time range, user role, or other custom logic.
This approach gives you full control over when and how the chatbot appears on your site.
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.
add_filter( 'mwai_stats_credits', function ( $credits, $userId ) {
$user = get_userdata( $userId );
if ( !empty( $user->roles) && is_array( $user->roles ) ) {
foreach ( $user->roles as $role) {
if ( $role === 'premium' ) {
return 50;
}
if ( $role === 'standard' ) {
return 10;
}
}
}
// This will be basically the default value set in the plugin settings
// for logged-in users.
return $credits;
}, 10, 2);
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.
For more details on all available filters, check the PHP Filters reference.
Soon, the AI Engine will propose a new system for the Timeframes, which will make it easier for you to create subscription logics:
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.
Build your own logic
You can also use the mwai_ai_allowed filter while disabling the built-in limit system to create your own custom logic for determining whether a query should be allowed.
Here are a few quick examples to get you started:
add_filter( 'mwai_ai_allowed', function( $allowed, $query, $limits ) {
// Only apply to text queries
if ( ! ( $query instanceof Meow_MWAI_Query_Text ) ) {
return $allowed;
}
// Always allow a specific chatbot, free to use / limitless
if (
isset( $query->botId ) &&
$query->botId === 'chatbot-free'
) {
return true;
}
return $allowed;
}, 10, 3 );
add_filter( 'mwai_ai_allowed', function( $allowed, $query, $limits ) {
// Only apply to text queries
if ( ! ( $query instanceof Meow_MWAI_Query_Text ) ) {
return $allowed;
}
// If guest user, keep default behavior
if ( ! is_user_logged_in() ) {
return $allowed;
}
$user_id = get_current_user_id();
$available = (int) get_user_meta( $user_id, 'available_messages', true );
// Block if no messages left
if ( $available <= 0 ) {
return false;
}
// Decrement and save
update_user_meta( $user_id, 'available_messages', $available - 1 );
return $allowed;
}, 10, 3 );
Assistants (OpenAI)
Assistants are being deprecated by OpenAI End of life is planned for mid-2026. We recommend using OpenAI models directly with the appropriate tools instead. For knowledge bases, you can use a Vector Store directly, which provides the same capabilities as Assistants (and often better performance). AI Engine is focusing development efforts on the Responses API going forward.
First, you will need to access the AI Engine dashboard and, under the “Server Modules” tab, enable the Assistants feature.
This action will generate a new section in the settings where you can view all of your OpenAI assistants. This is a read-only section, you wont be able to modify or add assistants from there, everything will be done on the OpenAI side.
Once you’ve created one or have some assistants ready, return to the AI Engine Assistants section and click the refresh button in the top right corner. You should see it/them appear in the table.
There’s no need to return to this tab anymore. Now that the assistant is available, let’s proceed to use it!
If you don’t see your assistants after refreshing the list, make sure that your server can communicate with OpenAI and that your WordPress REST API is operational and you have the right permalinks configured.
For this, navigate to the chatbot tab where you operate your regular chatbots for AI Engine. Select or create a new chatbot, and in the Main Setting section, you will be able to change the chatbot mode to assistant.
And it’s done! You are now using your OpenAI assistant directly within AI Engine. Have fun! 😊
File Upload
When using an Assistant this enables your users to send files directly through your chatbot, to learn more please read this documentation.
Organizations’ assistants
You can connect to your OpenAI account and go to the API Keys section to select your default organization. If it’s already the case, switch to personal, confirm the dialog box, and switch back to your organization to reset. Then, you’ll need to create a new API Key so that the header matches. Once this is done, you can refresh the assistant in AI Engine, and you should see it appear! 😊