Skip to main content
Watch: I Built an AI App Without Leaving Databricks

Setup guide - Documented by Aider

Use Mistral in Aider

Aider has no dedicated Mistral page, but it documents connecting to any OpenAI-compatible endpoint with OPENAI_API_BASE and OPENAI_API_KEY plus an openai/ model prefix. Mistral documents https://api.mistral.ai/v1 as its OpenAI-compatible base URL. Aider's Other LLMs page also lists MISTRAL_API_KEY among the env vars its LiteLLM backend supports.

Last verified 2 steps4 official sources

Steps

  1. Step 1.

    Configure your Mistral API key and Mistral's OpenAI-compatible endpoint (Aider's documented env vars, Mistral's documented base URL).

    Terminal
    # Mac/Linux:
    export OPENAI_API_BASE=https://api.mistral.ai/v1
    export OPENAI_API_KEY=<your_mistral_api_key>
    
    # Windows:
    setx OPENAI_API_BASE https://api.mistral.ai/v1
    setx OPENAI_API_KEY <your_mistral_api_key>
    # ... restart shell after setx commands
  2. Step 2.

    Start aider in your codebase and prefix the Mistral model name with openai/.

    Terminal
    # Change directory into your codebase
    cd /to/your/project
    
    # Prefix the model name with openai/
    aider --model openai/mistral-medium-latest

Caveats

  • This combines Aider's documented OpenAI-compatible mechanism with Mistral's documented base URL and model ids.
  • Aider's Other LLMs page lists MISTRAL_API_KEY as a LiteLLM-supported variable but does not document a mistral/ model prefix or give an example. Only the openai/ path is shown verbatim here.
  • Aider warns about models it is not familiar with. See its model warnings page.
  • Devstral 2 (devstral-2512) was retired 2026-07-31 and replaced by mistral-medium-3-5.

FAQ

How do I use Mistral in Aider?

Aider has no dedicated Mistral page, but it documents connecting to any OpenAI-compatible endpoint with OPENAI_API_BASE and OPENAI_API_KEY plus an openai/ model prefix. Mistral documents https://api.mistral.ai/v1 as its OpenAI-compatible base URL. Aider's Other LLMs page also lists MISTRAL_API_KEY among the env vars its LiteLLM backend supports.

Which Mistral model ids work in Aider?

The official docs read for this guide list mistral-medium-3-5, mistral-medium-latest, mistral-small-2603, mistral-small-latest, codestral-2508 and codestral-latest. Requests go to https://api.mistral.ai/v1.

Is this an official Mistral and Aider setup?

Aider documents this setup in its own docs. It was last checked against 4 official pages on October 17, 2026.

Sources

Last verified against 4 official pages.

Newsletter

New models, set up the day they ship

One email per week. New model releases, the coding tools that support them and how to wire them up.