=== AI Provider for MiniMax ===
Donate link: https://alaminahamed.com/donate
Contributors: mralaminahamed
Tags: ai, minimax, llm, text generation, artificial intelligence
Requires at least: 6.7
Tested up to: 7.0
Requires PHP: 7.4
Stable tag: 1.2.1
License: GPL-2.0-or-later
License URI: https://spdx.org/licenses/GPL-2.0-or-later.html

MiniMax AI provider for WordPress AI Client. Access 9 models: M2.7, M2.5, M2.1, M1, Text-01, and highspeed variants.

== Description ==

This plugin integrates [MiniMax](https://www.minimax.io/) as an AI provider for the WordPress AI Client. It enables access to MiniMax's high-performance AI models through the OpenAI-compatible API.

This plugin is an independent, third-party integration and is not affiliated with, endorsed by, or sponsored by MiniMax. "MiniMax" is the name of the third-party service this plugin connects to.

**Features:**

* Seamless integration with the WordPress AI Client plugin
* Dynamic model discovery from the MiniMax API
* Support for text generation with all MiniMax-M2 and M1 series models including highspeed variants
* Secure API key management via WordPress settings or environment variable

**Supported Models (fallback list):**

MiniMax-M2.7, MiniMax-M2.7 Highspeed, MiniMax-M2.5, MiniMax-M2.5 Highspeed, MiniMax-M2.1, MiniMax-M2.1 Highspeed, MiniMax-M2, MiniMax-M1, MiniMax-Text-01

When an API key is configured, the live model list is fetched directly from the MiniMax API.

**Requirements:**

* WordPress AI Client plugin (or WordPress 7.0+ with built-in AI Client)
* A [MiniMax](https://www.minimax.io/) account and API key

**API Key Configuration:**

Set your MiniMax API key in one of two ways:

1. WordPress AI Client settings — go to the WordPress AI Client configuration page and enter your MiniMax API key there
2. `MINIMAX_API_KEY` environment variable on your server (takes priority over the database setting)

== Installation ==

= As a WordPress Plugin =

1. Download the plugin zip file
2. Go to **Plugins > Add New > Upload Plugin** in your WordPress admin
3. Upload the zip and click **Install Now**
4. Ensure the **WordPress AI Client** plugin is installed and activated
5. Activate **AI Provider for MiniMax**
6. Enter your MiniMax API key via the WordPress AI Client settings
7. Optionally go to **Settings > MiniMax** to configure the default model and generation parameters

= Manual Installation =

1. Upload the `alamin-ai-provider-for-minimax` folder to `/wp-content/plugins/`
2. Follow steps 4–6 above

= As a Composer Package =

`composer require mralaminahamed/alamin-ai-provider-for-minimax`

== Frequently Asked Questions ==

= What is MiniMax? =

MiniMax is an AI company that provides high-performance language models, including the MiniMax-M2 series known for their coding and text generation capabilities. Learn more at [minimax.io](https://www.minimax.io/).

= Do I need the WordPress AI Client? =

Yes. This plugin is a provider add-on for the WordPress AI Client. Install and activate that plugin first.

= Where do I get an API key? =

Sign up at [minimax.io](https://www.minimax.io/) and generate an API key from your account dashboard.

= Is my API key stored securely? =

Your API key is stored by the WordPress AI Client plugin in the WordPress options table. For higher security, set the `MINIMAX_API_KEY` environment variable on your server instead — this bypasses the database entirely.

== External Services ==

This plugin connects to the **MiniMax API** (`https://api.minimax.io/v1`) to provide AI text generation.

**What the service does:** MiniMax is a third-party AI platform that provides large language model APIs. This plugin uses it to retrieve available models and send text generation requests.

**What data is sent and when:**

* Your MiniMax API key is sent via the `Authorization` header on every request.
* When a WordPress feature triggers AI text generation, the text prompt or conversation is sent to `https://api.minimax.io/v1`.
* When the model list is refreshed (once per hour, cached via WordPress transients), a request is sent to `https://api.minimax.io/v1/models` with your API key.

No data is sent until you enter an API key and a WordPress feature triggers a request.

This service is provided by MiniMax: [Terms of Service](https://platform.minimax.io/protocol/terms-of-service), [Privacy Policy](https://platform.minimax.io/protocol/privacy-policy).

== Changelog ==

= 1.2.1 =
* Fixed connector showing as "Connected" before any API key is entered — provider availability now correctly checks for a configured API key

= 1.2.0 =
* Added provider logo displayed on the WordPress Connectors page
* Fixed false "no valid connector" warning on the AI admin page when API key is set via the Connectors page
* Expanded test suite from 33 to 44 tests covering all model IDs, highspeed variants, provider logo path, and settings edge cases

= 1.1.0 =
* Updated fallback model list to include all current MiniMax text generation models: M2.7, M2.7 Highspeed, M2.5, M2.5 Highspeed, M2.1, M2.1 Highspeed, M2, M1, and Text-01
* Added Domain Path header field to plugin file
* Improved plugin file header field ordering and alignment per WordPress.org standard
* Added file-level PHPDoc block to plugin bootstrap file
* Updated tested up to WordPress 7.0

= 1.0.0 =
* Initial release
* MiniMax provider registration with WordPress AI Client
* Dynamic model discovery
* Settings page for API key and default model configuration
* Support for `MINIMAX_API_KEY` environment variable

== Upgrade Notice ==

= 1.2.0 =
Fixes a false "no valid connector" warning on the AI admin page. No database changes required.

= 1.1.0 =
Expanded fallback model list to 9 models. No database changes or manual steps required.

= 1.0.0 =
Initial release. No upgrade steps required.
