Updated 2026-08-05

Use an Alibaba Cloud API key in Cursor

Cursor exposes Alibaba Model Studio through its OpenAI API Key and Override OpenAI Base URL controls. For an ordinary pay-as-you-go key, enter the workspace-specific `/compatible-mode/v1` Base URL, add a supported model such as `qwen3.7-max`, and verify it as a standard chat model. This BYOK route does not replace every Cursor model: Tab Completion and other specialized features can continue using Cursor's built-in models.

1. Confirm what Cursor BYOK does and does not control

Cursor's custom API-key feature applies to standard chat models. Cursor's own documentation says specialized features such as Tab Completion continue using built-in models. Do not promise that one Alibaba key reroutes every request the editor makes.

Cursor also states that the key is sent with requests through its backend for final prompt assembly. Treat this as a different privacy boundary from a purely local CLI, even when the underlying model call is billed to your Alibaba account.

Cursor feature boundary
SurfaceAlibaba BYOK effect
Chat / standard model requestsCan use the configured Alibaba-compatible model
Model pickerCan show manually added supported model IDs
Tab CompletionContinues using Cursor's specialized built-in model
Prompt assemblyRequests still pass through Cursor's backend according to Cursor docs

Sources checked

  • Cursor custom API keys - Primary source for BYOK scope, supported standard chat models, verification, and request handling.
  • Alibaba Cloud Cursor guide - Primary source for Cursor's Model Studio fields, regional Base URLs, and model-name adjustments.

2. Copy the exact workspace API Host before opening Cursor Settings

Use the API Host shown with the ordinary key in Model Studio. Beijing and Singapore keys use workspace-specific hostnames. Virginia uses a regional shared hostname. The key and Base URL must belong to the same region.

The Cursor field expects a Base URL ending in `/compatible-mode/v1`, not the full `/chat/completions` endpoint. Cursor appends the request path when it sends the standard chat call.

Pay-as-you-go Cursor values
FieldBeijing example
OpenAI API KeyYour ordinary Model Studio API key
Override OpenAI Base URLhttps://{WorkspaceId}.cn-beijing.maas.aliyuncs.com/compatible-mode/v1
Model nameqwen3.7-max
Request protocolOpenAI-compatible Chat Completions

3. Enter the key, Base URL, and model in Cursor

Open Cursor Settings, choose Models, enable OpenAI API Key, and turn on Override OpenAI Base URL. Enter the ordinary Model Studio key, the matching workspace Base URL, and a model ID supported in that workspace. Click Verify before relying on it in a repository.

Do not use a provider marketing name in the model field. Alibaba documents punctuation changes for several Kimi and GLM IDs in Cursor. `qwen3.7-max` can be entered as written, while affected IDs must follow Alibaba's Cursor mapping table exactly.

Cursor Settings > Models

OpenAI API Key: YOUR_API_KEY
Override OpenAI Base URL:
https://{WorkspaceId}.cn-beijing.maas.aliyuncs.com/compatible-mode/v1

Model:
qwen3.7-max

Click: Verify

4. Verify the protocol independently when Cursor reports a generic error

Cursor's Verify result can collapse several causes into one message. Before rotating the key, send a minimal Chat Completions request to the same workspace host. A 200 response proves the key, region, host, model, and Chat contract work outside Cursor.

If curl succeeds while Cursor fails, re-check the override toggle, exact Base URL, model-name mapping, and Cursor's current support for that standard chat model. Do not switch the endpoint to Responses or Anthropic Messages to make the verification button pass.

curl -X POST \
  "https://{WorkspaceId}.cn-beijing.maas.aliyuncs.com/compatible-mode/v1/chat/completions" \
  -H "Authorization: Bearer $DASHSCOPE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "qwen3.7-max",
    "messages": [{"role": "user", "content": "Reply with cursor-ok"}]
  }'

5. Add and switch models without changing the provider

Add each permitted model under Cursor Settings > Models, then select the desired model in the chat or Agent model picker. Switching from one Alibaba model to another keeps the same key and Base URL when both models belong to the same workspace and support standard chat.

If the new model fails, revert to the known-good model before editing the key. Then check the target model's exact Cursor spelling, regional availability, workspace permission, and standard-chat support.

6. Keep Cursor API keys separate from Cursor platform keys

The Alibaba credential belongs in the model BYOK field. A Cursor account API key for Cursor CLI, Background Agents, or the Admin API is a different credential issued by Cursor and cannot call Model Studio.

Use labels that make the owner explicit when documenting setup: 'Alibaba Model Studio API Key' for inference and 'Cursor API Key' only for Cursor's own platform APIs.

FAQ

Which protocol does Cursor use with Alibaba Model Studio?

Alibaba's Cursor guide uses the OpenAI-compatible Base URL for standard Chat Completions requests.

Will the Alibaba key power Cursor Tab Completion?

No. Cursor documents that custom API keys work with standard chat models; specialized features such as Tab Completion continue using built-in models.

Why does Cursor Verify fail when my key is valid?

Check the workspace region, Base URL override, exact model name, and whether that model is supported as standard chat. Use a direct Chat Completions curl to isolate the provider path.

Can I paste the full /chat/completions URL into Cursor?

No. The documented Override OpenAI Base URL ends at `/compatible-mode/v1`; Cursor appends the request path.

Does the Alibaba key stay entirely on my device?

Cursor says the key is not stored but is sent with requests through its backend for final prompt assembly. Evaluate that data path before using sensitive repositories.

Cursor's Alibaba route is a standard-chat BYOK integration: use the ordinary key, the matching workspace `/compatible-mode/v1` Base URL, and exact supported model IDs. Verify the Chat endpoint separately and keep Cursor's built-in specialized features outside the claim.

Related model comparisons

Continue from this guide into structured DeepSeek-first comparison pages with model tables, routing advice, and pricing context.