Back to Kilocode

Using Mistral AI with Kilo Code

packages/kilo-docs/pages/ai-providers/mistral.md

7.3.542.9 KB
Original Source

Using Mistral AI With Kilo Code

Kilo Code supports accessing models through the Mistral AI API, including both standard Mistral models and the code-specialized Codestral model.

Website: https://mistral.ai/

Getting an API Key

  1. Sign Up/Sign In: Go to the Mistral Platform. Create an account or sign in. You may need to go through a verification process.
  2. Create an API Key:

Configuration in Kilo Code

{% tabs %} {% tab label="VSCode (Legacy)" %}

  1. Open Kilo Code Settings: Click the gear icon ({% codicon name="gear" /%}) in the Kilo Code panel.
  2. Select Provider: Choose "Mistral" from the "API Provider" dropdown.
  3. Enter API Key: Paste your Mistral API key into the "Mistral API Key" field if you're using a mistral model. If you intend to use codestral-latest, see the "Codestral" section below.
  4. Select Model: Choose your desired model from the "Model" dropdown.

{% /tab %} {% tab label="VSCode" %}

Open Settings (gear icon) and go to the Providers tab to add Mistral and enter your API key.

The extension stores this in your kilo.json config file. You can also edit the config file directly — see the CLI tab for the file format.

{% /tab %} {% tab label="CLI" %}

Set the API key as an environment variable or configure it in your kilo.json config file:

Environment variable:

bash
export MISTRAL_API_KEY="your-api-key"

Config file (~/.config/kilo/kilo.json or ./kilo.json):

jsonc
{
  "provider": {
    "mistral": {
      "env": ["MISTRAL_API_KEY"],
    },
  },
}

Then set your default model:

jsonc
{
  "model": "mistral/mistral-large-latest",
}

{% /tab %} {% /tabs %}

Reasoning Variants

Mistral's adjustable reasoning support is exposed only for reasoning-capable Mistral Small 4 models: mistral-small-2603 and mistral-small-latest. When one of these models is selected, Kilo offers a high variant that sends reasoningEffort: "high" to the Mistral provider.

Other Mistral models do not get automatic reasoning variants, even if they appear in the same provider. See Mistral's reasoning documentation for provider-level details.

Using Codestral

Codestral is a model specifically designed for code generation and interaction. Only for Codestral you could use different endpoints (Default: codestral.mistral.ai). For the La Platforme API Key change the Codestral Base Url to: https://api.mistral.ai

To use Codestral:

  1. Select "Mistral" as the API Provider.
  2. Select a Codestral Model
  3. Enter your Codestral (codestral.mistral.ai) or La Plateforme (api.mistral.ai) API Key.