How to use Cursor with a custom OpenAI-compatible API endpoint
Set Override OpenAI Base URL in Cursor to https://www.ccsub.net/api/v1, enable Use OpenAI API Key, and learn why claude- model names bypass the override.
Copy-paste configuration
These are the three values the tool needs. Create the API key on the API Keys page of your CCSub dashboard.
- OpenAI API Key
sk-your-ccsub-key(then turn on Use OpenAI API Key)- Override OpenAI Base URL
https://www.ccsub.net/api/v1(no trailing slash)- Custom model name
gpt-5.5(do not use a name starting with claude-)
For model, use an ID such as claude-sonnet-5 — the full list of model IDs is on the models page. No key yet? Create an account first.
Steps at a glance
- 1
Create a CCSub API key
Sign up for CCSub and create an sk- key on the API Keys page of the dashboard.
- 2
Open Cursor's API Keys section
Go to Cursor Settings → Models, scroll to the bottom and expand API Keys.
- 3
Paste the key and enable it
Paste the CCSub key into OpenAI API Key and switch on Use OpenAI API Key. Pasting alone is not enough — without the toggle, requests go out without the key.
- 4
Override the base URL
Switch on Override OpenAI Base URL and enter https://www.ccsub.net/api/v1.
- 5
Add a model and test it
Add the model name you want (for example gpt-5.5) on the Models page, select it in Chat or Agent, send a message, and check the Usage page in the CCSub dashboard.
Cursor is an AI code editor built on VS Code. It has exactly one way to talk to a third-party endpoint: the OpenAI API key slot with "Override OpenAI Base URL" switched on. The Anthropic and Google key slots cannot be re-pointed, so connecting Cursor to CCSub always goes through the OpenAI-compatible protocol.
Where the settings are
Open Cursor Settings → Models, scroll to the very bottom and expand API Keys:
- OpenAI API Key
sk-your-ccsub-keyThen switch on Use OpenAI API Key.- Override OpenAI Base URL
https://www.ccsub.net/api/v1Switch it on, then enter the URL. No trailing slash.
There are two toggles here, and most failed setups miss one of them:
- Use OpenAI API Key has to be switched on separately after you paste the key. A recent Cursor update introduced this toggle and left it off for existing configurations. With it off, requests go out without the key and fail with
Model name is not valid. - Override OpenAI Base URL must be on for the URL field to take effect. Cursor appends
/chat/completions, so the URL includes/api/v1(https://www.ccsub.net/v1works too).
Add your model
Add the model name you want on the Models page. The model field takes IDs such as gpt-5.5; the full list is on the models page. If the name already exists in Cursor's list — gpt-5.5 does — just enable the built-in entry; with the override on, its requests go to CCSub as well.
Do not use a model name that starts with claude-. Cursor routes by name prefix: anything starting with claude- uses the Anthropic key slot, which has no base URL override, so the request never reaches CCSub. That is a Cursor limitation. If you want claude- model IDs inside your editor, use Cline or Zed, which let you set a custom URL for the Anthropic protocol.
What actually goes through CCSub
- Chat and Agent: once you pick your custom model, requests go to CCSub and show up on the Usage page.
- Tab completion: no. Cursor's documentation states that custom API keys only work with chat models; Tab always uses Cursor's built-in models.
- Cursor's in-house models: the override applies to every model that is not a Claude or Gemini model. While it is on, Cursor's own models answer with
This model does not support custom API keys. Switch the override off to use them.
Requests come from Cursor's servers
This is the part that surprises people. With a custom base URL, the request is sent by Cursor's backend, not by your computer. Two consequences:
- A local proxy or VPN on your machine has no effect on these requests, so you do not need one for CCSub.
- The endpoint must be reachable from the public internet;
localhostand LAN addresses fail. CCSub is a public endpoint, so this is not a problem.
Cursor also only calls /chat/completions, never the Responses API. On Teams and Enterprise plans, admins can block personal API keys altogether — if the options above are missing, ask your workspace admin.
Verify
Pick your custom model in the Chat or Agent model menu and send a message, then open the Usage page in the CCSub dashboard. If the request is there, you are set. Prefer an extension inside plain VS Code? See the Cline guide and the Continue guide.
Common errors and fixes
Model name is not valid
Cause:The OpenAI API key is filled in but the Use OpenAI API Key toggle is off, so the request carries no key. The toggle arrived in a recent update and was left off for existing setups.
Fix:Go back to Settings → Models → API Keys and switch Use OpenAI API Key on.
This model does not support custom API keys
Cause:You picked one of Cursor's own models while the override is on.
Fix:Select your custom model instead, or turn the override off to use Cursor's models.
Custom model rejected as “already available”
Cause:The name collides with a model that is already in Cursor's built-in list.
Fix:Enable the built-in entry with that name — with the override on, it is sent to CCSub too — or use a different model ID that CCSub serves.
401 authentication_error: Invalid or disabled API key
Cause:The key was pasted incorrectly or is disabled in the CCSub dashboard.
Fix:Copy the key again and make sure it is enabled.
For more error messages and what they mean, see the error troubleshooting index. Installation and network issues are covered in the troubleshooting docs (Chinese).
FAQ
Can I use claude- model IDs through the override?
No. Cursor decides which key to use from the model name: names starting with claude- go to the Anthropic key slot, which has no base URL override, so they never reach CCSub. In Cursor, use OpenAI-style IDs such as gpt-5.5.
Does Tab completion use my endpoint?
No. Cursor's docs say custom API keys only work with chat models; Tab completion keeps using Cursor's built-in models.
Does the override URL need /v1?
Yes. Use https://www.ccsub.net/api/v1 without a trailing slash; Cursor appends /chat/completions.
Cursor's own models broke after I enabled the override. Why?
The override applies to every model except Claude and Gemini ones, including Cursor's in-house models, which then report that they do not support custom API keys. Turn the override off when you want to use them.
Do I need a local proxy?
No. With a custom base URL, Cursor's servers make the request, not your machine. That also means the endpoint must be publicly reachable — localhost or LAN addresses fail — which CCSub is.
Related setup guides
Need a CCSub API key?
Sign up, create a key in the dashboard, and paste the values above into your tool. Pay-as-you-go balance does not expire — you only pay for the tokens you use.