What you’ll need
- Cursor installed, on a paid plan.
- An access key from app.ngrok.ai.
Point Cursor at the gateway
Open Cursor Settings, go to Models, and expand API Keys:- Turn on OpenAI API Key and paste your ngrok.ai access key. The field is labeled OpenAI, but Cursor sends the key to whatever endpoint you configure below.
- Turn on Override OpenAI Base URL and enter
https://gateway.ngrok.ai/v1. Keep the/v1suffix: Cursor appends/chat/completionsto whatever you enter. - Select + Add model, enter a model ID from the model catalog, such as
gpt-5.5, and enable it. Useprovider:modelto pin a provider. - Select Verify to confirm the gateway answers.
Test the connection
Pick your model in the chat model selector and send a prompt:Explain what a hash map is in two sentences.
What the override doesn’t cover
Expect chat, not the whole editor. Three Cursor behaviors limit how far a custom model reaches:- Tab completion always uses Cursor’s built-in models. It never reaches your endpoint.
- Agent and Edit also rely on Cursor’s own models, so Cursor may refuse them while a custom API key is set and ask you to disable the key.
- Where agent runs do work, Cursor’s tool definitions over an overridden base URL aren’t strictly OpenAI-shaped, so tool calls can fail against a self-hosted model even when plain chat succeeds.
Use a model you run yourself
To reach a model on your own machine, register it as a custom provider, then add itsprovider:model name as a model, such as ollama:llama3.2.
See Use a model you run yourself for the full setup.
Next steps
- Restrict providers and models: Scope what an access key can call
- Configure fallback models: Try another model when the first one fails
- Observability: See which model served each request