mirror of
https://github.com/musistudio/claude-code-router.git
synced 2026-04-28 02:09:27 +00:00
2.7 KiB
2.7 KiB
| title |
|---|
| Server Introduction |
Server Introduction
Claude Code Router Server is a core service component responsible for routing Claude Code API requests to different LLM providers. It provides a complete HTTP API with support for:
- API Request Routing: Convert Anthropic-format requests to various provider API formats
- Authentication & Authorization: Support API Key authentication
- Configuration Management: Dynamic configuration of providers, routing rules, and transformers
- Web UI: Built-in management interface
- Logging System: Complete request logging
Architecture Overview
┌─────────────┐ ┌──────────────────┐ ┌──────────────┐
│ Claude Code │────▶│ CCR Server │────▶│ LLM Provider │
│ Client │ │ (Router + │ │ (OpenAI/ │
└─────────────┘ │ Transformer) │ │ Gemini/etc)│
└──────────────────┘ └──────────────┘
│
├─ Web UI
├─ Config API
└─ Logs API
Core Features
1. Request Routing
- Token-count-based intelligent routing
- Project-level routing configuration
- Custom routing functions
- Scenario-based routing (background, think, longContext, etc.)
2. Request Transformation
- Supports API format conversion for multiple LLM providers
- Built-in transformers: Anthropic, DeepSeek, Gemini, OpenRouter, Groq, etc.
- Extensible transformer system
3. Agent System
- Plugin-based Agent architecture
- Built-in image processing Agent
- Custom Agent support
4. Configuration Management
- JSON5 format configuration file
- Environment variable interpolation
- Hot configuration reload (requires service restart)
Use Cases
Scenario 1: Personal Local Service
Run the service locally for personal Claude Code use:
ccr start
Scenario 2: Team Shared Service
Deploy using Docker to provide shared service for team members:
docker run -d -p 3456:3456 musistudio/claude-code-router
Scenario 3: Secondary Development
Build custom applications based on exposed APIs:
GET /api/config
POST /v1/messages
GET /api/logs
Next Steps
- Docker Deployment Guide - Learn how to deploy the service
- API Reference - View complete API documentation
- Configuration Guide - Understand server configuration options