Skip to content

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.

Error output
API key is empty

After 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.

  1. Upgrade to `v3.16.1` or later, then retest the DeepSeek Balance query using the original steps.

  2. 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.

  3. 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.

Toolcc-switch
Versionv3.16.0 - v3.16.1(维护者称相关问题已修复,建议升级到 v3.16.1 或更新版本验证)
PlatformsUnknown

(No FAQ yet)

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.