From eeff72141c04b16672267b6dd31319288b666f86 Mon Sep 17 00:00:00 2001 From: hex2077 Date: Mon, 2 Mar 2026 21:19:13 +0800 Subject: [PATCH] =?UTF-8?q?docs:=20=E6=9B=B4=E6=96=B0=20README=20=E6=96=87?= =?UTF-8?q?=E6=A1=A3=E4=BB=A5=E6=B7=BB=E5=8A=A0=20Grok=20=E5=8D=8F?= =?UTF-8?q?=E8=AE=AE=E6=94=AF=E6=8C=81=E8=AF=B4=E6=98=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在中文、日文和英文 README 中更新版本日志,新增 Grok 协议支持条目 - 在核心优势部分将 Grok 添加到支持模型列表中 - 在最新模型支持部分添加 Grok 3/4 的详细描述 - 新增 Grok Cookie/SSO 配置步骤章节 - 在提供商列表和代理配置示例中添加 Grok 支持 --- README-JA.md | 31 ++++++++++++++++++++++--------- README-ZH.md | 31 ++++++++++++++++++++++--------- README.md | 31 ++++++++++++++++++++++--------- 3 files changed, 66 insertions(+), 27 deletions(-) diff --git a/README-JA.md b/README-JA.md index 1d25b80..e6475da 100644 --- a/README-JA.md +++ b/README-JA.md @@ -30,10 +30,11 @@ > - Ruan Yifeng先生による[週刊359号](https://www.ruanyifeng.com/blog/2025/08/weekly-issue-359.html)での推薦に感謝します > > **📅 バージョン更新ログ** -> +> >
> クリックして詳細なバージョン履歴を展開 -> +> +> - **2026.03.02** - Grokプロトコルサポートを追加:Cookie/SSO方式でxAI Grokシリーズモデル(Grok 3/4)へのアクセスに対応し、マルチモーダル入力、画像/動画生成、自動トークンリフレッシュ、ストリーミング出力をサポート > - **2026.01.26** - Codexプロトコルサポートを追加:OpenAI Codex OAuth認証での接続に対応 > - **2026.01.25** - AI 監視プラグインの強化:AI プロトコル変換前後のリクエストパラメータとレスポンスの監視をサポート。ログ管理の最適化:統一されたログ形式、ビジュアル設定 > - **2026.01.15** - プロバイダープールマネージャーの最適化:非同期リフレッシュキューメカニズム、バッファキュー重複排除、グローバル並行制御、ノードウォームアップと自動期限切れ検出を追加 @@ -61,7 +62,7 @@ ## 💡 コアアドバンテージ ### 🎯 統一アクセス、ワンストップ管理 -* **マルチモデル統一インターフェース**:標準OpenAI互換プロトコルを通じて、一度の設定でGemini、Claude、Qwen Code、Kimi K2、MiniMax M2などの主流大規模モデルにアクセス +* **マルチモデル統一インターフェース**:標準OpenAI互換プロトコルを通じて、一度の設定でGemini、Claude、Grok、Qwen Code、Kimi K2、MiniMax M2などの主流大規模モデルにアクセス * **柔軟な切り替えメカニズム**:Pathルーティング、起動パラメータ、環境変数の3つの方法で動的にモデルを切り替え、異なるシナリオのニーズに対応 * **ゼロコスト移行**:OpenAI API仕様と完全互換、Cherry-Studio、NextChat、Clineなどのツールを変更なしで使用可能 * **マルチプロトコルインテリジェント変換**:OpenAI、Claude、Geminiの3大プロトコル間のインテリジェント変換をサポートし、クロスプロトコルモデル呼び出しを実現 @@ -203,6 +204,7 @@ docker compose up -d #### 最新モデルサポート 以下の最新大規模モデルをシームレスにサポート、Web UIまたは[`config.json`](./configs/config.json)で対応するエンドポイントを設定するだけで使用可能: +* **Grok 3 / Grok 4** - xAIのフラッグシップモデル。Grok Cookie/SSO経由でサポートされ、思考モデル、画像生成、動画生成に対応 * **Claude 4.5 Opus** - Anthropic史上最強モデル、Kiro、Antigravity経由でサポート * **Gemini 3 Pro** - Google次世代アーキテクチャプレビュー版、Gemini、Antigravity経由でサポート * **Qwen3 Coder Plus** - アリババ通義千問の最新コード専用モデル、Qwen Code経由でサポート @@ -303,6 +305,15 @@ curl http://localhost:3000/claude-kiro-oauth/v1/chat/completions \ 3. **自動保存**:認証成功後、システムがCodexのOAuth認証情報ファイルを自動保存 4. **コールバックポート**:OAuthコールバックポート `1455` が占有されていないことを確認 +#### Grok Cookie/SSO 設定 +1. **SSOトークンの取得**: [Grok公式サイト](https://grok.com/)にログインし、ブラウザの開発者ツールの Application -> Cookies から `sso` の値をコピーします。 +2. **設定の入力**: Web UIの「設定管理」ページ、または設定ファイルを直接編集して、トークンを `GROK_COOKIE_TOKEN` に入力します。 +3. **サポート機能**: + - チャットおよび思考モデル (Grok 3 Thinking) + - 画像生成 (Grok Imagine) + - 動画生成 (Grok Video) +4. **注意事項**: ブロックを避けるため、`GROK_USER_AGENT` がCookie取得時と同じブラウザのものであることを確認してください。 + #### アカウントプール管理設定 1. **プール設定ファイルの作成**:[provider_pools.json.example](./configs/provider_pools.json.example) を参考に設定ファイルを作成します 2. **プールパラメータの設定**:config.json で `PROVIDER_POOLS_FILE_PATH` を設定し、プール設定ファイルを指定します @@ -365,6 +376,7 @@ curl http://localhost:3000/ollama/api/chat \ - `[Claude]` - 公式Claude APIを使用 - `[Gemini CLI]` - Gemini CLI OAuth経由でアクセス - `[OpenAI]` - 公式OpenAI APIを使用 +- `[Grok]` - Grok Cookie/SSO経由でアクセス - `[Qwen CLI]` - Qwen OAuth経由でアクセス --- @@ -394,12 +406,13 @@ curl http://localhost:3000/ollama/api/chat \ ```json { "PROXY_URL": "http://127.0.0.1:7890", - "PROXY_ENABLED_PROVIDERS": [ - "gemini-cli-oauth", - "gemini-antigravity", - "claude-kiro-oauth" - ] - } + "PROXY_ENABLED_PROVIDERS": [ + "gemini-cli-oauth", + "gemini-antigravity", + "claude-kiro-oauth", + "grok-custom" + ] +} ``` 3. **プロバイダー独自のプロキシ済みエンドポイント**:一部のプロバイダー(OpenAI、Claudeなど)はプロキシ済みAPIエンドポイントの設定をサポートしています diff --git a/README-ZH.md b/README-ZH.md index 65bac24..66ff990 100644 --- a/README-ZH.md +++ b/README-ZH.md @@ -30,10 +30,11 @@ > - 感谢阮一峰老师在 [周刊 359 期](https://www.ruanyifeng.com/blog/2025/08/weekly-issue-359.html) 的推荐 > > **📅 版本更新日志** -> +> >
> 点击展开查看详细版本历史 -> +> +> - **2026.03.02** - 新增 Grok 协议支持,支持通过 Cookie/SSO 方式访问 xAI Grok 系列模型(Grok 3/4),支持多模态输入、图片/视频生成、自动 token 刷新及流式输出 > - **2026.01.26** - 新增 Codex 协议支持:支持 OpenAI Codex OAuth 授权接入 > - **2026.01.25** - 增强 AI 监控插件:支持监控 AI 协议转换前后的请求参数和响应。优化日志管理:统一日志格式,可视化配置 > - **2026.01.15** - 优化提供商池管理器:新增异步刷新队列机制、缓冲队列去重、全局并发控制,支持节点预热和自动过期检测 @@ -60,7 +61,7 @@ ## 💡 核心优势 ### 🎯 统一接入,一站式管理 -* **多模型统一接口**:通过标准 OpenAI 兼容协议,一次配置即可接入 Gemini、Claude、Qwen Code、Kimi K2、MiniMax M2 等主流大模型 +* **多模型统一接口**:通过标准 OpenAI 兼容协议,一次配置即可接入 Gemini、Claude、Grok、Qwen Code、Kimi K2、MiniMax M2 等主流大模型 * **灵活切换机制**:Path 路由、支持通过启动参数、环境变量三种方式动态切换模型,满足不同场景需求 * **零成本迁移**:完全兼容 OpenAI API 规范,Cherry-Studio、NextChat、Cline 等工具无需修改即可使用 * **多协议智能转换**:支持 OpenAI、Claude、Gemini 三大协议间的智能转换,实现跨协议模型调用 @@ -202,6 +203,7 @@ docker compose up -d #### 最新模型支持 无缝支持以下最新大模型,仅需在 Web UI 或 [`configs/config.json`](./configs/config.json) 中配置相应的端点: +* **Grok 3 / Grok 4** - xAI 旗舰模型,现已通过 Grok Cookie/SSO 支持,支持思考模型、图片生成及视频生成 * **Claude 4.5 Opus** - Anthropic 史上最强模型,现已通过 Kiro, Antigravity 支持 * **Gemini 3 Pro** - Google 下一代架构预览版,现已通过 Gemini, Antigravity 支持 * **Qwen3 Coder Plus** - 阿里通义千问最新代码专用模型,现已通过Qwen Code 支持 @@ -302,6 +304,15 @@ curl http://localhost:3000/claude-kiro-oauth/v1/chat/completions \ 3. **自动保存**:授权成功后,系统会自动保存 Codex 的 OAuth 凭据文件 4. **回调端口**:确保 OAuth 回调端口 `1455` 未被占用 +#### Grok Cookie/SSO 配置 +1. **获取 SSO 令牌**:登录 [Grok 官网](https://grok.com/),在浏览器开发者工具的 Application -> Cookies 中复制 `sso` 的值 +2. **填入配置**:在 Web UI 的“配置管理”或直接修改配置文件,将令牌填入 `GROK_COOKIE_TOKEN` +3. **支持功能**: + - 聊天与思考模型(Grok 3 Thinking) + - 图片生成(Grok Imagine) + - 视频生成(Grok Video) +4. **注意事项**:确保 `GROK_USER_AGENT` 与您获取 Cookie 时使用的浏览器一致以避免被拦截 + #### 账号池管理配置 1. **创建号池配置文件**:参考 [provider_pools.json.example](./configs/provider_pools.json.example) 创建配置文件 2. **配置号池参数**:在 `configs/config.json` 中设置 `PROVIDER_POOLS_FILE_PATH` 指向号池配置文件 @@ -364,6 +375,7 @@ curl http://localhost:3000/ollama/api/chat \ - `[Claude]` - 使用 Claude 官方 API - `[Gemini CLI]` - 通过 Gemini CLI OAuth 访问 - `[OpenAI]` - 使用 OpenAI 官方 API +- `[Grok]` - 通过 Grok Cookie/SSO 访问 - `[Qwen CLI]` - 通过 Qwen OAuth 访问 --- @@ -393,12 +405,13 @@ curl http://localhost:3000/ollama/api/chat \ ```json { "PROXY_URL": "http://127.0.0.1:7890", - "PROXY_ENABLED_PROVIDERS": [ - "gemini-cli-oauth", - "gemini-antigravity", - "claude-kiro-oauth" - ] - } + "PROXY_ENABLED_PROVIDERS": [ + "gemini-cli-oauth", + "gemini-antigravity", + "claude-kiro-oauth", + "grok-custom" + ] +} ``` 3. **提供商自带代理端点**:某些提供商(如 OpenAI、Claude)支持配置已代理的 API 端点 diff --git a/README.md b/README.md index b8e19d5..8bb8394 100644 --- a/README.md +++ b/README.md @@ -30,10 +30,11 @@ > - Thanks to Ruan Yifeng for the recommendation in [Weekly Issue 359](https://www.ruanyifeng.com/blog/2025/08/weekly-issue-359.html) > > **📅 Version Update Log** -> +> >
> Click to expand detailed version history -> +> +> - **2026.03.02** - Added Grok protocol support, supporting access to xAI Grok series models (Grok 3/4) via Cookie/SSO, supporting multimodal input, image/video generation, automatic token refresh and streaming output > - **2026.01.26** - Added Codex protocol support: supports OpenAI Codex OAuth authorization access > - **2026.01.25** - Enhanced AI Monitor plugin: supports monitoring request parameters and responses before and after AI protocol conversion. Optimized log management: unified log format, visual configuration > - **2026.01.15** - Optimized provider pool manager: added async refresh queue mechanism, buffer queue deduplication, global concurrency control, node warmup and automatic expiry detection @@ -61,7 +62,7 @@ ## 💡 Core Advantages ### 🎯 Unified Access, One-Stop Management -* **Multi-Model Unified Interface**: Through standard OpenAI-compatible protocol, configure once to access mainstream large models including Gemini, Claude, Qwen Code, Kimi K2, MiniMax M2 +* **Multi-Model Unified Interface**: Through standard OpenAI-compatible protocol, configure once to access mainstream large models including Gemini, Claude, Grok, Qwen Code, Kimi K2, MiniMax M2 * **Flexible Switching Mechanism**: Path routing, support dynamic model switching via startup parameters or environment variables to meet different scenario requirements * **Zero-Cost Migration**: Fully compatible with OpenAI API specifications, tools like Cherry-Studio, NextChat, Cline can be used without modification * **Multi-Protocol Intelligent Conversion**: Support intelligent conversion between OpenAI, Claude, and Gemini protocols for cross-protocol model invocation @@ -203,6 +204,7 @@ Supports various input types such as images and documents, providing you with a #### Latest Model Support Seamlessly support the following latest large models, just configure the corresponding endpoint in Web UI or [`configs/config.json`](./configs/config.json): +* **Grok 3 / Grok 4** - xAI's flagship models, now supported via Grok Cookie/SSO, supporting thinking models, image generation, and video generation * **Claude 4.5 Opus** - Anthropic's strongest model ever, now supported via Kiro, Antigravity * **Gemini 3 Pro** - Google's next-generation architecture preview, now supported via Gemini, Antigravity * **Qwen3 Coder Plus** - Alibaba Tongyi Qianwen's latest code-specific model, now supported via Qwen Code @@ -303,6 +305,15 @@ Notes: 3. **Auto Save**: After successful authorization, the system automatically saves the Codex OAuth credential file 4. **Callback Port**: Ensure the OAuth callback port `1455` is not occupied +#### Grok Cookie/SSO Configuration +1. **Obtain SSO Token**: Log in to the [Grok official website](https://grok.com/), copy the value of `sso` from Application -> Cookies in browser developer tools +2. **Enter Configuration**: In the Web UI "Configuration" page or directly modify the configuration file, enter the token into `GROK_COOKIE_TOKEN` +3. **Supported Features**: + - Chat and Thinking models (Grok 3 Thinking) + - Image generation (Grok Imagine) + - Video generation (Grok Video) +4. **Notes**: Ensure `GROK_USER_AGENT` matches the browser used when obtaining the cookie to avoid being blocked + #### Account Pool Management Configuration 1. **Create Pool Configuration File**: Create a configuration file referencing [provider_pools.json.example](./configs/provider_pools.json.example) 2. **Configure Pool Parameters**: Set `PROVIDER_POOLS_FILE_PATH` in `configs/config.json` to point to the pool configuration file @@ -365,6 +376,7 @@ curl http://localhost:3000/ollama/api/chat \ - `[Claude]` - Use official Claude API - `[Gemini CLI]` - Access via Gemini CLI OAuth - `[OpenAI]` - Use official OpenAI API +- `[Grok]` - Access via Grok Cookie/SSO - `[Qwen CLI]` - Access via Qwen OAuth --- @@ -394,12 +406,13 @@ This project supports flexible proxy configuration, allowing you to configure a ```json { "PROXY_URL": "http://127.0.0.1:7890", - "PROXY_ENABLED_PROVIDERS": [ - "gemini-cli-oauth", - "gemini-antigravity", - "claude-kiro-oauth" - ] - } + "PROXY_ENABLED_PROVIDERS": [ + "gemini-cli-oauth", + "gemini-antigravity", + "claude-kiro-oauth", + "grok-custom" + ] +} ``` 3. **Provider-Specific Proxied Endpoints**: Some providers (like OpenAI, Claude) support configuring proxied API endpoints