### Install CLI Tools with npm Source: https://ccswitch.io/en/docs?section=getting-started&item=settings Use these npm commands to install or update various CLI tools. Copy the command to your clipboard for easy execution. ```bash npm i -g @anthropic-ai/claude-code@latest npm i -g @openai/codex@latest npm i -g @google/gemini-cli@latest npm i -g opencode@latest npm i -g openclaw@latest ``` -------------------------------- ### Gemini Configuration Example Source: https://ccswitch.io/en/docs?section=providers&item=add Configuration for Gemini models, requiring an API key and optionally a custom base URL and model. ```json { "env": { "GEMINI_API_KEY": "your-api-key", "GOOGLE_GEMINI_BASE_URL": "https://api.example.com" } } ``` -------------------------------- ### Claude Configuration Example Source: https://ccswitch.io/en/docs?section=providers&item=add Configuration for Claude models, requiring an API key and optionally a custom base URL. ```json { "env": { "ANTHROPIC_API_KEY": "your-api-key", "ANTHROPIC_BASE_URL": "https://api.example.com" } } ``` -------------------------------- ### Kimi Model Mapping Setup Source: https://ccswitch.io/en/docs?section=providers&item=claude-desktop Recommended configuration for Kimi provider in Model Mapping Mode. Maps 'Sonnet' role to 'Kimi K2' with 1M context support matching the provider's capability. ```text Model role| Menu display name| Requested model| 1M ---|---|---|--- Sonnet| Kimi K2| `kimi-k2`| Match provider capability ``` -------------------------------- ### Codex config.toml Example Source: https://ccswitch.io/en/docs?section=providers&item=add Basic and custom provider configuration for Codex, including model selection and API endpoint. ```toml # Basic configuration model_provider = "custom" model = "gpt-5.2" model_reasoning_effort = "high" disable_response_storage = true # Custom provider configuration [model_providers.custom] name = "custom" base_url = "https://api.example.com/v1" wire_api = "responses" requires_openai_auth = true ``` -------------------------------- ### Codex auth.json Example Source: https://ccswitch.io/en/docs?section=providers&item=add Stores the API key for Codex authentication. ```json { "OPENAI_API_KEY": "your-api-key" } ``` -------------------------------- ### DeepSeek Model Mapping Setup Source: https://ccswitch.io/en/docs?section=providers&item=claude-desktop Recommended configuration for DeepSeek provider in Model Mapping Mode. Maps 'Sonnet' role to 'DeepSeek V4 Pro' with 1M context support matching the provider's capability. ```text Model role| Menu display name| Requested model| 1M ---|---|---|--- Sonnet| DeepSeek V4 Pro| `deepseek-v4-pro`| Match provider capability ``` -------------------------------- ### Example: Import MCP Server Deep Link Source: https://ccswitch.io/en/docs?section=faq&item=deeplink This deep link imports an MCP server configuration into CC Switch. The config parameter is a Base64 encoded JSON string. ```url ccswitch://v1/import?resource=mcp&name=mcp-fetch&apps=claude,codex,gemini&config=%7B%22command%22%3A%22uvx%22%2C%22args%22%3A%5B%22mcp-server-fetch%22%5D%7D ``` -------------------------------- ### Example: Import Claude Provider Deep Link Source: https://ccswitch.io/en/docs?section=faq&item=deeplink This deep link is used to import a Claude provider into CC Switch. Ensure the API key and endpoint are correctly formatted. ```url ccswitch://v1/import?resource=provider&app=claude&name=Test%20Provider&apiKey=sk-xxx&endpoint=https%3A%2F%2Fapi.example.com ``` -------------------------------- ### Windows Claude Desktop Configuration Paths Source: https://ccswitch.io/en/docs?section=providers&item=claude-desktop These are the default locations for Claude Desktop configuration files on Windows. CC Switch maintains these files automatically. ```text %LOCALAPPDATA%\Claude\claude_desktop_config.json %LOCALAPPDATA%\Claude-3p\claude_desktop_config.json %LOCALAPPDATA%\Claude-3p\configLibrary\_meta.json %LOCALAPPDATA%\Claude-3p\configLibrary\00000000-0000-4000-8000-000000157210.json ``` -------------------------------- ### OpenClaw Configuration File Structure Source: https://ccswitch.io/en/docs?section=faq&item=config-files This is the main configuration file for OpenClaw, using JSON5 format. It defines providers, environment variables, agent defaults, and other settings. ```json5 { // Model provider configuration models: { mode: "merge", providers: { "custom-provider": { baseUrl: "https://api.example.com/v1", apiKey: "your-api-key", api: "openai-completions", models: [{ id: "model-id", name: "Model Name" }] } } }, // Environment variables env: { ANTHROPIC_API_KEY: "sk-..." }, // Agent default model configuration agents: { defaults: { model: { primary: "provider/model" } } }, // Tool configuration tools: {}, // Workspace file configuration workspace: {} } ``` -------------------------------- ### Register CC Switch Protocol on macOS Source: https://ccswitch.io/en/docs?section=faq&item=deeplink Run this command in the terminal to register the CC Switch protocol if it's not working correctly. Reinstalling the app is an alternative. ```bash /usr/bin/open -a "CC Switch" --args --register-protocol ``` -------------------------------- ### macOS Claude Desktop Configuration Paths Source: https://ccswitch.io/en/docs?section=providers&item=claude-desktop These are the default locations for Claude Desktop configuration files on macOS. CC Switch maintains these files automatically. ```text ~/Library/Application Support/Claude/claude_desktop_config.json ~/Library/Application Support/Claude-3p/claude_desktop_config.json ~/Library/Application Support/Claude-3p/configLibrary/_meta.json ~/Library/Application Support/Claude-3p/configLibrary/00000000-0000-4000-8000-000000157210.json ``` -------------------------------- ### Generic Provider Template Source: https://ccswitch.io/en/docs?section=providers&item=usage-query Use this template for most providers with standard API formats. It includes request details and an extractor function to parse the response. ```javascript ({ request: { url: "{{baseUrl}}/user/balance", method: "GET", headers: { "Authorization": "Bearer {{apiKey}}", "User-Agent": "cc-switch/1.0" } }, extractor: function(response) { return { isValid: response.is_active || true, remaining: response.balance, unit: "USD" }; } }) ``` -------------------------------- ### Model Mapping Mode Gateway URL Source: https://ccswitch.io/en/docs?section=providers&item=claude-desktop This is the local gateway URL Claude Desktop connects to when using Model Mapping Mode. CC Switch handles model mapping and format conversion. ```text http://127.0.0.1:15721/claude-desktop ``` -------------------------------- ### New API Template Source: https://ccswitch.io/en/docs?section=providers&item=usage-query This template is designed for New API-type proxy services. It specifies request headers and an extractor function to handle specific response structures. ```javascript ({ request: { url: "{{baseUrl}}/api/user/self", method: "GET", headers: { "Content-Type": "application/json", "Authorization": "Bearer {{accessToken}}", "New-Api-User": "{{userId}}" }, }, extractor: function (response) { if (response.success && response.data) { return { planName: response.data.group || "Default Plan", remaining: response.data.quota / 500000, used: response.data.used_quota / 500000, total: (response.data.quota + response.data.used_quota) / 500000, unit: "USD", }; } return { isValid: false, invalidMessage: response.message || "Query failed" }; }, }) ``` -------------------------------- ### Direct Mode Configuration Source: https://ccswitch.io/en/docs?section=providers&item=claude-desktop Use this JSON configuration when the provider exposes the native Anthropic Messages API and requires direct connection. Ensure model IDs are compatible and no format conversion is needed. ```json { "inferenceProvider": "gateway", "inferenceGatewayBaseUrl": "https://api.example.com", "inferenceGatewayAuthScheme": "bearer", "inferenceGatewayApiKey": "your API key" } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.