Get an Alibaba Qwen key
Who this is for: anyone with an Alibaba Cloud Model Studio (DashScope) account who wants Qwen models through SpiderGate.
What this does: explains Alibaba's three kinds of Qwen key, then walks you through adding yours to the SpiderGate vault with the host it needs.
Before you begin
An Alibaba Cloud Model Studio account (international) or Bailian account (China).
About 2 minutes.
Limits and terms to know first
Alibaba sells three things, each with its own key and host. Alibaba says the keys and base URLs "are not interchangeable. Do not mix them."
Kind | Key | OpenAI-compatible host |
|---|---|---|
Coding Plan |
|
|
Token Plan |
|
|
Pay-as-you-go |
|
|
Coding Plan Pro costs $50 a month for up to 6,000 requests per five hours, 45,000 per week and 90,000 per month. One prompt in a coding tool may use 5 to 30 or more requests. The Lite plan is closed.
Warning: Do not use a Coding Plan key with n8n, scripts or your own apps. Alibaba says: "Do not use the plan's API key for automated scripts, application backends, or other non-interactive scenarios. Using the API key outside the permitted scope is a violation that may result in subscription suspension or API key revocation." It adds that the plan "is not supported in tools like curl, Postman, or Dify". For automation, use a pay-as-you-go key.
Warning: Alibaba says the Coding Plan "is for your use only and must not be shared." Keep it to your own brand.
Steps
Step 1 — Copy the key
For a Coding Plan key, copy it from the Coding Plan page in Model Studio. For a pay-as-you-go key, use the Model Studio API keys page at dashscope.console.aliyun.com/apiKey.
Step 2 — Add it in SpiderGate
Open Gate → Vault (/dashboard/gate/vault) and click Add Provider. Alibaba Qwen appears under Connect a subscription and under Pay-as-you-go. Paste the key into API Key and add a Label. Then set Billing and the host to match your key:
Token Plan key: Billing Subscription. SpiderGate's subscription host is the Token Plan host, so leave Base URL (optional) empty.
Coding Plan key: Billing Subscription, and put
https://coding-intl.dashscope.aliyuncs.com/v1in Base URL (optional). Without it, SpiderGate sends the key to the Token Plan host, which refuses it.Pay-as-you-go key: Billing Paid, Base URL empty.
China (Bailian) account: put your region's host in Base URL (optional), for example
https://coding.dashscope.aliyuncs.com/v1for a China Coding Plan key.
For a plan key, pick your package. Under Routing, turn Share with SpiderIQ key pool off. Click Add key.
Verify it worked
When you click Add key, SpiderGate sends one request to Alibaba with the key before it stores anything: it lists models on the host your Billing and Base URL select.
If Alibaba accepts the key, the dialog closes and the key appears in your vault list.
If it does not, the dialog stays open and shows:
The qwen key did not pass its check: <reason>. Nothing was saved.The reason is SpiderGate's own wording, never Alibaba's error text. The usual ones are Invalid API key (401 Unauthorized), Access denied (403 Forbidden) and The account behind this key has no credit left (402).
To see the key serve a request, give it a slot in one of your own routing aliases and send a request to that alias. The trace shows which provider answered.
Troubleshoot
An sk-sp- key fails the check. Check whether it is a Coding Plan or a Token Plan key, then match the host as in Step 2. Both kinds start with sk-sp-.
A China-region key fails. SpiderGate's defaults are Alibaba's international hosts. Put your region's host in Base URL (optional).
Too many keys checked for this workspace; try again in …s. SpiderGate runs at most 20 key checks per brand in any 10 minutes. Wait the number of seconds it gives, then click Add key again.
Request timed out (15s) or Could not reach … to check the key. Try again later. The provider did not answer in time. Nothing was saved. Try again in a minute.
The provider is rate-limiting us (429). Try again in a minute. The provider throttled the check itself. Wait a minute and retry.