This commit is contained in:
jinhui.li
2025-06-10 12:55:25 +08:00
parent 089654871c
commit 2cc91ada5c
19 changed files with 521 additions and 1150 deletions

View File

@@ -2,44 +2,26 @@
> This is a repository for testing routing Claude Code requests to different models.
![demo.png](https://github.com/musistudio/claude-code-router/blob/main/screenshoots/demo.png)
## Implemented
- [x] Support writing custom plugins for rewriting prompts.
- [x] Support writing custom plugins for implementing routers.
## Usage
0. Install Claude Code
1. Install Claude Code
```shell
npm install -g @anthropic-ai/claude-code
```
1. Clone this repo and install dependencies
2. Install Claude Code Router
```shell
git clone https://github.com/musistudio/claude-code-router
cd claude-code-router && pnpm i
npm run build
npm install -g @musistudio/claude-code-router
```
2. Start claude-code-router server
3. Start Claude Code by claude-code-router
```shell
node dist/cli.js
ccr code
```
3. Set environment variable to start claude code
```shell
export DISABLE_PROMPT_CACHING=1
export ANTHROPIC_BASE_URL="http://127.0.0.1:3456"
export API_TIMEOUT_MS=600000
claude
```
## Plugin
@@ -58,3 +40,8 @@ You need to move them to the `$HOME/.claude-code-router/plugins` directory and c
"OPENAI_MODEL": ""
}
```
## Features
- [x] Plugins
- [] Support change models
- [] Suport scheduled tasks