Your privacy choices

Allow optional cookies for referral attribution, visit analytics, and Google Ads purchase measurement.

Codex Deployment Guide

Download CC Switch for your computer, enter your Guishu AI API key, and get your first reply in Codex CLI.

1. Download and open CC Switch

Use CC Switch to set up the API connection and Codex CLI to chat in your terminal. Choose the CC Switch 4.0.25 installer for your computer.

  • Windows x64 · Download MSI Choose this for most Intel and AMD PCs. Double-click the downloaded .msi, complete the installation, and open CC Switch from the Start menu.
  • Windows ARM64 · Download MSI Open Settings → System → About. Choose this installer if System type shows an ARM-based processor.
  • macOS · Download DMG The same installer works on Intel Macs and Macs with Apple silicon. Open the .dmg, drag CC Switch into Applications, and launch it from there.
  • Linux · Choose a package Expand Assets and match the package to the output of uname -m (aarch64 means arm64). Choose .deb for Ubuntu or Debian, or .rpm for Fedora.

Downloaded a different file? v3.12.2-en.md contains the release notes. If you extracted an archive and found only CC-SWITC.14, use the installer for your system above. Leave the file extension as it is. You can find other versions on the official releases page.

2. Install Codex CLI

Open Command Prompt on Windows, or Terminal on macOS or Linux. If Codex is already installed, run codex --version. If it prints a version number, skip to step 3.

For a first-time installation, install Node.js LTS, reopen your terminal, and run the two commands below in order. The second should print codex-cli and the version number.

npm install -g @openai/codex@latest
codex --version

3. Add Guishu AI in CC Switch

Select Codex in the sidebar, open Direct, and click Add Provider (+). Under All, choose Custom Configuration.

FieldWhat to enter
Provider NameEnter “Guishu AI” so you can find it in the list.
API Request URLEnter https://api.llm-token.cn/v1, including the final /v1.
API KeyPaste your full Guishu AI API key.
Default ModelFrom the model list, copy a model ID that your key can access and that supports the Responses API, such as gpt-6.1-terra.

Click Add at the bottom. In the Direct list, click Switch on the Guishu AI card. If you were using routing or aggregation, the button reads Back to direct and use. When the card shows In use, open Codex.

4. Get your first reply in the terminal

Exit any open Codex session. In your terminal, go to your project folder and run codex. If you don’t have a project yet, use an empty folder:

mkdir my-codex-project
cd my-codex-project
codex

Type “Reply with just OK” in Codex. A reply confirms the request completed. This test uses your key’s quota.

No reply? For a 401 error, paste your API key again and check that it’s enabled. If the model is unavailable, check the default model ID and whether your key has access to it. If the endpoint can’t be found, check that the URL ends in /v1 and that Upstream Format under Advanced Options is set to OpenAI Responses.

Optional: Edit the configuration files manually

If you received a reply after using CC Switch, you’re done. To configure Codex by hand, edit the two files below in %USERPROFILE%\.codex\ on Windows or ~/.codex/ on macOS and Linux. Create the folder if needed. If it already contains configuration files, back them up and keep your other settings.

config.toml — Set the provider, URL, and a model your key can access.

model_provider = "gpt-agent"
model = "gpt-6.1-terra"

[model_providers.gpt-agent]
name = "LLM API Gateway"
base_url = "https://api.llm-token.cn/v1"
wire_api = "responses"
requires_openai_auth = true

auth.json — Replace the placeholder with your Guishu AI API key, save the file, and relaunch Codex as in step 4.

{
  "OPENAI_API_KEY": "YOUR_API_KEY"
}