Run GPT Inside Claude Code: Inside cc-switch's Local Protocol Router (137k Stars)

cc-switch is a cross-platform Tauri app that manages 10 AI coding tools via 90+ provider presets and a local router on 127.0.0.1:15721, converting between Anthropic, OpenAI, and Gemini API formats so models like GPT can run inside Claude Code, with failover, usage dashboards, and team sync via WebDAV or S3.

Architecture Digest
Architecture Digest
Architecture Digest
Run GPT Inside Claude Code: Inside cc-switch's Local Protocol Router (137k Stars)

Overview

cc-switch (GitHub: farion1231/cc-switch) is a cross-platform desktop application built with Tauri 2 (Rust) that centralizes configuration for 10 AI coding assistants: Claude Code, Claude Desktop, Codex, Gemini CLI, Grok Build, OpenCode, OpenClaw, Hermes, Pi, and MiniMax Code. As of the article's writing, the project has 137,199 stars and 9,338 forks, is MIT-licensed, and has reached v3.20.4 with active maintenance.

The tool solves the friction of manually editing different configuration files for each tool — settings.json for Claude Code, config.toml for Codex, .env for Gemini CLI — by providing a single GUI where users select a provider preset, paste an API key, and click to switch. The app handles file reading, writing, format differences, and atomic updates automatically.

Three Core Capabilities

Unified control for 10 tools : A feature matrix in the README documents which tools support local routing, MCP/Skills sync, and where prompts are written.

90+ provider presets : Pre-filled request URLs for DeepSeek, Zhipu GLM, Kimi, MiniMax, Qwen (Tongyi), AWS Bedrock, NVIDIA NIM, and others; only the API key is required.

Local protocol router : The architectural highlight — a local process that translates between API formats on the fly.

Local Router: How GPT Runs Inside Claude Code

Problem

Each coding tool expects its native API dialect: Claude Code speaks Anthropic Messages, Codex speaks OpenAI Chat Completions, Gemini CLI speaks generateContent. Previously, using a non-native model (e.g., GPT in Claude Code) required a third-party proxy server — requests left the machine.

Solution

cc-switch starts a local router process listening on 127.0.0.1:15721. It intercepts outgoing requests from the tool, converts the payload among four formats — Anthropic Messages, OpenAI Chat Completions, OpenAI Responses, and Gemini generateContent — and forwards the translated request to the target provider. The entire translation happens on-device; no traffic leaves the machine for the conversion step.

Local router architecture diagram
Local router architecture diagram

Router Subsystems

Failover : Configure an ordered provider queue; on failure the router automatically tries the next provider, with a circuit breaker and health monitoring to prevent a flaky provider from stalling the workflow.

Rectifier : Automatically repairs upstream-incompatible requests — e.g., strips unsupported thinking signatures or falls back when image input is not accepted — eliminating manual debugging.

Usage Dashboard : Scans local session logs of each tool, aggregates request counts, tokens, cache hit rates, and cost per provider and model. Subscription quotas (Claude, ChatGPT, Gemini) and account balances appear on provider cards and in the system tray. Custom per-model pricing can be entered or imported from models.dev.

Quick Start

Download the installer from ccswitch.io or GitHub Releases (Windows 10+, macOS 12+, Ubuntu 22.04+ / glibc 2.35+).

Open the app, go to the Tools tab, click Add Provider: choose a preset, enter the API key.

Click the provider card to switch; the corresponding config file is written automatically. Return to the terminal and use the tool normally.

Additional details:

The app stays in the system tray; right-click to switch providers without opening the main window.

Data is stored in ~/.cc-switch (SQLite, atomic writes, automatic backup every 24 hours, last 10 backups retained for rollback).

Enterprise Team Deployment

Unified onboarding : New hires install cc-switch, import a team configuration template, and skip half a day of environment setup.

Distribution : Configurations export/import; ccswitch:// deep links enable one-click import from an internal wiki. Cross-device sync via WebDAV (Jianguoyun, Nextcloud, Synology NAS) or S3-compatible storage (AWS S3, Cloudflare R2, Alibaba Cloud OSS, Tencent Cloud COS).

Cost tracking : The usage dashboard aggregates spend by provider and model, sufficient for team AI usage reports. The About page shows CLI tool versions to prevent version drift.

Standards as code : Prompt libraries are managed per tool; enabling a prompt writes it to CLAUDE.md, AGENTS.md, or GEMINI.md. Skills can be installed from a GitHub repo or ZIP and synced in bulk to all tools.

Team deployment UI
Team deployment UI

Real-World Scenarios

Developers using Claude Code + Codex + Gemini CLI simultaneously — configure once, works everywhere.

Frequent switchers between official and domestic providers — presets + tray switching, no more hand-editing JSON.

Cost-conscious teams — dashboard breaks down spend by model.

Users who want GPT/DeepSeek inside Claude Code — local router handles the format translation.

Pros, Cons, and Pitfalls

Strengths

Single app manages 10 tools, 90+ presets, local cross-format routing, MIT open source, three-platform support, exceptionally complete documentation (multi-language user manual).

Limitations

README sponsorship section is crowded with third-party proxy ads — users must vet providers themselves.

Using the local router with third-party proxies sits in a compliance gray area; the official OAuth docs state "using subscriptions outside the official client may violate provider terms, risk at your own discretion."

Third-party proxies see your API keys, expanding the leakage surface.

Feature richness introduces cognitive load; RHEL/Rocky/Alma Linux are not officially supported.

Avoidance Tips

When using third-party proxies, create dedicated sub-keys with spending caps; never hand over a primary key.

For company code and sensitive data, prefer official APIs or self-hosted gateways; don't run production code through unverified proxies.

Verify the sole official site ccswitch.io (README explicitly warns "Only official website") to avoid phishing clones.

Conclusion

As AI coding assistants proliferate, configuration management — the "grunt work" — finally has a serious solution. cc-switch's value goes beyond time savings: its local router turns protocol translation into on-machine infrastructure, an architectural insight more valuable than the "switcher" label suggests. Compliance remains the user's responsibility: the tool is neutral; who holds your keys and which network path your code travels, decide before you install.

Open source:

https://github.com/farion1231/cc-switch
Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

RustTauriconfiguration managementopen-sourcelocal routingprotocol conversionAI coding toolscc-switch
Architecture Digest
Written by

Architecture Digest

Focusing on Java backend development, covering application architecture from top-tier internet companies (high availability, high performance, high stability), big data, machine learning, Java architecture, and other popular fields.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.