Skip to content

Codex CLI Installation Guide ​

If you plan to use the GPT / Codex model families, it's a good idea to install the Codex CLI in advance. Once installed, you can also connect to NextHub through CC-Switch.

Installation Steps ​

1. Verify the Node.js environment ​

The Codex CLI also requires Node.js. Check your version first:

bash
node -v
npm -v

2. Install the Codex CLI globally ​

Run the following command in your terminal to install Codex:

bash
npm install -g @openai/codex

3. Verify the Codex installation ​

Run the commands below; if the version number prints correctly or Codex starts, you're all set:

bash
codex --version
codex

Once installation is complete, continue directly with the CC-Switch tutorial. In CC-Switch, select Codex, enter https://api.nexthub.cc/v1 as the request URL (the OpenAI Responses protocol requires /v1), then fill in your ApiKey to start using the GPT-Azure group (0.47x).

Connection Method 2: Manual Configuration ​

If you'd rather not use a configuration tool, just edit Codex's two configuration files manually.

1. Open the Codex configuration directory ​

bat
start "" "%USERPROFILE%\.codex"
bash
open "$HOME/.codex"

Create the corresponding files manually if the directory doesn't already contain them.

2. Configure config.toml ​

Write the following content to ~/.codex/config.toml:

toml
model = "gpt-5.6"
model_provider = "nexthub"
model_reasoning_effort = "high"
disable_response_storage = true

[model_providers.nexthub]
name = "nexthub"
base_url = "https://api.nexthub.cc/v1"
wire_api = "responses"
requires_openai_auth = true

The Request URL Must Include /v1

Codex uses the OpenAI Responses protocol (/v1/responses), so base_url must include /v1. Fill in model with a model ID offered by the GPT-Azure / GPT-Pro groups as needed (for example gpt-5.6, gpt-6-astra); for real-time data, refer to the Model Plaza.

3. Configure auth.json ​

Write your ApiKey to ~/.codex/auth.json (the key for the GPT-Azure or GPT-Pro group):

json
{
  "OPENAI_API_KEY": "your NextHub ApiKey"
}

4. Verify ​

Run codex in your terminal and send a test message. If the selected model appears at the top of the interface and you get a normal reply, you're connected.

Global Prompts

~/.codex/AGENTS.md is Codex's global prompt file. It is created automatically if missing, and you can write your working conventions there as needed.

NextHub · Direct connections to OpenAI / Anthropic via official account pools — reliable, secure, and worry-free.