How to add a custom OpenAI base URL in Cursor
Open Cursor settings, go to Models, paste your gateway key into the OpenAI API key field and set the OpenAI base URL override to https://api.quickrouter.homes/v1. Then add the model names you intend to call - Cursor only routes to models that are explicitly enabled in that list.
Last updated: October 2026What you need before you start
Cursor can only verify a key it can reach, so create the key first and keep the model list close by.
- A QuickRouter account with an active plan and an API key copied from the console.
- The OpenAI-style base URL: https://api.quickrouter.homes/v1. Cursor expects the full path here, /v1 included.
- The model names you plan to use, spelled exactly as the gateway serves them - gpt-5, claude-sonnet-4-5, deepseek-v3.2 and so on.
- A Cursor plan that allows custom API keys. Team plans can restrict this per member.
Add the key and the base URL in Cursor
Everything happens in one settings pane. Set the key first, then the override, then enable the models, because Cursor validates the connection as you type.
- 01
Open the Models pane
In Cursor, open Settings and select Models. The OpenAI section holds both fields you need.
- 02
Paste the API key
Put your gateway key in the OpenAI API key field. Cursor stores it locally and uses it for every OpenAI-shaped request.
- 03
Turn on the base URL override
Enable Override OpenAI Base URL and paste the full path, /v1 included.
Override OpenAI Base URL: https://api.quickrouter.homes/v1 API key: sk-qr-your-key - 04
Add the models you want to call
Add each model name to the list below the key. A model that is reachable through the gateway is still invisible to Cursor until it appears here.
gpt-5 gpt-5-mini claude-sonnet-4-5 - 05
Send one request to confirm
Ask a short question in the chat pane, then check the usage view in the gateway console for a matching entry.
Turning off the base URL override
If you later switch back to your own provider key, disable the override first. Leaving the override on while pasting a different provider key sends that key to the wrong host and produces 401 responses that look like a billing problem.
- Clear or disable the override, then paste the other key - the field alone does not switch the routing back.
- Keep a separate profile or project if you need both providers active at the same time.
Errors you are most likely to hit
Cursor reports almost everything as a generic failure, so work through the three causes in order: wrong path, missing model, or a key the editor cannot validate.
| Symptom | Cause | Fix |
|---|---|---|
| Model not found or model disappears from the picker | The name is not in the custom model list | Add the exact gateway model name in the Models pane |
| 404 from the API | The override holds https://api.quickrouter.homes without the /v1 suffix | Set the override to https://api.quickrouter.homes/v1 |
| Invalid API key | The key was pasted with trailing whitespace or was truncated | Paste again from the console, then use the verification button |
| Requests succeed but nothing is billed | The override is off, so Cursor used its own provider | Turn the override back on and re-check the console usage view |
| Tool calls stop working on a smaller model | The chosen model does not expose tool calling through the gateway | Switch the agent model to gpt-5 or claude-sonnet-4-5 |
Which model should Cursor use?
Use a fast, cheap model for inline completions and a stronger one for agent mode. The pricing difference between the two is large enough that splitting them is worth the setup.
Frequently asked questions
Does Cursor work with an OpenAI-compatible gateway?+
Yes. Cursor routes custom models through the OpenAI chat completions shape, which is what the gateway exposes, so the override field is the only change you need.
Should the Cursor base URL include /v1?+
Yes. Unlike Claude Code, Cursor expects the full path: https://api.quickrouter.homes/v1.
Can I use Claude models in Cursor through the gateway?+
Yes. Request an Anthropic model name from the OpenAI-shaped endpoint and the gateway routes it to the matching upstream provider.
Do I need a separate key for each editor?+
No. One key works across every tool on the gateway. Separate keys per tool are still useful if you want per-tool spend reporting in the console.
One key covers every model in this guide
Create an account, pick a plan and copy an API key. Gateway plans start at $19 per month and model usage is billed at upstream list prices.