SHENWENAI
+ 01
+ 02
ShenwenAI
ISOLATED_CODEX_HOME

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.

Supported model IDs

Copy these model IDs into config files, API request bodies, or any OpenAI-compatible client that asks for a model name.

API_KEY_REQUIRED

Prepare your API key first

1. Go to your account page

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 page
2. Confirm the Base URL

Codex uses the OpenAI-compatible endpoint, so this Base URL must include /v1.

https://api.shenwenai.com/v1

Do not share your API key with others or commit it to GitHub, GitLab, or any public repository.

Choose your system first

The commands below will switch based on your selected system.

Install Codex CLI

Run this only if Codex CLI is not installed yet.

macOS / Linux
bash
npm install -g @openai/codex

Create an isolated config folder

macOS / Linux
bash
mkdir -p ~/.codex-shenwen

Open config.toml

Create or edit config.toml inside the isolated config folder.

macOS / Linux
bash
nano ~/.codex-shenwen/config.toml

Paste 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.

toml
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 = true

Open auth.json

Create or edit auth.json inside the isolated config folder.

macOS / Linux
bash
nano ~/.codex-shenwen/auth.json

Paste 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.

json
{ "OPENAI_API_KEY": "sk-or-v1-your-key" }

Start Codex

macOS / Linux
bash
CODEX_HOME="$HOME/.codex-shenwen" codex

Switch models inside Codex

After entering Codex, type /model to switch between the models currently supported by ShenwenAI.

text
/model

gpt-5.6-sol
gpt-5.6-terra
gpt-5.6-luna
gpt-5.5
gpt-5.4
gpt-5.4-mini

Optional: 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.

macOS / Linux
bash
echo 'alias scodex="CODEX_HOME=\"$HOME/.codex-shenwen\" codex"' >> ~/.zshrc
source ~/.zshrc

After that, use scodex for testing. Your original codex command still uses your personal ChatGPT / Codex config.