Help Center/MaaS/Model Calling/Accessing a Client/Development Tool/Quickly Building a Code Editor with DeepSeek API and Cursor
Updated on 2026-03-19 GMT+08:00

Quickly Building a Code Editor with DeepSeek API and Cursor

Cursor is a modern code editor for developers that uses AI technology. 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 and DeepSeek, and offers flexible customization. This makes it ideal for users from beginners to professionals.

MaaS deploys DeepSeek models on its platform, allowing developers use them via API calls.

This guide describes how to use Cursor to call a DeepSeek model deployed in MaaS to build a code editor.

Billing

This section describes how to use a built-in service or deploy a built-in service as My Services. The billing of the two methods is as follows:

This section describes how to deploy a built-in service as My Services for calls. Calling My Services uses compute and storage resources, which are billed. For details, see Compute Resource Billing Items.

Constraints

This function is only available in the CN-Hong Kong region.

Prerequisites

Step 1: Downloading and Installing Cursor

Download and install Cursor from the official website.

Step 2: Preparing for MaaS Model API Access

  1. In the navigation pane of the MaaS console, choose Model Inference > Real-time inference.
  2. Click the My Services tab and click Deploy Model in the upper right corner to create a model service. For details, see Deploying a Model Service in ModelArts Studio (MaaS).
  3. Locate a running model service and choose More > View Call Description in the Operation column.
  4. In the View Call Description dialog box, click Create API Key, set related parameters, and click OK.

    API keys are used for API authentication. You can create up to 30 keys. The label of an API key cannot be changed after the API key is created. Each key is displayed only once after creation. Keep it secure. If the key is lost, it cannot be retrieved. In this case, create a new API key. For details about the API key parameters, see Creating an API Key.

  5. In the Your Key dialog box, copy the key and store it securely. After the key is saved, click Saved. Confirm and Close.

    After you click Saved. Confirm and Close, the key cannot be viewed again.

  6. Check the API URL and model name on the page. You will need these for the next steps in configuring Cursor.

Step 3: Configuring the MaaS API in Cursor

  1. Click the settings icon in the upper right corner of the Cursor platform.
  2. In the Cursor Settings area, choose Models and click Add model.
    Figure 1 Adding a model
  3. Enter the model name obtained in Step 2 in the text box and click Add model on the right.
  4. Select only the added MaaS model. Choosing others might cause the verification to fail.
    Figure 2 Selecting a MaaS model
  5. In the OpenAI Key area, enter the API key created in Step 2.
    Figure 3 Entering the API key
  6. Click Override Openai Base URL. Change the basic API URL to the one from Step 2, removing /chat/completions at the end. Then click Save.
  7. Click Verify to verify the API connectivity. If no errors show, the setup is complete and you can start using the API.
    Figure 4 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.

Figure 5 Using the MaaS API