# 9router-proxy 中文文档

规范地址：https://npmcn.com/package/9router-proxy/

版本：0\.6\.25
npm 元数据更新时间：2026-11-06T06:30:36.546Z
中文译文更新时间：2026-11-06T06:15:47.935Z
软件包许可：MIT

本文由上游 README 翻译，可能存在偏差，请结合原文核对 API、命令与配置。版权与许可归原作者所有。

原始 npm 页面：https://www.npmjs.com/package/9router-proxy
原文对照：https://npmcn.com/package/9router-proxy/?lang=original

## 关键信息（来自 npm 元数据）

- 包体积（解压后）：56.3 MB，3484 个文件
- TypeScript 类型：未声明
- Node.js 要求：\>=18\.17\.0
- 运行依赖：6 个
- 首次发布：2026-09-21T04:44:57.684Z
- 最新版本发布：2026-11-06T06:30:36.381Z
- 近 30 天下载量：4516（2026-10-04 至 2026-11-02，npm 官方下载统计）
- 已发布版本数：43（近 12 个月 43 个）

## 中文简介

9路特 CLI - 启动并管理9路特服务器

## 安装

```sh
npm install 9router-proxy
```

也可以使用：`pnpm add 9router-proxy`、`yarn add 9router-proxy`、`bun add 9router-proxy`

## README

# 9路特 - FREE AI 路由器和托肯保护器

**永不停止编码. 以RTK + 自动倒回FREE & 廉价AI模式保存20-40%的令牌.**

**连接所有AI代码工具(Claude Code, Cursor, Antigravity, Copilot, Codex, 双子座, OpenCode, Cline, OpenClaw...)到40+AI提供商和100+模型.**

[![npm](https://img.shields.io/npm/v/9router-proxy.svg)](https://www.npmjs.com/package/9router-proxy) [![Downloads](https://img.shields.io/npm/dm/9router-proxy.svg)](https://www.npmjs.com/package/9router-proxy) [![Docker Pulls](https://img.shields.io/docker/pulls/decolua/9router.svg?logo=docker&label=Docker%20pulls)](https://hub.docker.com/r/decolua/9router) [![GHCR](https://img.shields.io/badge/GHCR-decolua%2F9router-blue?logo=github)](https://github.com/decolua/9router/pkgs/container/9router) [![License](https://img.shields.io/npm/l/9router.svg)](https://github.com/decolua/9router/blob/main/LICENSE)

[![decolua%2F9router | Trendshift](https://trendshift.io/api/badge/repositories/22628)](https://trendshift.io/repositories/22628)

[网站](https://9router.com/) 二. 支助 [完整文档](https://github.com/decolua/9router)

* * *

## 为什么是9路特?

**停止浪费钱,代币和打出限制:**

-   \* 每月订阅配额到期
-   QQ 利率限制停止中编码
-   QQ 工具输出( git diff, grep, Is. ) 快速刻录符号
-   \* 昂贵的API(每个供应商每月20-50美元)

**9路特解决了这个问题:**

-   ✅ **RTK 托肯保护程序** - 自动压缩工具 结果, 保存 20- 40% 的令牌
-   ✅ **最大限度的订阅** - 曲目配额,在重置前使用每一分
-   ✅ **自动倒置** 免费、零停机
-   ✅ **多账户** - 每家供应商账户之间的轮旋
-   ✅ **通用** - 与OpenAI/Claude兼容的CLI合作

* * *

## QQ 快速启动

**选项1- npm( 建议桌面):**

```bash
npm install -g 9router-proxy
9router-proxy

# Or run directly with npx
npx 9router-proxy
```

**备选案文2——多克(服务器/VPS):**

```bash
docker run -d --name 9router -p 20128:20128 \
  -v "$HOME/.9router:/app/data" -e DATA_DIR=/app/data \
  decolua/9router:latest
```

已发布图像 : [多克枢纽](https://hub.docker.com/r/decolua/9router) 二. 支助 [千兆赫](https://github.com/decolua/9router/pkgs/container/9router) (多平台 amd64/arm64).

{\\fn黑体\\fs22\\bord1\\shad0\\3aHBE\\4aH00\\fscx67\\fscy66\\2cHFFFFFF\\3cH808080} `http://localhost:20128`

**2\. 连接FREE供应商(不需要注册):**

盘子 提供商 连接 **基罗大赦国际** (自由克洛德无限)或 **打开代码自由** (无授权) 完成!

**3\. 将以下工具用于国家领导才能工具:**

```
Claude Code/Codex/OpenClaw/Cursor/Cline Settings:
  Endpoint: http://localhost:20128/v1
  API Key:  [copy from dashboard]
  Model:    kr/claude-sonnet-4.5
```

就这样! 开始用FREE AI模型编码.

* * *

## QQ CLI 选项

```bash
9router-proxy              # Start with default settings (interactive)
9router-proxy start        # Start headless background server (log: ~/.9router/server.log)
9router-proxy status       # Show background server status
9router-proxy stop         # Stop background server
9router-proxy --port 8080        # Custom port
9router-proxy --no-browser       # Don't open browser
9router-proxy --skip-update      # Skip auto-update check
9router-proxy --help             # Show all options
```

**盘子**数字 : `http://localhost:20128/dashboard`

* * *

## 连接到远程 9 路透社

已经在另一台机器上运行了9路透(比如在你的局域网上运行团队服务器)? 将这个机器的 CLI 工具对准它——没有开始本地服务器:

```bash
npx 9router-proxy connect http://<server-host>:20128                       # pick tools interactively
npx 9router-proxy connect http://<server-host>:20128 --tools claude,codex  # or choose up front
npx 9router-proxy connect --reset --tools claude,codex                     # undo
```

它使用仪表板密码( 隐藏快取) 登录、 重复使用或创建命名的 API 密钥 `cli-<hostname>`,并写入每个工具的配置(备份一次原作) `*.bak-9router`) (中文(简体) ).

支持的工具 : `claude`, (中文(简体) ), `codex`, (中文(简体) ), `opencode`, (中文(简体) ), `droid`, (中文(简体) ), `crush`, (中文(简体) ), `kilo`, (中文(简体) ), `cline`, (中文(简体) ), `pi`, (中文(简体) ), `omp`,或 `all`。 。 。 .

### 模型

模型来自 **服务器自己的 CLI 工具配置**,所以客户端得到任何 操作员已经选择在仪表板上。 没有硬码.

| 工具 | 模式取自( 第一次比赛获胜) |
| --- | --- |
| `claude` | 分级旗 (`--opus` • 服务器的克洛德级 _未设置_ (Claude Code自己默认) |
| 其他人员 | `--model` ~ 该工具在服务器上的自有模型 ~ 服务器的OpenCode模型 ~ _工具跳过_ |

`kilo` 服务器上没有可读模型, 因此它总是使用 `--model` 或 OpenCode 模型. `omp` (Oh My Pi)不需要模型:它使用代理发现,所以每个服务器模型都出现在下面 `9router` 内 `/model`。服务器没有设置的 Claude 级从您的配置中删除, 而不是从早先的运行中删除 。 跳过的工具使命令退出 `1`。 。 。 .

### 覆盖服务器的模型

```bash
# One Claude tier; the other tiers still come from the server
npx 9router-proxy connect http://<server-host>:20128 --tools claude --sonnet cc/claude-sonnet-5-5

# Every Claude tier
npx 9router-proxy connect http://<server-host>:20128 --tools claude \
  --fable cc/claude-fable-5-1 --opus cc/claude-opus-5-5 \
  --sonnet cc/claude-sonnet-5-5 --haiku cc/claude-haiku-4-5-20251001

# All non-Claude tools at once
npx 9router-proxy connect http://<server-host>:20128 --tools codex,opencode,kilo --model ocg/deepseek-flash

# Claude and other tools in one run
npx 9router-proxy connect http://<server-host>:20128 --tools claude,codex --opus cc/claude-opus-5-5 --model gpt-6

# A different model per tool: --model covers every non-Claude tool in a run, so run once per tool
npx 9router-proxy connect http://<server-host>:20128 --tools codex --model gpt-6
npx 9router-proxy connect http://<server-host>:20128 --tools opencode --model ocg/glm-5.3
```

服务器未列出的模型仍然被写入,其中有一个 `not listed by server` 警告 警告他们 看它所服务的ID: `curl http://<server-host>:20128/v1/models -H "Authorization: Bearer <your key>"`。 。 。 .

### 检查当前配置

`9router-proxy show` 打印此机上每个 CLI 工具目前设定的 URL 、 遮盖的 API 密钥和模型 。 它只读取本地文件,从来不接触服务器.

```bash
npx 9router-proxy show                 # every supported tool
npx 9router-proxy show claude          # one tool
npx 9router-proxy show claude codex    # several
npx 9router-proxy show claude --json   # machine-readable (key still masked)
```

```
✅ Claude Code
   File:     ~/.claude/settings.json
   Base URL: http://<server-host>:20128/v1
   API key:  sk-a1b…9f3c
   Models:
     fable   cc/claude-fable-5-1
     opus    cc/claude-opus-5-5
     sonnet  cc/claude-sonnet-5-5
```

未指向9路特的工具列为 `not configured`。对于 Codex 、 OpenCode 和 Cline , 当一个 9router 条目存在时, 它也会发出警告, 但另一个提供者是活动者 .

### 其他选择

| 选项 | 目的 |
| --- | --- |
| `--password <pw>` | 密码(或 `NINE_ROUTER_PASSWORD`; 如果省略, 提示 —— 首选, 使其远离外壳历史 |
| `--save` | 成功登录后, 请保存此服务器的密码到 `~/.9router/connect.env` (plain text, mode 600) 所以以后会跳过提示 。 删除文件以忘记它 |
| `--api-key <key>` | 使用此密钥并跳过登录 。 服务器的模型没有登录就无法读取,所以通过模型旗 |
| `--key-name <name>` | 重新使用/创建的 API 密钥名( 默认) `cli-<hostname>`(中文(简体) ) |
| `--print-env` | 还打印 `OPENAI_BASE_URL` 编号 : `OPENAI_API_KEY` 其他 cLI 指标 |
| `--reset` | 从选中的工具中删除 9router 设置 |

见 `9router-proxy connect --help` 完整名单.

> 过平地 `http://` 密码和 API 密钥是不加密发送的 —— 使用一个可信赖的局域网/ VPN 或将 HTTPS 放在前面 。 API密钥被存储在每个工具的配置文件中.

* * *

## 支持的 CLI 工具

Claude-Code • OpenClaw • Codex • OpenCode • Cursor • Antigravity • Cline • 继续 机器人 • Roo • 副驾驶 • Kilo 代码 • 双子座 CLI • Quen 代码 • iFlow • Crusher • Aider

任何支持OpenAI/Claude-compatiable API作品的工具.

* * *

## 数据位置

-   **macOS/ 在线**数字 : `~/.9router/db/data.sqlite`
-   **窗口**数字 : `%APPDATA%/9router/db/data.sqlite`
-   **夹克**数字 : `/app/data/db/data.sqlite` (数目) `$HOME/.9router` (将持续)

* * *

## 页:1

完整的文档、高级设置、视频教程和开发指南 :

-   **GitHub 图像**数字 : [https://github.com/decolua/9router (英语)](https://github.com/decolua/9router)
-   **完全读取**数字 : [https://github.com/decolua/9router/blob/master/README.md 互联网档案馆的存檔,存档日期2013-12-11](https://github.com/decolua/9router/blob/master/README.md)
-   **网站**数字 : [https://9router.com (英语)](https://9router.com/)

* * *

## 承认

-   **[CLIProxyAPI (英语)](https://github.com/router-for-me/CLIProxyAPI)** - 原实施

## 许可证

麻省理工学院执照 - 看 [自由主义](https://npmcn.com/package/9router-proxy/LICENSE) 详细情况.

## 常见问题

### 9router-proxy 是什么？

9路特 CLI - 启动并管理9路特服务器

### 如何安装 9router-proxy？

在项目目录运行 npm install 9router-proxy，或使用 pnpm add / yarn add / bun add。它还提供命令行工具 9router-proxy，可以用 npx 9router-proxy 直接运行。

### 9router-proxy 支持 TypeScript 吗？

该包的 package\.json 没有声明类型入口。需要类型提示时，可以在 npm 上查找社区维护的 @types/9router-proxy 是否存在。

### 9router-proxy 需要什么版本的 Node\.js？

package\.json 的 engines 字段要求 Node\.js \>=18\.17\.0。版本不符时 npm 默认只给出警告，开启 engine-strict 后会拒绝安装。

### 9router-proxy 可以商用吗？

9router-proxy 使用 MIT 许可。宽松许可：允许商业使用、修改和再分发，通常只需在分发时保留原版权与许可声明。以上为概括，不构成法律意见，请以许可原文为准。

### 9router-proxy 的下载量有多少？

根据 npm 官方下载统计，9router-proxy 在 2026/10/04 – 2026/11/02 这 30 天内被下载 4,516 次，日均约 151 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入，适合横向比较热度，不能直接等同于使用人数。

### 9router-proxy 还在维护吗？

最新版本 0\.6\.25 发布于 2026/11/06（今天）；至今共发布 43 个版本，其中过去 12 个月发布了 43 个；首次发布于 2026/09/21。发布频率只是参考信号：功能稳定的工具可能很少需要更新，建议结合源码仓库的 issue 和提交记录判断。

