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.

  1. 01

    Install the desktop app or the editor extension

    Either one is enough.

    1. 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).
    2. 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.

  2. 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:

    1. Desktop app: Settings → Configuration → Open config.toml.
    2. 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

  3. 03

    Paste in these settings

    1. If the file is empty: paste the whole block below and save.
    2. 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.

  4. 04

    Put your key in a .env file

    1. Open the .codex folder that config.toml is in.
    2. Create a new file in it named exactly .env (a dot at the front, no .txt at the end).
    3. Paste the line below, replace sk-your-key with the key you copied, and save.
    .env
    XYLEMNODE_API_KEY=sk-your-key

    You 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.

  5. 05

    Restart Codex and send a test message

    1. Desktop app: quit completely and open it again. Editor: press Ctrl + Shift + P (Cmd + Shift + P on a Mac) and run Developer: Reload Window.
    2. Start a new task and choose to run it on this computer, not in the Cloud.
    3. 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.

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.