Claude-Code-Router

Universal Claude API Proxy for Multiple Providers

🚀 Supported AI Providers

Click any provider above to learn more, or scroll to see all options

Shared Ready

DSDeepSeek

High-performance reasoning models with excellent cost efficiency. Perfect for complex coding tasks.

DEEPSEEK_BASE_URL=https://api.deepseek.com
Deploy Required

AIOpenAI

Industry-leading GPT models including GPT-4o and GPT-4o-mini for diverse AI applications.

OPENAI_BASE_URL=https://api.openai.com/v1
Deploy Required

KMKimi (Moonshot AI)

Advanced Chinese AI models with strong multilingual capabilities and long context support.

KIMI_BASE_URL=https://api.moonshot.cn/v1
Deploy Required

OROpenRouter

Access to multiple AI models through a single API, including Claude, GPT, and open-source models.

OPENROUTER_BASE_URL=https://openrouter.ai/api/v1
🎁 $100 Free Credits

ARAnyRouter

Model proxy service - Provides access to Claude and other models. Click to register and get $100 free credits!

ANTHROPIC_BASE_URL=https://cc.xiaohui.cool
Deploy Required

SFSiliconFlow

Chinese AI infrastructure platform providing access to various domestic and international models.

SILICONFLOW_BASE_URL=https://api.siliconflow.cn/v1

Quick Setup Guide

âš ī¸ Important: Provider Access Notice

🌐 Shared Instance (cc.xiaohui.cool):

Supports OpenRouter and AnyRouter by default. You can use them immediately with your API key.

🚀 Self-Deployed Instance:

Required for DeepSeek, OpenAI, Kimi, SiliconFlow and other providers. You must deploy your own instance to configure these providers.

1

Install Claude Code

Get the official Claude Code CLI tool from Anthropic.

npm install -g @anthropic-ai/claude-code
Or download from claude.ai/code
2

Choose Your Provider & Get API Key

Sign up with any supported provider and obtain your API key:

3

Configure Environment

Add these to your shell config (~/.bashrc or ~/.zshrc):

For OpenRouter:
export ANTHROPIC_BASE_URL="https://cc.xiaohui.cool"
export ANTHROPIC_API_KEY="your-openrouter-api-key"
For AnyRouter:
export ANTHROPIC_BASE_URL="https://anyrouter.top"
export ANTHROPIC_API_KEY="your-anyrouter-api-key"

Then reload your shell:

source ~/.bashrc # or source ~/.zshrc

🚀 Ready to Code!

Run claude in your terminal and enjoy Claude with your preferred AI provider

🔒 Deploy Your Own Instance

For maximum data security and to access all AI providers beyond OpenRouter

🤔 Why Self-Deploy?

🌐 Access All Providers

Our shared instance only supports OpenRouter. Self-deploy to use DeepSeek, OpenAI, Kimi, SiliconFlow, and more.

🔐 Data Security

Your API keys and requests never pass through third-party servers when you control the infrastructure.

âš™ī¸ Full Control

Configure any provider, custom model mappings, and deployment settings according to your needs.

📊 Zero Logs

No request logging or data retention when you deploy your own instance to Cloudflare Workers.

1. Clone & Install

git clone https://github.com/istarwyh/claude-code-router
cd claude-code-router
npm install

2. Configure Provider (Secure Method)

Recommended: Use Wrangler secrets for secure configuration:

# For DeepSeek
wrangler secret put OPENAI_COMPATIBLE_BASE_URL
# Enter: https://api.deepseek.com

# For OpenAI
wrangler secret put OPENAI_BASE_URL
# Enter: https://api.openai.com/v1

# For Kimi (Moonshot AI)
# Enter: https://api.moonshot.cn/v1

# For SiliconFlow
# Enter: https://api.siliconflow.cn/v1

# Or for OpenRouter
# Enter: https://openrouter.ai/api/v1
Using secrets ensures your API endpoints are encrypted and not visible in your code repository.

3. Deploy to Cloudflare

npm run deploy
Your custom domain will be provided after deployment. Update your ANTHROPIC_BASE_URL accordingly.