> ## Documentation Index
> Fetch the complete documentation index at: https://code.pipellm.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Codex

# Codex

Codex 使用 OpenAI Responses 格式。推荐通过 [CC Switch](/cc-switch) 的内置 **PIPELLM** 供应商完成配置，避免手动维护 `auth.json` 和 `config.toml`。

<Tip>
  在 CC Switch 中选择 **PIPELLM**，填入 PIPELLM Code API Key 后，Codex 配置会自动生成。
</Tip>

## 基础配置

Codex 的 API 请求地址为：

```text theme={null}
https://cc-api.pipellm.ai/v1
```

在「API Key」中填入你的 PIPELLM Code API Key。该 API Key 可在 [https://code.pipellm.ai](https://code.pipellm.ai) 获取。

<Frame>
  <img src="https://mintcdn.com/pipellmcode/dzjATQcx3kQQ-O-8/images/cc-switch-pipellm-codex-basic.png?fit=max&auto=format&n=dzjATQcx3kQQ-O-8&q=85&s=e9392b463afec2abfacc0c1b9dd39dc2" alt="PIPELLM Codex 基础配置" width="2002" height="1900" data-path="images/cc-switch-pipellm-codex-basic.png" />
</Frame>

## 生成配置

CC Switch 会同步生成 `auth.json` 和 `config.toml`。通常只需要确认「写入通用配置」已开启，然后点击添加即可。

<Frame>
  <img src="https://mintcdn.com/pipellmcode/dzjATQcx3kQQ-O-8/images/cc-switch-pipellm-codex-config.png?fit=max&auto=format&n=dzjATQcx3kQQ-O-8&q=85&s=09fe95bdf1c6929fc62b71acfb32b97a" alt="PIPELLM Codex config.toml 配置" width="2002" height="1900" data-path="images/cc-switch-pipellm-codex-config.png" />
</Frame>

## 手动配置参考

如果你需要手动检查配置，可以参考以下内容。

`auth.json`：

```json theme={null}
{
  "OPENAI_API_KEY": "<YOUR_API_KEY>"
}
```

`config.toml`：

```toml theme={null}
model_provider = "custom"
model = "gpt-5.5"
model_reasoning_effort = "medium"
disable_response_storage = true

[model_providers]
[model_providers.custom]
name = "PIPELLM"
wire_api = "responses"
requires_openai_auth = true
base_url = "https://cc-api.pipellm.ai/v1"
```
