packages/kilo-docs/pages/code-with-ai/features/autocomplete/mistral-setup.md
This guide walks you through setting up Mistral's Codestral model for free autocomplete in Kilo Code. Mistral offers a free tier that's perfect for getting started with AI-powered code completions.
Go to the Mistral AI console and sign up or sign in to your account. In the sidebar, click Codestral under the Code section.
Click the Generate API Key button to create your new Codestral API key.
Once generated, click the copy button next to your API key to copy it to your clipboard.
{% callout type="note" %} The Codestral API key is separate from the standard Mistral La Plateforme API key. Make sure you generate a key specifically from the Codestral section of the Mistral console. {% /callout %}
{% callout type="tip" %} For more details on BYOK, see the Bring Your Own Key documentation. {% /callout %}
Once your BYOK key is saved, Kilo Code's autocomplete will automatically use your Codestral key through the Kilo Gateway. No additional configuration is needed in the extension.
Tab to accept a suggestion.The autocomplete status bar in VS Code shows the current provider ("Kilo Gateway") and tracks cumulative cost. With BYOK, requests are billed directly by Mistral at their rates (Codestral has a free tier) and show as $0.00 on your Kilo balance.
When you add a Codestral BYOK key, the request flow is:
Your Editor → Kilo Gateway (with your key) → Mistral