Aider error
Aider: Model gpt-3.5-turbo has hit a token limit!
Model gpt-3.5-turbo has hit a token limit!Status: WorkaroundLast verified 3 documented fixes2 sources
What it means
The API provider reported that the request went over the model's context window (input plus output) or its output token limit. Aider reports the error and suggests actions. The token counts it prints are estimates. Aider never enforces token limits; it only reports token limit errors from the API provider. Lines such as "-- exceeded output limit!" or "-- possibly exhausted context window!" show which limit was hit.
Causes
- Trying to send too much data to a model, overflowing its context window (official docs).
- Asking for a large change that affects a lot of code, so the LLM hits output token limits; most models have output limits as low as 4k tokens (official docs).
- Non-compliant API proxy servers or bugs in the API server hosting a local model (official docs).
How to fix it
- Fix 1.
Reduce input tokens: use /tokens to see usage, /drop to remove unneeded files, /clear to clear chat history, and break your code into smaller source files.
Snippet/tokens /drop /clear - Fix 2.
Reduce output tokens: ask for smaller changes in each request, break code into smaller files, use a strong model like gpt-4o, sonnet or DeepSeek V3 that can return diffs, or use a model that supports infinite output.
- Fix 3.
Try aider without an API proxy server, or directly with one of the recommended cloud APIs. For local models the docs note that Ollama is known to work well with aider.
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 foobar: Unknown context window size and costs, using sane defaults.Status: By designModel azure/gpt-4-turbo: Missing these environment variables: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 gpt-3.5-turbo has hit a token limit!" mean in Aider?
The API provider reported that the request went over the model's context window (input plus output) or its output token limit. Aider reports the error and suggests actions. The token counts it prints are estimates. Aider never enforces token limits; it only reports token limit errors from the API provider. Lines such as "-- exceeded output limit!" or "-- possibly exhausted context window!" show which limit was hit.
How do I fix "Model gpt-3.5-turbo has hit a token limit!"?
There are 3 documented fixes. Start with the first: Reduce input tokens: use /tokens to see usage, /drop to remove unneeded files, /clear to clear chat history, and break your code into smaller source files.
Is this Aider error fixed?
Status: Workaround. No release removes the cause. The documented fixes work around 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.