Skip to content

Codex

Codex talks to the OpenAI Responses API. ai& exposes an OpenAI-compatible /v1/responses endpoint, so any tool-calling model in our catalog can drive the agent loop.

Prerequisite: Node.js 18 or newer.

Terminal window
npm install -g @openai/codex

Confirm the install — codex --version should print a version number:

Terminal window
codex --version

The config below reads your key from the AIAND_API_KEY environment variable, so Codex never stores it on disk.

Terminal window
export AIAND_API_KEY="sk-your-aiand-api-key"

Add that line to your ~/.zshrc or ~/.bashrc to persist it across terminals.

Codex 0.141+ keeps each profile in its own file, ~/.codex/<name>.config.toml. Create ~/.codex/aiand.config.toml:

model = "zai-org/glm-5.2"
model_reasoning_effort = "high"
model_provider = "aiand"
web_search = "disabled"
[model_providers.aiand]
name = "ai&"
base_url = "https://api.aiand.com/v1"
env_key = "AIAND_API_KEY"
wire_api = "responses"
[tools]
view_image = false
[features]
unified_exec = false
apps = false
browser_use = false
browser_use_external = false
computer_use = false
image_generation = false
multi_agent = false
in_app_browser = false

The model_reasoning_effort line matters. Codex’s built-in default is medium, but supported reasoning levels vary by model: moonshotai/kimi-k3 accepts only high, low and max (anything else is rejected), and zai-org/glm-5.2 treats every value except high as its maximum — and most expensive — level. high is a safe, deliberate choice for every model recommended on this page.

The [features] block matters too. ai& serves standard function tools — which is all the coding agent loop needs — but not Codex’s hosted/built-in tools (web search, image generation, browser & computer control) or its grouped-tool wrapper. Left on, Codex can send tool types the API rejects (tool type … not supported), so the profile turns them off.

Save it in one step:

Terminal window
mkdir -p ~/.codex && cat > ~/.codex/aiand.config.toml <<'EOF'
model = "zai-org/glm-5.2"
model_reasoning_effort = "high"
model_provider = "aiand"
web_search = "disabled"
[model_providers.aiand]
name = "ai&"
base_url = "https://api.aiand.com/v1"
env_key = "AIAND_API_KEY"
wire_api = "responses"
[tools]
view_image = false
[features]
unified_exec = false
apps = false
browser_use = false
browser_use_external = false
computer_use = false
image_generation = false
multi_agent = false
in_app_browser = false
EOF
Terminal window
codex --profile aiand

Or non-interactively — --full-auto lets the agent edit files in the workspace:

Terminal window
codex exec --profile aiand --full-auto "Fix the failing test in src/math.js"

Probe the wire-level path from the shell — a match means the key authenticates and the model is on your org:

Terminal window
curl -sS https://api.aiand.com/v1/models \
-H "Authorization: Bearer $AIAND_API_KEY" \
| grep -o 'zai-org/glm-5.2'