qwencloud-payment
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseQwenCloud Payment
QwenCloud 支付
Manage QwenCloud account payment method status, card binding, and spending limits.
管理 QwenCloud 账户的支付方式状态、银行卡绑定和消费限额。
Prerequisites
前置条件
- QwenCloud CLI >= 1.3.0 must be installed. Verify with:
bash
qwencloud versionIf not installed, run:
bash
npm install -g @qwencloud/qwencloud-cliNode.js >= 18 required.
- All billing commands require authentication. See Authentication Flow below.
- 必须安装 QwenCloud CLI >= 1.3.0。使用以下命令验证:
bash
qwencloud version如果尚未安装,请运行:
bash
npm install -g @qwencloud/qwencloud-cli需要 Node.js >= 18。
- 所有计费命令都需要身份认证。请参阅下文的身份认证流程。
Authentication Flow (for Agents)
身份认证流程(适用于 Agent)
The CLI auto-detects non-TTY environments and degrades safely.
CLI 会自动检测非 TTY 环境,并以安全方式降级。
TL;DR — 3-step auth path
TL;DR — 3 步认证流程
- →
qwencloud auth status --format json→ skip to commandsauthenticated: true - → extract
qwencloud auth login --init-only --format json→ open in browserverification_url - → poll until
qwencloud auth login --complete --format jsoneventsuccess
If on step 1, proceed directly to payment commands.
authenticated: trueFor full details on the two-phase login flow (init-only → complete), refer to the skill or skill documentation.
qwencloud-usageqwencloud-ops-auth- →
qwencloud auth status --format json→ 跳至命令执行步骤authenticated: true - → 提取
qwencloud auth login --init-only --format json→ 在浏览器中打开verification_url - → 轮询直至出现
qwencloud auth login --complete --format json事件success
如果第 1 步返回 ,则直接执行支付相关命令。
authenticated: true有关两阶段登录流程(init-only → complete)的完整详情,请参阅 skill 或 skill 文档。
qwencloud-usageqwencloud-ops-authPayment Status Commands
支付状态命令
Payment Method Status
支付方式状态
bash
qwencloud billing payment-method list --format jsonResponse fields:
- — list of payment methods
items[] - — only items with status
items[].statusare considered activeVALID
Present the count of valid payment methods and their types.
bash
qwencloud billing payment-method list --format json响应字段:
- — 支付方式列表
items[] - — 仅状态为
items[].status的项目视为有效VALID
显示有效支付方式的数量及其类型。
Spending Limit
消费限额
Query or display the current spending limit configuration.
bash
qwencloud billing limit --format jsonReturns the configured spending limit and current consumption against it. When status is , inform the user that no spending limit is currently configured.
INACTIVENumber formatting: Use K = 1000, M = 1000000 when displaying large values (e.g., $5K, $1.2M).
查询或显示当前的消费限额配置。
bash
qwencloud billing limit --format json返回已配置的消费限额及当前相对于该限额的消费情况。当状态为 时,告知用户当前未配置消费限额。
INACTIVE数字格式: 显示大数值时,使用 K = 1000、M = 1000000(例如 $5K、$1.2M)。
Bind Card
绑定银行卡
This command opens the official web console page. It does NOT perform transactions within the conversation.
此命令会打开官方 Web 控制台页面,不会在对话中执行交易。
Confirmation Flow
确认流程
Before executing bind-card, the agent MUST:
- Show impact — explain what the action will do (open a web page for card binding)
- Wait for explicit user confirmation — return status if not confirmed
confirmation_required - Execute only after confirmation
执行绑卡操作前,Agent 必须:
- 说明影响 — 解释此操作将执行的内容(打开用于绑定银行卡的 Web 页面)
- 等待用户明确确认 — 如果用户未确认,则返回 状态
confirmation_required - 仅在确认后执行
States
状态
| State | Meaning |
|---|---|
| Action pending user confirmation — do NOT execute |
| User explicitly agreed — proceed with command |
| 状态 | 含义 |
|---|---|
| 操作正在等待用户确认 — 请勿执行 |
| 用户已明确同意 — 继续执行命令 |
Steps
步骤
- User requests bind card
- Agent presents: "This will open the official card-binding page in your browser. Proceed?"
- If user confirms → execute the command
- If user declines or does not respond → return , take no action
confirmation_required
- 用户请求绑定银行卡
- Agent 提示:“这将在您的浏览器中打开官方绑卡页面。是否继续?”
- 如果用户确认 → 执行命令
- 如果用户拒绝或未响应 → 返回 ,不执行任何操作
confirmation_required
Execute
执行
bash
qwencloud billing payment-method bind --format jsonOpens the official card-binding page in the user's browser. No card data is submitted via CLI.
bash
qwencloud billing payment-method bind --format json在用户的浏览器中打开官方绑卡页面。不会通过 CLI 提交任何银行卡数据。
Output and Agent Display Rules
输出和 Agent 展示规则
CLI commands return JSON by default in agent/pipe environments.
Always pass , parse the structured response, then present a human-readable summary.
--format json在 Agent/pipe 环境中,CLI 命令默认返回 JSON。
始终传入 ,解析结构化响应,然后以便于阅读的形式呈现结果。
--format jsonHow to present output
如何展示输出
- Parse the JSON and extract relevant data for the user's question
- Present a human-readable summary — do not dump raw JSON
- Add analysis AFTER the summary — clearly separated with
---
- 解析 JSON 并提取与用户问题相关的数据
- 提供便于阅读的摘要 — 不要直接输出原始 JSON
- 在摘要之后添加分析 — 使用 明确分隔
---
Error Handling
错误处理
- Auth failure: Return the original CLI error message. Do NOT retry login in a loop.
- After successful login: Retry the failed command exactly once.
- Network error: Report the error and suggest the user check connectivity.
- Unknown error: Return the raw CLI stderr output for debugging.
- 身份认证失败:返回原始 CLI 错误消息。请勿循环重试登录。
- 登录成功后:将失败的命令原样重试一次。
- 网络错误:报告错误,并建议用户检查网络连接。
- 未知错误:返回 CLI stderr 的原始输出以便调试。
Result Status
结果状态
| Status | When |
|---|---|
| Command executed and full data returned |
| Command executed (exit 0) but some expected fields are missing or |
| Command executed but no data (e.g., no payment methods bound) |
| Bind-card action awaiting user confirmation |
| Command failed — include error details |
| 状态 | 使用场景 |
|---|---|
| 命令执行成功并返回完整数据 |
| 命令执行成功(退出码为 0),但部分预期字段缺失或为 |
| 命令执行成功但没有数据(例如未绑定任何支付方式) |
| 绑卡操作正在等待用户确认 |
| 命令执行失败 — 包含错误详情 |
NEVER
禁止事项
- ❌ Execute without explicit user confirmation
bind - ❌ Perform actual card submission or transactions in the conversation
- ❌ Judge payment method "insufficient" without explicit criteria
- ❌ Handle support tickets (out of scope)
- ❌ Query billing history or usage (use instead)
qwencloud-usage - ❌ Query subscription status (use instead)
qwencloud-usage - ❌ Retry login in a loop on auth failure
- ❌ 未经用户明确确认不得执行
bind - ❌ 不得在对话中实际提交银行卡信息或执行交易
- ❌ 没有明确判定标准时,不得将支付方式判定为“不足”
- ❌ 不得处理支持工单(不在范围内)
- ❌ 不得查询账单历史或用量(请改用 )
qwencloud-usage - ❌ 不得查询订阅状态(请改用 )
qwencloud-usage - ❌ 身份认证失败时,不得循环重试登录