@musistudio/claude-code-router 1.0.35 → 1.0.37
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +26 -0
- package/README_zh.md +4 -0
- package/dist/cli.js +4828 -4736
- package/dist/index.html +46 -41
- package/package.json +2 -2
- package/dist/lib/worker.js +0 -2
package/README.md
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
# Claude Code Router
|
|
2
2
|
|
|
3
|
+
I am seeking funding support for this project to better sustain its development. If you have any ideas, feel free to reach out to me: [m@musiiot.top](mailto:m@musiiot.top)
|
|
4
|
+
|
|
5
|
+
|
|
3
6
|
[中文版](README_zh.md)
|
|
4
7
|
|
|
5
8
|
> A powerful tool to route Claude Code requests to different models and customize any request.
|
|
@@ -47,6 +50,27 @@ The `config.json` file has several key sections:
|
|
|
47
50
|
- **`Router`**: Used to set up routing rules. `default` specifies the default model, which will be used for all requests if no other route is configured.
|
|
48
51
|
- **`API_TIMEOUT_MS`**: Specifies the timeout for API calls in milliseconds.
|
|
49
52
|
|
|
53
|
+
#### Environment Variable Interpolation
|
|
54
|
+
|
|
55
|
+
Claude Code Router supports environment variable interpolation for secure API key management. You can reference environment variables in your `config.json` using either `$VAR_NAME` or `${VAR_NAME}` syntax:
|
|
56
|
+
|
|
57
|
+
```json
|
|
58
|
+
{
|
|
59
|
+
"OPENAI_API_KEY": "$OPENAI_API_KEY",
|
|
60
|
+
"GEMINI_API_KEY": "${GEMINI_API_KEY}",
|
|
61
|
+
"Providers": [
|
|
62
|
+
{
|
|
63
|
+
"name": "openai",
|
|
64
|
+
"api_base_url": "https://api.openai.com/v1/chat/completions",
|
|
65
|
+
"api_key": "$OPENAI_API_KEY",
|
|
66
|
+
"models": ["gpt-5", "gpt-5-mini"]
|
|
67
|
+
}
|
|
68
|
+
]
|
|
69
|
+
}
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
This allows you to keep sensitive API keys in environment variables instead of hardcoding them in configuration files. The interpolation works recursively through nested objects and arrays.
|
|
73
|
+
|
|
50
74
|
Here is a comprehensive example:
|
|
51
75
|
|
|
52
76
|
```json
|
|
@@ -512,5 +536,7 @@ A huge thank you to all our sponsors for their generous support!
|
|
|
512
536
|
- [@kesku](https://github.com/kesku)
|
|
513
537
|
- @水\*丫
|
|
514
538
|
- @二吉吉
|
|
539
|
+
- @a\*g
|
|
540
|
+
- @*林
|
|
515
541
|
|
|
516
542
|
(If your name is masked, please contact me via my homepage email to update it with your GitHub username.)
|
package/README_zh.md
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
# Claude Code Router
|
|
2
2
|
|
|
3
|
+
我正在为该项目寻求资金支持,以更好地维持其发展。如果您有任何想法,请随时与我联系: [m@musiiot.top](mailto:m@musiiot.top)
|
|
4
|
+
|
|
3
5
|
> 一款强大的工具,可将 Claude Code 请求路由到不同的模型,并自定义任何请求。
|
|
4
6
|
|
|
5
7
|

|
|
@@ -503,6 +505,8 @@ jobs:
|
|
|
503
505
|
- [@kesku](https://github.com/kesku)
|
|
504
506
|
- @水\*丫
|
|
505
507
|
- @二吉吉
|
|
508
|
+
- @a\*g
|
|
509
|
+
- @*林
|
|
506
510
|
|
|
507
511
|
(如果您的名字被屏蔽,请通过我的主页电子邮件与我联系,以便使用您的 GitHub 用户名进行更新。)
|
|
508
512
|
|