#Codex issue

1 messages · Page 1 of 1 (latest)

late flowerBOT
#

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

tardy jayBOT
uncut swanBOT
#

That error usually means OpenClaw is trying the direct OpenAI API-key route (openai/*) but you only have/want Codex OAuth.

First, can you paste:

openclaw --version
openclaw models status

Likely fix if you’re using ChatGPT/Codex subscription auth:

openclaw models auth login --provider openai-codex --set-default
openclaw config set agents.defaults.model.primary openai-codex/gpt-5.5
openclaw gateway restart
openclaw models status
#

If you’re on a remote/headless box and browser callback is awkward, use:

openclaw models auth login --provider openai-codex --device-code --set-default

The key distinction: openai/gpt-5.5 is not the normal PI/Codex OAuth route. For Codex OAuth, use openai-codex/gpt-5.5. If you actually want direct OpenAI Platform billing, then set OPENAI_API_KEY and use an API-enabled openai/* model.

Docs: https://docs.openclaw.ai/providers/openai and https://docs.openclaw.ai/concepts/oauth

carmine kite
#

🦞 OpenClaw 2026.5.22 (a374c3a) — I'm the middleware between your ambition and your attention span.

Config : ~/.openclaw/openclaw.json
Agent dir : ~/.openclaw/agents/main/agent
Default : openai/gpt-5.5
Fallbacks (0) : -
Image model : -
Image fallbacks (0): -
Aliases (0) : -
Configured models (2): openrouter/auto, openai/gpt-5.5

Auth overview
Auth store : ~/.openclaw/agents/main/agent/auth-profiles.json
Shell env : off
Providers w/ OAuth/tokens (2): openai-codex (2), openrouter (1)

  • openai-codex effective=profiles:~/.openclaw/agents/main/agent/auth-profiles.json | profiles=2 (oauth=2, token=0, api_key=0) | openai-codex:alex@pestbusterzz.com=OAuth (alex@pestbusterzz.com), openai-codex:default=OAuth | synthetic=plugin-owned | source=codex-app-server
  • openrouter effective=profiles:~/.openclaw/agents/main/agent/auth-profiles.json | profiles=1 (oauth=0, token=1, api_key=0) | openrouter:default=token:sk-or-v1...1208aca9
  • xai effective=profiles:~/.openclaw/agents/main/agent/auth-profiles.json | profiles=1 (oauth=0, token=0, api_key=1) | xai:default=xai-tVQ9...nc6mGuKT

Runtime auth

  • openai via codex uses openai-codex effective=profiles:~/.openclaw/agents/main/agent/auth-profiles.json | status=usable

OAuth/token status

uncut swanBOT
uncut swanBOT
# carmine kite 🦞 OpenClaw 2026.5.22 (a374c3a) — I'm the middleware between your ambition and y...

If it still throws the same error after that, switch away from the app-server route and use the explicit PI Codex route:

openclaw config set agents.defaults.model.primary openai-codex/gpt-5.5
openclaw gateway restart
openclaw models status

Then test in a fresh session again with /new.

One more thing: you’re on 2026.5.22. Since this is right in the model/auth routing area, I’d update OpenClaw too if the restart + fresh session doesn’t clear it. Docs for the relevant routes are here: https://docs.openclaw.ai/providers/openai

carmine kite
#

headshotxx99@HeadShotXX ~ % openclaw provider openai-codex
[openclaw] Could not start the CLI.
[openclaw] Reason: Unknown command: openclaw provider. No built-in command or plugin CLI metadata owns "provider".
[openclaw] Debug: set OPENCLAW_DEBUG=1 to include the stack trace.
[openclaw] Try: openclaw doctor
[openclaw] Help: openclaw --help
headshotxx99@HeadShotXX ~ %

uncut swanBOT
uncut swanBOT
carmine kite
#

🦞 OpenClaw 2026.5.22 (a374c3a) — WhatsApp automation without the "please accept our new privacy policy".

Config : ~/.openclaw/openclaw.json
Agent dir : ~/.openclaw/agents/main/agent
Default : openai-codex/gpt-5.5
Fallbacks (0) : -
Image model : -
Image fallbacks (0): -
Aliases (0) : -
Configured models (2): openrouter/auto, openai/gpt-5.5

Auth overview
Auth store : ~/.openclaw/agents/main/agent/auth-profiles.json
Shell env : off
Providers w/ OAuth/tokens (2): openai-codex (2), openrouter (1)

  • openai-codex effective=profiles:~/.openclaw/agents/main/agent/auth-profiles.json | profiles=2 (oauth=2, token=0, api_key=0) | openai-codex:alex@pestbusterzz.com=OAuth (alex@pestbusterzz.com), openai-codex:default=OAuth
  • openrouter effective=profiles:~/.openclaw/agents/main/agent/auth-profiles.json | profiles=1 (oauth=0, token=1, api_key=0) | openrouter:default=token:sk-or-v1...1208aca9
  • xai effective=profiles:~/.openclaw/agents/main/agent/auth-profiles.json | profiles=1 (oauth=0, token=0, api_key=1) | xai:default=xai-tVQ9...nc6mGuKT

OAuth/token status

uncut swanBOT
# carmine kite 🦞 OpenClaw 2026.5.22 (a374c3a) — WhatsApp automation without the "please accept...

Nice, the default is now on openai-codex/gpt-5.5 and the OAuth profiles are healthy.

One remaining mismatch: Configured models still only shows:

openrouter/auto, openai/gpt-5.5

If agents.defaults.models is acting as an allowlist, add the Codex model there too:

openclaw config set agents.defaults.models '{"openai-codex/gpt-5.5":{}}' --strict-json --merge
openclaw gateway restart
openclaw models status

Then test in Discord with a fresh session:

uncut swanBOT
carmine kite
#

How can I remove all models except codex

uncut swanBOT
# carmine kite How can I remove all models except codex

Use --replace on the configured model allowlist, then make Codex the default:

openclaw config set agents.defaults.models '{"openai-codex/gpt-5.5":{}}' --strict-json --replace
openclaw config set agents.defaults.model.primary openai-codex/gpt-5.5
openclaw models fallbacks clear
openclaw gateway restart
openclaw models status

That removes openrouter/auto and openai/gpt-5.5 from the selectable/configured model list, leaving only the Codex OAuth route.

This does not delete your OpenRouter/XAI auth profiles from the auth store; it just stops those models from being configured/selected. That’s the safer move.

carmine kite
#

Ok I’ll try it out and let you know