@killingjacky/claude-code-router 2.2.0 → 2.2.1
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 +13 -0
- package/dist/cli.js +203 -203
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -315,6 +315,7 @@ The `activate` command sets the following environment variables:
|
|
|
315
315
|
|
|
316
316
|
- `ANTHROPIC_AUTH_TOKEN`: API key from your configuration
|
|
317
317
|
- `ANTHROPIC_BASE_URL`: The local router endpoint (default: `http://127.0.0.1:3456`)
|
|
318
|
+
- `CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY`: Enables Claude Code's `/model` picker to list every configured CCR provider/model pair
|
|
318
319
|
- `NO_PROXY`: Set to `127.0.0.1` to prevent proxy interference
|
|
319
320
|
- `DISABLE_TELEMETRY`: Disables telemetry
|
|
320
321
|
- `DISABLE_COST_WARNINGS`: Disables cost warnings
|
|
@@ -322,6 +323,8 @@ The `activate` command sets the following environment variables:
|
|
|
322
323
|
|
|
323
324
|
> **Note**: Make sure the Claude Code Router service is running (`ccr start`) before using the activated environment variables. The environment variables are only valid for the current shell session. To make them persistent, you can add `eval "$(ccr activate)"` to your shell configuration file (e.g., `~/.zshrc` or `~/.bashrc`).
|
|
324
325
|
|
|
326
|
+
After activation, run `/model` in Claude Code to select a configured model directly. Each entry is shown as `provider, model`; CCR routes it to that exact configured provider and model.
|
|
327
|
+
|
|
325
328
|
#### Providers
|
|
326
329
|
|
|
327
330
|
The `Providers` array is where you define the different model providers you want to use. Each provider object requires:
|
|
@@ -330,8 +333,18 @@ The `Providers` array is where you define the different model providers you want
|
|
|
330
333
|
- `api_base_url`: The full API endpoint for chat completions.
|
|
331
334
|
- `api_key`: Your API key for the provider.
|
|
332
335
|
- `models`: A list of model names available from this provider.
|
|
336
|
+
- `models_1m` (optional): A list of models that support a 1-million-token context window. Each entry must also be present in `models`; Claude Code then shows it as an additional `[1M]` option. Entries that are not in `models` are ignored for gateway discovery.
|
|
333
337
|
- `transformer` (optional): Specifies transformers to process requests and responses.
|
|
334
338
|
|
|
339
|
+
For example, this configuration shows `gpt-5.4` in Claude Code both normally and as `gpt-5.4 [1M]`, while `gpt-5.4-mini` is shown only normally:
|
|
340
|
+
|
|
341
|
+
```json
|
|
342
|
+
{
|
|
343
|
+
"models": ["gpt-5.4", "gpt-5.4-mini"],
|
|
344
|
+
"models_1m": ["gpt-5.4"]
|
|
345
|
+
}
|
|
346
|
+
```
|
|
347
|
+
|
|
335
348
|
#### Transformers
|
|
336
349
|
|
|
337
350
|
Transformers allow you to modify the request and response payloads to ensure compatibility with different provider APIs.
|