contenox

Alibaba Cloud Model Studio for coding agents: plans and endpoints

Updated

MODEL PROVIDERS Alibaba Cloud Model Studio

Alibaba Cloud Model Studio sells Qwen models to coding agents in three ways: Token Plan, a subscription and Alibaba’s recommended product now; Coding Plan, an older subscription that is mostly closed; and pay-as-you-go per token. Each has its own API key and its own base URL, and a key only works with its own URL. Pick the plan first, then copy the endpoint for your agent from the table below.

Which plan: Token Plan, Coding Plan or pay-as-you-go?

Token PlanCoding PlanPay-as-you-go
StatusOpen. Personal and Team editionsLite closed to new buyers since 20 March 2026. Pro has limited slots, restocked dailyOpen
How you payA subscription, metered in CreditsA subscription with request capsPer token
Key starts withsk-sp-sk-sp-sk- or sk-ws
UseInteractive use in compatible toolsInteractive use in programming tools only. Scripts and backends are prohibitedAnything, including scripts and CI
ModelsQwen3.8 Max and Flash, Qwen3.7, plus DeepSeek, GLM and othersQwen3.7 Plus, Qwen3.6 Plus, Qwen3.5 Plus, Kimi, GLM, MiniMaxQwen3.8 Max and Flash, Qwen3.7 Plus, DeepSeek and others

Prices change, so they aren’t here: see the Token Plan and Coding Plan pages. How the plans differ, and what to do if you hold a Coding Plan, is in Qwen Coding Plan and Token Plan.

Pay-as-you-go is the only one of the three you can use from a script or CI job. A Coding Plan key used that way can be suspended or revoked.

The three endpoints

Every plan exposes the same two API styles under its own host:

PlanOpenAI-compatibleAnthropic-compatible
Token Planhttps://token-plan.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1https://token-plan.ap-southeast-1.maas.aliyuncs.com/apps/anthropic
Coding Planhttps://coding-intl.dashscope.aliyuncs.com/v1https://coding-intl.dashscope.aliyuncs.com/apps/anthropic
Pay-as-you-gohttps://<WorkspaceId>.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1https://<WorkspaceId>.ap-southeast-1.maas.aliyuncs.com/apps/anthropic

Replace <WorkspaceId> with your workspace ID from the console. Alibaba’s regions page also lists a shared DashScope host per region; its example is https://dashscope.aliyuncs.com/compatible-mode/v1 for Beijing. It recommends the workspace host.

Which agent needs which style:

  • OpenAI-compatible: Qwen Code, Codex CLI, Cline, Kilo Code, Contenox.
  • Anthropic-compatible: Claude Code, and OpenCode in Alibaba’s own config.

The key-and-URL trap: a plan key sent to another plan’s URL fails. A Coding Plan key at the general Model Studio URL returns a 403, and a general key at a plan URL returns a 401. Check the sk-sp- prefix and the host together before you debug anything else.

Every agent: base URL and config file

Token Plan values. For the other plans, swap in the host from the table above.

AgentWhereWhat to set
Qwen Code~/.qwen/settings.jsonmodelProviders.openai entry with baseUrl …/compatible-mode/v1 and envKey BAILIAN_TOKEN_PLAN_API_KEY; security.auth.selectedType openai
Claude Code~/.claude/settings.json, env blockANTHROPIC_BASE_URL …/apps/anthropic, ANTHROPIC_AUTH_TOKEN your key
Codex CLI~/.codex/config.toml[model_providers.Token_Plan], base_url …/compatible-mode/v1, env_key = "OPENAI_API_KEY", wire_api = "responses"
OpenCode~/.config/opencode/opencode.jsonProvider with @ai-sdk/anthropic, baseURL …/apps/anthropic/v1
ClineSettings → API ProviderOpenAI Compatible, Base URL …/compatible-mode/v1
Kilo CodeSettings → Providers → Custom providerOpenAI Compatible, same Base URL
ContenoxBackends → Providers → OpenAIBase URL …/compatible-mode/v1

On Windows the home folder is C:\Users\<you>, so the Qwen Code file is C:\Users\<you>\.qwen\settings.json. The complete Claude Code, Codex and OpenCode blocks are on the Qwen page.

The OpenCode URL ends in /v1 and the Claude Code URL doesn’t. Both are right for their own agent.

How do I create an API key?

For a pay-as-you-go key, open the Model Studio API Key page, choose a region at the upper right and select Create API Key. Set a workspace, and copy the key at once: after you close the dialog the plaintext key can’t be shown again. Alibaba’s examples keep it in DASHSCOPE_API_KEY; on Windows, setx DASHSCOPE_API_KEY "your-key-here" and reopen your terminal.

A Token Plan Personal key comes from the subscription page after you subscribe. For Team, an administrator assigns you a seat and you create the key from the organization members page. Team and Personal keys aren’t interchangeable.

Keys don’t expire. They stay valid until deleted, so a leaked one keeps working. See keep secrets away from AI agents.

International or China?

Model Studio runs separate regions, and each has its own endpoint, API key and model list. A key from one region doesn’t work in another.

RegionDashScope host
Singaporedashscope-intl.aliyuncs.com
China (Beijing)dashscope.aliyuncs.com
China (Hong Kong)cn-hongkong.dashscope.aliyuncs.com

US (Virginia), Germany (Frankfurt) and Japan (Tokyo) are also listed, but only through workspace-specific hosts of the form <WorkspaceId>.<region>.maas.aliyuncs.com. Alibaba recommends that workspace host over the shared one.

Request data is stored in the region you select, and inference runs in the deployment scope you choose. The plan setups in Alibaba’s docs use the Singapore region. For a Beijing Coding Plan, Qwen Code’s docs give https://coding.dashscope.aliyuncs.com/v1.

Why do I get 429?

  • Too many requests: wait about a minute and run fewer agents in parallel. Token Plan’s concurrency limit moves with platform load, and parallel agents share it.
  • insufficient_quota on Token Plan: the seat’s monthly allowance is used up. It doesn’t carry over; wait for the reset, buy a shared pack, or add seats.
  • Coding Plan: a cap is hit. Three caps apply at once (a rolling window, a week and a month), and whichever is reached first pauses calls.
  • Codex: reset times in 429 messages are in UTC. Add 8 hours for Singapore time.

Contenox

Contenox connects to Model Studio through its own Alibaba Cloud Model Studio provider, with the international endpoint as the default and a Base URL field for the China and Coding Plan endpoints from the table above.

  1. Open Backends → Providers and, under Recommended, choose Alibaba Cloud Model Studio.
  2. Select Create key, create a key in Model Studio and copy it.
  3. Paste it into API Key. For the China region or a Coding Plan key (it starts with sk-sp-), open Advanced and set Base URL to that endpoint; the international endpoint is the default.
  4. Select Connect and wait for Connected. The Model chip then lists the models your key can reach.

To keep the key out of the app, enter DASHSCOPE_API_KEY under Advanced in Environment variable name and set the variable on your system instead.

On releases before the provider shipped, the same works through More providers → OpenAI with the Model Studio key and the endpoint in Base URL; type the model name in the Model chip.

contenox-runtime backend add alibaba --type alibaba-cloud --api-key-env DASHSCOPE_API_KEY

Related

Esc to close