#Codex issue
1 messages · Page 1 of 1 (latest)
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
🦞 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
- openai-codex usage: 5h 86% left ⏱2h 31m · Week 62% left ⏱3d 19h
- openai-codex:alex@pestbusterzz.com (alex@pestbusterzz.com) static
- openai-codex:default static
- openrouter
- openrouter:default static
Good, this is not a missing login. Your status says Codex OAuth is present and usable:
Runtime auth - openai via codex ... status=usable
So the likely stale bit is the running gateway/session that produced the error. Try this next:
openclaw gateway restart
openclaw models status --probe --probe-provider openai-codex
Then in this Discord thread/session, start fresh before testing again:
/new
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
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 ~ %
Yep, openclaw provider is not a command. Use the models commands instead.
For your case, run:
openclaw gateway restart
openclaw models status --probe --probe-provider openai-codex
If the probe is OK but Discord still errors, send this in the Discord session:
/new
If it still fails after that, switch the default to the explicit Codex OAuth route:
openclaw config set agents.defaults.model.primary openai-codex/gpt-5.5
openclaw gateway restart
openclaw models status
Docs: https://docs.openclaw.ai/cli/models and https://docs.openclaw.ai/providers/openai
🦞 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
- openai-codex usage: 5h 86% left ⏱2h 23m · Week 62% left ⏱3d 19h
- openai-codex:alex@pestbusterzz.com (alex@pestbusterzz.com) ok expires in 10d
- openai-codex:default ok expires in 8d
- openrouter
- openrouter:default static
headshotxx99@HeadShotXX ~ %
- openrouter:default static
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:
/new
After that, the status should show Configured models including openai-codex/gpt-5.5. If it still errors, paste the exact new error plus:
openclaw models status --probe --probe-provider openai-codex
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.
Ok I’ll try it out and let you know