Cursor error
Own API keys and Ollama in Cursor (Grok Build): "This model does not support custom API keys"
Cursor sends every request through its own servers to build the prompt, even when you use your own API key. That has three effects: your key only fills the provider slots Cursor offers (OpenAI with an optional base URL, Anthropic, Google, Azure and AWS Bedrock), Cursor's own Composer and Grok models can't run on a custom key, and a server on your own computer, such as Ollama on localhost, can't be reached because Cursor's servers can't see it.
This model does not support custom API keys.
Also shown as: “Model name is not valid”, “Ollama on localhost doesn't connect”, “Override OpenAI Base URL not working”
Why it happens
What people report causes it.
The OpenAI key goes with almost every model
With the OpenAI API key turned on, Cursor sends that key and your base URL with every model except Claude and Gemini. Composer and Grok can't run on a custom key, so they're rejected with this message. Cursor's staff confirmed this in September 2026 and are tracking it.
Requests go through Cursor's servers
Grok Build's docs say every request is routed through its servers for prompt building, and your key is sent along with it. A custom base URL therefore has to be a public HTTPS address; localhost doesn't work.
Model names Cursor doesn't know
Cursor checks model names before sending, which has blocked custom models such as GLM-4.7 with "Model name is not valid" even when the provider accepts them.
A problem with the key or the provider
A key without access to the model, a plan that doesn't include it or a provider-side change (a regional Gemini endpoint once broke Gemini keys) all fail the same way inside Cursor.
How to fix it
Try these, in order.
- 1
Turn the OpenAI key off to use Composer or Grok
Switch the OpenAI API key off in Settings › Models while you use them, and back on for your own models. Cursor's staff say Auto keeps working with the key on.
- 2
Test the key outside Cursor
Call the provider's API with the same key, URL and model name, with curl for example. If that fails too, the problem is the key or your plan with the provider; if it works, it's Cursor's side.
- 3
Use a public HTTPS address for a local model
Cursor's staff suggest exposing Ollama through a tunnel such as ngrok or Cloudflare Tunnel and setting that address as Override OpenAI Base URL. Your requests still pass through Cursor's servers on the way.
- 4
Expect Tab to keep using Cursor's models
Custom API keys only work with chat models in Cursor; Tab completion always uses its built-in models.
- 5
On a team plan, expect a per-token charge
On Teams and Enterprise, eligible models carry the Grok Build Token Rate of $0.25 per million tokens even on your own key. On individual plans, own-key requests don't count against your usage.
Avoid: Don't post a tunnel address anywhere or leave it running when you're done. Ollama has no sign-in of its own, so anyone who finds the address can use your models and your computer.
If you'd rather move on
Flintr: the independent AI code editor, without the guesswork.
Your own key goes straight to the provider
Models you connect with your own API key are called from the editor on your computer, not through Flintr's servers, and the key stays in the editor's secret storage on that computer.
Local models without a tunnel
Add any server that speaks the OpenAI or Anthropic API as a Custom Endpoint, including Ollama or LM Studio on localhost. Flintr calls it from your computer, so nothing has to be exposed to the internet.
Free, and never counted against a plan
Hobby is the full editor with your own API keys, for Agent and chat, with no account needed: Anthropic, OpenAI, Google, xAI, OpenRouter and Azure, plus custom endpoints. Requests on your own keys never count against a Flintr plan.
Free with your own API keys. See Flintr vs Cursor for the full comparison.
FAQ
Questions about this error.
Why does Cursor say "This model does not support custom API keys"?
Your OpenAI key is turned on, so Cursor sends it with a model that can't use one, such as Composer or Grok. Turn the key off while you use those models, or use Auto.
Can I use Ollama with Cursor?
Not on localhost. Cursor's servers build every request, so they need a public HTTPS address. The workaround is a tunnel such as ngrok or Cloudflare Tunnel, set as Override OpenAI Base URL.
Do requests on my own API key count against my Cursor plan?
On individual plans, no: your provider bills you directly. On Teams and Enterprise, eligible models carry the Grok Build Token Rate of $0.25 per million tokens.
Does Cursor's zero data retention apply to my own API key?
No. Grok Build's docs say your data then follows your provider's privacy policy.
Can I use a local model in Flintr?
Yes. Add your local server, such as Ollama or LM Studio, as a Custom Endpoint from Connect a model in Flintr's settings, and use it in Agent and chat on the free Hobby plan. Tab comes with a paid plan.
Sources, checked December 2026
More Cursor help: Taking longer than expected · We're experiencing high demand right now · Your request has been blocked as our system has detected suspicious activity from your account · Too many free trial accounts used on this machine · User is unauthorized · You've hit your usage limit · Why does Cursor's usage page show tokens instead of dollars? · Was the 7-day free trial removed? · How do I cancel my Cursor subscription?
Flintr isn't affiliated with Cursor, Anysphere, SpaceX, X Corp or xAI. Cursor is now called Grok Build; this page collects what its forum and docs say, checked in December 2026.
Your editor. Your models. Your bill.
Flintr is out for Windows. Download it free, with a free 7-day trial of Flintr's models. No card needed.
Windows 10+ today · macOS and Linux coming soon