docs(xai): document Grok OAuth setup and disclose client identity reuse

Document the xAI OAuth flow (discovery, device, token, and API endpoints)
in the zh/en/ja manuals. State explicitly that the integration reuses the
public OAuth client identity and scopes registered for the official Grok
CLI rather than a CC Switch registration, and strengthen the shared
account-backed proxy note back to an explicit warning covering account
restriction and suspension risk.
This commit is contained in:
Jason
2026-07-19 00:20:25 +08:00
parent e9317f476e
commit 09101e2a2d
6 changed files with 57 additions and 12 deletions
@@ -278,21 +278,36 @@ Log level descriptions:
Settings > **OAuth Auth Center** Tab
Added in v3.13.0, the **OAuth Auth Center** (Beta) provides unified management for third-party OAuth credentials. It currently supports two account types:
Added in v3.13.0, the **OAuth Auth Center** (Beta) provides unified management for third-party OAuth credentials. It currently supports three account types:
| Account Type | Purpose |
| ------------------------- | ---------------------------------------------------------- |
| **GitHub Copilot** | Used with the Copilot reverse proxy |
| **ChatGPT (Codex OAuth)** | Used with the Codex OAuth reverse proxy; manage ChatGPT accounts |
| **xAI (Grok OAuth)** | Used with the xAI Responses API reverse proxy |
**What you can do here**:
- Log in to ChatGPT / GitHub accounts via the Device Code flow
- Log in to ChatGPT / GitHub / xAI accounts via the Device Code flow
- View the list of logged-in accounts and authentication status
- Set a default account when managing multiple accounts
- Remove individual accounts or log out all accounts at once
> **Note**: Both features use reverse-engineered OAuth flows and carry account risk and Terms of Service risk. Before using, please read the full risk notice in [2.1 Add Provider → Codex OAuth Reverse Proxy](../2-providers/2.1-add.md#codex-oauth-reverse-proxy-claude-provider).
The xAI integration uses the OAuth 2.0 Device Authorization Grant, not a loopback callback. Its network contract is explicit:
| Dependency | Endpoint |
| ---------- | -------- |
| OpenID discovery | `https://auth.x.ai/.well-known/openid-configuration` |
| Device authorization | `device_authorization_endpoint` from discovery (currently `https://auth.x.ai/oauth2/device/code`) |
| Token exchange / refresh | `token_endpoint` from discovery (currently `https://auth.x.ai/oauth2/token`) |
| Inference | `https://api.x.ai/v1/responses` |
| Model discovery | `https://api.x.ai/v1/models` |
There is no local callback port. Authentication and model requests use CC Switch's global outbound proxy configuration.
The xAI integration does **not** use an OAuth application registered to CC Switch. It reuses the public OAuth client identity and scopes registered for the official Grok CLI (`client_id: b1a00492-073a-47ea-816f-4c329264a828`, including `grok-cli:access`) to obtain account-backed API access.
> **Warning**: These account-backed reverse proxies use reverse-engineered OAuth integrations and carry account and Terms of Service risk. Reusing an upstream product's OAuth client may be unsupported and may cause the provider to restrict or suspend the account. Review the applicable provider terms and use these features at your own risk. For the existing Codex flow, also read [2.1 Add Provider → Codex OAuth Reverse Proxy](../2-providers/2.1-add.md#codex-oauth-reverse-proxy-claude-provider).
## About Page
@@ -8,7 +8,7 @@ Once enabled, you can:
- Use third-party Anthropic-compatible providers in Claude Desktop
- Configure model mapping for models outside the three role IDs: legacy Claude IDs (e.g. `claude-3-5-sonnet`) and non-Claude models like DeepSeek / Kimi / DouBao / OpenAI / Gemini all need it
- Reuse Copilot / Codex OAuth account-based providers
- Reuse Copilot / Codex OAuth / xAI OAuth account-based providers
- Switch between Claude Desktop official mode and third-party providers
Claude Desktop and Claude Code are separate app entry points. Claude Code uses `~/.claude/settings.json`, while Claude Desktop uses its own 3P profile configuration. In CC Switch they appear as separate apps: "Claude" and "Claude Desktop"; the icon badge in the bottom-right corner helps distinguish them.
@@ -278,21 +278,36 @@ WebDAV プロトコルを使用して複数のデバイス間で設定を同期
設定 → **OAuth 認証センター** タブ
v3.13.0 で追加された **OAuth 認証センター**(Beta)は、サードパーティの OAuth 認証情報を一元管理します。現在、以下の 2 種類のアカウントタイプをサポートしています:
v3.13.0 で追加された **OAuth 認証センター**(Beta)は、サードパーティの OAuth 認証情報を一元管理します。現在、以下の 3 種類のアカウントタイプをサポートしています:
| アカウントタイプ | 用途 |
| ----------------------------- | --------------------------------------------------------------- |
| **GitHub Copilot** | Copilot リバースプロキシと組み合わせて使用 |
| **ChatGPT (Codex OAuth)** | Codex OAuth リバースプロキシと組み合わせて使用、ChatGPT アカウントを管理 |
| **xAI (Grok OAuth)** | xAI Responses API リバースプロキシと組み合わせて使用 |
**ここでできること**
- Device Code フローで ChatGPT / GitHub アカウントにログイン
- Device Code フローで ChatGPT / GitHub / xAI アカウントにログイン
- ログイン済みアカウント一覧と認証状態の確認
- マルチアカウント時のデフォルトアカウント設定
- 個別アカウントの削除や全アカウントの一括ログアウト
> **注意**:これら 2 つの機能はリバースエンジニアリングされた OAuth フローを使用するため、アカウントリスクおよび利用規約リスクが存在します。ご利用前に [2.1 プロバイダーの追加 → Codex OAuth リバースプロキシ](../2-providers/2.1-add.md#codex-oauth-リバースプロキシclaude-プロバイダー) の完全なリスク通知をお読みください。
xAI 連携はローカルのループバックコールバックではなく、OAuth 2.0 Device Authorization Grant を使用します。ネットワーク依存関係は次のとおりです:
| 依存関係 | エンドポイント |
| -------- | -------------- |
| OpenID discovery | `https://auth.x.ai/.well-known/openid-configuration` |
| デバイス認証 | discovery の `device_authorization_endpoint`(現在は `https://auth.x.ai/oauth2/device/code` |
| Token 交換・更新 | discovery の `token_endpoint`(現在は `https://auth.x.ai/oauth2/token` |
| 推論 | `https://api.x.ai/v1/responses` |
| モデル取得 | `https://api.x.ai/v1/models` |
ローカルのコールバックポートは使用しません。認証およびモデルリクエストは CC Switch のグローバル送信プロキシ設定を共有します。
xAI 連携は CC Switch 用に登録された OAuth アプリケーションを**使用しません**。公式 Grok CLI 用に登録された公開 OAuth クライアントの ID とスコープ(`client_id: b1a00492-073a-47ea-816f-4c329264a828``grok-cli:access` を含む)を再利用して、アカウントベースの API アクセスを取得します。
> **警告**:これらのアカウント型リバースプロキシは、リバースエンジニアリングされた OAuth 連携を使用しており、アカウントおよび利用規約上のリスクがあります。上流製品の OAuth クライアント再利用は公式にサポートされない可能性があり、サービス提供者によるアカウントの制限・停止につながるおそれがあります。各プロバイダーの規約を確認し、自己責任で使用してください。既存の Codex フローについては [2.1 プロバイダーの追加 → Codex OAuth リバースプロキシ](../2-providers/2.1-add.md#codex-oauth-リバースプロキシclaude-プロバイダー) も参照してください。
## バージョン情報ページ
@@ -8,7 +8,7 @@ Claude Desktop パネルでは、CC Switch 上で Claude Desktop のプロバイ
- Claude Desktop でサードパーティの Anthropic 互換プロバイダーを使う
- 三つの役割 ID 以外のモデルにマッピングを設定する:旧式 Claude ID(例:`claude-3-5-sonnet`)や DeepSeek / Kimi / DouBao / OpenAI / Gemini などの非 Claude モデルはいずれも必要
- Copilot / Codex OAuth のアカウント型プロバイダーを再利用する
- Copilot / Codex OAuth / xAI OAuth のアカウント型プロバイダーを再利用する
- Claude Desktop 公式モードとサードパーティプロバイダーを切り替える
Claude Desktop と Claude Code は別々のアプリ入口です。Claude Code は `~/.claude/settings.json` を使い、Claude Desktop は専用の 3P profile 設定を使います。CC Switch 上でも「Claude」と「Claude Desktop」として別々に表示され、アイコン右下の小さなバッジで区別できます。
@@ -278,21 +278,36 @@ CC Switch 自身数据的存储位置,默认为 `~/.cc-switch/`。
设置 → **OAuth 认证中心** Tab
v3.13.0 新增的 **OAuth 认证中心**(Beta)统一管理第三方 OAuth 凭据,目前支持类账号:
v3.13.0 新增的 **OAuth 认证中心**(Beta)统一管理第三方 OAuth 凭据,目前支持类账号:
| 账号类型 | 用途 |
| ---------------------------- | ----------------------------------------------- |
| **GitHub Copilot** | 配合 Copilot 反向代理使用 |
| **ChatGPT (Codex OAuth)** | 配合 Codex OAuth 反向代理使用,管理 ChatGPT 账号 |
| **xAI (Grok OAuth)** | 配合 xAI Responses API 反向代理使用 |
**你可以在这里**
- 通过 Device Code 流程登录 ChatGPT / GitHub 账号
- 通过 Device Code 流程登录 ChatGPT / GitHub / xAI 账号
- 查看已登录账号列表和认证状态
- 为多账号设置默认账号
- 移除单个账号或一键注销所有账号
> ⚠️ **注意**:这两项功能使用逆向 OAuth 流程,存在账号风险和服务条款风险。使用前请阅读 [2.1 添加供应商 → Codex OAuth 反向代理](../2-providers/2.1-add.md#codex-oauth-反向代理claude-供应商) 的完整风险提示。
xAI 集成使用 OAuth 2.0 Device Authorization Grant,不使用本机回环回调。其网络依赖契约如下:
| 依赖 | 端点 |
| ---- | ---- |
| OpenID discovery | `https://auth.x.ai/.well-known/openid-configuration` |
| 设备授权 | discovery 返回的 `device_authorization_endpoint`(当前为 `https://auth.x.ai/oauth2/device/code` |
| Token 交换/刷新 | discovery 返回的 `token_endpoint`(当前为 `https://auth.x.ai/oauth2/token` |
| 推理 | `https://api.x.ai/v1/responses` |
| 模型发现 | `https://api.x.ai/v1/models` |
流程不占用任何本地回调端口;认证和模型请求均复用 CC Switch 的全局出站代理设置。
xAI 集成**不使用**注册给 CC Switch 的 OAuth 应用,而是复用 xAI 官方 Grok CLI 注册的公共 OAuth 客户端身份与 scope`client_id: b1a00492-073a-47ea-816f-4c329264a828`,包含 `grok-cli:access`)获取账号型 API 访问权限。
> ⚠️ **警告**:这些账号型反向代理使用逆向接入的 OAuth 流程,存在账号与服务条款风险。复用上游产品的 OAuth 客户端可能不受官方支持,并可能导致服务商限制或封禁账号。请在使用前审阅对应服务商条款并自行承担风险;现有 Codex 流程另见 [2.1 添加供应商 → Codex OAuth 反向代理](../2-providers/2.1-add.md#codex-oauth-反向代理claude-供应商) 的完整风险提示。
## 关于页面
@@ -8,7 +8,7 @@ Claude Desktop 面板用于在 CC Switch 中管理 Claude Desktop 的供应商
- 在 Claude Desktop 中使用第三方 Anthropic 兼容供应商
- 为三档角色 ID 之外的模型配置映射:旧式 Claude ID(如 `claude-3-5-sonnet`)、以及 DeepSeek / Kimi / DouBao / OpenAI / Gemini 等非 Claude 模型都需要
- 复用 Copilot / Codex OAuth 账号类供应商
- 复用 Copilot / Codex OAuth / xAI OAuth 账号类供应商
- 在 Claude Desktop 官方模式和第三方供应商之间切换
Claude Desktop 与 Claude Code 是两个不同的应用入口。Claude Code 使用 `~/.claude/settings.json`Claude Desktop 使用自己的 3P profile 配置;在 CC Switch 中也分别显示为「Claude」和「Claude Desktop」,图标右下角会有一个小图标用来区分。