#Codex CLI + OpenClaw

1 messages Β· Page 1 of 1 (latest)

astral heath
#

I have Codex CLI on my WSL 2 instance. Can OpenClaw use it for LLM calls? How to configure it?

winged briarBOT
#

To help others find answers, you can mark your question as solved via Right click solution message -> Apps -> βœ… Mark Solution

last micaBOT
amber arrowBOT
#

Let me check the actual docs paths and the CLI backend section so I don’t hand you fake config keys.

#

Yep, but there are 2 different ways to do it.

First, can you paste openclaw --version? Config details moved a bit across releases.

1) Best for normal OpenClaw model usage: use Codex auth reuse / native provider

  • Run openclaw onboard and choose OpenAI Code / Codex
  • or openclaw models auth login --provider openai-codex
  • If ~/.codex/auth.json already exists, onboarding can reuse it
  • Then set your default model to openai-codex/gpt-5.4

2) Best if you literally want OpenClaw to shell out to the local Codex binary: use the CLI backend

  • Model ref: codex-cli/gpt-5.4
  • Config lives under agents.defaults.cliBackends

Example:

#
{
  agents: {
    defaults: {
      model: { primary: "codex-cli/gpt-5.4" },
      cliBackends: {
        "codex-cli": {
          command: "/full/path/to/codex"
        }
      }
    }
  }
}

A couple gotchas:

  • codex-cli is a CLI backend, meant mainly as a text-first fallback/runtime path