Environment: Cursor 3.17.19, Windows, custom OpenAI API key (Override Base URL pointing to a third-party OpenAI-compatible endpoint, e.g. a long-context model with 128K+ native context).
Two questions I couldn’t find answered in the docs:
1. Does Max Mode have any effect on models accessed via a custom API key / custom OpenAI Base URL? I understand from the docs that Max Mode is listed under legacy request-based plans, but there’s no statement about how it interacts (or doesn’t) with BYOK models. Empirically, my local client config shows a fullContextTokenLimit of 30000 with chat summarization (‘Chat context summarized’) - does this cap apply to BYOK models regardless of their native context window?
2. For BYOK models, what determines the effective context window sent by Cursor - the provider’s API limits, or Cursor’s client-side limits (like the 30k fullContextTokenLimit above)? The model reference table only covers Cursor-proxied models, so there’s no documented answer for custom endpoints.
Would appreciate an official clarification. Thanks!
Hey, thanks for the detailed questions. I’ll answer both.
What sets the context window for custom API models?
For models that aren’t in the Cursor catalog, the default window is 1M tokens. We use that as a safe upper bound so we don’t accidentally set a lower limit than a model actually supports. If you see a smaller number like 200K, it’s most likely because the model name matched a catalog entry that has a lower capped limit. A workaround is to register the model under a name that isn’t in the catalog, then the 1M default applies.
We don’t have any documented effect of Max Mode on this budget for custom BYOK models. Cursor can’t auto-detect the real context window of a custom endpoint right now, and there’s no UI to set it manually yet. This is a known limitation, and the team has a request on the radar to make the window configurable, but I can’t share an ETA.
Provider or Cursor?
The effective context window is based on Cursor’s assumption, not the provider’s real limit. There’s also a practical gotcha for your 128K model. Auto-compaction is calculated against the assumed window of 1M. So the provider’s real 128K limit gets hit before compaction kicks in, and the chat can get stuck with a provider error. The only user-side workaround right now is to do a round trip through Auto Mode, switch to it, let compaction run, then switch back to the custom model.
About fullContextTokenLimit: 30000 that you found in the local config. That’s not the cap that controls your model window via Override Base URL, it isn’t tied to BYOK.
If you want to push prioritization, the best place to add your case with the model, the provider’s real limit, and whether you need 1M or need it lower is here: Unlock Full Context Window with Own API Keys
Hey, thanks for sharing. This trick actually has a real effect, not just a cosmetic one. Switching Max Mode to the built-in models changes the context budget Cursor allocates for the request, and that state sticks when you switch back to a custom model. So yeah, this can increase the assumed context window for a custom endpoint.
One thing to keep in mind, especially for your 128K-native model, @xbq: even with the bigger budget, Cursor still doesn’t auto-detect the provider’s real limit. So if the assumed window ends up larger than the real 128K, auto-compaction is calculated against the assumed window, and you can hit the provider’s real limit before summarisation kicks in. Then the chat gets a provider-side error. The workaround is the same as before: do a round-trip through Auto Mode, let compaction run, then switch back to the custom model.
There isn’t a way to manually set the context window for custom models yet. That’s a known limitation, and I can’t give an ETA. If you want to push prioritisation, the best place is this thread: Unlock Full Context Window with Own API Keys
To make your feedback useful for prioritization, please describe if you can:
which model you’re using and via which provider/endpoint
the model’s actual native context window
whether you need 1M, or if we should lock a smaller limit instead
The ability to manually set the context window for custom models is a known limitation, and there’s no ETA yet. But the more specific the use cases are in the thread, the clearer the picture is for the team.