#Automatically switches to OpenAI when I start new Session with Claude
1 messages · Page 1 of 1 (latest)
Not the same
Problem is I am not verified organization yet so it’s also looping to the error of verifying my org for gpt5. I do not want to switch to gpt 5
I asked it to remove openai in the system to fix this
not doing it at all
This usually boils down to one of these two things:
- You only switched to Claude “per-session” (via
/model …), then you start a new session (/new) and it correctly snaps back to the agent default model (often an OpenAI one if you onboarded Codex/OpenAI). - Claude is the primary, but it’s failing auth / rate-limiting, so OpenClaw fails over to an OpenAI fallback.
Fast check (in this Discord thread)
Send:
/model status
That will tell you what model is actually pinned for this session, and whether a profile is pinned.
Fast check (on the machine running the Gateway)
Paste the output of:
“Not the same” as in: it switches to GPT‑5 even without you doing /new, or it switches only when you start a new thread/session?
Either way, we can pin down exactly why in ~30 seconds if you paste one thing:
- In the Discord thread where it “should be Claude”, run:
/model status
- Then do whatever triggers the switch (either
/newor start a new Discord thread), and run again:
/model status
That output is safe to share and it will show:
- the active agent for that chat (important: different agent = different defaults)
- the resolved model (primary vs fallback)
- whether a profile is pinned
The 3 most common “it flips to GPT‑5” causes
- Different agent is handling the new session/thread, and that agent’s default model is OpenAI.
openclaw --version
openclaw models status
openclaw models status will very explicitly show:
- the resolved primary model
- any fallbacks
- and whether Anthropic creds are missing (common reason it “switches”).
Fix depending on what you see
A) If /model status shows you’re on OpenAI right after /new
That means your default model is set to OpenAI. Set the default to your Claude model:
- Claude fails (missing Anthropic auth / rate limit / model not available), so OpenClaw falls back to OpenAI.
- You’re selecting Claude via a session-only override, so new sessions correctly revert to defaults.
If you also have CLI access on the gateway host, paste this too (it’s the ground truth for defaults + fallbacks):
openclaw models status
Once I see those two /model status outputs, I can tell you the exact fix (either set agents.defaults.model.primary to Claude, fix Anthropic auth, or fix routing/bindings).
- either temporarily per session: use
/modeland pick Claude again - or permanently for new sessions (recommended): set
agents.defaults.model.primary(CLI easiest)
Docs on the “default model” key: https://docs.openclaw.ai/help/faq#what-is-the-default-model
Models CLI: https://docs.openclaw.ai/cli/models
B) If openclaw models status shows Claude primary but it still flips to OpenAI
That’s failover (Claude failing → fallback used). In that case the “asap” fix is:
- restore/repair Anthropic auth (so Claude stops failing), or
- remove/clear OpenAI from fallbacks (only if you prefer “hard fail” over switching)
Failover behavior docs: https://docs.openclaw.ai/concepts/model-failover
If you paste just the outputs of openclaw --version + openclaw models status (they redact secrets), I can tell you which case you’re in and the exact next step.
Removing OpenAI “by asking the bot” won’t reliably change anything — you need to change the model config (primary + fallbacks). Otherwise a new session will just go back to the configured default, or fail over to OpenAI again.
Do this on the machine running your Gateway
- Check what’s actually configured (paste this output here):
openclaw models status
- Set Claude as the default (pick the exact Claude model from
openclaw models listif you’re unsure):
openclaw models list
openclaw models set anthropic/<your-claude-model>
- Remove OpenAI as a fallback (this is the usual reason it “switches”):
openclaw models fallbacks clear
openclaw models image-fallbacks clear
openclaw gateway restart
Then verify in Discord
- run
/new - then run
/model status
If it still comes up as GPT-5 after that, it almost always means the new session/thread is being handled by a different agent with different defaults — /model status will show the active agent, and we can fix the routing once you paste it.
Docs (for reference):
- Default model key: https://docs.openclaw.ai/help/faq#what-is-the-default-model
- Failover behavior: https://docs.openclaw.ai/concepts/model-failover
- Models CLI: https://docs.openclaw.ai/cli/models
I am doing /new in the dashboard
Yep — that’s expected behavior: /new (whether in chat or in the Dashboard) resets the session, and that also resets any per-session /model override. After /new, OpenClaw goes back to the agent’s default model (agents.defaults.model.primary). If your default is GPT‑5, you’ll land on GPT‑5.
Fix: make Claude the default model (so new sessions start on Claude)
On the machine running your Gateway, run:
openclaw --version
openclaw models list
openclaw models set anthropic/<copy-the-claude-model-from-the-list>
openclaw gateway restart
Then do /new again in the Dashboard and it should start on Claude.
Also remove GPT/OpenAI as fallback (optional, but stops “switching”)
If you want it to never fall back to OpenAI when Claude errors/rate-limits:
openclaw models fallbacks clear
openclaw models image-fallbacks clear
openclaw gateway restart
Quick confirmation inside the Dashboard chat
Run this before and after /new:
/model status
If you paste the /model status output (and openclaw models status if you can), I can tell you whether this is “default model resets on /new” vs “Claude failing → failover to OpenAI”.
Docs:
- Default model behavior: https://docs.openclaw.ai/help/faq#what-is-the-default-model
- Models CLI: https://docs.openclaw.ai/cli/models
I did /new in telegram too and after launching a session for sonnet then gpt error comes
That symptom (“I set Sonnet, then after /new it immediately tries GPT and errors”) is almost always model failover:
- You start a fresh session → session model pin is cleared
- It tries your configured default / primary (or your Sonnet override)
- Anthropic fails (missing auth, rate limit, timeout, model not allowed, etc.)
- OpenClaw falls back to the next model in
agents.defaults.model.fallbacks(often OpenAI) - Then OpenAI fails too (so you see a “GPT error”)
1) Please paste the exact “gpt error” text
Even 1 line is enough (e.g. “No credentials found…”, “Model is not allowed…”, “401…”, “429…”). The fix depends on that.
2) On the Gateway host, run and paste:
openclaw models status
This shows your primary model, fallbacks, and whether Anthropic/OpenAI creds are missing.
3) If you want to stop it from ever jumping to OpenAI
Clear fallbacks (so it fails loudly instead of switching providers):
openclaw models fallbacks clear
openclaw models image-fallbacks clear
openclaw gateway restart
4) Then make Sonnet the default (so /new starts there)
openclaw models set anthropic/<your-sonnet-model-from-openclaw-models-list>
openclaw gateway restart
If you paste (a) the GPT error line and (b) openclaw models status, I can tell you whether the real root cause is: missing Anthropic auth, Anthropic rate limits, model allowlist, or routing to a different agent on Telegram.
This is what I get:
Current: anthropic/claude-sonnet-4-20250514
Tap below to browse models, or use:
/model <provider/model> to switch
/model status for details
But if I start asking my assistant to do something, it responds like this:
Your organization must be verified to use the model gpt-5-mini. Please go to: https://platform.openai.com/settings/organization/general and click on Verify Organization. If you just verified, it can take up to 15 minutes for access to propagate.
I followed instruction and it is not resolved
Help me delete permanently openai from terminal
That OpenAI message (“Your organization must be verified to use the model gpt-5-mini…”) means: even though /model shows Sonnet, OpenClaw is still attempting an OpenAI call — almost always because:
- Anthropic call failed → OpenClaw fell back to an OpenAI model (
agents.defaults.model.fallbacks), or - Telegram is routed to a different agent whose defaults/fallbacks include OpenAI.
1) Confirm what’s happening (2 quick outputs)
On Telegram (right after it errors), run:
/model status
On the machine running your Gateway, paste:
openclaw --version
openclaw models status
2) “ASAP stop switching to OpenAI” fix
If you don’t want OpenAI involved at all, clear fallbacks (this prevents “Claude fails → try GPT”):
openclaw models fallbacks clear
openclaw models image-fallbacks clear
openclaw gateway restart
Now if Anthropic is the real problem, you’ll see the real Anthropic error instead of the OpenAI org-verification error.
3) Fix the root cause (why it’s failing over)
Most common: Anthropic auth missing/expired for the agent handling Telegram (auth is per-agent).
If you’re using a Claude subscription (setup-token):
openclaw models auth setup-token --provider anthropic
# or if you generated it elsewhere:
openclaw models auth paste-token --provider anthropic
Then:
openclaw gateway restart
Docs:
- Failover behavior: https://docs.openclaw.ai/concepts/model-failover
- Anthropic setup-token: https://docs.openclaw.ai/providers/anthropic
If you paste openclaw models status + the /model status output from Telegram, I can tell you exactly which agent/provider is failing and why it’s touching OpenAI at all.
You can’t really “uninstall OpenAI” from OpenClaw like a package — OpenClaw is just configured to use OpenAI as a provider (often as a fallback). So the fix is: remove OpenAI from your model config + remove OpenAI credentials.
A) Stop OpenClaw from ever trying OpenAI (recommended ASAP)
On the Gateway machine:
openclaw models fallbacks clear
openclaw models image-fallbacks clear
openclaw gateway restart
This prevents “Claude failed → try GPT” (which is why you’re seeing the OpenAI org verification error even though you selected Sonnet).
B) Remove OpenAI credentials from config/env (optional but “permanent”)
If you stored your OpenAI key in OpenClaw config:
openclaw config unset env.OPENAI_API_KEY
openclaw gateway restart
Also check if you have any OpenAI-ish env keys set and unset those too (only if they exist in your config):
openclaw config get env
If you’re using Codex OAuth, you may also have OpenAI/Codex tokens stored as auth profiles (separate from config). Those live per-agent at:
$OPENCLAW_STATE_DIR/agents/<agentId>/agent/auth-profiles.json(usually~/.openclaw/agents/<agentId>/agent/auth-profiles.json)
To remove them “for real”, back up the file, then delete profiles whose provider is openai or openai-codex, then restart the gateway.
C) After this, try your task again
If it still fails, you should now get the real Anthropic error (instead of the OpenAI org verification error). Paste that error text and we can fix the actual Claude-side issue.
If you can paste openclaw models status, I’ll tell you exactly where OpenAI is still being pulled in (fallbacks vs another agent vs image model).
i have not done option B
i get the same error
That OpenAI message means OpenClaw is still making an OpenAI request somewhere (it’s not just the UI “showing GPT”). So we need to find where gpt-5-mini is coming from: model fallbacks, a different agent, or memory search embeddings.
1) On the Gateway host: paste these 3 outputs
openclaw models status
openclaw models fallbacks list
openclaw models image-fallbacks list
If either fallback list shows openai/ or gpt-mini, that’s why you’re seeing the org-verification error.
2) Hard-stop OpenAI fallback (works even if you keep OpenAI keys)
openclaw models fallbacks clear
openclaw models image-fallbacks clear
openclaw gateway restart
3) If you STILL see OpenAI errors after clearing fallbacks
Then it’s usually memory search provider auto-picking OpenAI (or you’re on a different agent).
Check memory search provider:
openclaw config get agents.defaults.memorySearch.provider
openclaw config get agents.defaults.memorySearch.fallback
To force “no OpenAI” for memory search:
openclaw config set agents.defaults.memorySearch.provider "local"
openclaw config set agents.defaults.memorySearch.fallback "none"
openclaw gateway restart
Also run /model status right after the error (in Telegram/Discord) and look for the Agent: line — if Telegram is routed to a different agent, we need to clear fallbacks for that agent.