Back to API Docs
Codex CLI
Kết nối Codex CLI qua provider tương thích OpenAI.
Connection
- URL cơ sở
- https://your-domain.com/v1
- Install
- npm install -g @openai/codex
Default model
Setup
- Install the Codex CLI globally via npm.
- Cách nhanh nhất: vào trang API Keys, chọn key → tab Codex CLI → copy lệnh 1 dòng. Hoặc cấu hình thủ công bên dưới.
- Configure your shell environment with the keys.
- Save the configuration to ~/.codex/config.toml.
- Run `codex` in your project directory.
Cấu hình
Cài nhanh 1 lệnh — macOS / Linux
Terminal
bash
eval "$(curl -fsSL "https://your-domain.com/api/setup/codex.sh?key=YOUR_API_KEY&model=gpt-5.6-sol")"Cài nhanh 1 lệnh — Windows
PowerShell
powershell
irm "https://your-domain.com/api/setup/codex.ps1?key=YOUR_API_KEY&model=gpt-5.6-sol" | iexBiến môi trường
~/.zshrc
bash
export OPENAI_API_KEY="YOUR_API_KEY"
export OPENAI_BASE_URL="https://your-domain.com/v1"Provider config
~/.codex/config.toml
toml
model = "gpt-5.6-sol"
model_provider = "gateway"
[model_providers.gateway]
name = "API Gateway"
base_url = "https://your-domain.com/v1"
wire_api = "responses"
env_key = "OPENAI_API_KEY"Tip: Codex chỉ hỗ trợ wire_api = "responses". Xác nhận model đã chọn khả dụng trên /v1/responses trước khi dùng provider này.
