Cursor access
Cursor officially supports using its own OpenAI API Key and allows overriding the OpenAI Base URL in model settings. ShangHai Do uses the OpenAI compatible Chat Completions interface, so it is configured according to the OpenAI entrance.
If not yet installed, follow Cursor download page to install the client. An agent is an assistant that can read and write files and carry out tasks.
Check the applicable scope first.
- Cursor official help page description: Custom API Key is only used for chat models. Tab auto-completion continues to use Cursor’s built-in model.
- Cursor official support staff note: Agent, Chat, and Edit paths using custom models and custom Base URLs require Pro or higher packages; specific package restrictions are subject to the current Cursor page.
- Cursor will send the key you filled in with the request to the Cursor backend, and then Cursor will complete the request processing. Do not fill out sensitive production tokens in an environment that does not accept this data flow.
Configuration Steps
1. Open the model settings
- Open Cursor.
- Enter Cursor Settings → Models.
- Expand API Keys at the bottom of the page.
2. Fill in the ShangHai Do key and address
In OpenAI API Key:
- Open Use OpenAI API Key.
- Fill in the site token
YOUR_API_KEY. - Open Override OpenAI Base URL.
- Fill in:
https://shanghaido.com/v1
Click Verify. If your ShangHai Do site is not an official site, replace the domain name with your own site root address, but still keep the /v1 at the end.
3. Add model
Add the model name in the custom model area:
qwen3.8-flash
The model name must be exactly the same as id returned by GET /v1/models. Do not write it as Qwen 3.8 Flash, and do not spell /v1 into the model name. After saving, create a new Chat or Agent session and select it in the model selector.
If the Cursor version calls the button Add model or Add custom model, the meaning is the same. The model name should keep the accurate value returned by this site and do not add the claude- prefix; Cursor may use the Anthropic key entry based on this prefix.
**Override OpenAI Base URL is a global setting and cannot be filled in separately for each model. ** After it is turned on, other models using the OpenAI portal may also request the ShangHai Do address; when switching back to other services, the address, key and currently selected model must be checked at the same time.
Get started
Send a normal text first:
请回复:连接成功
After confirming that it can be returned, let the Agent read a small file. When performing project operations, please pay attention to client prompts and confirm tool permissions.
FAQ
still requests Cursor’s own model
Confirm that you have selected qwen3.8-flash in the new Chat or Agent session, and both Use OpenAI API Key and Override OpenAI Base URL are turned on. Team admins may also have Restrict Personal API Keys enabled, which hides or disables personal key entry.
Tab completion does not use ShangHai Do
This is the official current limitation of Cursor: the custom API Key only covers the chat model, and Tab completion continues to use Cursor’s built-in model. Do not judge Chat access failure based on whether the Tab changes.
Prompt model does not exist
Execute first:
curl "https://shanghaido.com/v1/models" -H "Authorization: Bearer YOUR_API_KEY"
Fill in the returned accurate model id back to the Cursor. Also confirm that the Base URL is /v1 and do not fill in /v1/chat/completions.
official information
- Cursor:Bring your own API key
- Cursor official support: API Key and Base URL of custom model
- Cursor official support: Package restrictions for custom models in Agent, Chat, and Edit
- Cursor official support: global scope covered by Base URL
encountered a problem
If you encounter problems with calling or configuration, please contact the site customer service and provide the model name, error time and error information to facilitate troubleshooting.