| 1 | --- |
| 2 | title: "How to Set Up Codestral" |
| 3 | description: "Step-by-step guide for configuring Mistral's Codestral model with Continue for both chat and autocomplete functionality using your Mistral AI API key" |
| 4 | --- |
| 5 | |
| 6 | **Here is a step-by-step guide on how to set up Codestral with Continue using the Mistral AI API:** |
| 7 | |
| 8 | 1. Install the Continue VS Code or JetBrains extension following the instructions [here](/getting-started/install) |
| 9 | |
| 10 | 2. Click on the gear icon in the bottom right corner of the Continue window to open `~/.continue/config.json` (MacOS) / `%userprofile%\.continue\config.json` (Windows) |
| 11 | |
| 12 | 3. Log in and create an API key on Mistral AI's La Plateforme [here](https://console.mistral.ai/codestral). Make sure you get an API key from the "Codestral" page. |
| 13 | |
| 14 | 4. To use Codestral as your model for both `autocomplete` and `chat`, insert your Mistral API key below and add it to your configuration file: |
| 15 | |
| 16 | - YAML |
| 17 | - JSON |
| 18 | |
| 19 | config.yaml |
| 20 | |
| 21 | ``` |
| 22 | models: |
| 23 | - name: Codestral |
| 24 | provider: mistral |
| 25 | model: codestral-latest |
| 26 | apiKey: <YOUR_CODESTRAL_API_KEY> |
| 27 | apiBase: https://codestral.mistral.ai/v1 |
| 28 | roles: |
| 29 | - chat |
| 30 | - autocomplete |
| 31 | ``` |
| 32 | |
| 33 | config.json |
| 34 | |
| 35 | ```json |
| 36 | { |
| 37 | "models": [ |
| 38 | { |
| 39 | "title": "Codestral", |
| 40 | "provider": "mistral", |
| 41 | "model": "codestral-latest", |
| 42 | "apiKey": "<YOUR_CODESTRAL_API_KEY>", |
| 43 | "apiBase": "https://codestral.mistral.ai/v1" |
| 44 | } |
| 45 | ], |
| 46 | "tabAutocompleteModel": [ |
| 47 | { |
| 48 | "title": "Codestral", |
| 49 | "provider": "mistral", |
| 50 | "model": "codestral-latest", |
| 51 | "apiKey": "<YOUR_CODESTRAL_API_KEY>", |
| 52 | "apiBase": "https://codestral.mistral.ai/v1" |
| 53 | } |
| 54 | ] |
| 55 | } |
| 56 | ``` |
| 57 | |
| 58 | 5. If you run into any issues or have any questions, please join our Discord and post in the `#help` channel [here](https://discord.gg/EfJEfdFnDQ) |