Getting StartedOpenAI CodexInstallation & Setup

OpenAI Codex Installation and Configuration Guide

This guide will help you configure OpenAI Codex to use the claude-code.club AI API service.

1. Install the Codex CLI

Install the Codex CLI globally using one of the following methods:

npm install -g @openai/codex

For more installation options and detailed instructions, refer to the OpenAI Codex official documentation.

2. Configure Codex

Configuring Codex requires editing two files: ~/.codex/config.toml and ~/.codex/auth.json.

Configuration file: config.toml

Add the following configuration to the beginning of your ~/.codex/config.toml file:

model_provider = "club"
model = "gpt-5.3-codex"
model_reasoning_effort = "medium"
disable_response_storage = true
preferred_auth_method = "apikey"
personality = "pragmatic"
 
[model_providers.club]
name = "ai code club"
base_url = "https://claude-code.club/openai/v1"
wire_api = "responses"
requires_openai_auth = true
env_key = "OPENAI_API_KEY"
 
[features]
shell_snapshot = true
collaboration_modes = true
multi_agent = true
unified_exec = true

Authentication file: auth.json

Configure ~/.codex/auth.json as follows:

{
  "OPENAI_API_KEY": <your-api-key>
}

3. Configure Environment Variables

Set the OPENAI_API_KEY environment variable to your API key (format: cr_xxxxxxxxxx).

Temporary (current session only):

export OPENAI_API_KEY=cr_xxxxxxxxxx

Permanent (recommended):

For zsh (macOS default):

echo 'export OPENAI_API_KEY="cr_xxxxxxxxxx"' >> ~/.zshrc
source ~/.zshrc

For bash:

echo 'export OPENAI_API_KEY="cr_xxxxxxxxxx"' >> ~/.bashrc
source ~/.bashrc

Note: After setting this, you may need to reopen your terminal window, or manually run source ~/.zshrc (zsh) / source ~/.bashrc (bash) for the configuration to take effect.

⚠️

Replace cr_xxxxxxxxxx with your actual API key obtained from claude-code.club.

4. Verify the Configuration

Once configured, start Codex to verify everything is working:

codex

Congratulations! You have successfully configured OpenAI Codex. You can now start using AI-assisted coding.

Frequently Asked Questions

Q: Getting an “Invalid API Key” error? A: Check that your environment variable is configured correctly, and make sure OPENAI_API_KEY in ~/.codex/auth.json is set to the correct API key.

Q: How do I get an API key? A: Visit the Get API Key page to learn how to obtain a key.


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