Configure Mistral for PagibleAI

Mistral can replace the default provider for text generation, content refinement or audio transcription. Each action needs both the provider name and the API key.

Get a Mistral API key

  1. Sign in to the Mistral console and create or select a workspace.
  2. Activate billing; keys remain inactive until the workspace has a payment method.
  3. Create a key for this deployment and set a workspace spending limit.
  4. Copy the key to your deployment secret store.

Separate development and production workspaces make usage and limits easier to track. Do not commit keys to source control.

Login/signup form with email and social login options.
The image displays a web interface for managing API keys. It shows a sidebar with navigation, where "API Keys" is selected. The main content area is titled "Your API keys," providing options to create new keys, filter existing ones, and view a list of personal API keys with their names, masked keys, creation dates, and expiration status. There's also information about organization API keys and the limit of 50 active keys per organization. UI for creating a new API key with a pre-filled name "Pagible AI".

Use Mistral for text

Set Mistral as the provider for each text action you want to move. This example moves writing from Gemini and refinement from OpenAI:

MISTRAL_API_KEY="..."

CMS_AI_WRITE="mistral"
CMS_AI_WRITE_API_KEY="${MISTRAL_API_KEY}"

CMS_AI_REFINE="mistral"
CMS_AI_REFINE_API_KEY="${MISTRAL_API_KEY}"

Use Mistral for transcription

Use these variables only if Mistral should also replace OpenAI for transcription:

CMS_AI_TRANSCRIBE="mistral"
CMS_AI_TRANSCRIBE_API_KEY="${MISTRAL_API_KEY}"

Run the command below after editing .env. Restart Octane, queue workers and other long-running PHP processes.

php artisan config:clear

Test Mistral

Test only the actions you changed. Generate a short paragraph, refine a small content block or transcribe a brief audio file. If the request still goes to Gemini or OpenAI, the provider setting has not been loaded.

Troubleshooting

Why does PagibleAI still use Gemini or OpenAI?

An API key does not switch providers. Set CMS_AI_WRITE, CMS_AI_REFINE or CMS_AI_TRANSCRIBE to mistral, clear the configuration cache and restart long-running PHP processes.

Why does Mistral reject a new key?

Check that billing is active for the key's workspace and that the key has not been revoked.

Why does Mistral return 429?

The workspace has reached a rate or spending limit. Check its usage and limits before retrying.

What if the key was exposed?

Revoke it in the Mistral console, deploy a replacement, clear the configuration cache and restart workers.