Skip to main content
This page configures Codex CLI with a NexusAPI key, not your ChatGPT password.

1. Install Codex

Open PowerShell on Windows or Terminal on Mac. Run only your system’s installer. Skip this if installed.
Reopen the terminal and check the version. Continue only when a version number appears; fix installation first if the command is missing.

2. Save the address and model

Create a key, select its group in Model Square, and copy a Codex / Responses-compatible model name. Open the user configuration:
In nano, save with Ctrl + O, Enter, then exit with Ctrl + X. In Windows Notepad use Ctrl + S. Keep the filename config.toml, not .txt. Paste into an empty file, replacing only YOUR_MODEL_ID:
Back up existing configuration. Keep model and model_provider at the top, then add or update [model_providers.nexusapi] without duplicate sections. You can use CC Switch instead. Do not put the key in this file.

3. Set and save your API key

Replace only YOUR_API_KEY with your complete key. The Windows commands set both the current terminal and persistent user environment.
The examples use Mac’s default Zsh and Linux Bash. Other shells need their own startup file; ask support if unsure. Keep keys out of projects and screenshots.

4. Start and test

Open a terminal in your own project and run:
Use /status to check your model and the NexusAPI provider. Send “Reply only: connection successful. Do not modify files.” A complete reply and a record in Usage Logs confirm setup. The test uses a little credit.

5. Common problems

For Missing environment variable, repeat step 3. For an unavailable model, recopy a Codex-compatible name from your group. See troubleshooting for other errors. An editor launched from the Mac Dock may not inherit terminal variables. Verify the CLI first; for the Codex extension, launch the editor from the configured terminal with code . or cursor .. Keep keys out of project settings. Official installation and configuration: Codex CLI · Custom providers. Need a different model or group/key? If settings do not apply, use the symptom checklist.