Aider error
Aider: Model azure/gpt-4-turbo: Missing these environment variables
Model azure/gpt-4-turbo: Missing these environment variables:Status: By designLast verified 3 documented fixes2 sources
What it means
The model you picked needs provider environment variables that are not set, for example AZURE_API_BASE, AZURE_API_VERSION and AZURE_API_KEY for azure/ models. If you start chatting anyway, you will get errors.
Causes
- The environment variables required by the selected provider are not set (official docs).
- On Windows, the variables were set with setx but the terminal was not restarted (official docs tip).
How to fix it
- Fix 1.
Set the listed environment variables before starting aider.
- Fix 2.
On Windows, if you just set them with setx, restart your terminal or command prompt for the changes to take effect.
- Fix 3.
Pass the model and key on the command line.
Terminalaider --model sonnet --api-key anthropic=your-key-goes-here
More Aider errors
All 17 Aider errorsThe LLM did not conform to the edit format.Status: WorkaroundSearchReplaceNoExactMatch: This SEARCH block failed to exactly match lines in {path}Status: WorkaroundModel gpt-3.5-turbo has hit a token limit!Status: WorkaroundModel foobar: Unknown context window size and costs, using sane defaults.Status: By designaider: The term 'aider' is not recognized as a name of a cmdlet, function, script file, or executable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.Status: Workaroundaider-chat 0.23.0 requires somepackage==X.Y.Z, but you have somepackage U.W.V which is incompatible.Status: WorkaroundThe API provider is not able to authenticate you. Check your API key.Status: By designThe API provider has rate limited you. Try again later or check your quotas.Status: By design
Related reading
- Aider vs Claude Code in 2026: Git-First Open Source vs Subagent RuntimeAider vs Claude Code: git-first, model-agnostic Aider against the Claude Code runtime of subagents and hooks. Compare architecture, cost, governance and fit.
- Aider vs Claude Code: Open Source vs Commercial AI Coding CLIAider is open source and works with any model. Claude Code is Anthropic's commercial agent. Here is how they compare for TypeScript.
FAQ
What does "Model azure/gpt-4-turbo: Missing these environment variables" mean in Aider?
The model you picked needs provider environment variables that are not set, for example AZURE_API_BASE, AZURE_API_VERSION and AZURE_API_KEY for azure/ models. If you start chatting anyway, you will get errors.
How do I fix "Model azure/gpt-4-turbo: Missing these environment variables"?
There are 3 documented fixes. Start with the first: Set the listed environment variables before starting aider.
Is this Aider error fixed?
Status: By design. Expected behavior, not a bug. The documented fixes change the setup that triggers it. Affected versions: All versions.
Sources
Last verified against 2 sources: official docs, maintainer replies and release notes.
Newsletter
Fixes for the tools you use, weekly
One email per week. New coding agent releases, what broke, and how developers are working around it.