Use NordRouter in Codex CLI with OpenCodex
OpenCodex is a third-party local proxy for Codex and Claude Code. It accepts the Responses API used by Codex and translates requests to the OpenAI-compatible /chat/completions endpoint supported by NordRouter.
This is the recommended route when you want to use the regular Codex CLI with NordRouter models. OpenCode, Cline, Roo Code, and other OpenAI-compatible clients can connect to NordRouter directly.
OpenCodex is not a NordRouter or OpenAI product. Source code and releases: lidge-jun/opencodex.
Install and configure
Node.js 18 or newer is required:
This guide was verified with version 2.7.31:
npm install -g @bitkyc08/opencodex@2.7.31Create %USERPROFILE%\.opencodex\config.json on Windows or ~/.opencodex/config.json on macOS/Linux:
{
"port": 10100,
"defaultProvider": "nordrouter",
"providers": {
"nordrouter": {
"adapter": "openai-chat",
"baseUrl": "https://nordrouter.com/v1",
"authMode": "key",
"apiKey": "${NORDROUTER_API_KEY}",
"defaultModel": "anthropic/claude-sonnet-4.6"
}
}
}The environment variable keeps the key out of the JSON file. Do not paste a real key into screenshots or support messages.
PowerShell, for the current window:
$env:NORDROUTER_API_KEY = "sk-nr-YOUR-KEY"macOS/Linux, for the current shell:
export NORDROUTER_API_KEY="sk-nr-YOUR-KEY"Start Codex
ocx startocx start stays attached to the current terminal and syncs the model catalog on startup. Leave it running and open Codex in a second terminal:
codex -m "nordrouter/anthropic-claude-sonnet-4.6"The local dashboard is available at http://localhost:10100. Keep its default loopback binding unless you explicitly need remote access.
NordRouter model IDs contain /. OpenCodex exposes them to Codex with inner slashes replaced by hyphens, then restores the native ID before sending the request upstream. It also discovers available models from NordRouter's authenticated /v1/models endpoint; run ocx sync to refresh the list.
Tool calling, image input, and reasoning levels still depend on the selected model. OpenCodex translates the protocol but cannot add unsupported model capabilities.
Remove OpenCodex
ocx uninstall
npm uninstall -g @bitkyc08/opencodexAccording to the project documentation, ocx uninstall stops the proxy, removes its service and shim, restores the native Codex configuration, and deletes ~/.opencodex.