Your session outgrew the context window
Every request carries the system prompt, the tools and the whole history. When that no longer fits the model's window, the request fails before the model answers.
curl -fsSL https://www.openllm.sh/install | bashopenllm claudeWhat the error means
When the input alone is larger than the model's context window, Anthropic's API rejects the request with a 400 invalid_request_error saying the prompt is too long. Other providers word it differently, but it is the same failure: the request is too big for this model, not for every model.
Option 1: compact
Claude Code compacts on its own as it nears the limit, and /compact does it on demand. It replaces older history with a summary, so the session goes on with less detail. Add instructions, like /compact keep the test output, to choose what survives.
Option 2: move to a bigger window
If the details still matter, send the same request to a model whose window can hold it. In OpenLLM this is the default for every model alias: a model that clearly can't fit the request is skipped, and a too-long rejection moves on to the next model in the chain without cooling it.
- Or set your account to compact on the same model instead
- If no model in the chain fits, OpenLLM compacts the request as a last resort rather than return a certain error
Fusion: hand long conversations to the next model
Set a model alias to Fusion and, optionally, give each model a length. The conversation starts on the first model and moves to the next once it grows past that point, and no step runs past its own model's context window.
- Fusion mode is on every plan, with the models you already have
- It picks the model by how long the conversation is, never by the task
- OpenLLM Fusion, included with Trial and Pro, is the same idea ready-made: Opus first, Sonnet as the chat grows, DeepSeek V4.1 for long chats.
Fallback chains when a model is rate-limited
Define an ordered chain per model alias. When a hop returns a rate limit, an overload or a provider error, the request moves to the next hop instead of failing your session.
- Chains are configured once and shared by every client and device
- Each hop resolves its own model settings, so a fallback never inherits the wrong parameters
- Every hop that ran is visible in your request history
Questions
Something else? Contact us
Checked 2026-11-25 against Claude API: context windows, Claude Code: manage costs effectively.