Qwencloud Ops Auth
Configure authentication (API keys, endpoints). TRIGGER when: setting up QWEN_API_KEY, troubleshooting 401/auth errors, when another skill reports missing credentials, or user explicitly invokes this skill by name (e.g. use qwencloud-ops-auth). DO NOT TRIGGER when: non-auth Qwen tasks, general API usage questions.
- Skill ID
- qwencloud/qwencloud-ai/qwencloud-ops-auth
- Publisher
- qwencloud
- Repository
- qwencloud-ai
- Installs
- 0
- Files
- 6
- Requires
- Requires curl for PAYG verification. Cursor: auto-loaded. Claude Code: read this skill's SKILL.md before first use.
- Synced
- Sep 23, 2026
Open any RiverX project, open the Skills panel in the chat, and search for this identifier. The files are fetched from the source repository at install time.
qwencloud/qwencloud-ai/qwencloud-ops-authInstalls these files- SKILL.md
- cdn/references/qwencloud-token-plan-models.md
- references/codingplan.md
- references/custom-oss.md
- references/sources.md
- references/tokenplan.md
What this skill tells the agent
QwenCloud Authentication Setup
Configure and verify authentication for QwenCloud APIs. This skill is part of qwencloud/qwencloud-ai.
Skill directory
Use this skill's internal files for learning. Load references only when the user needs console or documentation links.
| Location | Purpose |
|---|---|
references/tokenplan.md | Token Plan vs Coding Plan vs PAYG; CDN model catalog, endpoint mapping, pricing, User-Agent |
references/codingplan.md | Coding Plan vs standard key: model list, endpoint mapping, error codes, cost risks |
references/custom-oss.md | Custom OSS bucket setup for production file uploads (replaces 48h temp storage) |
references/sources.md | Console URLs, auth guide (manual lookup only) |
Security
NEVER output any API key, OSS credential in plaintext. This applies equally to DASHSCOPE_API_KEY and custom OSS AccessKey pairs. Any check or detection of credentials in this skill must be non-plaintext: report only status (e.g. "set" / "not set", "valid" / "invalid", HTTP status code), never the key value.
API Key Handling (MANDATORY)
When the API key is not configured or a script reports missing credentials:
- NEVER ask the user to provide their API key directly. Do not prompt "please paste your API key" or similar. Do not request the key value in any form.
- Help create a `.env` file with a placeholder, then instruct the user to fill in their own key:
- Run:
echo 'DASHSCOPE_API_KEY=sk-your-key-here' >> .env - Tell the user: "Please replace
sk-your-key-herewith your actual API key from the QwenCloud Console."
- Or explain how to configure the environment variable:
export DASHSCOPE_API_KEY='sk-...'+ provide the console URL. - Only write the actual key value into
.envif the user explicitly insists on having the agent do it for them.
Credential Priority Chain
Credentials are loaded in the following order (first match wins):
- Environment variable —
DASHSCOPE_API_KEY(orQWEN_API_KEYalias) - `.env` file — in current working directory, then repo root (detected via
.gitorskills/directory). Existing environment variables are not overwritten.
Environment Variables
| Variable | Purpose |
|---|---|
DASHSCOPE_API_KEY | API key (required) |
QWEN_API_KEY | Alias for DASHSCOPE_API_KEY. If both are set, QWEN_API_KEY takes priority. |
QWEN_BASE_URL | Override default endpoint (optional; for custom deployments) |
QWEN_TMP_OSS_BUCKET | Custom OSS bucket for file uploads (replaces 48h temp storage). See custom-oss.md. |
QWEN_TMP_OSS_REGION | OSS region (required when QWEN_TMP_OSS_BUCKET is set). |
QWEN_TMP_OSS_AK_ID / AK_SECRET | OSS credentials (use RAM user with least-privilege: oss:PutObject + oss:GetObject). Falls back to OSS_ACCESS_KEY_ID / OSS_ACCESS_KEY_SECRET if not set. |
API Key Types
QwenCloud has three mutually exclusive key/plan types:
| Key Type | Format | Purpose | Endpoint |
|---|---|---|---|
| Standard (Pay-as-you-go) | sk-xxxxx | API calls from scripts, apps, and tools | dashscope-intl.aliyuncs.com |
| Token Plan | sk-sp-xxxxx | Interactive AI tools with User-Agent header | token-plan.ap-southeast-1.maas.aliyuncs.com |
| Coding Plan | sk-sp-xxxxx | Interactive AI coding tools only (Cursor, Claude Code, Qwen Code) | coding-intl.dashscope.aliyuncs.com |
All qwencloud/qwencloud-ai scripts require a standard key (sk-). Coding Plan keys (sk-sp-) produce 401 invalid_api_key on standard endpoints. Token Plan keys (sk-sp-) are auto-routed to the Token Plan endpoint by scripts. Before a Token Plan request, fetch and read the current Token Plan model catalog and pass an exact listed model; if CDN access fails, use the local fallback. Coding Plan details remain in codingplan.md.
If the user's key starts with sk-sp-, first check tokenplan.md for Token Plan details and the CDN catalog above for model coverage, then codingplan.md for Coding Plan specifics. Guide them to obtain a standard key from the console below if needed for models outside their plan.
Viewing Bills
Use the qwencloud-usage skill to query usage, free tier quota, and billing directly. Alternatively, billing details are available in the QwenCloud console:
| Key Type | Billing Page |
|---|---|
| Standard (Pay-as-you-go) | Pay-as-you-go Billing |
| Token Plan Personal | Personal Billing |
| Token Plan Team | Team Billing |
| Coding Plan | Coding Plan Billing |
| Usage analytics (both) | Usage Analytics |
NEVER fabricate, guess, or construct usage/billing/console URLs. Only provide the exact links listed in this skill. If a URL is not listed here, do not invent one.
Getting an API Key
- Open the QwenCloud Console
- Sign in with your QwenCloud account
- Create or copy an API key from the API Key management section
- Standard keys start with
sk-(notsk-sp-which is Coding Plan only)
Security Best Practices
- Never hardcode API keys in source code or config files committed to version control
- Use environment variables or
.envfiles (and add.envto.gitignore) - Rotate keys periodically and revoke compromised keys immediately
- Use least-privilege — create dedicated keys for specific applications when possible
Setting up .env
Create a .env file in your project root or current working directory:
echo 'DASHSCOPE_API_KEY=sk-your-key-here' >> .envThe script automatically loads .env from the current working directory and the project root (detected via .git or skills/ directory). Existing environment variables are not overwritten by .env values.
Example .gitignore entry
.env
.env.local
*.envVerification
Unless explicitly stated otherwise, any script or task mentioned in this skill runs in the foreground — wait for standard output; do not run it as a background task.
PAYG only: Test authentication with a simple curl request. Token Plan: do not use curl; verify with the target skill's bundled Python script.
curl -sS -X POST "https://dashscope-intl.aliyuncs.com/compatible-mode/v1/chat/completions" \
-H "Authorization: Bearer $DASHSCOPE_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"qwen-turbo","messages":[{"role":"user","content":"Hi"}]}'A successful response returns JSON with choices and message.content.
Authentication Error Handling
QwenCloud API keys are scoped to the QwenCloud console. An invalid or mismatched key produces 401 Unauthorized.
When to trigger
More from qwencloud
Use this skill in a project
Open any RiverX project, search the Skills panel for qwencloud/qwencloud-ai/qwencloud-ops-auth, and install it in one click.
