Codex Setup
To avoid touching your existing Codex / ChatGPT login, put the ShenwenAI test config in a separate folder and isolate it with CODEX_HOME.
This keeps your personal ~/.codex unchanged, and your original codex command will still work after testing.
Copy these model IDs into config files, API request bodies, or any OpenAI-compatible client that asks for a model name.
Prepare your API key first
After logging in, create or copy an API key from your account page. It looks like sk-or-v1-xxxxxxxxxxxx. Treat it like a password.
Go to account pageCodex uses the OpenAI-compatible endpoint, so this Base URL must include /v1.
Do not share your API key with others or commit it to GitHub, GitLab, or any public repository.
The commands below will switch based on your selected system.
Install Codex CLI
Run this only if Codex CLI is not installed yet.
npm install -g @openai/codexCreate an isolated config folder
mkdir -p ~/.codex-shenwenOpen config.toml
Create or edit config.toml inside the isolated config folder.
nano ~/.codex-shenwen/config.tomlPaste config.toml
In nano on macOS / Linux: paste the content, press Ctrl+O, press Enter to save, then press Ctrl+X to exit. In Windows Notepad, press Ctrl+S and close the window.
model_provider = "OpenAI"
model = "gpt-5.6-terra"
model_reasoning_effort = "high"
disable_response_storage = true
[model_providers.OpenAI]
name = "OpenAI"
base_url = "https://api.shenwenai.com/v1"
wire_api = "responses"
requires_openai_auth = trueOpen auth.json
Create or edit auth.json inside the isolated config folder.
nano ~/.codex-shenwen/auth.jsonPaste auth.json
Replace the key with your own ShenwenAI API key. In nano on macOS / Linux: paste the content, press Ctrl+O, press Enter to save, then press Ctrl+X to exit. In Windows Notepad, press Ctrl+S and close the window.
{ "OPENAI_API_KEY": "sk-or-v1-your-key" }Start Codex
CODEX_HOME="$HOME/.codex-shenwen" codexSwitch models inside Codex
After entering Codex, type /model to switch between the models currently supported by ShenwenAI.
/model
gpt-5.6-sol
gpt-5.6-terra
gpt-5.6-luna
gpt-5.5
gpt-5.4
gpt-5.4-miniOptional: create an alias
If typing CODEX_HOME every time is annoying, create the scodex alias. In Windows Notepad, paste the function at the end of the file, press Ctrl+S, then close the window.
echo 'alias scodex="CODEX_HOME=\"$HOME/.codex-shenwen\" codex"' >> ~/.zshrc
source ~/.zshrcAfter that, use scodex for testing. Your original codex command still uses your personal ChatGPT / Codex config.