Skip to content

cc-switch token count is 0 - CC Switch

Quick fix

An older database missing pricing for a new model makes token statistics read 0. Upgrade to a version containing the fix.

Error output
使用cc-switch接入model api 后(比如glm-5.1),claudecode多次成功调用llm,但是 ccswitch的token使用统计结果都是0,明显不对。
English translation

After connecting a model api through cc-switch (glm-5.1, for example), claudecode called the llm successfully several times, but the cc-switch token usage statistics all read 0 — clearly wrong.

Maintainers confirmed this comes from an older database lacking pricing for the new model, so the requests succeed while the token usage statistics show 0. The fix ships in a subsequent release.

Users later reported the problem apparently persisting on v3.16.3 when requesting a new api anthropic endpoint, so this cluster carries inconsistent feedback about the fix coverage: the original issue was closed as "database missing pricing for a new model", yet similar behaviour continues on newer versions, possibly because pricing data for particular upstream endpoints or models is still missing.

  1. Upgrade cc-switch to a version maintainers confirmed contains the fix.

  2. After upgrading, make a Claude Code request again and confirm the request log and token statistics are no longer 0.

  3. If it is still 0 after upgrading, record your cc-switch version, upstream endpoint type, and model name, and add them to the issue — users have reported it still reproducing on v3.16.3 against a new api anthropic endpoint.

ToolClaude Code
VersionUnknown
PlatformsWindows
Claude Code calls succeed — why are the cc-switch token statistics still 0?
Maintainers explain an older database lacking pricing for the new model means the request succeeds while the statistics cannot be calculated, so they display as 0.
Is it normal to still see 0 after upgrading to v3.16.3?
Users report the problem apparently persisting on v3.16.3 against a new api anthropic endpoint, so if it still reproduces after upgrading, add your upstream endpoint and model information to continue the investigation.
ccusage also shows 0 token consumption. Is that the same problem?
In that issue, users report token consumption also reading 0 in ccusage for models routed through the cc-switch proxy — the same statistics anomaly.

This is an unofficial community wiki with no affiliation to the cc-switch authors or the project itself. Its content is compiled from the project's public GitHub issues. This site distributes no software.