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.

Codex has three common surfaces: CLI in your terminal, IDE usage through VS Code / Cursor / Windsurf or their integrated terminal, and the Codex desktop app. All of them read the same local Codex configuration.

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

  1. Open the dolinx console and sign in.
  2. Go to API Keys and create a new key.
  3. Copy the key that starts with sk-.
Treat the 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
The /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.json

Windows PowerShell

'{ "OPENAI_API_KEY": "sk-***" }' | Set-Content $env:USERPROFILE\.codex\auth.json

You 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

Once both files are saved you can run Codex right away — no terminal restart needed.
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.

If the desktop app keeps returning 401, it is usually a leftover ChatGPT login. Run codex logout (this clears auth.json), then rewrite auth.json as in step 4 and reopen the app.

Troubleshooting

SymptomFix
codex: command not foundReopen the terminal, or reinstall Node.js and Codex.
401 / unauthorizedCheck the key in ~/.codex/auth.json, make sure it starts with sk-, and remove extra spaces.
Provider or model not foundCheck that config.toml was saved and that all field names match the example.
Spinning or timeoutMake sure base_url is exactly https://api.dolinx.com/v1.
Codex keeps opening ChatGPT loginRun codex logout (this clears auth.json), then re-run the install script or rewrite auth.json as in step 4.