Skip to content

Project introduction

Codex CLI is a coding agent from OpenAI that runs locally on your computer.

Dli.li endpoint options

TypeURL
Official default APIhttps://api.dli.li/v1
Official backup APIhttps://api.dlizz.com/v1

Recommended usage

Codex is an OpenAI-compatible client. You can set `base_url` to the official default API `https://api.dli.li/v1`; if you want the official backup API directly, use `https://api.dlizz.com/v1`.

Demo

introduce-01.webp

Features

Feature areaNotes
Terminal workflowInteractive coding assistant for editing, patching, and running commands
Tool-driven modelUses tools such as apply_patch, shell execution, and plan tracking
Patch editingSupports atomic file updates through structured patches
Sandboxing and approvalsSupports permission controls and approval modes
Plan trackingHelps keep multi-step tasks explicit
Safe workflowAvoids unrelated changes and dangerous operations by default

Model setup

Manual configuration example

If you do not use the helper script, you can edit the Codex config files under the user's home directory directly. Create or edit ~/.codex/config.toml (on native Windows, use %USERPROFILE%\.codex\config.toml) and save this content:

toml
model_provider = "custom"
model = "gpt-5.4"
model_reasoning_effort = "xhigh"
network_access = "enabled"
disable_response_storage = true
windows_wsl_setup_acknowledged = true
model_verbosity = "high"

[model_providers]
[model_providers.custom]
name = "custom"
wire_api = "responses"
requires_openai_auth = true
base_url = "https://api.dli.li/v1"

Then edit the auth file in the same directory, ~/.codex/auth.json, and replace token with the API token you created in the console:

json
{
  "OPENAI_API_KEY": "token"
}

Restart codex after saving so it reads the new configuration.

Windows guide

1. Open a terminal

windows_open_terminal

2. Install WSL2

For the best Windows experience, install WSL2:

powershell
wsl --install

Restart Windows afterward.

Windows notes

- PowerShell is recommended over CMD - Run as administrator if permissions are blocked - Some antivirus tools may require allow-listing

windows-img-03.webp

Install NVM:

bash
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/master/install.sh | bash

windows-img-04.webp

Open WSL and install Node.js:

bash
wsl
nvm install 22

windows-img-05.webp

3. Install Codex CLI

bash
npm i -g @openai/codex

windows-img-06.webp

4. Configure the CLI

Use the upstream helper:

powershell
iex (irm 'https://raw.githubusercontent.com/QuantumNous/new-api-docs/refs/heads/main/helper/codex-cli-setup.ps1')

windows-configure

5. Start using Codex CLI

bash
wsl
codex

Or in a project:

bash
cd /mnt/c/path/to/your/project
codex

windows-img-09.webpwindows-img-10.webp

Permission modes are typically:

  1. Allow Codex to edit directly
  2. Require manual approval before edits

To select a model:

bash
/model

windows-img-11.webpwindows-img-12.webpwindows-img-13.webpwindows-img-14.webp

After changing the API address, all models use the custom endpoint instead of OpenAI account quota.

macOS guide

1. Install Homebrew if needed

Official site: https://brew.sh

macos-img-01.webp

bash
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

macos-img-02.webpmacos-img-03.webpmacos-img-04.webp

2. Install Node.js

bash
brew update
brew install node

macOS notes

- You may need `sudo` if permissions are restricted - The first launch may require macOS permission confirmation - Terminal or iTerm2 is recommended

macos-img-05.webpmacos-img-06.webp

Verify:

bash
node --version
npm --version

3. Install Codex CLI

bash
npm install -g @openai/codex

If needed:

bash
sudo npm install -g @openai/codex

macos-img-07.webp

Verify:

bash
codex --version

4. Configure the CLI

bash
curl -fsSL https://raw.githubusercontent.com/QuantumNous/new-api-docs/refs/heads/main/helper/codex-cli-setup.sh | bash

macos-configure

5. Start using Codex CLI

bash
codex

Or in a project:

bash
cd /path/to/your/project
codex

macos-img-09.webpmacos-img-10.webpmacos-img-11.webpmacos-img-12.webpmacos-img-13.webpmacos-img-14.webp

After changing the API address, all models use the custom endpoint instead of OpenAI account quota.

6. macOS common issues

Permission error during installation

Try:
  • sudo npm install -g @openai/codex
  • npm config set prefix ~/.npm-global

Security settings block execution

Open macOS security settings and allow the app, or run:
bash
sudo spctl --master-disable

Linux guide

1. Install Node.js

bash
sudo curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash -
sudo apt-get install -y nodejs

Linux notes

- Some distributions need extra dependencies - Use `sudo` if permissions are restricted - Make sure your global npm directory is writable

linux-img-01.webplinux-img-02.webp

Verify:

bash
node --version
npm --version

2. Install Codex CLI

bash
npm install -g @openai/codex

If needed:

bash
sudo npm install -g @openai/codex

linux-img-03.webp

Verify:

bash
codex --version

3. Configure the CLI

bash
curl -fsSL https://raw.githubusercontent.com/QuantumNous/new-api-docs/refs/heads/main/helper/codex-cli-setup.sh | bash

macos-configure

4. Start using Codex CLI

bash
codex

Or in a project:

bash
cd /path/to/your/project
codex

linux-img-05.webplinux-img-06.webplinux-img-07.webplinux-img-08.webplinux-img-09.webplinux-img-10.webp

After changing the API address, all models use the custom endpoint instead of OpenAI account quota.

5. Linux common issues

Permission error during installation

Try:
  • sudo npm install -g @openai/codex
  • npm config set prefix ~/.npm-global
  • export PATH=~/.npm-global/bin:$PATH

Missing dependencies

Some Linux distributions require:
bash
sudo apt install build-essential

Or:

bash
sudo dnf groupinstall "Development Tools"