API key is empty: cc-switch DeepSeek balance query
Quick fix
Upgrade to v3.16.1 or later and verify again. The original issue did not confirm the fix.
Symptom
Section titled “Symptom”API key is emptyAfter entering and saving `ANTHROPIC_AUTH_TOKEN` in the DeepSeek preset provider, the API key read by the Balance template in Usage Query remained empty. The reporter believed that `getProviderCredentials()` in UsageScriptModal.tsx did not retrieve the saved value when reading `ANTHROPIC_AUTH_TOKEN` or `ANTHROPIC_API_KEY`.
The same report included two variants: the DeepSeek dual-currency balance showed a USD item with a balance of 0, and OpenCode sessions under `~/.local/share/opencode/` were not counted by Usage Dashboard. The maintainer said the report substantially overlapped with issues fixed in v3.16.0 / v3.16.1 and recommended upgrading for verification. However, the original issue did not confirm that the problem disappeared after upgrading, so this cannot be treated as a verified fix.
Upgrade to `v3.16.1` or later, then retest the DeepSeek Balance query using the original steps.
If the error persists, add the CC Switch version, operating system, relevant application versions, provider or routing configuration, reproduction steps, and logs or screenshots to the original issue, as requested by the maintainer.
The temporary workaround recorded in the original issue was to switch to the “Custom” template and hardcode the API key in the script. The reporter marked this as insecure and inconvenient; no verifiable official solution was provided.
Affected Versions
Section titled “Affected Versions”Source Issues
Section titled “Source Issues”This page is distilled from 1 real issues
(No FAQ yet)
Related problems
Section titled “Related problems”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.