TUTORIAL
How to run GLM 5.3 with Codex CLI
Run OpenAI's Codex CLI on Z.ai's GLM 5.3, a 1M-context model for coding and tool use, served by Nebius Token Factory through NConnect. No OpenAI account needed.
Codex speaks the OpenAI Responses API, which Nebius does not serve. NConnect runs a local proxy that translates Codex's requests to Nebius chat completions. GLM 5.3 from Z.ai is a 1,024K-context model tuned for coding, reasoning and tool use.
Prerequisites
- macOS or Linux.
- A Nebius Token Factory API key from tokenfactory.nebius.com.
- No OpenAI account or API key.
Steps
Install NConnect
This installs the CLI and the
ncodexalias, plus Bun if needed.curl -fsSL https://nconnect.sh/install.sh | bashAdd your Nebius API key
nconnect configureInstall Codex CLI
Skip this if
codexis already on your PATH. In an interactive terminal, NConnect also offers to run this for you the first time you launch Codex CLI.npm install -g @openai/codexLaunch Codex CLI on GLM 5.3
nconnect --model zai-org/GLM-5.3 codexArguments after
codexgo to Codex, so non-interactive runs work too:nconnect --model zai-org/GLM-5.3 codex exec "add a test for the parser"
What NConnect does on launch
- Registers a temporary
nconnectmodel provider with command-line overrides. Your~/.codex/config.tomlis not modified. - Translates Responses API traffic to Nebius and meters every turn.
- Backs Codex's native
web_searchwith Tavily when you have added a Tavily key. - Summarizes traces for Codex's durable memory with a cheaper model (MiniMax M3 by default; change it with
NCONNECT_CODEX_MEMORY_MODEL).
Start faster with --no-mcp
Codex connects to every MCP server in your config at startup, which can add seconds to a simple prompt. --no-mcp is an NConnect shortcut that skips your user config for that launch. Authentication still works.
nconnect --model zai-org/GLM-5.3 codex --no-mcpAttaching images
GLM 5.3 is text-only. To attach screenshots, launch with a vision model such as Kimi K2.6. See Images & vision.
