Use Alibaba Cloud Model Studio models in Cursor.
Quick Start
- 1
Get an API Key
Obtain an API Key for your billing plan:- Token Plan Personal Edition: Create or view API Key
- Token Plan Team Edition: Assign a seat and get the API Key
- Pay-as-you-go: Model Studio API Key
- Coding Plan: Coding Plan API Key
- 2
Configure the model
In Cursor, open Cursor Settings > Models, enable OpenAI API Key and Override OpenAI Base URL, and enter the values for your billing plan.- Token Plan
- Pay-as-you-go
- Coding Plan
Item Value Base URL https://token-plan.cn-beijing.maas.aliyuncs.com/compatible-mode/v1API Key Token Plan API Key Model Enter a text generation model supported by Personal Edition or Team Edition. Some models require aliases; see FAQ - 3
Verify
Send a message in the Cursor chat panel. A normal response confirms the configuration.
Integrate Bailian CLI
Bailian CLI registers a Skill at ~/.cursor/skills/bailian-cli/ during installation, allowing Cursor to invoke Bailian capabilities through conversation. For the full capability list, see the Bailian CLI console. Prerequisite: Node.js 18+.
- 1
Install Bailian CLI
In the Cursor chat, run: - 2
Configure the API Key
Obtain an API Key, then ask Cursor to configure it in the chat.
Error Codes
If you encounter errors during configuration, refer to the FAQ for your billing plan:
- Token Plan: Personal Edition FAQ · Team Edition FAQ
- Pay-as-you-go: Error codes
- Coding Plan: Coding Plan FAQ
FAQ
How do I use savings plans and resource plans with pay-as-you-go?
How do I use savings plans and resource plans with pay-as-you-go?
The pay-as-you-go setup remains the same: use your general Model Studio API key and Base URL. After you purchase a savings plan or resource plan, it takes effect automatically and eligible usage is deducted automatically. See Savings plans and resource plans.
Cannot invoke an added model in Cursor
Cannot invoke an added model in Cursor
Error messages:
- The model xxx does not work with your current plan or api key.
- Named models unavailable Free plans can only use Auto. Switch to Auto or upgrade plans to continue.
Cannot find the added model after configuration
Cannot find the added model after configuration
In the chat panel, disable Auto mode, then select the desired model from the model dropdown.
Some model names cannot be invoked
Some model names cannot be invoked
Some model IDs conflict with Cursor built-in model names and require hyphenated aliases:
- Write glm-5.3 as
glm-5-3, glm-5.2 asglm-5-2, glm-5.1 asglm-5-1, and glm-5 asglm-5-0 - Write kimi-k2.6 as
kimi-k2-6, and kimi-k2.5 askimi-k2-5
Model invocation error: "We're having trouble connecting to the model provider." or "Unauthorized User API key"
Model invocation error: "We're having trouble connecting to the model provider." or "Unauthorized User API key"
Troubleshoot the following items:
- Verify that the API Key, Base URL, and model name match the selected billing plan. Credentials are not interchangeable between plans.
- For Pay-as-you-go, verify that the API Key and Base URL belong to the same region.
- Verify whether the model name requires an alias. See the previous item.