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.
1. Install Codex
Section titled “1. Install Codex”Prerequisite: Node.js 18 or newer.
npm install -g @openai/codexConfirm the install — codex --version should print a version number:
codex --versionnpm install -g @openai/codexConfirm the install — codex --version should print a version number:
codex --version2. Set your API key
Section titled “2. Set your API key”The config below reads your key from the AIAND_API_KEY environment variable, so Codex never stores it on disk.
export AIAND_API_KEY="sk-your-aiand-api-key"Add that line to your ~/.zshrc or ~/.bashrc to persist it across terminals.
$env:AIAND_API_KEY = "sk-your-aiand-api-key"To persist it across sessions: setx AIAND_API_KEY "sk-your-aiand-api-key" (reopen the terminal afterward).
3. Add an ai& profile
Section titled “3. Add an ai& profile”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 = falseapps = falsebrowser_use = falsebrowser_use_external = falsecomputer_use = falseimage_generation = falsemulti_agent = falsein_app_browser = falseThe 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:
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 = falseapps = falsebrowser_use = falsebrowser_use_external = falsecomputer_use = falseimage_generation = falsemulti_agent = falsein_app_browser = falseEOFNew-Item -ItemType Directory -Force -Path $HOME\.codex | Out-Null@'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 = falseapps = falsebrowser_use = falsebrowser_use_external = falsecomputer_use = falseimage_generation = falsemulti_agent = falsein_app_browser = false'@ | Set-Content -Encoding utf8 $HOME\.codex\aiand.config.toml4. Run Codex
Section titled “4. Run Codex”codex --profile aiandOr non-interactively — --full-auto lets the agent edit files in the workspace:
codex exec --profile aiand --full-auto "Fix the failing test in src/math.js"Verify
Section titled “Verify”Probe the wire-level path from the shell — a match means the key authenticates and the model is on your org:
curl -sS https://api.aiand.com/v1/models \ -H "Authorization: Bearer $AIAND_API_KEY" \ | grep -o 'zai-org/glm-5.2'(Invoke-RestMethod https://api.aiand.com/v1/models ` -Headers @{ Authorization = "Bearer $env:AIAND_API_KEY" }).data.id ` | Select-String "zai-org/glm-5.2"