Set up apimodels in CC Switch with one click
CC Switch is an open-source desktop app that manages provider settings for Claude Code, Codex, Gemini CLI, OpenCode, OpenClaw and more in one place. Paste your apimodels API key, click the button for your tool, and the endpoint, key, default model and balance display are imported together — no forms to fill in. The MCP server is one more button.
What CC Switch is
- An open-source (MIT) desktop app for Windows, macOS and Linux.
- Each tool gets its own provider list. Click Enable and CC Switch rewrites that tool’s config file with the chosen endpoint and key; OpenCode and OpenClaw can hold several providers at once.
- It also manages MCP servers, prompts and Skills, and can show your balance on the provider card.
- It is a third-party project with no affiliation to apimodels. Source and downloads: github.com/farion1231/cc-switch
How the one-click import works
- Install CC Switch and open it at least once — only then does your system know what to do with ccswitch:// links.
- Get a key: in Console → API Keys click “Create a key for CC Switch” and the import buttons appear in the new-key dialog; if you already have a key, paste it into the generator below.
- Click the tool you want. Your browser asks whether to open CC Switch — choose Open.
- CC Switch shows a confirmation dialog listing the endpoint, the masked key, the model and the full balance script. Check it, then click Import. The switch at the bottom decides whether to switch to it right away (Claude Code, Codex, Gemini CLI) or add it to the tool’s config right away (OpenCode, OpenClaw).
- After switching to apimodels: Claude Code picks it up on the next message; Codex and Gemini CLI need a new terminal or a CLI restart.
Paste your key, get the import buttons
The key stays in this page’s memory and is only used to build the import links in your browser: it is never uploaded or saved, and it is gone when you refresh or close the page.
No key yet? Go to Console → API Keys and click “Create a key for CC Switch”; the same buttons appear in the dialog once the key is created.
One-click import into CC Switch
Requires CC Switch (v4.0.10 or later) installed on this computer. The link carries this key straight to CC Switch on your machine; it is not sent to apimodels or any other server.
Import as a provider (one button per app)
Your browser asks whether to open CC Switch first: choose Open, review the confirmation dialog in CC Switch, then click Import. Nothing happens? CC Switch is probably not installed yet, or the browser blocked the external app. Clicking the same button twice imports two copies.
What each button imports
| Tool | API format | Endpoint | Default model |
|---|---|---|---|
| Claude Code | Anthropic Messages | https://api.apimodels.app | claude-opus-5-5 |
| Codex | OpenAI Responses | https://api.apimodels.app/v1 | gpt-6-sol |
| Gemini CLI | Gemini native | https://api.apimodels.app | gemini-3-flash-preview |
| OpenCode | OpenAI Chat Completions | https://api.apimodels.app/v1 | claude-opus-5-5 |
| OpenClaw | OpenAI Chat Completions | https://api.apimodels.app/v1 | claude-opus-5-5 |
- All five buttons use each tool’s native API format, so the imports are direct connections — no CC Switch routing needed.
- Every link also carries the name apimodels, our homepage, an icon and the balance script.
- Codex also gets a short config.toml: review_model set to gpt-6-sol and reasoning effort medium, matching the recommended setup on our Codex page.
- You can change the default model on the CC Switch card at any time; for OpenCode and OpenClaw the import adds just this one model, so add others on the card if you need them.
Adding it by hand instead
In CC Switch, pick the tool in the sidebar, click + at the top right to add a provider, choose a custom configuration and fill in the values below, then click Enable (Add for OpenCode and OpenClaw). These are exactly the fields the one-click import writes into each tool’s config.
Claude CodeSetup without CC Switch
ANTHROPIC_BASE_URL https://api.apimodels.app
ANTHROPIC_AUTH_TOKEN sk_…your_apimodels_key…
ANTHROPIC_MODEL claude-opus-5-5CodexSetup without CC Switch
base_url https://api.apimodels.app/v1
wire_api responses
model gpt-6-sol
API Key sk_…your_apimodels_key…Gemini CLISetup without CC Switch
GOOGLE_GEMINI_BASE_URL https://api.apimodels.app
GEMINI_API_KEY sk_…your_apimodels_key…
GEMINI_MODEL gemini-3-flash-previewOpenCode
npm @ai-sdk/openai-compatible
baseURL https://api.apimodels.app/v1
apiKey sk_…your_apimodels_key…
models claude-opus-5-5OpenClawSetup without CC Switch
api openai-completions
baseUrl https://api.apimodels.app/v1
apiKey sk_…your_apimodels_key…
models claude-opus-5-5MCP: one button for every tool
“Add the apimodels MCP server to all apps” adds a remote MCP server named apimodels to CC Switch and writes it into the Claude Code, Codex, Gemini CLI and OpenCode config files as soon as you import. Agents in those tools can then call the image, video, chat and speech tools directly. CC Switch does not write MCP servers for OpenClaw, so it is not included.
{
"mcpServers": {
"apimodels": {
"type": "http",
"url": "https://api.apimodels.app/mcp",
"headers": { "Authorization": "Bearer sk_…your_apimodels_key…" }
}
}
}- If CC Switch already has an MCP server named apimodels, the import only ticks the extra tools and leaves its existing config alone. To replace it, delete the old one first, then import.
- The key is written in plain text, as a request header, into each tool’s MCP config file. If you would rather avoid that, use the browser sign-in flow described on the MCP page instead.
- The full tool list and how the hosted server differs from the local one: /docs/mcp
Balance on the provider card
Every provider link carries the usage script below, enabled on import: CC Switch calls GET https://api.apimodels.app/v1/balance with your key and shows the available balance in USD on the card. The endpoint is read-only and free. The request goes straight from your computer to api.apimodels.app and nowhere else.
({
request: {
url: "{{baseUrl}}".replace(/\/+$/, "").replace(/\/v1$/, "") + "/v1/balance",
method: "GET",
headers: { "Authorization": "Bearer {{apiKey}}" }
},
extractor: function (response) {
var data = response && response.data;
if (response && response.code === 200 && data && typeof data.balance === "number") {
return { remaining: data.balance, unit: "USD" };
}
return { isValid: false, invalidMessage: (response && response.msg) || "Balance query failed" };
}
})The link sets no auto-refresh interval; to refresh on a schedule, set one in the card’s usage-query settings.
Troubleshooting
| Clicking a button does nothing | Usually CC Switch is not installed yet, or was installed but never opened (on macOS, move it to Applications and open it once so ccswitch:// gets registered). The browser may also have blocked the external app — look for a notice in the address bar, allow it and click again. A web page cannot reliably tell whether CC Switch is installed, so the buttons always stay clickable. |
| API key is required / Endpoint is required | The link is incomplete — usually the key was cut off when pasting. Paste the full key and click again. |
| Two apimodels entries in the list | Clicking the same button twice imports two copies; CC Switch does not de-duplicate. Delete the extra one. |
| The card says it needs routing | It means the provider’s API format is not native to that tool, so CC Switch has to run in routing mode and convert requests locally. All five buttons on this page use each tool’s native format and import as direct connections, so this should not appear; if it does, check whether the API format was changed by hand. |
| No balance on the card | Older CC Switch versions ignore the usage script in the link (the icon also needs v4.0.10 or later): upgrade to v4.0.10+ and import again. You can also open the usage-query settings on the card and run the script test to see the error. |
| Requests fail with 401 after switching | The key was deleted in the console, or copied incompletely. Create a new key and import again. |
| Model not found | Edit the provider card in CC Switch and set a model id we serve (see the model list), or import again to get the defaults from this page. |
Installers: github.com/farion1231/cc-switch/releases
FAQ
What is CC Switch used for?
CC Switch is an open-source (MIT) desktop app for Windows, macOS and Linux that manages providers for AI coding tools such as Claude Code, Codex, Gemini CLI, OpenCode and OpenClaw. You keep several endpoints and keys in one place and switch between them with a click instead of editing each tool’s config files by hand; it also manages MCP servers, prompts and Skills and can show your balance on the provider card. It is a third-party project with no affiliation to apimodels.
How do I install CC Switch?
Download it from the Releases page of github.com/farion1231/cc-switch: the .msi installer (or the portable zip) on Windows, the .dmg on macOS (or brew install --cask cc-switch), and .deb, .rpm or AppImage on Linux. It needs Windows 10+, macOS 12+, or Linux with glibc 2.35+ and WebKitGTK 4.1. Open it once after installing: that registers ccswitch:// links, which the one-click import buttons rely on.
How do I set up a relay or aggregator API in CC Switch?
CC Switch stores a provider per tool: a name, an endpoint, an API key and a model. If the service offers an “Import to CC Switch” button, one click fills all of it. For apimodels the buttons are on the /docs/cc-switch page and in the new-key dialog under Console → API Keys; they set the endpoint per tool (https://api.apimodels.app for Claude Code and Gemini CLI, https://api.apimodels.app/v1 for Codex, OpenCode and OpenClaw), a default model, and a balance display.
How do I add a relay to CC Switch by hand, without a link?
Pick the tool in the CC Switch sidebar, click + at the top right to add a provider, choose a custom configuration, and fill in the endpoint, API key and model; save it and click Enable (Add for OpenCode and OpenClaw). The values for each tool are listed in the “Adding it by hand” section of /docs/cc-switch. For Codex, keep the wire API on Responses (wire_api = "responses").
How do I connect Claude Code to apimodels with CC Switch?
With CC Switch installed, paste your key on /docs/cc-switch and click Claude Code, or click the same button in the new-key dialog in the console. In the confirmation dialog, check the endpoint https://api.apimodels.app (no /v1) and the default model claude-opus-5-5, import it and switch to apimodels. Claude Code needs no restart: the next message uses the new provider.
What is the difference between routing and direct mode in CC Switch?
In direct mode the tool sends requests straight to the provider’s endpoint and CC Switch only writes the config. In routing mode requests first go through a forwarder CC Switch runs on your own computer, which can convert API formats (for example, let Claude Code use an OpenAI-format provider) and fail over between providers before passing them on. apimodels offers each tool its native format, so everything imported from /docs/cc-switch is direct and needs no routing; you only need routing when a card says so.
If I use a relay through CC Switch, can the relay see my code?
CC Switch itself only edits config files on your computer and does not handle your requests (in routing mode the forwarding also happens on your own machine). What goes out is the request from the tool, such as Claude Code: it sends the conversation, including any code it has read into the context, to the endpoint you configured, so that content passes through the relay (apimodels included) on its way to the model. Local files that were never read into the conversation are not uploaded. How each service handles data is set out in its privacy policy; ours is at apimodels.app/privacy.