Coding agents
CC-Switch setup
Save and switch Codex, OpenAI-compatible, and Claude Code profiles without editing each file manually.
This guide connects CC-Switch to Modelflare. Use Option A to import a provider directly from the Modelflare API Keys page. Use Option B to add a universal provider manually in CC-Switch.
1. Create an API key
Section titled “1. Create an API key”Sign in to Modelflare, open API Keys, and create a key whose non-default group can access the model you want to use.
2. Install CC-Switch
Section titled “2. Install CC-Switch”Download the current CC-Switch release from the official setup guide, then open the app once.
3. Choose a setup method
Section titled “3. Choose a setup method”Option A: import directly from Modelflare
Section titled “Option A: import directly from Modelflare”- Return to API Keys and find the key you want to use.
- Open that key’s action menu and click Import to CC Switch.
- Choose Claude Code or Codex, then confirm the primary model.
- Click Open CC Switch and confirm the import in CC-Switch.
- Enable the imported provider in CC-Switch. The import adds the provider but does not switch the active provider automatically; restart the target CLI when CC-Switch asks you to, especially for Codex.
Modelflare fills in the correct Base URL and API key automatically. Account balance queries are optional and disabled by default in the import dialog. If enabled, CC-Switch runs the supplied query every 30 minutes and shows the current Modelflare account’s wallet balance together with account-level total and used credit. It does not show the API key’s own quota limit. The import link contains the API key, so use it only on a trusted device and never share it. To configure both Claude Code and Codex, repeat the import once for each application. Re-import an older provider to add the optional credit query configuration.
Option B: add a universal provider manually
Section titled “Option B: add a universal provider manually”- Click the + button in the top-right corner of the CC-Switch window.
- Select Add Universal Provider.
- Under preset type, select 自定义网关 (Custom Gateway).
Enter the following values:
- API URL:
https://modelflare.dev - API Key: Paste the API key created in Modelflare
- Website URL:
https://modelflare.dev
Under Enabled Apps, select the apps that should use Modelflare, then click Add.