Mistral: Set Up Codestral Code Completion (2026)
๐ Quick start
- Install the Continue plugin in VS Code or JetBrains and open its config panel.
- Add Mistral as a provider and paste your Mistral API key.
- Select a Codestral model ID from the official Mistral model list.
- Enable Fill-in-the-Middle (FIM) completions and tune the completion delay.
๐ก Why use Mistral for this
Codestral is Mistral's code-focused model family, and it can be wired into your IDE through the Continue plugin to deliver inline fill-in-the-middle (FIM) completions. The practical workflow is: install Continue, add Mistral as a provider with your API key, pick a Codestral model ID from Mistral's official model list, then enable FIM so typing a function signature produces ghost-text suggestions you accept with Tab. Plan gotchas: Mistral API access is pay-as-you-go and billed per token, so free-tier availability and exact rates must be confirmed on the official pricing page before you commit. Context windows are finite, so keep files self-contained rather than expecting repo-wide understanding. All pricing, model IDs, and limits below were checked against official Mistral documentation on 2026-10-15; anything we have not personally run is marked as a TODO for our first-hand test.
๐ ๏ธ How to Set Up Codestral Code Completion (6 steps)
Step 1
Open your IDE (VS Code or JetBrains) and install the Continue plugin from the official marketplace. After installation, open the Continue panel from the sidebar.
Step 2
In the Continue config, add a new model and select Mistral as the provider. Paste your Mistral API key into the API key field.
Step 3
For the model field, enter the exact Codestral model ID listed on Mistral's official models documentation page (model IDs change over time, so copy the current one rather than guessing).
Step 4
In Continue's settings, enable Fill-in-the-Middle (FIM) mode under the completions/advanced completions section so suggestions are treated as code completions rather than chat.
Step 5
Adjust the completion delay and max tokens to values that suit your machine and network; start with a small delay and a modest token cap, then tune based on observed latency. measure, don't estimate
Step 6
Create a new file (e.g., app.py), type a function signature such as `def process_csv_and_return_stats(file_path: str) -> dict:` and stop after the colon. Wait briefly for ghost text to appear, then press Tab to accept.
๐ฆ What you'll get
After completing setup, typing a function signature in a supported language should produce inline ghost-text suggestions that you can accept with Tab. The exact quality, latency, and whether error handling or comments are included will vary by prompt and model version.
๐ฐ Pricing (checked 2026-10-15)
| Plan | Price | What you get for this workflow | Official link |
|---|---|---|---|
| Plan | Price |
What you get | pricing โ |
| Mistral API (pay-as-you-go) | Per-token pricing; confirm current rates on the official pricing page |
API access to Mistral models including Codestral, billed by input/output tokens | pricing โ |
| Free tier | Confirm current availability on the official pricing page |
Any free usage or trial credits are defined by Mistral and may change | pricing โ |
| Continue plugin | Free / open source |
IDE plugin that connects to your chosen model provider | pricing โ |
๐ Copy-paste prompts
"function UserProfile({ userId }: { userId: string }) {"
"# Refactor the following for-loop into a list comprehension\nresult = []\nfor item in data:\n if item['active']:\n result.append(item['name'])"
"def test_calculate_invoice_total():"
โ ๏ธ Common mistakes
โ๏ธ Mistral vs Alternatives
| Tool | Price | Best For | Verdict |
|---|---|---|---|
Confirm current individual and business plan pricing on the official GitHub Copilot pricing page (checked 2026-10-15). |
|||
Continue plugin is free/open source; you pay only for the model provider you connect. |
โ Frequently Asked Questions
Q: Is Codestral free to use?
Codestral is accessed through the Mistral API, which is generally pay-as-you-go. Any free tier or trial credits are defined by Mistral and can change, so check the official pricing page for current terms.
Q: Which IDEs support the Continue plugin?
Continue supports VS Code and JetBrains IDEs. Check the official Continue documentation for the current list of supported editors and versions.
Q: What is fill-in-the-middle (FIM) mode?
FIM is a completion mode where the model fills in code between a prefix and suffix, which is what enables inline ghost-text suggestions in an editor rather than chat-style responses.
Q: How large is Codestral's context window?
Context window size depends on the specific Codestral model version. Check Mistral's official models documentation for the current context window of the model ID you plan to use.
Q: Can Codestral understand my whole repository?
No. The context window is finite and generally too small for multi-file repository reasoning. Keep files self-contained and use explicit imports or references within the same file.
Q: Do I need a paid Mistral plan to use Codestral in my IDE?
You need API access to Codestral, which is billed per token. Whether a free tier covers your usage depends on Mistral's current terms, so confirm on the official pricing page.
๐ Level up your AI toolkit
Understand AI in 5 minutes a day. No jargon. No hype. Unsubscribe anytime.