Skip to content

Terry-Yuxiang/cc-gateway

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cc-gateway

Use Claude Code — the most powerful AI coding agent — with any LLM API key.

Gemini · OpenAI · Mistral · Groq · DeepSeek · and more

GitHub stars License: MIT

中文文档


Why cc-gateway?

Claude Code is the best AI coding agent available. But you don't need an Anthropic subscription to use it.

With cc-gateway, you can point Claude Code at any LLM provider — Gemini, GPT-4o, Groq, DeepSeek, Mistral — using your own API keys. Zero changes to your workflow. Just type claude-g instead of claude.

claude-g "refactor this module"   # runs Claude Code, powered by Gemini
claude-w "write unit tests"       # same agent, powered by GPT-4o
claude                            # your normal Anthropic Claude

Everything works — file editing, bash execution, multi-step agents, all Claude Code tools.


How it works

claude-g [args...]
    │
    ▼
litellm proxy (auto-started locally, ~3s on first run)
    │
    ▼
Gemini / OpenAI / Groq / DeepSeek / ...

cc-gateway generates thin shell wrappers that inject ANTHROPIC_BASE_URL and ANTHROPIC_API_KEY, then exec the real claude binary. A local litellm proxy handles protocol translation so Claude Code's API calls reach any provider transparently.


Quickstart

git clone https://github.com/Terry-Yuxiang/cc-gateway
cd cc-gateway
sh install.sh

install.sh also installs litellm automatically if not found.

Then add a provider:

cc-gateway add g
Provider type [anthropic-compat]: gemini
model (e.g. gemini/gemini-2.0-flash): gemini/gemini-flash-latest
api_key: <your-gemini-api-key>
cc-gateway apply   # generate the wrapper script
claude-g           # use Claude Code powered by Gemini

That's it. litellm starts automatically in the background on first use.


Supported providers

Command Provider Free tier
claude-g Google Gemini ✅ Yes
claude-w OpenAI
claude-d DeepSeek ✅ Yes (very cheap)
claude-r Groq ✅ Yes
claude-m Mistral ✅ Yes
claude-b AWS Bedrock
claude-v Google Vertex AI
claude-z Azure OpenAI
claude-c Cohere ✅ Yes
claude-t Together AI ✅ Yes

Any name works — you choose the suffix when running cc-gateway add <name>.


Commands

cc-gateway add <name>     Add a provider
cc-gateway apply          Generate wrapper scripts from config
cc-gateway list           List configured providers
cc-gateway remove <name>  Remove a provider and its wrapper
cc-gateway edit           Open config in $EDITOR
cc-gateway stop [name]    Stop litellm proxy
cc-gateway status         Show proxy status

Config

~/.cc-gateway/config.yaml — edit directly or via cc-gateway edit.

providers:
  g:
    type: gemini
    model: gemini/gemini-flash-latest
    api_key: <your-key>

  w:
    type: openai
    model: openai/gpt-4o
    api_key: <your-key>

  d:
    type: deepseek
    model: deepseek/deepseek-chat
    api_key: <your-key>

  # Anthropic-compatible endpoints work too (no proxy needed)
  custom:
    base_url: https://your-proxy.com
    api_key: <your-key>

Requirements

  • Claude Code installed and in PATH
  • Python 3.10+ (for litellm — auto-installed by install.sh)
  • Or: uv (brew install uv) — then litellm runs via uvx with zero install

Star History

Star History Chart


If cc-gateway saves you money or unlocks Claude Code for you, consider giving it a ⭐

About

Claude Code provider switcher — route claude-g to Gemini, claude-w to OpenAI, etc.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages