N·01Integration guides
Codex / ChatGPT
OpenAI's coding assistant: tell it in plain words what you want and it edits the code in your project. It comes as a desktop app, an editor extension and a command-line tool, and one setup covers all three.
The three things this tool needs
- Address
https://api.xylemnode.com/v1- Key
sk-your-key- Model name
gpt-6.2-astra
Codex's address must end in /v1. Your key's group needs to include the GPT models.
Pick this if you'd rather not touch a terminal: use the Codex built into the ChatGPT desktop app, or the Codex extension in VS Code or Cursor. It's all clicks, plus pasting text into two files.
- 01
Install the desktop app or the editor extension
Either one is enough.
- Desktop app: click "Download ChatGPT desktop" above, install it and open it. Codex is inside (the separate Codex desktop app has been merged into it).
- Editor extension: in VS Code, Cursor or Windsurf, click the Extensions icon on the left, search for Codex, and install the one published by OpenAI.
You should seeYou can see Codex in the desktop app, or a Codex icon has appeared on the editor's left side.
- 02
Open the settings file, config.toml
Codex keeps its settings in a text file called config.toml, and you can open it from inside the app:
- Desktop app: Settings → Configuration → Open config.toml.
- Editor extension: the gear at the top right of the Codex panel → Codex Settings → Open config.toml.
You should seeA text editor opens. It may be empty, or it may already have a few lines.
Why, and what to do if it goes wrong
The file lives here. If the app says it doesn't exist, create a file named config.toml at this location yourself. Windows: %USERPROFILE%\.codex\config.toml (paste %USERPROFILE%\.codex into File Explorer's address bar and press Enter to open the folder) macOS / Linux: ~/.codex/config.toml
- 03
Paste in these settings
- If the file is empty: paste the whole block below and save.
- If it already has content: paste the block at the very top, then check that only one line starts with model = and only one starts with model_provider =. Delete the older duplicates.
toml model = "gpt-6.2-astra" model_provider = "xylemnode" [model_providers.xylemnode] name = "XylemNode" base_url = "https://api.xylemnode.com/v1" wire_api = "responses" env_key = "XYLEMNODE_API_KEY"You should seeThe file is saved, and its first two lines are model and model_provider.
Why, and what to do if it goes wrong
This block does three things: the first line picks the model, the second tells Codex to use XylemNode, and the bracketed section gives XylemNode's address. The key isn't here. The last line only gives it a name, XYLEMNODE_API_KEY; the next step puts the real key in another file. Leave wire_api as responses and keep /v1 on the address. The [model_providers.xylemnode] section may appear only once in the file.
- 04
Put your key in a .env file
- Open the .codex folder that config.toml is in.
- Create a new file in it named exactly .env (a dot at the front, no .txt at the end).
- Paste the line below, replace sk-your-key with the key you copied, and save.
.env XYLEMNODE_API_KEY=sk-your-keyYou should seeThe .codex folder now holds both config.toml and .env.
Why, and what to do if it goes wrong
In Windows Notepad, set "Save as type" to "All files", or it saves as .env.txt and Codex can't read it. In Mac TextEdit, choose Format → Make Plain Text first. .codex is a hidden folder; press Cmd + Shift + . in Finder to see it. The name before the equals sign must match env_key from the previous step exactly, and it must not start with CODEX_, because Codex ignores those names. On Windows you can skip .env: search the Start menu for "Edit environment variables for your account", add a variable called XYLEMNODE_API_KEY and set its value to your key.
- 05
Restart Codex and send a test message
- Desktop app: quit completely and open it again. Editor: press Ctrl + Shift + P (Cmd + Shift + P on a Mac) and run Developer: Reload Window.
- Start a new task and choose to run it on this computer, not in the Cloud.
- Send "Hi, reply with OK only".
You should seeCodex replies. If gpt-6.2-astra doesn't show in the model dropdown yet, that's fine: Codex uses the model on the first line of config.toml.
Why, and what to do if it goes wrong
Cloud tasks only run on a ChatGPT account and can't use XylemNode, so always run locally. The desktop app, the editor extension and the command line read the same config.toml and .env, so once this works the command-line version needs no setup either.
- 01
Open a terminal and install Codex
On Windows, search the Start menu for "PowerShell"; on a Mac, open Terminal. Paste one of the two install commands below and press Enter. The npm route needs Node.js installed first.
terminal # npm (all platforms)
npm install -g @openai/codex# macOS Homebrew
brew install --cask codexYou should seeThe install finishes without red error text.
Why, and what to do if it goes wrong
Keep the @openai/ in the npm command. Without it you install an unrelated package of the same name.
- 02
Check that it installed
terminal codex --versionYou should seeThe terminal prints a version number.
- 03
Create the settings file, config.toml
Codex keeps its settings in config.toml, inside the .codex folder in your user directory. Open it in Notepad or any text editor, or create it at this location if it isn't there.
- Windows
%USERPROFILE%\.codex\config.toml- macOS / Linux
~/.codex/config.toml
Why, and what to do if it goes wrong
To keep the settings in another folder, point the CODEX_HOME environment variable at it. You rarely need this.
- 04
Paste in these settings
Paste the whole block into config.toml and save. If the file already has a line starting with model = or model_provider =, edit that line instead of adding another.
toml model = "gpt-6.2-astra" model_provider = "xylemnode" [model_providers.xylemnode] name = "XylemNode" base_url = "https://api.xylemnode.com/v1" wire_api = "responses" env_key = "XYLEMNODE_API_KEY"Why, and what to do if it goes wrong
The address needs /v1, and wire_api stays responses, the only way Codex sends requests now. The key isn't written here; the last line only names it, and the next step stores the real key.
- 05
Store your key on the system
Run the line for your system in the terminal, with sk-your-key replaced by your key.
terminal # Windows (PowerShell / CMD)
setx XYLEMNODE_API_KEY "sk-your-key"# macOS / Linux
export XYLEMNODE_API_KEY="sk-your-key"You should seeOn Windows you see "SUCCESS: Specified value was saved."
Why, and what to do if it goes wrong
After setx on Windows, close this terminal and open a new one before it takes effect. On macOS / Linux, export only lasts for the current terminal window. To keep it, add the line to the end of ~/.zshrc (or ~/.bashrc). The desktop app and the editor extension can't read a key set with export; if you use them too, put the key in .codex/.env as the "Desktop app / editor extension" tab shows.
- 06
Start Codex and send a test message
Open a new terminal, run codex, then type "Hi, reply with OK only" and press Enter.
terminal codex# To use a different model just this once
codex --model gpt-6.2-astraYou should seeCodex replies.
Common questions
Every Codex command fails after an upgrade
Open config.toml and look at the wire_api line. New versions of Codex only accept responses there; wire_api = "chat" makes it fail, so change every wire_api to "responses". While you're there, check that base_url ends in /v1, which Codex doesn't add for you.