Back to library
AI
best practice

Track Token Expenses Instantly via the /stats Command

Monitor your AI API token expenditure in real-time from the CLI.

Type /stats in the Qwen Code terminal to immediately track your daily token consumption and associated costs.

Qwen

The Scenario

You are experimenting with heavy code refactoring and want to ensure you aren't overspending on high-density token context window usage.

Before & after

The old way

Users have to log in to cloud provider dashboards, navigate to billing sections, and wait for usage data to refresh, which takes 5-10 minutes.

With AI

Simply type /stats to see a breakdown of your daily usage and costs locally, allowing you to adjust your model usage in seconds.

The Prompt

/stats

Managing API costs is critical for developers using high-end models. The /stats command provides an immediate, local view of token consumption, helping you stay within budget during heavy development phases.

Source

Qwen Code Blog: AI Coding Updates and Guides | Qwen Code Docs
"/stats shows your daily token spend, /voice lets you speak instead of type, workflows can be saved..."