Cursor
Cursor is a modern AI code editor for developers. It combines the strong features of traditional editors like VS Code with AI-powered smart coding tools. These include smart code completion, natural language programming, and code library understanding, which boost development speed. Cursor also supports popular AI models like OpenAI's GPT-4, DeepSeek, and GLM, and offers flexible customization. This makes it ideal for users from beginners to professionals.
MaaS provides access to DeepSeek and GLM models, allowing developers to use these models via API calls.
This guide describes how to use Cursor to call a DeepSeek model deployed in MaaS to build a code editor.
Billing
You are billed based on the number of tokens used. For details, see Inference Service Billing Items.
Constraints
This function is only available in the CN-Hong Kong region.
Prerequisites
- You have registered a Huawei Cloud account. For details, see Signing Up for a Huawei Cloud Account.
- For details, see Configuring MaaS Access Permissions.
- You have subscribed to a built-in service or created an endpoint. For details, see Subscribing to a Built-in Service and Creating an Endpoint.
- You have subscribed to the Cursor membership.
Step 1: Downloading and Installing Cursor
Download and install Cursor from the official website.
Step 2: Obtaining MaaS Model API for Interconnection
Obtain the model ID, API key, and API address of the MaaS model service, which are required for connecting with Cursor.
- Obtain the Model ID and API URL
- Go to the MaaS Real-Time Inference page. By default, the Built-in Services page is displayed. You can also switch to the Endpoints page. Figure 1 Real-Time Inference page
- In the Operation column of the model, click API Calling and select a version. On the View API Call Description page, obtain the API URL and model ID.

- Go to the MaaS Real-Time Inference page. By default, the Built-in Services page is displayed. You can also switch to the Endpoints page.
- Obtain an API Key
If you already have an API key, you can use it. If you do not have an API key, go to the API Key Management page to create one.
Step 3: Configuring the MaaS API in Cursor
- Click the settings icon in the upper right corner of the Cursor platform.
- In the Cursor Settings area, choose Models and click Add model. Figure 2 Adding a model
- Enter the model name obtained in Step 2 in the text box and click Add model on the right.
- Select only the added MaaS model. Choosing others might cause the verification to fail. Figure 3 Selecting a MaaS model
- In the OpenAI Key area, enter the API key created in Step 2. Figure 4 Entering the API key
- Click Override Openai Base URL. Change the basic API URL to the one obtained from Step 2, and remove /chat/completions at the end. Then click Save.
- Click Verify to verify the API connectivity. If no errors show, the setup is complete and you can start using the API. Figure 5 Verifying connectivity
Step 4: Using the MaaS API in Cursor to Generate Code
On the code editing page, choose the configured model in the red box for tasks like dialog, code generation, and code parsing.
What is your overall rating for this page?
Thank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot