Codex / GPT Setup Guide
A beginner-friendly guide for macOS and Windows. Even if you have never used a terminal, you can copy, paste and press Enter to run OpenAI Codex through dolinx.
RECOMMENDED · 30 SECONDS
One-command install. Do step 2 first to get your API key, then run this single command instead of steps 1, 3 and 4 — it installs Node and Codex, writes config.toml, auth.json and the environment variable automatically. Already-installed tools are skipped; re-running is safe.
# macOS / Linux curl -fsSL https://dolinx.com/install.sh | bash -s -- --codex-key sk-your-codex-key # Windows PowerShell $env:CODEX_KEY="sk-your-codex-key"; irm https://dolinx.com/install.ps1 | iex
If Codex opens a ChatGPT login page afterwards, run codex logout and then re-run the script. See the Setup Center for details, or keep reading for the manual walkthrough.
What is a terminal?
A terminal, command line or PowerShell is a small window where you type commands. For this guide, you only need copy, paste and Enter.
macOS: press Command + Space, type Terminal and press Enter. Windows: open the Start menu, search PowerShell and open Windows PowerShell.
1. Install Codex
Install Node.js first if you do not have it. Then run:
npm install -g @openai/codex
On macOS you can also use brew install codex. Check the installation with codex --version. If the command is not found, close the terminal and open a new one.
2. Get your dolinx API key
- Open the dolinx console and sign in.
- Go to API Keys and create a new key.
- Copy the key that starts with
sk-.
sk- key like a password. Do not paste it into public repositories, screenshots or group chats.3. Edit config.toml
Codex uses config.toml to decide which model provider to call. The file lives at ~/.codex/config.toml on macOS / Linux and %USERPROFILE%\.codex\config.toml on Windows. Create it if it does not exist, then paste:
model = "gpt-5.5" model_provider = "dolinx" [model_providers.dolinx] name = "dolinx" base_url = "https://api.dolinx.com/v1" wire_api = "responses" requires_openai_auth = true
/v1 suffix matters for Codex because Codex uses an OpenAI-compatible API route. requires_openai_auth tells Codex to read your key from ~/.codex/auth.json, which you create in the next step.4. Write your key to auth.json
This step happens in the terminal, not inside config.toml. The key lives in a file, so the CLI, IDE extension and desktop app all pick it up — no environment variables, no terminal restart.
macOS / Linux
echo '{ "OPENAI_API_KEY": "sk-***" }' > ~/.codex/auth.jsonWindows PowerShell
'{ "OPENAI_API_KEY": "sk-***" }' | Set-Content $env:USERPROFILE\.codex\auth.jsonYou can also create auth.json in the .codex folder with any text editor — the content is just that one line of JSON.
5. Start using Codex
CLI
cd ~/your-project codex # Or start with a prompt codex "Refactor this module and add tests"
Useful commands include /model, /approvals and codex resume.
IDE usage
You can install the official Codex extension in VS Code / Cursor / Windsurf, or simply open the IDE integrated terminal and run codex. If your IDE was already open before you finished the setup, quit it fully and reopen it.
Codex desktop app
If you prefer the standalone Codex desktop app for macOS or Windows, download it from the official OpenAI Codex App page. Windows users can also use the official Microsoft Store installer link.
The desktop app does not have a separate gateway form. It reads the same ~/.codex/config.toml and ~/.codex/auth.json you configured above.
codex logout (this clears auth.json), then rewrite auth.json as in step 4 and reopen the app.Troubleshooting
| Symptom | Fix |
|---|---|
codex: command not found | Reopen the terminal, or reinstall Node.js and Codex. |
| 401 / unauthorized | Check the key in ~/.codex/auth.json, make sure it starts with sk-, and remove extra spaces. |
| Provider or model not found | Check that config.toml was saved and that all field names match the example. |
| Spinning or timeout | Make sure base_url is exactly https://api.dolinx.com/v1. |
| Codex keeps opening ChatGPT login | Run codex logout (this clears auth.json), then re-run the install script or rewrite auth.json as in step 4. |