Skip to content

Qwen CLI Source

  • ~/.qwen/projects/*/chats/*.jsonl
Terminal window
llm-usage daily --source qwen --qwen-dir /path/to/.qwen/projects

qwen is directory-backed, so generic source directory overrides also work:

Terminal window
llm-usage daily --source-dir qwen=/path/to/.qwen/projects

The adapter does not read QWEN_DATA_DIR in this release; use --qwen-dir for non-default locations.

The adapter reads Qwen CLI JSONL chat rows. Assistant rows with usageMetadata become usage events: promptTokenCount minus cachedContentTokenCount maps to input (Qwen Code’s prompt count always includes cached input), cachedContentTokenCount to cache read, candidatesTokenCount to output, thoughtsTokenCount to reasoning, and totalTokenCount to the declared total when present. OpenAI- and Anthropic-backed models already count reasoning inside candidatesTokenCount; when the declared total shows thoughts reported outside it (Gemini-native responses), thoughts are added to output because they are billed at the output rate. Rows without a declared total fall back to the model family: only gemini-* models report thoughts outside candidatesTokenCount.