CCR - Claude Code Router

A seamless proxy enabling Claude Code to work with OpenRouter's diverse model selection

Built entirely with Claude Code - Showcasing AI-powered development workflow

What is CCR?

This Cloudflare Worker acts as a translation layer between Anthropic's Claude API format and OpenAI-compatible APIs, specifically OpenRouter. It allows Claude Code to access a wide range of models through OpenRouter while maintaining the familiar Claude API interface.

πŸ”„ How CCR Works

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   Claude Code     │────▢│       CCR         │────▢│   OpenRouter      β”‚
β”‚                   β”‚     β”‚                   β”‚     β”‚                   β”‚
β”‚ ANTHROPIC_BASE_   β”‚     β”‚ API Format        β”‚     β”‚ Multiple Models:  β”‚
β”‚ URL="ccr.duyet.   β”‚     β”‚ Translation       β”‚     β”‚                   β”‚
β”‚ net"              β”‚     β”‚                   β”‚     β”‚ β€’ Anthropic       β”‚
β”‚                   β”‚     β”‚ Model Pass-       β”‚     β”‚ β€’ OpenAI          β”‚
β”‚ ANTHROPIC_API_    β”‚     β”‚ through or        β”‚     β”‚ β€’ Moonshot        β”‚
β”‚ KEY="your-open    β”‚     β”‚ Mapping           β”‚     β”‚ β€’ Google          β”‚
β”‚ router-api-key"   β”‚     β”‚                   β”‚     β”‚ β€’ Meta            β”‚
β”‚                   β”‚     β”‚                   β”‚     β”‚ β€’ DeepSeek        β”‚
β”‚ ANTHROPIC_MODEL=  β”‚     β”‚                   β”‚     β”‚ β€’ & More...       β”‚
β”‚ "kimi-k2"         β”‚     β”‚                   β”‚     β”‚                   β”‚
β”‚                   │◀────│                   │◀────│                   β”‚
β”‚ Anthropic Format  β”‚     β”‚                   β”‚     β”‚                   β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜     β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜     β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸ”„ API Translation

Seamlessly converts between Anthropic and OpenAI API formats

🌐 OpenRouter Integration

Access to multiple AI models through OpenRouter's unified API

⚑ Cloudflare Workers

Fast, globally distributed proxy with minimal latency

πŸ› οΈ Quick Setup

1

Set up Claude Code

Claude Code Setup Guide

npm install -g @anthropic-ai/claude-code
2

Get OpenRouter API Key

Sign up at openrouter.ai and get your API key

3

Using Claude Code with CCR

Basic Usage

Use either ANTHROPIC_API_KEY or ANTHROPIC_AUTH_TOKEN (both work the same way)

ANTHROPIC_BASE_URL="https://ccr.duyet.net" \
ANTHROPIC_API_KEY="your-openrouter-api-key" \
claude

ANTHROPIC_BASE_URL="https://ccr.duyet.net" \
ANTHROPIC_AUTH_TOKEN="your-openrouter-api-key" \
claude

With Custom Models

Use either ANTHROPIC_API_KEY or ANTHROPIC_AUTH_TOKEN with custom models

ANTHROPIC_BASE_URL="https://ccr.duyet.net" \
ANTHROPIC_API_KEY="your-openrouter-api-key" \
ANTHROPIC_MODEL="moonshotai/kimi-k2:free" \
claude

ANTHROPIC_BASE_URL="https://ccr.duyet.net" \
ANTHROPIC_AUTH_TOKEN="your-openrouter-api-key" \
ANTHROPIC_MODEL="moonshotai/kimi-k2:free" \
claude

⚠️ Note: This is a proxy service. Your API key will be used to make requests to OpenRouter. Make sure to use a secure connection and keep your API key private.

πŸš€ Quick Actions

duyet.net β€’ Terms β€’ Privacy

Built entirely with Claude Code - Showcasing AI-powered development workflow