Skip to content

⚙️ Mistral AI Provider Setup

Connect Mistral AI models with Flexpilot, your AI code assistant in VS Code, similar to GitHub Copilot. Follow this concise setup guide to get started quickly!

🔑 Getting API Key

  1. Visit the Mistral AI Console and sign in or create a new account.
  2. Navigate to Codestral section in your account settings and copy the Codestral API key.
  3. If using the Mistral endpoint instead, navigate to API Keys section and create a new key for the Mistral endpoint.

NOTE

Its recommended to use the Codestral endpoint for better performance and model availability in Flexpilot.

🛠️ Configuration

  1. Open Flexpilot Settings in VS Code:

    • Press Ctrl+Shift+P (Windows) or Cmd+Shift+P (Mac).
    • Select Flexpilot: Configure the Language Model Provider.
    • Choose Add New Configuration.
    • Select Mistral AI (options: mistral-chat or mistral-completion) as the provider.
  2. Enter a nickname when prompted. Pressing Escape will cancel the model configuration.

  3. Input the Mistral API endpoint when prompted.

NOTE

Use https://codestral.mistral.ai or https://api.mistral.ai based on your preference.

  1. Enter your API Key when prompted.

NOTE

If using the Codestral endpoint, input the Codestral API key; otherwise, use the Mistral API key.

  1. Enter the Mistral Model Name when prompted.

NOTE

Models via the Codestral endpoint must start with codestral-. Refer to the models overview for the correct model name.

📌 Important Notes

  • 🔒 Security: Always keep your API key private.
  • 💳 Usage & Billing: You’ll be billed per token (input & output). Check Mistral AI's Pricing for detailed rates.
  • 💼 Model Availability: Some models may have different pricing tiers, so choose accordingly.

🚫 Troubleshooting

  • API Key Issues: Ensure your API key is accurate and saved.
  • Credit Balance: Confirm you have enough credits for API usage.
  • Model Availability: Check if the selected model is supported in your region.

For further assistance, refer to Mistral AI's Documentation for API usage, limits, and best practices.