Integrations / Codex CLI / Setup Guide
Codex CLI with AI Token商城
Codex CLI is OpenAI’s official command-line AI coding tool. AI Token商城 is fully OpenAI-compatible — you only need to set two environment variables.
🔑 Key Configuration
Base URL:
https://ai.ccdan.live/v1/responsesAuth Var:
OPENAI_API_KEYAPI Key:Buy a redemption code at ccdan.live, then redeem at ai.ccdan.live.
1. Install Codex CLI
Install globally via npm:
npm install -g @openai/codexOfficial repo: github.com/openai/codex
2. Set Environment Variables
Edit ~/.zshrc (or ~/.bashrc) and add:
export OPENAI_API_KEY="你的_AI_TOKEN商城_API_KEY"
export OPENAI_BASE_URL="https://ai.ccdan.live/v1/responses"Reload the shell:
source ~/.zshrcWindows PowerShell users: use setx OPENAI_API_KEY "your-key" and setx OPENAI_BASE_URL "https://ai.ccdan.live/v1/responses", then restart the terminal.
3. Verify Configuration
Run a test command:
codex "Create a Hello World Python script"If Codex generates code normally, you’re connected.
Usage Tips
Specify a Model
Use the --model flag to switch models:
codex --model gpt-5.4-mini-codex "重构这个函数"
codex --model gpt-5.1-codex-max "修复这个 Bug"Recommended Models
| Scenario | Model |
|---|---|
| Everyday code generation | gpt-5.4-mini-codex |
| Complex refactor / debugging | gpt-5.1-codex-max |
Codex CLI options change between versions — keep an eye on the official README.