MIT License Version Platform Bash

Multi-Provider Router for Claude Code

Switch between Anthropic, GitHub Copilot, or Ollama with 3 characters. Use your Copilot subscription with Claude Code CLI.

3 providers 25+ models 30s install

How It Works

┌─────────────────────────────────────────────────┐
│           Claude Code CLI                       │
│         (Anthropic's CLI tool)                  │
└─────────────────┬───────────────────────────────┘
                  │
        ┌─────────▼──────────┐
        │  cc-copilot-bridge │  ◄─── This Tool
        └─────────┬──────────┘
                  │
    ┌─────────────┼─────────────┐
    │             │             │
┌───▼────┐  ┌─────▼──────┐  ┌───▼────┐
│ Direct │  │  Copilot   │  │ Ollama │
│  API   │  │   Bridge   │  │ Local  │
└────────┘  └────────────┘  └────────┘
Anthropic    GitHub Copilot   Self-hosted
Pay-per-token Premium requests Free (offline)
          

Three Providers, One Interface

🎯

Anthropic Direct

ccd

Official Anthropic API. Maximum quality for production code review, security audits, and critical decisions.

💰 Pay-per-token 🔒 Official API
🚀

GitHub Copilot

ccc

Use your Copilot subscription with Claude Code. Access Claude, GPT, and Gemini models via copilot-api proxy. Start the proxy first: copilot-api start or scripts/launch-unified-fork.sh.

Setup: Run copilot-api start in Terminal 1, then use ccc in Terminal 2

📊 Premium requests quota ⚠️ ToS risk
🏠

Ollama Local

cco

100% offline inference. Perfect for proprietary code, air-gapped environments, and privacy-first workflows.

🆓 Free (local compute) 🔐 100% private

Features

Instant Switching

Switch providers with 3 characters. No config changes, no restarts, no environment juggling.

🎨

25+ Models

Access Claude, GPT-4.1, GPT-5, Gemini, and local models (Devstral 68% SWE-bench, Qwen3 69.6%, Granite4) through a unified interface.

🔧

MCP Profiles

Auto-generated compatibility profiles exclude problematic MCP servers for strict models like GPT-4.1.

🆔

Model Identity

System prompt injection ensures GPT and Gemini correctly identify themselves when running through Claude Code.

🩺

Health Checks

Fail-fast validation. Get clear error messages when copilot-api or Ollama isn't running.

📝

Session Logging

Full audit trail in ~/.claude/claude-switch.log. Track provider, model, duration, and exit status.

GitHub Copilot Quotas & Limits

cc-copilot-bridge is free and open-source (MIT). This section explains GitHub Copilot's quota system, which applies when using the ccc provider.

Plan Monthly Cost Premium Requests Notes
Copilot Free $0 50 Limited model access
Copilot Pro $10 300 Access to most models
Copilot Pro+ $39 1,500 Full model access
Copilot Business $19/user 300 Organization features
Copilot Enterprise $39/user 1,000 Custom models, knowledge bases

Model Multipliers

Different models consume different amounts of premium requests:

Model Multiplier Effective Quota (Pro, 300) Effective Quota (Pro+, 1500)
GPT-4.1, GPT-4o, GPT-5-mini 0x Unlimited Unlimited
Claude Haiku 4.5 0.33x ~900 interactions ~4,500 interactions
Claude Sonnet 4.5 1x 300 interactions 1,500 interactions
Gemini 2.5 Pro 1x 300 interactions 1,500 interactions
Claude Opus 4.5 3x ~100 interactions ~500 interactions
💡 Key insight: GPT-4.1 and GPT-4o are free (0x multiplier) on paid plans. Use them for routine tasks to preserve premium requests for Claude/Opus.

See It In Action

Claude Sonnet 4.5 via Copilot

Claude Sonnet 4.5 (default) via GitHub Copilot

Claude Opus 4.5 via Copilot

Claude Opus 4.5 (premium, 3x multiplier)

GPT-4.1 via Copilot

GPT-4.1 (free, 0x multiplier)

Ollama Local

Ollama Local (100% offline)

claude-switch help

Full command reference

Quick Start

Get started in 30 seconds:

Homebrew (Recommended)

bash
brew tap FlorianBruniaux/tap
brew install cc-copilot-bridge
eval "$(claude-switch --shell-config)"

Script Install (Alternative)

bash
curl -fsSL https://raw.githubusercontent.com/FlorianBruniaux/cc-copilot-bridge/main/install.sh | bash
source ~/.zshrc  # or ~/.bashrc

Also available: Debian/Ubuntu (.deb), RHEL/Fedora (.rpm) — See all install options →

Setup Aliases

bash
# Add to ~/.bash_aliases or ~/.zshrc
alias ccd='claude-switch direct'      # Anthropic API (paid)
alias ccc='claude-switch copilot'     # GitHub Copilot (quota)
alias cco='claude-switch ollama'      # Ollama Local (offline)
alias ccs='claude-switch status'      # Check all providers

# Model shortcuts
alias ccc-gpt='COPILOT_MODEL=gpt-4.1 claude-switch copilot'
alias ccc-opus='COPILOT_MODEL=claude-opus-4.5 claude-switch copilot'

First Usage

bash
# Terminal 1: Start copilot-api (keep running)
copilot-api start
# or start the unified fork
scripts/launch-unified-fork.sh

# Terminal 2: Use Copilot (uses your subscription)
ccc

# Switch models on-the-fly
COPILOT_MODEL=gpt-4.1 ccc         # GPT-4.1 (free!)
COPILOT_MODEL=claude-opus-4.5 ccc # Opus (3x quota)

# Check provider status
ccs

Note: copilot-api (or the unified fork via scripts/launch-unified-fork.sh) must be running for Copilot mode. Direct (ccd) and Ollama (cco) don't need it.

Full installation guide →

⚠️ Risk Disclosure

Terms of Service Considerations

This project uses copilot-api, a community tool that reverse-engineers GitHub Copilot's API. Start the proxy first: copilot-api start or scripts/launch-unified-fork.sh.

Important Disclaimers

  • Not officially supported: copilot-api is not endorsed by GitHub, Microsoft, Anthropic, or any AI provider
  • ToS risk: Using third-party proxies to access Copilot may violate GitHub Copilot Terms of Service
  • Account suspension: GitHub reserves the right to suspend accounts for ToS violations without prior notice
  • API changes: This tool may stop working at any time if providers change their APIs
  • No guarantees: The authors provide no warranty and accept no liability for account suspension

Recommendations

Use Case Recommended Provider
Production code Anthropic Direct (ccd) - Official API, no ToS risk
Sensitive/proprietary code Ollama Local (cco) - 100% offline, no cloud
Daily development Copilot (ccc) - Understand the risks first
Risk-averse users Avoid copilot-api entirely

FAQ

Is this legal to use?

Using copilot-api (the Copilot provider) may violate GitHub's Terms of Service. The tool itself is MIT licensed, but how you use it matters. For risk-free usage, use the Anthropic Direct (ccd) or Ollama (cco) providers.

How much does it cost?

Depends on the provider: Copilot uses your existing subscription quota. Anthropic Direct is pay-per-token ($0.015-$75/1M tokens). Ollama is free (local compute).

Why is GPT-4.1 free on Copilot?

GitHub assigns a 0x multiplier to GPT-4.1, GPT-4o, and GPT-5-mini on paid plans. This means they don't consume your premium request quota. Use them for routine tasks to save quota for Claude/Opus.

Does Ollama work offline?

Yes, 100%. Ollama runs entirely on your machine with no internet required. Perfect for proprietary code, air-gapped environments, and privacy-first workflows.

What's copilot-api?

copilot-api is a community project that reverse-engineers GitHub Copilot's API. It's the bridge that makes the Copilot provider possible. cc-copilot-bridge is a wrapper that makes it easy to use with Claude Code CLI. Start the proxy first: copilot-api start or scripts/launch-unified-fork.sh.

How do I start copilot-api?

Terminal 1: Keep this running

copilot-api start

Terminal 2: Use Copilot mode

ccc  # or ccc-opus, ccc-gpt, etc.

Alternative: For Codex models (gpt-5.2-codex), use the unified fork:

ccunified  # or ~/path/to/cc-copilot-bridge/scripts/launch-unified-fork.sh

💡 Tip: Check if copilot-api is running: ccs (shows status of all providers)

Which models are available?

Anthropic: Claude Opus, Sonnet, Haiku (4.5).

Copilot: Claude family, GPT-4.1/5, Gemini 2.5 Pro.

Ollama (Local): Devstral-small-2 (68% SWE-bench, best agentic coding), Granite4 (62%, long context), Qwen3-coder (69.6%, needs config), and any model you install.

Why Devstral over Qwen3-coder for Ollama?

Qwen3-coder has 1.6% higher SWE-bench (69.6% vs 68%), but Devstral is more reliable in practice:

  • Architecture: Devstral = native agentic design vs Qwen3 = post-training bolt-on
  • Practice: Devstral = "best agentic" confirmed vs Qwen3 = "needs template work"
  • Precedent: High benchmarks ≠ reliability (Llama3.1:8b = 68% HumanEval but 15% SWE-bench)

SWE-bench measures real GitHub issue resolution with tool calling, not just code completion.