Directory / plugin

AI Provider for Mistral

v1.3.0 · by Lauri Saarni

Independent WordPress AI Client provider for Mistral.

About this plugin

This plugin provides a third-party Mistral integration for the PHP AI Client SDK. It enables WordPress sites to use Mistral models for text generation and related AI capabilities.
It is not affiliated with, endorsed by, or sponsored by Mistral AI.

Features:

  • Text generation with Mistral models
  • Image generation with Mistral mistral-medium-2505 model
  • Text-to-speech with Mistral Voxtral TTS models, including voice cloning from a reference recording
  • Function calling support (for compatible models)
  • Vision input support (for compatible models)
  • Automatic provider registration

Available models are dynamically discovered from the Mistral API.

Requirements:

  • PHP 7.4 or higher
  • PHP AI Client plugin must be installed and activated
  • Mistral API key

For Developers

Filters

ai_provider_for_mistral_model_sort_callback

Filters the comparator used to order Mistral models in the metadata directory. Return any callable with the usort() signature function (ModelMetadata $a, ModelMetadata $b): int. The default comparator, the directory instance, and the unsorted model list are passed as context, so your filter can delegate to the default for everything except the cases you want to override.

Example — pin codestral-latest to the top and fall back to the default order for everything else:

add_filter(
    'ai_provider_for_mistral_model_sort_callback',
    function ( callable $default ): callable {
        return function ( $a, $b ) use ( $default ) {
            if ( $a->getId() === 'codestral-latest' ) return -1;
            if ( $b->getId() === 'codestral-latest' ) return 1;
            return $default( $a, $b );
        };
    }
);

ai_provider_for_mistral_default_voice_id

Filters the voice used for text-to-speech when no voice is set with asOutputSpeechVoice(). Defaults to the English preset voice voice_478 for Voxtral TTS 3 models and gb_jane_neutral for older models. The model ID is passed as the second argument.

ai_provider_for_mistral_tts_max_text_length

Filters the maximum number of characters narrated in a single text-to-speech request (default 2000). Longer text is split at paragraph and sentence boundaries and the audio joined into one file, which requires the MP3 or PCM format. The model ID is passed as the second argument.

External services

This plugin connects to the Mistral AI API (https://api.mistral.ai/v1) to provide AI text generation, image generation, and text-to-speech capabilities.

Data is sent to the Mistral API when your application code makes AI generation requests through the PHP AI Client. The data sent includes your prompts, model configuration, and API key. No data is sent automatically — requests only occur when explicitly triggered by code using the PHP AI Client SDK.

This service is provided by Mistral AI (https://mistral.ai/):
– Terms of Service: https://mistral.ai/terms/
– Privacy Policy: https://mistral.ai/terms/#privacy-policy

Plugin tags