Choose a key and model
Get a key from key management. The current model listing includes gpt-6.1-sol in both Codex Pro groups, Codex Lite and GPT 官方直连. Codex Pro(仅限Codex) permits only ChatGPT Desktop and Codex CLI, excluding scripts, Hermes, OpenClaw and image generation. Choose Codex Pro(外接版) for external use. Lite permits external use but has no free Fast tier. Consult live pricing.
Install on Windows, macOS or Linux
Prepare Node.js, then run in Windows PowerShell, macOS Terminal or a Linux shell:
If your Windows client release has incomplete native support, install and configure inside WSL; its home directory differs from the Windows user directory. On Linux, resolve global npm permissions with a user-owned runtime.
Windows
npm install -g @openai/codex@latest
codex --versionmacOS
npm install -g @openai/codex@latest
codex --versionLinux
npm install -g @openai/codex@latest
codex --versionConfigure the Responses provider
Back up existing configuration and merge this minimal example with a text editor. Do not overwrite project settings. Use ~/.codex/config.toml on macOS / Linux or %USERPROFILE%\.codex\config.toml on Windows; create the directory if needed.
model_provider = "monkeyai"
model = "gpt-6.1-sol"
[model_providers.monkeyai]
name = "MonkeyAI"
base_url = "https://monkeytheme.com/v1"
wire_api = "responses"
requires_openai_auth = false
env_key = "MONKEYAI_API_KEY"Authentication uses an environment variable, keeping the key out of TOML. This is user-level configuration. See the official configuration reference. Enter the key privately in the terminal that launches Codex. These prompts hide input and keep the literal key out of command history. Set it again after closing the terminal.
Windows
$env:MONKEYAI_API_KEY = [System.Net.NetworkCredential]::new("", (Read-Host "MonkeyAI API key" -AsSecureString)).PasswordmacOS
read -r -s "MONKEYAI_API_KEY?MonkeyAI API key: "
export MONKEYAI_API_KEYLinux
read -r -s -p "MonkeyAI API key: " MONKEYAI_API_KEY
export MONKEYAI_API_KEYLaunch and desktop use
Run codex inside your project. Check the active provider and model, and review tool approval requests. Restart existing sessions after configuration changes. Desktop configuration sharing depends on the application version and environment; validate its selected model and errors separately even when the CLI works.
Verify and recover
After checking cost, you can send a short question. For 401, inspect the placeholder and key; for 403, check group and client restrictions; for model_not_found, check the exact ID; for 404, check Responses support and duplicated /v1. Restore the backup if necessary and collect redacted errors without exposing the key.