CC Switch
CC Switch
CC Switch is an open-source desktop app that manages provider settings for Claude Code, Codex, Gemini CLI and other coding tools. It rewrites each tool's config file for you, so you don't need to set environment variables, and once your 上上之钥 key is imported it shows your balance right in the app.
The fastest way: on the API Keys page of the console, click Import to CCS next to your key. The endpoint, key and balance query are filled in for you.
Step 1: Install CC Switch
Downloads are available on the CC Switch website and GitHub Releases.
Open CC Switch at least once after installing. The first launch registers the ccswitch:// link handler; one-click import from the web page only works after that.
Step 2: Import your key
Sign in to the console and open API Keys. If you don't have a key yet, click Create API Key first; Click Import to CCS next to the key (or click Use Key and then Import to CC Switch in the dialog); Pick the tool you want from the list: Claude Code, Codex, Gemini CLI, Grok Build, OpenCode, OpenClaw, Hermes, Pi or Antigravity CLI. Tools the key's group can't serve are greyed out with the reason. CC Switch can't import Claude Desktop by link yet, so add it manually in CC Switch; When the browser asks whether to open CC Switch, click Allow / Open; Confirm the import in CC Switch. A provider named 上上之钥 is added.
The import includes:
The endpoint: https://upupkey.com for both Claude Code and Codex (CC Switch appends /v1 for Codex itself); Your API key; A balance query that refreshes every 30 minutes and shows your remaining credit on the provider card; The API protocol, chosen per tool (Anthropic for Claude Code, Responses for Codex / Grok Build, Chat Completions for OpenCode / OpenClaw / Hermes / Pi); A default model for Codex, Grok Build, OpenCode, OpenClaw, Hermes and Pi (claude-sonnet-5-5 for Claude groups, gpt-5.5 for OpenAI groups).
Each import targets one tool. To use the key in several tools, click Import to CCS again and pick another one. Requires CC Switch 4.0.10 or later.
If nothing happens after clicking, or you see "CC Switch is not installed", you most likely haven't opened CC Switch yet. Open it once and try again.
Step 3: Enable and start coding
In CC Switch, select the tool on the left (Claude Code / Codex / Gemini CLI); Find the imported 上上之钥 provider and click Enable. You can also switch from the system tray menu; Start the tool in your terminal:
When the switch takes effect:
Add it manually
If the browser can't open CC Switch, add the provider by hand:
Select the tool on the left and click + (Add provider) in the top-right corner; Choose Custom configuration; Fill in the fields below, save, and click Enable.
Do not add /v1 to the end of the endpoint, or requests go to /v1/v1/... and fail. The Test connection button on the card only checks that the address is reachable; it doesn't validate your key or model name.
Troubleshooting
Balance shows "query failed"
The endpoint was probably edited to a different path. Set it back to https://upupkey.com, or delete the provider and import it again.
Codex says the model doesn't exist
Edit the provider in CC Switch and pick a model that your group supports. You can check available models on the Models page or in the Use Key dialog.
Insufficient balance or 401 errors
Make sure the key isn't disabled or expired and that your account has enough balance. Key status is shown on the API Keys page.