Skip to main content
Use a DGrid Model API Key for model requests. A Management API Key is an administrative credential and cannot be used for this tutorial. Check that your key has available credits and access to the selected model.
Connect Codex CLI or Codex in the desktop app to DGrid using your API key, the Responses API base URL, and a complete model ID. The current desktop download is the ChatGPT desktop app, which includes Codex. Existing installations may still use the Codex app name. Get the app from the official download page. This guide uses openai/gpt-6-sol. Screenshots and the detailed desktop walkthrough use macOS; Windows installation and CLI instructions are also included.

Before you start

  • A DGrid account with available credits and access to a model that supports the Responses API.
  • A DGrid API key: sign in and create or copy a key from API Keys.
  • For installation through npm, Node.js with npm. The desktop method can be used independently of the CLI.
Keep your full key out of screenshots and shared files. Preserve the complete model ID, including its openai/ prefix.
If Codex reports a model metadata or catalog error, ask DGrid for catalog settings that match your Codex version. Custom model aliases may need matching catalog metadata; do not guess a catalog URL. See the official gateway setup guide.

Choose your setup

The CLI profile selects DGrid for runs started with that profile. Editing the desktop main file changes the default provider for clients that read that file. If you depend on your current desktop setup, use another computer for the desktop walkthrough. Both methods use these connection settings:

1. Install Node.js and Codex CLI

If needed, install the current LTS release from the Node.js download page. On macOS, run the macOS installer; on Windows, run the Windows installer. Standard installers include npm.Open Terminal on macOS or PowerShell on Windows and check:
Install using the official Codex npm method.macOS: install into your user directory.
The PATH command applies to this terminal. Run it again in a new terminal, or add the directory to your shell’s PATH configuration.Windows PowerShell:
If PowerShell blocks npm.ps1, use npm.cmd instead of npm.The CLI screenshots use codex-cli 0.163.0. The separate profile-file format below applies to Codex 0.134.0 and later; see configuration profiles.

2. Create a DGrid profile

Create ~/.codex/dgrid.config.toml on macOS, or %USERPROFILE%\.codex\dgrid.config.toml on Windows. Paste this content into that file:
On macOS, you can create and open the file using:
If the profile already exists, edit its matching settings. Save as plain text with straight quotation marks. env_key is the variable’s name: keep DGRID_API_KEY here.
Codex CLI installed and a separate DGrid profile created in Terminal

Codex CLI installed and a separate DGrid profile created in Terminal

3. Enter the API key

Use the same terminal where you will launch Codex.macOS Terminal with Zsh:
Paste your key at the prompt and press Enter. No characters appear as you enter it. Wait for the terminal prompt to return before running the next command.Windows PowerShell: run the first line, enter the key at the masked prompt, then run the remaining lines.
This sets the key for the current terminal session. A new terminal requires entering it again.

4. Launch Codex and send a message

On macOS:
On Windows PowerShell:
If Codex asks whether you trust the folder, confirm for this demo folder you created. Check the selected model is openai/gpt-6-sol. You can also use /status to inspect the session.Send:
The expected response is:
Codex CLI displaying the response with the DGrid model selected

Codex CLI displaying the response with the DGrid model selected

If startup shows Running without the shared background server: --profile requires embedded mode., it describes how this profile session runs. Use F2 to view the warning and Esc to close it, then continue. Some Mac keyboards use Fn + F2.

Confirm the request in DGrid

Open DGrid’s request history and find the matching request time and complete model ID. A completed request appears with Success status.
DGrid request history showing openai/gpt-6-sol and Success, with Key Name blurred

DGrid request history showing openai/gpt-6-sol and Success, with Key Name blurred

The Key Name is blurred for privacy. Token counts and costs vary with the model and the context sent by Codex.

Troubleshooting

The Codex configuration reference lists provider settings. This guide covers connecting and receiving a response; tools, web search, and longer agent tasks depend on the selected model and gateway support.