Codex CLI có thể dùng OpenAI-compatible endpoint của cheapkeyai.shop. Cấu hình nên đặt trong thư mục `.codex` của user để dùng ổn định qua nhiều project.
Cài đặt Codex
npm i -g @openai/codex@latestTạo file config.toml
File đặt tại `~/.codex/config.toml` trên macOS/Linux, hoặc `%USERPROFILE%\.codex\config.toml` trên Windows. Tạo thư mục `.codex` nếu chưa có.
model_provider = "cheapkeyai"
model = "gpt-5.2"
model_reasoning_effort = "xhigh"
model_verbosity = "high"
network_access = "enabled"
disable_response_storage = true
windows_wsl_setup_acknowledged = true
[model_providers.cheapkeyai]
name = "cheapkeyai"
base_url = "https://cheapkeyai.shop/v1"
wire_api = "responses"
requires_openai_auth = trueTạo file auth.json
Cùng thư mục với config.toml: `~/.codex/auth.json` trên macOS/Linux, hoặc `%USERPROFILE%\.codex\auth.json` trên Windows. Thay `sk-your-api-key-here` bằng key bạn tạo ở trang Keys.
{
"OPENAI_API_KEY": "sk-your-api-key-here"
}Sử dụng
codex
codex -m gpt-5.3-codex -c model_reasoning_effort="xhigh"
codex "Review thay đổi hiện tại và đề xuất test cần chạy"Khắc phục sự cố
- Codex không kết nối: kiểm tra `base_url`, `wire_api` và `auth.json`.
- Command not found: kiểm tra npm global bin có nằm trong PATH không.
- Model trả lời lạ: thử model khác hoặc giảm/tăng reasoning effort theo task.
- Không đọc được network: bật cấu hình network nếu workflow cần truy cập web/API.