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

# Codex 命令行

> 将 Codex CLI 接入 Syon

Codex CLI is OpenAI's terminal-based AI coding assistant. Install it first (section 1), then connect it to Syon (section 2). If Codex is already installed, skip straight to section 2.

## 1. Install Codex

* Codex requires Node.js 22 or later. Install it from the [official installer](https://nodejs.org/en/download/) or via Homebrew (`brew install node`).

![Image 1](https://docs.syon.ai-images/en/codex-1.png)

* macOS users can also install Codex with Homebrew: `brew install codex`.
* In your terminal, run:

plaintext

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

* After installation, check the version:

plaintext

```
codex --version
```

## 2. Connect to Syon

### Configure the provider

#### macOS / Linux

Open a terminal, paste the full block below, and press Enter:

plaintext

```
mkdir -p ~/.codex && cat > ~/.codex/config.toml <<'EOF'
model_provider = "syon"
model = "gpt-5.6-sol"
model_reasoning_effort = "high"
[model_providers.syon]
name = "Syon"
base_url = "https://api.syon.com/v1"
env_key = "OPENAI_API_KEY"
wire_api = "responses"
EOF
```

#### Windows

Open PowerShell and run:

plaintext

```
New-Item -ItemType Directory -Force -Path "$HOME\.codex" | Out-Null
@'
model_provider = "syon"
model = "gpt-5.6-sol"
model_reasoning_effort = "high"

[model_providers.syon]
name = "Syon"
base_url = "https://api.syon.com/v1"
env_key = "OPENAI_API_KEY"
wire_api = "responses"
'@ | Set-Content -Path "$HOME\.codex\config.toml" -Encoding UTF8
```

### Set the API key

Replace `<your-Syon-key>` with the API key you created in the [Syon dashboard](https://syon.com/dashboard?tab=api-keys).

#### macOS

plaintext

```
echo 'export OPENAI_API_KEY="<your-Syon-key>"' >> ~/.zshrc
source ~/.zshrc
```

#### Linux

plaintext

```
echo 'export OPENAI_API_KEY="<your-Syon-key>"' >> ~/.bashrc
source ~/.bashrc
```

#### Windows

plaintext

```
[Environment]::SetEnvironmentVariable("OPENAI_API_KEY", "<your-Syon-key>", "User")
```

Windows users: after running the command above, close the current PowerShell window and open a new one.

After both steps, run `codex` in the terminal. It will use Syon.

## 3. Enable Fast mode (optional)

Fast mode makes GPT-series models respond faster (`gpt-5.6-sol` runs up to 2.5x faster than Standard), billed at 2x the standard rate.

To enable it for the current session, type this inside Codex:

bash

```
/fast
```

(`/fast` is a toggle — type it again to turn it off.)

To enable it permanently, add this line at the top of `~/.codex/config.toml`:

toml

```
service_tier = "fast"
```

All requests under this config will then use Fast mode.
