Docs / Tool setup / Codex CLI
Use clawcu with Codex CLI
Codex uses the OpenAI Responses protocol. The one-line script is recommended: it writes the gateway config and installs a model catalog so Codex knows each model's context window.
| Protocol | OpenAI Responses (/v1/responses) |
|---|---|
| Base URL | https://token.clawcu.ai/v1 |
| Requires | Node.js 18+ |
Models: kimi-k3 (strongest for coding, used on this page), glm-5.3, deepseek-flash (cheapest and fastest). See the Models page in the console or GET /v1/models for the full list and prices.
Before you start
Create a key on the API Keys page of the console (the plaintext is shown once), then put it in the CLAWCU_LLM_KEY environment variable — every step below reads it from there:
export CLAWCU_LLM_KEY=sk-your-key
Windows (PowerShell)
$env:CLAWCU_LLM_KEY="sk-your-key"
To keep it, add the line to ~/.zshrc / ~/.bashrc; on Windows run setx CLAWCU_LLM_KEY sk-… and open a new terminal.
Install
npm install -g @openai/codex
Configure
Recommended: the one-line script (with CLAWCU_LLM_KEY set, --model kimi-k3 --yes skips the questions; leave them off to be asked step by step).
macOS / Linux
bash <(curl -fsSL https://docs.clawcu.ai/clawcu-codex-setup.sh) --model kimi-k3 --yes
Windows (PowerShell)
irm https://docs.clawcu.ai/clawcu-codex-setup.ps1 | iex
Run the script again to switch models; pick r in its menu to restore your previous config.
Or write ~/.codex/config.toml by hand (Codex warns “Model metadata … not found” and falls back to defaults — it works, but the script's model catalog is more accurate):
model = "kimi-k3"
model_provider = "clawcu"
[model_providers.clawcu]
name = "clawcu"
base_url = "https://token.clawcu.ai/v1"
wire_api = "responses"
env_key = "CLAWCU_LLM_KEY"
Verify
If it replies OK, you are connected to clawcu:
codex exec --skip-git-repo-check "Reply with exactly: OK"
Everyday use
Run codex in your project; the startup banner shows model: kimi-k3, and /model lists every clawcu model.
cd /path/to/your-project
codex
FAQ
bwrap / namespace errors when Codex runs commands inside Docker?
Codex's sandbox needs kernel features that containers don't grant by default — unrelated to clawcu. Inside a container use --dangerously-bypass-approvals-and-sandbox, or run on the host.
Why --skip-git-repo-check?
codex exec only runs inside a Git repository by default; you don't need the flag inside a project repo.
Other tools:Claude Code · OpenCode · OpenClaw · Hermes Agent