DriversRecommendedOutdated drivers can make a good PC feel brokenScan driver issues before chasing fixes manually.Scan NowOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsSlow PC?RecommendedPC slow today? Run a repair scan before it gets worseResolve common Windows issues and optimize system performance.Scan Now×
Skip to content
VGSources
Blog

How to Change the AI Model in OpenClaw Without Wiping Your Config

Learn the exact OpenClaw commands for temporary chat switches and persistent defaults, how provider authentication works, which scope flags require admin rights, and how to avoid damaging your configuration.
WorldOpenClaw Without Wiping Your Config Length11 min Posted Quest giverVGSources Team
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Use /model <provider/model> to switch the model for the current OpenClaw conversation. To change the default used by future sessions, run openclaw models set <provider/model> or edit only agents.defaults.model.primary in ~/.openclaw/openclaw.json. Authenticate the provider first, use the full provider/model identifier, and choose the scope deliberately so a temporary experiment does not become a shared default.

The three ways to change an OpenClaw model

OpenClaw separates a model selection for one conversation from defaults that affect later work. The quickest route is a chat command; the durable route is the models CLI or a narrowly scoped configuration edit.

As an Amazon Associate I earn from qualifying purchases.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Goal Command or setting What changes Permission or access
Try a model in this conversation /model <provider/model> Current session only unless you add another scope Normal session user, subject to policy
Make the session scope explicit /model <provider/model> -s or --session Current conversation only Normal session user, subject to policy
Request an agent-default change /model <provider/model> -a or --agent Current session plus the agent-default request Owner or administrator
Request a shared global change /model <provider/model> -g or --global Current session plus the shared global-default request Owner or administrator
Set the persistent default from a terminal openclaw models set <provider/model> Updates model configuration for future sessions CLI access
Set it in the configuration file agents.defaults.model.primary in ~/.openclaw/openclaw.json Changes the configured primary model Permission to edit the OpenClaw configuration

The short, unscoped /model command is normally a session override. If you intend a different lifetime, include -s, -a, or -g rather than relying on an implicit scope.

Think of the choices as a ladder of impact. A session change is easiest to reverse and affects only the conversation in front of you. An agent change establishes a default for that agent, while a global change can alter what other sessions inherit. The CLI and configuration-file methods are persistent administrative changes, so they should be used when you have deliberately chosen the model and its provider.

Before you switch: find a valid model and authenticate its provider

List the models OpenClaw can see

Start by checking the identifiers exposed by your installation:

  • In a terminal, run openclaw models list.
  • In chat, use /model list or /models.
  • To narrow the result to one provider, use /models <provider>.

Model references use the form provider/model. Copy the exact ID shown by the list command, including punctuation and version suffixes. The documentation examples include openai/gpt-5.5 and anthropic/claude-sonnet-4-6; those are examples of the naming pattern, not a guarantee that every account exposes those models.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Listing is useful for more than browsing names. It confirms that OpenClaw has a configured provider entry and shows the spelling that its resolver accepts. If a model is absent from the list, changing the command syntax will not make it available; complete that provider’s setup or use an identifier that is listed.

Authenticate before selecting

Provider credentials must be configured before OpenClaw can use a model. Follow the provider’s setup flow, commonly started with openclaw onboard or openclaw configure. The intended order is:

  1. Choose the provider.
  2. Complete its authentication or API-key setup.
  3. Select a default using the provider-qualified model ID.

Adding credentials does not, by itself, replace an existing primary model. OpenClaw preserves agents.defaults.model.primary when a provider is added or reauthenticated. Authentication and model selection are separate operations.

If you want the login operation to set the default intentionally, use the provider login flow’s explicit option where supported:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
openclaw models auth login --provider <id> --set-default

That option is different from merely adding credentials. Without an explicit default-setting action, expect the existing primary model to remain in place.

How to pick a model in one OpenClaw chat

Use the fastest session-only command

  1. Open the conversation in which you want to test another model.
  2. Enter /model <provider/model>, replacing the placeholder with an ID from the model list.
  3. Send the command and continue chatting. New requests in that conversation use the selected model, subject to policy and availability.

For example:

/model openai/gpt-5.5

This is the appropriate choice for a temporary comparison, a task that needs a different capability, or a quick trial that should not alter defaults for other sessions. It does not rewrite the provider credentials, agent configuration, or shared default.

Make the session scope explicit

If you want the command to state its persistence clearly, use:

/model openai/gpt-5.5 -s
# or
/model openai/gpt-5.5 --session

The -s and --session forms both target the current conversation. They are useful in shared procedures because another administrator can see that the change is intentionally temporary.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Confirm which model is active

Run /model status after the change. This lets you check the effective model rather than assuming that a command, alias, or provider fallback resolved as expected. Verification is especially important after switching between providers with similar model names or after changing a persistent default while an existing session still has an override.

How to change the default model for future sessions

Use the models CLI

The most direct persistent change is:

openclaw models set anthropic/claude-sonnet-4-6

Replace the example with the exact provider/model ID available to your account. This updates the model configuration used when later sessions do not have their own override.

A persistent default does not necessarily replace a model already pinned to an existing conversation. Check that conversation with /model status; if it has a temporary selection, clear it with /model default so it can inherit the newly configured primary model.

Set an agent default from chat

An owner or administrator can request an agent-default update with:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
/model openai/gpt-5.5 -a
# or
/model openai/gpt-5.5 --agent

The command applies the model to the current session and requests that it become the agent default. The agent scope is different from a session override and from the shared global scope, so use it only when the intended owner of the change is the current agent configuration.

Set a shared global default from chat

An owner or administrator can request a shared default change with:

/model openai/gpt-5.5 -g
# or
/model openai/gpt-5.5 --global

This changes the current session and requests the shared global default. A global change can affect other users or sessions that inherit the shared setting; reserve it for an intentional administrative change. If you only wanted to test a model, do not use -g.

Change the model in openclaw.json without replacing the file

The persistent primary model is represented by agents.defaults.model.primary in ~/.openclaw/openclaw.json. If you edit configuration directly, change that field and leave unrelated settings intact. A minimal conceptual value looks like this:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
{
  "agents": {
    "defaults": {
      "model": {
        "primary": "anthropic/claude-sonnet-4-6"
      }
    }
  }
}

The surrounding file may contain many other required keys, so do not paste this fragment over the complete configuration. For RPC-based administration, inspect the relevant schema with config.schema.lookup and use a partial config.patch object. The documented rule is to change only model fields and avoid full-config replacement.

A partial patch also makes review and rollback easier: the intended change is visible, while channels, credentials, tools, and agent options remain untouched. Treat the JSON fragment above as the value to merge into the existing file, not as a complete replacement configuration.

If a full overwrite has already removed settings, restore a known-good backup or run openclaw doctor before attempting another model change. A model switch should not require rebuilding unrelated channels, credentials, tools, or agent options.

Choosing the right scope, persistence and authority

Use this decision path before entering a command:

  • Only this conversation: choose /model <provider/model> -s.
  • This agent and its future sessions: an owner or administrator can choose -a.
  • Everyone inheriting the shared setting: an owner or administrator can choose -g.
  • A durable terminal-side configuration change: run openclaw models set <provider/model>.
  • Manual or automated configuration management: patch agents.defaults.model.primary, not the entire file.

Owner or administrator status does not make an unscoped model selection global. Scope flags are what express the requested persistence, and authorization still applies to the agent and global forms.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Question Choose Reason
Am I testing a model briefly? Session Least persistent and easiest to reset
Should one agent use it by default? Agent Changes that agent’s inherited behavior
Should shared sessions inherit it? Global Broadest impact and owner/admin authority
Am I managing configuration from automation? CLI or partial patch Repeatable, persistent change without replacing unrelated keys

Reset a temporary model override

When a conversation has a temporary model selection and should return to its configured default, enter:

/model default

The model concepts documentation also supports clearing a session override with a session patch equivalent to sessions.patch {model: null}. Clearing the override makes the session resolve through the normal configured default again; it does not erase the provider credentials or other OpenClaw settings.

After resetting, run /model status. The status result should show the model inherited from the agent or global configuration. If it does not, inspect the persistent primary value and any applicable policy allowlist before trying another switch.

Why OpenClaw may select a different model than expected

The provider prefix was omitted

A bare model name can be ambiguous. When the provider is missing, OpenClaw attempts aliases and configured-provider matches before a deprecated default-provider fallback. That resolution order can select a different model from the one you intended. Always write the full provider/model reference, especially when two providers expose similarly named models.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

The provider was authenticated but the primary model stayed the same

This is expected behavior. Authentication supplies access; it does not intentionally switch agents.defaults.model.primary. Set the model separately with openclaw models set <provider/model>, or use the authentication command’s explicit default option when supported:

openclaw models auth login --provider <id> --set-default

Use the provider ID required by your installation and verify the result with /model status.

An allowlist blocks a model that exists

Model discovery and authorization are separate. The models-set command, provider setup, and alias commands do not change modelPolicy.allow. If an explicit allowlist is enabled, add the intended model through the appropriate configuration procedure, then try the selection again. Seeing a model in a list does not prove that policy permits an agent to use it.

A scope flag was misunderstood

A session command does not become global merely because the person running it is an owner or administrator. Conversely, the agent and global forms have broader effects and require the corresponding authority. Check the exact command entered, then inspect /model status and the configured primary value before changing anything else.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

The identifier is valid but unavailable at runtime

A listed model can still fail if its provider authentication is incomplete or if policy denies it. Recheck the exact provider/model spelling, confirm the provider login, and inspect the allowlist. Do not work around a denied model by replacing the whole configuration; fix the provider or policy entry that governs that model.

A safe model-switching checklist

  1. Run openclaw models list or /models and copy an exact model ID.
  2. Complete provider authentication with openclaw onboard, openclaw configure, or the provider’s documented flow.
  3. Decide whether the change is session, agent, global, or persistent CLI scope.
  4. Use the full provider/model string.
  5. For a trial, use /model <provider/model> -s.
  6. For a future default, use openclaw models set <provider/model> or patch only agents.defaults.model.primary.
  7. Run /model status to verify the effective selection.
  8. If the trial is over, run /model default to remove the session override.
  9. If configuration was accidentally overwritten, restore a backup or run openclaw doctor before further edits.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Worked examples

Try a second provider for one task

/models
/model anthropic/claude-sonnet-4-6 -s
/model status

The first command reveals available IDs, the second changes only the current conversation, and the third confirms the effective model.

Make a model the normal default

openclaw models list
openclaw models set anthropic/claude-sonnet-4-6
/model status

This sequence checks the identifier, updates the persistent default, and verifies the active result in a session.

Authenticate and intentionally set a provider default

openclaw models auth login --provider <id> --set-default
/model status

The explicit --set-default option makes the otherwise separate authentication and default-selection actions part of one intentional operation.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Switch temporarily, then return to the configured default

/model openai/gpt-5.5 -s
/model status
/model default
/model status

The first status check confirms the temporary selection. After /model default, the final check confirms that the conversation is inheriting the configured primary model again.

Frequently asked questions

How do I change the default LLM in OpenClaw?

Run openclaw models set <provider/model>, using an exact ID from openclaw models list. You can also update agents.defaults.model.primary in ~/.openclaw/openclaw.json with a partial edit.

How do I switch models without wiping my config?

Use a session command for a temporary test, or change only agents.defaults.model.primary for a persistent default. Do not replace the whole JSON file. For RPC administration, inspect the schema and submit a partial config.patch.

How do I pick a model in chat?

Enter /model <provider/model>. Add -s or --session when you want the temporary scope to be explicit, then run /model status to verify it.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Does logging in to a new provider switch my model automatically?

No. Provider authentication does not change an existing primary model. Use openclaw models set or the login flow’s --set-default option when you intend to change the default.

What is the difference between -s, -a, and -g?

-s targets the current session, -a requests an agent-default change, and -g requests a shared global-default change. Agent and global forms require owner or administrator authority.

Can an owner make an unscoped command global?

No. Authority and scope are separate. An owner still needs the explicit -g flag for a global request; an unscoped selection remains subject to its normal session behavior.

Why does a model shown by /models fail when I select it?

Check provider authentication and modelPolicy.allow. Listing establishes discovery, not permission. Also verify that you used the complete provider-qualified identifier.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

How do I undo a model change?

For a temporary override, run /model default or clear the session model with sessions.patch {model: null}. For a persistent change, set the previous provider/model again. If the full configuration was overwritten, restore a backup or run openclaw doctor.

Do I need to change aliases when I change models?

Not necessarily. Aliases can participate in resolution, but the safest selection is the exact provider/model ID returned by the model list. Changing an alias does not automatically alter the primary model or the allowlist.

Frequently Asked Questions

What is the fastest way to test another model?

Use /model <provider/model> -s in the current chat, then verify with /model status.

What command changes the default for future OpenClaw sessions?

Run openclaw models set <provider/model> or change only agents.defaults.model.primary in the OpenClaw configuration.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Will provider authentication change my current model?

No. Authentication adds access but preserves the existing primary model unless you explicitly use a default-setting action.

Why should I include the provider name?

OpenClaw resolves aliases and configured-provider matches when the provider is omitted, so a bare model name can select an unintended model.

What should I do if a valid model is blocked?

Check the explicit modelPolicy.allow list and update it through the appropriate configuration process; model setup commands do not change that policy.

The Bottom Line

Use /model <provider/model> -s for a one-conversation test and openclaw models set <provider/model> for a persistent default. Authenticate first, specify the provider, use -a or -g only for the intended administrative scope, verify with /model status, and patch only the model field instead of replacing your OpenClaw configuration.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More quests from Patch Notes

  1. How to Set Up a RedM (RDR2) Server in 2026: License Key, txAdmin and server.cfg, Step by StepBlog11min
  2. Best RedM (RDR2) Server Hosting in 2026: Comparing Four Hosts on Slots, Memory and PriceBlog10min
  3. How to Host a Mindustry Server in 2026: server-release.jar, Port 6567 and the Commands That MatterBlog7min
Recommended PC Tool
Recommended PC Tool
Windows Errors? Fix Them Before They SpreadFree repair scan
Outdated Drivers Are Slowing You DownFree scan - exact matches

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.