> ## Content Index
> Fetch the complete content index at: https://brotherhong.com/llms.txt
> Use this file to discover other available public pages before exploring further.

# 如何使用中转站接入 Claude Code 和 Codex
- URL: https://brotherhong.com/zhongzhuanzhan-claude-code-codex/
- Published: 2026-06-09T00:00:00.000Z
- Updated: 2026-06-09T00:00:00.000Z
- Description: 从注册中转站、创建 API Key，到配置 Claude Code、Claude Code Desktop、Codex CLI 和 Codex APP 的完整流程。
- Author: 洪哥
- Tags: 教程, Claude Code, Codex, 中转站, AI编程

这篇记录如何通过中转站接入 Claude Code、Claude Code Desktop、Codex CLI 和 Codex APP。

同步视频教程：https://www.bilibili.com/video/BV1kM7R6TEAy/

## 一、找到中转站并注册

第一步，你需要找到一个中转站注册，有许多公益站每天会送额度，也有服务质量好的付费站，大家有自己渠道的可以用自己渠道，没有的可以用下面的 Seedance 注册入口，注册后查看可用模型、分组和 API 接入地址：

<https://www.openzhenzhen.com/?aff=xx1N&ch=brotherhong>

下方截图用于说明配置流程，控制台界面、模型分组与 API 地址以当前站点为准。

![中转站注册页面](https://brotherhong.com/content/images/2026/12/zhongzhuanzhan-claude-code-codex-img_001.webp)

## 二、安装 Claude Code、Claude Code Desktop、Codex CLI、Codex APP

根据你的需求，选择对应的工具下载就行，没必要全下载，凭自己喜好。

### Claude Code 安装命令及界面

```bash
npm install -g @anthropic-ai/claude-code

```

![Claude Code 安装界面](https://brotherhong.com/content/images/2026/12/zhongzhuanzhan-claude-code-codex-img_002.png)

### Claude Code Desktop 下载网址

https://code.claude.com/docs/zh-CN/desktop

![Claude Code Desktop 下载页面](https://brotherhong.com/content/images/2026/12/zhongzhuanzhan-claude-code-codex-img_003.png)

### Codex CLI 安装命令及界面

```bash
npm install -g @openai/codex

```

![Codex CLI 安装界面](https://brotherhong.com/content/images/2026/12/zhongzhuanzhan-claude-code-codex-img_004.png)

### Codex APP 下载网址

https://chatgpt.com/zh-Hans-CN/download/

![Codex APP 下载页面](https://brotherhong.com/content/images/2026/12/zhongzhuanzhan-claude-code-codex-img_005.png)

## 三、登录中转站，创建 API Key

### 进入控制台，添加密钥

![中转站控制台添加密钥](https://brotherhong.com/content/images/2026/12/zhongzhuanzhan-claude-code-codex-img_006.png)

### 添加一个 Claude 分组的密钥，和一个 Codex 分组的密钥

![添加 Claude 分组密钥](https://brotherhong.com/content/images/2026/12/zhongzhuanzhan-claude-code-codex-img_007.png)

创建完毕后，API 后台页面会显示成这样：

![API 后台密钥列表](https://brotherhong.com/content/images/2026/12/zhongzhuanzhan-claude-code-codex-img_008.png)

## 四、配置模型到对应工具

目前可以使用 cc switch 工具来配置，但是本教程主要是授人以渔，教最原始、最底层的配置方法，也不复杂。

### 配置 Claude Code

要用 Claude 模型对应的分组，选择复制密钥，复制成功后会弹出提示。

![复制 Claude 分组密钥](https://brotherhong.com/content/images/2026/12/zhongzhuanzhan-claude-code-codex-img_009.png)

然后打开配置文件 `~/.claude/settings.json`（没有就手动创建），复制密钥和网址进去。需要安装 VS Code 才能用 `code` 命令打开，没装的自己装一个，玩 AI 必备。

```bash
code ~/.claude/settings.json

```

```json
{
  "env": {
    "ANTHROPIC_AUTH_TOKEN": "替换成你刚才复制的密钥",
    "ANTHROPIC_BASE_URL": "替换成你的中转站网址",
    "ANTHROPIC_DEFAULT_OPUS_MODEL": "claude-opus-4-7",
    "ANTHROPIC_DEFAULT_SONNET_MODEL": "claude-opus-4-6",
    "ANTHROPIC_DEFAULT_HAIKU_MODEL": "claude-sonnet-4-6",
    "ANTHROPIC_MODEL": "claude-opus-4-7",
    "CLAUDE_CODE_ATTRIBUTION_HEADER": "0",
    "CLAUDE_CODE_DISABLE_ADAPTIVE_THINKING": "1",
    "CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC": "1",
    "CLAUDE_CODE_DISABLE_TERMINAL_TITLE": "1",
    "CLAUDE_CODE_PROXY_RESOLVES_HOSTS": "true"
  }
}

```

改后的效果是这样的，保存就可以了。

![Claude Code settings.json 配置效果](https://brotherhong.com/content/images/2026/12/zhongzhuanzhan-claude-code-codex-img_010.png)

进入到工作目录，比如我的 `D:\Projects`，打开 Claude，问一句好，能收到回复，就证明配置完成，可以使用了。

以后，你在哪个目录工作，你就在对应的目录下打开 Claude 就行，和其他软件一样的逻辑，只不过是命令行形式的罢了。

![Claude Code 测试回复](https://brotherhong.com/content/images/2026/12/zhongzhuanzhan-claude-code-codex-img_011.png)

### 配置 Claude Code Desktop

需要先挂科学上网，能访问到 Claude 服务，才能显示登录页面。在登录页打开开发者模式（Enable Developer Mode），弹窗二次确认 Enable 就好。

![Claude Code Desktop 登录页开启开发者模式](https://brotherhong.com/content/images/2026/12/zhongzhuanzhan-claude-code-codex-img_012.png)

![确认开启开发者模式](https://brotherhong.com/content/images/2026/12/zhongzhuanzhan-claude-code-codex-img_013.png)

进入开发者模式，配置网址和 API Key，并保存重启。

![Claude Code Desktop 配置 API 地址](https://brotherhong.com/content/images/2026/12/zhongzhuanzhan-claude-code-codex-img_014.png)

![Claude Code Desktop 保存配置](https://brotherhong.com/content/images/2026/12/zhongzhuanzhan-claude-code-codex-img_015.png)

老样子，问个好能收到回复即可。这里的模型比较多，注意要选中转站有的才行，否则会访问报错。

![Claude Code Desktop 测试回复](https://brotherhong.com/content/images/2026/12/zhongzhuanzhan-claude-code-codex-img_016.png)

### 配置 Codex CLI

从后台复制带有 Codex 或 GPT 模型的密钥，复制密钥的操作就不讲了，参考上面的配置 Claude。

复制好后，先打开 `~/.codex/auth.json`（老规矩，没有就手动创建），把密钥贴进去。

```bash
code ~/.codex/auth.json

```

```json
{
  "OPENAI_API_KEY": "替换成你刚才复制的密钥"
}

```

![Codex auth.json 配置](https://brotherhong.com/content/images/2026/12/zhongzhuanzhan-claude-code-codex-img_017.png)

然后再打开 Codex 的配置文件 `~/.codex/config.toml`，注意 Codex 中需要在网址后面加 `/v1`，切记：

```bash
code ~/.codex/config.toml

```

```toml
model_provider = "my_codex"
model = "替换成你希望用的模型"
model_reasoning_effort = "high"
disable_response_storage = true

[model_providers.my_codex]
name = "my_codex"
base_url = "替换成你的中转站网址/v1"
wire_api = "responses"
requires_openai_auth = true

```

![Codex config.toml 配置](https://brotherhong.com/content/images/2026/12/zhongzhuanzhan-claude-code-codex-img_018.png)

进入到工作目录，比如我的 `D:\Projects`，打开 Codex，问一句好，能收到回复，就证明配置完成，可以使用了。

![Codex CLI 测试回复](https://brotherhong.com/content/images/2026/12/zhongzhuanzhan-claude-code-codex-img_019.png)

### 配置 Codex APP

配置好了 Codex CLI 也就可以用 Codex APP 了，只不过其他的历史记录无法迁移过来，如图：

![Codex APP 使用界面](https://brotherhong.com/content/images/2026/12/zhongzhuanzhan-claude-code-codex-img_020.png)

问一句好，收到回答就证明配置完成。

![Codex APP 测试回复](https://brotherhong.com/content/images/2026/12/zhongzhuanzhan-claude-code-codex-img_021.png)

迁移历史记录自己找一下第三方工具吧，教程里暂时不讲了。