qwencloud-payment

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

QwenCloud 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 version
If not installed, run:
bash
npm install -g @qwencloud/qwencloud-cli
Node.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 步认证流程

  1. qwencloud auth status --format json
    →
    authenticated: true
    → skip to commands
  2. qwencloud auth login --init-only --format json
    → extract
    verification_url
    → open in browser
  3. qwencloud auth login --complete --format json
    → poll until
    success
    event
If
authenticated: true
on step 1, proceed directly to payment commands.
For full details on the two-phase login flow (init-only → complete), refer to the
qwencloud-usage
skill or
qwencloud-ops-auth
skill documentation.
  1. qwencloud auth status --format json
    →
    authenticated: true
    → 跳至命令执行步骤
  2. qwencloud auth login --init-only --format json
    → 提取
    verification_url
    → 在浏览器中打开
  3. qwencloud auth login --complete --format json
    → 轮询直至出现
    success
    事件
如果第 1 步返回
authenticated: true
,则直接执行支付相关命令。
有关两阶段登录流程(init-only → complete)的完整详情,请参阅
qwencloud-usage
skill 或
qwencloud-ops-auth
skill 文档。

Payment Status Commands

支付状态命令

Payment Method Status

支付方式状态

bash
qwencloud billing payment-method list --format json
Response fields:
  • items[]
    — list of payment methods
  • items[].status
    — only items with status
    VALID
    are considered active
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 json
Returns the configured spending limit and current consumption against it. When status is
INACTIVE
, inform the user that no spending limit is currently configured.
Number 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:
  1. Show impact — explain what the action will do (open a web page for card binding)
  2. Wait for explicit user confirmation — return
    confirmation_required
    status if not confirmed
  3. Execute only after confirmation
执行绑卡操作前,Agent 必须:
  1. 说明影响 — 解释此操作将执行的内容(打开用于绑定银行卡的 Web 页面)
  2. 等待用户明确确认 — 如果用户未确认,则返回
    confirmation_required
    状态
  3. 仅在确认后执行

States

状态

StateMeaning
confirmation_required
Action pending user confirmation — do NOT execute
confirmed
User explicitly agreed — proceed with command
状态含义
confirmation_required
操作正在等待用户确认 — 请勿执行
confirmed
用户已明确同意 — 继续执行命令

Steps

步骤

  1. User requests bind card
  2. Agent presents: "This will open the official card-binding page in your browser. Proceed?"
  3. If user confirms → execute the command
  4. If user declines or does not respond → return
    confirmation_required
    , take no action
  1. 用户请求绑定银行卡
  2. Agent 提示:“这将在您的浏览器中打开官方绑卡页面。是否继续?”
  3. 如果用户确认 → 执行命令
  4. 如果用户拒绝或未响应 → 返回
    confirmation_required
    ,不执行任何操作

Execute

执行

bash
qwencloud billing payment-method bind --format json
Opens 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
--format json
, parse the structured response, then present a human-readable summary.
在 Agent/pipe 环境中,CLI 命令默认返回 JSON。 始终传入
--format json
,解析结构化响应,然后以便于阅读的形式呈现结果。

How to present output

如何展示输出

  1. Parse the JSON and extract relevant data for the user's question
  2. Present a human-readable summary — do not dump raw JSON
  3. Add analysis AFTER the summary — clearly separated with
    ---
  1. 解析 JSON 并提取与用户问题相关的数据
  2. 提供便于阅读的摘要 — 不要直接输出原始 JSON
  3. 在摘要之后添加分析 — 使用
    ---
    明确分隔

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

结果状态

StatusWhen
success
Command executed and full data returned
partial
Command executed (exit 0) but some expected fields are missing or
null
— e.g.,
payment-method list
returns items but a field is
null
, or
billing limit
returns
INACTIVE
with some fields absent. Present available data and note that the user should verify details in the web console
empty
Command executed but no data (e.g., no payment methods bound)
confirmation_required
Bind-card action awaiting user confirmation
error
Command failed — include error details
状态使用场景
success
命令执行成功并返回完整数据
partial
命令执行成功(退出码为 0),但部分预期字段缺失或为
null
— 例如
payment-method list
返回了项目但某个字段为
null
,或
billing limit
返回
INACTIVE
且部分字段不存在。此时应展示可用的数据,并提醒用户在 Web 控制台中核实详情
empty
命令执行成功但没有数据(例如未绑定任何支付方式)
confirmation_required
绑卡操作正在等待用户确认
error
命令执行失败 — 包含错误详情

NEVER

禁止事项

  • ❌ Execute
    bind
    without explicit user confirmation
  • ❌ 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
    qwencloud-usage
    instead)
  • ❌ Query subscription status (use
    qwencloud-usage
    instead)
  • ❌ Retry login in a loop on auth failure
  • ❌ 未经用户明确确认不得执行
    bind
  • ❌ 不得在对话中实际提交银行卡信息或执行交易
  • ❌ 没有明确判定标准时,不得将支付方式判定为“不足”
  • ❌ 不得处理支持工单(不在范围内)
  • ❌ 不得查询账单历史或用量(请改用
    qwencloud-usage
    )
  • ❌ 不得查询订阅状态(请改用
    qwencloud-usage
    )
  • ❌ 身份认证失败时,不得循环重试登录