Getting StartedOpenAI Codex1-Minute Quick Setup

Codex 1-Minute Quick Setup

This page is for those who have never used a terminal. All you need: ① Download one app ② Copy-paste your Key and two config snippets ③ Copy-paste one command in the terminal (just one line).
Follow along and you’ll have Codex running in 1 minute.

⚠️

Codex requires one extra “terminal command” step compared to Claude Code. This step is just copy-paste one line, but unavoidable — Codex’s authentication mechanism requires the API Key to be read from system environment variables. If you’re already comfortable with the command line, jump directly to Step 3.


What You Need to Prepare

A Windows or Mac Computer

Windows 10/11 or macOS both work.

A CC Club API Key

If you don’t have one yet, go Get API Key to apply for free (come back to this page after getting it).

The API Key looks like cr_xxxxxxxxxxxxxxxxxxxxxxxxxxxx. Copy it to a notepad first, you’ll need it 3 times (GUI form, auth.json, terminal environment variable).


Step 1: Download and Install CC Switch

CC Switch is a desktop application that helps you manage API configurations — just copy-paste, no-brainer operation.

  1. Click to download: CC Switch Windows version (.msi, 12 MB)
  2. Double-click the downloaded .msi installer and follow the prompts to complete installation
  3. After installation, open CC Switch from the Start menu
⚠️

If Windows shows “Windows protected your PC” on first launch, click “More info” → “Run anyway”.


Step 2: Fill in Configuration in CC Switch

After opening CC Switch, follow these steps:

Switch to Codex Group

CC Switch has a column of groups on the left: Claude / Claude Desktop / Codex / OpenCode / Gemini. Click Codex.

Click ”+ Add Provider”

The blue button in the upper right corner. A form will pop up.

Fill in GUI Fields According to This Table

FieldWhat to Fill
Provider NameAny name, e.g. CC Club Codex
Official WebsiteLeave empty
APIPaste your Key here
Request URLhttps://claude-code.club/openai
API FormatSelect OpenAI Chat Completions from dropdown
Model RegionLeave empty

Paste This Snippet in the “auth.json Configuration” Box

Paste the entire snippet, only change one thing: fill in your API Key inside the empty quotes "" after OPENAI_API_KEY.

{
  "OPENAI_API_KEY": "your API key"
}
What the auth.json configuration box looks like after pasting

↑ After pasting, CC Switch’s auth.json (JSON) box should look like this

Paste This Snippet in the “config.toml Configuration” Box

Paste the entire snippet, no changes needed:

model_provider = "club"
model = "gpt-5.4"
model_reasoning_effort = "medium"
disable_response_storage = true
preferred_auth_method = "apikey"
 
[model_providers.club]
name = "ai code club"
base_url = "https://claude-code.club/openai"
wire_api = "responses"
requires_openai_auth = true
env_key = "OPENAI_API_KEY"
 
[features]
shell_snapshot = true
multi_agent = true
unified_exec = true
What the config.toml configuration box looks like after pasting

↑ After pasting, CC Switch’s config.toml (TOML) box should look like this

Click “Save” in the Bottom Right

On success, you’ll return to the list and see a new CC Club Codex provider.

Saving only writes the configuration to CC Switch, it’s not active yet. In Step 4 we’ll guide you to click Test → Enable to actually activate it.


Step 3: Configure Environment Variable (Required)

This is the biggest difference between Codex and Claude Code. When Codex starts, it looks for OPENAI_API_KEY in system environment variables. The Key in CC Switch’s GUI won’t automatically inject there. So we need to copy-paste one command into the terminal.

Open PowerShell (search “powershell” in Start menu), copy this entire line, replace cr_xxxxxxxxxx with your own API Key, and press Enter:

[System.Environment]::SetEnvironmentVariable('OPENAI_API_KEY', 'cr_xxxxxxxxxx', 'User')

What does this command do? It writes OPENAI_API_KEY to Windows user-level environment variables, permanently. After setting, restart PowerShell for newly launched processes to read it.


Step 4: Test, Enable, Verify

The saved provider is not active yet. This step has three actions: first Test the configuration (confirm Key + URL are correct) → then Enable (make it active) → finally Verify in terminal (run end-to-end once).

✅ Full Process Preview (take a look first, step-by-step instructions below)

1Click the test button on the right side of the provider row

Click Test (blue button) on the CC Club Codex row

2
Green success message from test

See green Test Successful message

3Click the enable button to activate this provider

Click Enable (green button), a appears at the beginning of the row when active

4Terminal running codex showing response

Run codex in terminal, see banner + response — connection is working

📌 Images ①②③ are from Claude configuration example (same CC Switch interface), Codex operations are identical

First Click “Test” to Verify Configuration

On the CC Club Codex provider row you just saved, click the blue Test button (as shown in image ① above). CC Switch will send a handshake request to the upstream using your Key + request URL.

  • See green “Test Successful” message (image ②): Key and URL are correct, proceed to next step
  • See red error: Usually wrong Key / wrong URL / network issue. Click Edit to check OPENAI_API_KEY and base_url, most common issue is Key has leading/trailing spaces

Why test first? Testing only verifies “CC Switch can connect to the API”, doesn’t require Codex itself. Get this working first, then installing the command line will be easier.

Click “Enable” to Activate This Configuration

After test passes, click the green Enable button on the same row (image ③). After successful activation:

  • A ✓ checkmark appears at the beginning of the row
  • Status changes from “Saved” to “Currently Active
⚠️

Save ≠ Enable ≠ Test, three separate things:

  • Save = Write this configuration to CC Switch
  • Test = Check if this configuration can connect
  • Enable = Make Codex actually use this configuration

Without clicking “Enable”, even if test passes it won’t take effect.

Install Codex CLI

CC Switch only manages “configuration”, not “installation”. You still need to install Codex itself — Find the “Install Codex” button at the top of CC Switch, click it, and it will automatically install for you.

(If you can’t find the button or it errors, follow the Manual Installation Steps.)

Verify Once in Terminal

codex "explain what vibe coding is in one sentence"

Returns a response within seconds (as shown in image ④ above), the entire chain is working 🎉.


What’s Next?

It’s working now. Recommended next steps:


Having Issues?

Issue 1: Terminal shows “command not found” when typing codex

This means Codex CLI itself isn’t installed. Two solutions:

  • Retry CC Switch’s “Install Codex” button: Previous attempt may have failed due to network interruption
  • Switch to manual installation: Follow Manual Installation Steps (below)
Issue 2: Running codex shows “Invalid API key” or “Authentication failed”

99% chance Step 3 wasn’t done or didn’t take effect. Three checks:

  1. Restart terminal: After setting environment variable, you must reopen a new terminal window, old window can’t read it
  2. Verify environment variable is set:
    • Windows PowerShell: echo $env:OPENAI_API_KEY
    • macOS Terminal: echo $OPENAI_API_KEY
    • Should output your Key; if empty, Step 3 didn’t work, redo it
  3. Confirm provider is activated in CC Switch: The CC Club Codex row in the list should have a ✓ checkmark
Issue 3: Response is very slow / keeps spinning

May be network node issue. Go back to CC Switch, edit that provider, change both Request URL and base_url in config.toml simultaneously to one of these groups, then save:

  • https://jp.claude-code.club/openai — Japan node (optimized for China)
  • https://hk.claude-code.club/openai — Hong Kong node (optimized for China)
  • https://sz.ai-code.club/openai — Shenzhen node (China relay)

After changing, don’t forget to click activate again.

Manual Install Codex (Backup Method)

If CC Switch doesn’t have an “Install Codex” button, or clicking it errors, install manually.

Requires Node.js (v18+) first:

npm install -g @openai/codex

Or on macOS using Homebrew:

brew install --cask codex

After installation, return to this page and continue with “Step 3”.


Already Experienced?

If you understand the terminal and want full control over the installation process, go directly to the traditional path:


MIT 2026 © Nextra.
加入社群CC Club返回官网