Back to Skills

qianwen-usage

[QianWen] Manage account auth and query usage/billing. Use for: login, logout, check usage, view billing, free tier quota, Token Plan status, pay-as-you-go costs. Skip for: model browsing, non-account tasks.

37starsUpdated 7/24/2026

Security Assessment

Safe(90/100)

Detected risks:

Handles account login and credentials (via official CLI)(Performs device-code login and reads billing/usage using the official QianWen CLI and OS keychain; no secret exfiltration)
Security Score90/100

About qianwen-usage

qianwen-usage manages QianWen account authentication and reports usage and billing through the QianWen CLI. It covers login and logout, checking consumption, viewing billing, free-tier quota, Token Plan status, and pay-as-you-go costs, and is scoped to account/usage tasks rather than model browsing.

A large part of the skill is an agent-friendly authentication flow: the CLI auto-detects non-TTY environments and degrades safely, so the skill documents a two-phase device-code login (initialize, then immediately poll for completion) with a defined JSON event structure (device_code, success, expired, error). It explicitly instructs agents not to pause for user confirmation between steps, and documents environment variables such as QIANWEN_KEYRING and QIANWEN_CREDENTIALS_DIR that control where credentials are stored.

It targets agents and users who need to authenticate to QianWen and inspect quota or spend from a headless or interactive environment. Credentials are handled through the official CLI and the OS keychain by default; the skill reads account status and billing but does not transmit secrets elsewhere.

FAQ

What is qianwen-usage for?

Managing QianWen account auth (login/logout) and querying usage and billing — free-tier quota, Token Plan status, and pay-as-you-go costs.

What are the prerequisites?

The QianWen CLI (npm install -g @qianwenai/qianwen-cli) with Node.js >= 18. No manual configuration is needed on first use; the CLI handles non-TTY detection and login automatically.

How does authentication work for agents?

A two-phase device-code flow: run login --init-only to get a verification URL, then immediately run login --complete to poll for success, parsing the JSON events array.

How are credentials stored?

Through the official CLI, using the OS keychain by default. QIANWEN_KEYRING can opt out of keychain storage and QIANWEN_CREDENTIALS_DIR overrides the file-based credential directory.

Install qianwen-usage

Download and extract the skill files to your .claude/skills/ directory.

Quick Setup:

  1. Copy the skill folder to .claude/skills/
  2. Claude will automatically detect and use the skill