Context length exceeded
A "context length exceeded" error means the prompt plus the requested output is larger than the model's context window. Shorten the conversation, lower max_tokens, or switch to a model with a larger window. Chat apps and coding agents resend the whole history on every turn, so long sessions reach the limit first.
What causes it?
- A long chat history, sent again with every message.
- A max_tokens value that, added to the prompt, exceeds the window.
- Large files or tool results pasted into the conversation.
How do I fix it?
In this order. The Troubleshooting has the full setup.
- Start a new session, or clear and summarise the history (/clear or /compact in coding agents).
- Lower max_tokens or the app's response length.
- Lower the context size setting in apps such as SillyTavern.
- Pick a model with a larger context window; each model page lists it.
{"model": "claude-sonnet-5-5",
"messages": [...],
"max_tokens": 4096}Questions
Does a longer context cost more?
Yes. Every input token is billed, and the whole history is sent on each turn. Cached input lowers the cost on models that list a cached price.
Where do I find a model's context window?
On its model page, under the price table.
Does Outrun keep my prompts or outputs?
Outrun does not store your prompts, images or outputs unless you choose to save them.
Related pages
Still stuck?
The troubleshooting table lists every error code, or message support on Telegram.