Skip to content

Model Connection Overview: The Provider System and Model Switching ​

With OpenClaw installed and onboarding completed, you already have a working model. But OpenClaw itself does not come with a model — models all come from "provider plugins," and this is exactly the core of OpenClaw model configuration: which plugin to connect, which credentials to configure, and writing the model reference in the correct provider/model form.

This lesson (1.6) explains this whole system in one go: how to check the current state, how to list the catalog, how to set the default, how to switch anytime in chat, and how to connect a brand-new provider. Every model connection page that follows in 1.7–1.15 is a concrete application of these rules. This tutorial is based on v2026.10.9.

What You'll Be Able to Do After This Lesson ​

  • Tell which model your current OpenClaw is using: openclaw models status tells you at a glance
  • Browse any provider's model catalog with openclaw models list — no more searching for "OpenClaw supported models"
  • Change the default model with openclaw models set <provider/model>, no need to edit config files by hand
  • Switch models anytime in chat with the /model command family: both temporary and persistent
  • When connecting a new provider, recite the three-step order off the top of your head: install plugin → configure credentials → choose model

Your Current Predicament ​

  • It works after installation, but you can't say clearly "which model am I actually using"; you want to switch to a cheaper or stronger one but don't know where to start
  • Searching for "OpenClaw supported models" yields all kinds of answers, mixed with old commands from the Clawdbot / Moltbot era
  • You see others editing agents.defaults in the config file and want to try it yourself, but you're afraid of breaking the Gateway so it won't start

When to Use This Technique ​

When you need to:

  • Understand OpenClaw's model system — what's currently in use, what else is available, and how to switch
  • Switch the default model to a domestic model (DeepSeek, Qwen, GLM...), or let different sessions use different models
  • Temporarily switch to a stronger model mid-chat, then switch back when done

And you don't want to:

  • Hand-edit the config file every time you switch models
  • Get lost in the official provider catalog with 70+ entries
  • Mix up "connecting a new model" with "switching an existing model" and flail around blindly

🎒 Prerequisites ​

  • Completed the installation: up and running in 5 minutes OpenClaw: onboarding has configured at least one provider (Claude / Codex login or some API Key)
  • Gateway is running: openclaw gateway status should show it listening on 18789 (you can still check models if it's not running, only models list will read the local cache directory)
  • If you want to connect a new provider along the way, have that provider's API Key ready — starting from the next lesson, DeepSeek will be used as the example

Core Idea ​

OpenClaw itself does not come with a model. Models and agent harnesses (Claude, Codex, local models) are all swappable plugins. Connecting a model = one provider plugin + one set of credentials. OpenClaw Model configuration has only three concepts:

  1. provider — a plugin for connecting a model vendor, with a unique id (e.g., deepseek, qwen, anthropic)
  2. model reference provider/model — the unified way to name a specific model, e.g., deepseek/deepseek-v4-pro
  3. default model and switching — write one default in the config; switch anytime in chat with /model

The reference rules are the foundation of this entire lesson:

RuleExampleExplanation
What comes before the first / is the provider idqwen/qwen3.5-plusprovider ids are always lowercase (normalized)
When the model ID itself contains /, the full prefix must be keptopenrouter/moonshotai/kimi-k2Split at the "first /"; a missing prefix means it won't be found
The spelling of the model ID follows the vendorminimax/MiniMax-M3MiniMax model IDs are case-sensitive; copy them exactly from the plugin catalog

Two ways to connect, distinguished in one table:

Official provider pluginsCustom / relay endpoints
Applicable toModels with official plugins (DeepSeek, Qwen, GLM, Kimi, MiniMax, etc.)Models without official plugins, OpenAI-compatible relay stations, local inference services
Need to write models.providers config?No: install plugin + set auth + pick a modelYes: baseUrl, apiKey, models list
See1.7–1.13 dedicated pages for each providerMore domestic models and custom relay endpoints

The provider family (the official Provider directory lists 70+ entries):

FamilyRepresentativesHow to connectDedicated page in this tutorial
Major international vendorsOpenAI (openai), Anthropic (anthropic), Google (google)Built-in plugins; onboarding is reusable Claude Code / Codex CLI loginCovered in Quick Start
Domestic modelsDeepSeek, Tongyi Qianwen, Zhipu GLM, Kimi, MiniMax, Doubao/Volcano, Hunyuan, Qianfan, StepFun, Xiaomi MiMo, LongCatOfficial plugin + API Key1.7–1.13 One page per provider
Aggregator routingOpenRouter, LiteLLM, ClawRouterOne key unlocks models from many providers1.14 Relay and more domestic models
Local modelsOllama, vLLM, SGLang, LM Studio, ds4Run on your own machine, zero API cost1.15 Local models

Good news for users in China: mainstream domestic models are all "first-class citizens"—each has an official provider plugin, and starting from 1.7 there is a hands-on page for every one of them.

Follow Along ​

Step 1: Check the current model configuration—openclaw models status ​

Why: onboarding configured the model for you, but many people can't say exactly which one they are using. See the current state clearly first, so every later step has something to compare against.

bash
openclaw models status

You should see: two blocks of information—the resolved default model and fallback chain (full provider/model references), plus each provider's credentials overview (Auth overview: environment variables, provider configuration, and credential sources found in auth storage). When OAuth credentials are close to expiring (by default within 24 hours), a warning also appears here.

Three additional points:

  • Bare openclaw models is equivalent to openclaw models status; add --json to get a machine-readable format

  • Without --probe, it does not send real model requests—credentials "appearing to be there" doesn't mean they work; to actually test, add --probe (this makes real model calls, may consume tokens, and may trigger rate limits)

  • Temporary switches within a single session are not visible to the CLI's status; use /model status inside that session instead

  • openclaw models status shows the full provider/model reference of the current default model

Step 2: Browse the model catalog—openclaw models list (see here for which models OpenClaw supports) ​

Why: check the goods before switching models. Each provider has its own model catalog: context window, input types, whether it's a reasoning model—it's all in the table.

bash
openclaw models list                      # 当前已装 provider 的可见模型
openclaw models list --all                # 完整发布目录
openclaw models list --provider deepseek  # 只看一家

You should see: one model reference per line (in provider/model form). After --provider comes the provider id (e.g. deepseek, moonshot), not the display name (e.g. Moonshot AI).

Four practical details:

  • Forgot the provider id? Run openclaw models list --all first and find it in the full catalog

  • An unknown provider id causes an error exit (non-zero exit code) and names the rejected id

  • Newly released models may not be in the local catalog; add --refresh to trigger rediscovery

  • Saving a provider's credentials brings its models into the selectable catalog—so after connecting a new provider in step 5, remember to come back and refresh

  • openclaw models list --provider <你已配好的 provider> lists its model catalog

Step 3: Set the default model — the core step of OpenClaw model configuration ​

Why: the default model determines what new sessions and scheduled tasks use. One line of command, no need to edit config files by hand.

bash
openclaw models set deepseek/deepseek-v4-pro

(The example uses DeepSeek; this assumes its provider plugin is installed—if not, see step 5 first, or go straight to Connecting DeepSeek.)

You should see: the command succeeds without errors; run openclaw models status again and the default model is the new value.

What it does: writes the config entry agents.defaults.model.primary. The equivalent config file looks like this:

json5
{
  agents: { defaults: { model: { primary: "deepseek/deepseek-v4-pro" } } },
}

Two foolproof rules (from the official CLI docs):

  • Unknown providers are rejected outright: non-zero exit, config untouched—the provider in the reference must be an installed plugin or a configured provider
  • A warning is shown if the model is not in the catalog: it doesn't block the write (newly released or self-hosted models may not be in the catalog yet), but it's worth double-checking the spelling

💡 Two other ways to change the default

openclaw models auth login --provider <id> --set-default adopts that provider's recommended default model at login time; for the default image model, use openclaw models set-image <provider/model> (writes agents.defaults.imageModel.primary).

  • openclaw models set <provider/model> executes successfully (or you understand why it rejected you)

Step 4: Switch models in chat—the /model command family ​

Why: what you set in the terminal is the "default"; in chat you can switch anytime—temporarily switch to a stronger model, switch back when done, and the global config stays untouched.

text
/model                              # See what the current session uses
/model list                         # Browse providers (/models also works)
/model deepseek/deepseek-v4-pro     # Switches only the current session (default behavior)
/model deepseek/deepseek-v4-pro -a  # Also updates this agent's default (requires owner/admin)
/model deepseek/deepseek-v4-pro -g  # Updates the global default (requires owner/admin)
/model default -s                   # Clears the session selection and falls back to the configured default
/model status                       # Credential candidates and baseUrl / api mode for each provider

You should see: the switch takes effect immediately—when the agent is idle, the next run uses the new model; if it is running, the switch is queued to the next safe switching point./models <provider> lists all models of a given provider.

Three quirks to know about:

  • The in-session selection is "strict": if the selected model is unreachable, it errors out directly instead of silently falling through the fallback chain (only the configured default uses fallbacks)
  • Numeric selection is not supported (/model 3 is invalid); Discord / Telegram have a native picker interface
  • When the model ID itself contains /, you must write the full prefix: /model openrouter/moonshotai/kimi-k2

Beyond /model there is a whole family of chat commands such as /think and /new; see Chat Commands Crash Course.

  • After switching with /model <provider/model> in chat, the next reply comes from the new model

Step 5: Connect a new provider—install the plugin, configure credentials, pick a model ​

Why: once you spot a model you like in the catalog, first let OpenClaw "get to know" it. Official provider plugins follow a fixed three steps:

text
① Install the plugin (needed for some providers) → ② Configure credentials (openclaw onboard) → ③ Pick a model

Take DeepSeek as an example (it is an external official plugin and needs to be installed):

bash
openclaw plugins install @openclaw/deepseek-provider
openclaw onboard --auth-choice deepseek-api-key

You should see: onboarding detects existing AI access → waits for you to choose a provider → after the connection check passes, only usable routes are saved → continues configuring the rest. After choosing --auth-choice, the default model picker is pre-filtered to that provider's models (sibling providers of the same plugin are also matched together, e.g. volcengine / volcengine-plan).

Three things to keep in mind:

  • Whether the plugin needs installing varies by provider: MiniMax is a bundled plugin, so openclaw plugins enable minimax is enough; external plugins like DeepSeek, Qwen, GLM, and Kimi require openclaw plugins install @openclaw/<名字>-provider. Each provider's exact command is given at the start of its 1.7–1.13 dedicated page
  • Official plugins do not require a models.providers config entry—install the plugin, set auth, pick a model, three steps and done; you only write one for custom endpoints or overriding baseUrl (see 1.14)
  • Re-running onboard does not wipe existing model configuration; for changes to model providers or auth routing, the official recommendation is to run openclaw onboard (openclaw configure is reserved for non-inference settings)

For models without official plugins yet, such as 01.AI Yi, Baichuan, and iFlytek Spark, use a custom OpenAI-compatible endpoint or an aggregator; see More Domestic Models and Custom Relay Endpoints. If you don't want to spend money on APIs, Local Models teaches you to run models locally with Ollama and vLLM.

  • You can recite the three-step order for connecting a new provider off the top of your head: install the plugin → configure credentials → pick a model

Checkpoint ✅ ​

  • openclaw models status can state the full provider/model reference of the current default model
  • openclaw models list --provider <id> can list a provider's model catalog
  • openclaw models set <provider/model> changing the default succeeds (or you understand why it refuses)
  • switching with /model <provider/model> in chat takes effect, and /model default -s can switch back to the default
  • you can state the three-step order for connecting a new provider: install the plugin → configure credentials → pick a model

Pitfall Reminders ​

❌ Model reference missing the provider prefix ​

Cause: OpenClaw splits references at the "first /". When the provider is omitted, it first tries aliases, then a uniquely matching configured provider, and only last the default provider (already deprecated behavior)—one more model with the same name and the selection fails.

text
/model kimi-k2                        # ❌ Fails to match in most cases
/model kimi/kimi-for-coding           # ✅ Include the provider prefix
/model openrouter/moonshotai/kimi-k2  # ✅ When the model ID contains /, the full prefix is required

Correct approach: always write references as full provider/model; if unsure, run openclaw models list --provider <id> first and copy exactly what the catalog shows (model IDs from MiniMax and similar vendors are case-sensitive).

❌ You configured a new provider's key and assumed the default model would switch automatically ​

Cause: saving a new provider's credentials does not change the existing default model—in the official Quick rules' own words: "Adding provider auth does not change your primary model"; only an explicit --set-default switches it.

Correct approach: to change the default, run openclaw models set <provider/model>, or use openclaw models auth login --provider <id> --set-default when logging in. If the symptoms don't match, first run openclaw models status to see what the default actually is.

❌ After installing the Gateway as a daemon, the exported API key "doesn't take effect" ​

Cause: when the Gateway runs as a launchd / systemd service, it cannot see the environment variables from export in your interactive shell—every provider's documentation specifically calls this out.

Correct approach: put the key in ~/.openclaw/.env, or provide it via env.shellEnv in the config; after changing the key, remember to restart the Gateway service.

❌ You used a retired old model ID ​

Cause: models get retired. DeepSeek's deepseek-chat / deepseek-reasoner were retired on 2026-07-24; the old IDs are no longer usable.

Correct approach: run openclaw models list --provider deepseek to see the current catalog and use new IDs like deepseek/deepseek-v4-pro and deepseek/deepseek-v4-flash; for migration details see the next lesson Connecting DeepSeek.

Advanced Tips (Optional) ​

Configure a fallback chain for the default model. Models in agents.defaults.model.fallbacks are tried in order; credential rotation happens within a provider before falling to the next fallback model. CLI management:

bash
openclaw models fallbacks list
openclaw models fallbacks add deepseek/deepseek-v4-flash
openclaw models fallbacks remove <model-or-alias>
openclaw models fallbacks clear

Let OpenClaw pick free fallbacks for you. openclaw models scan reads OpenRouter's public :free catalog and ranks candidates by image support, tool latency, context, and so on. Two notes: the metadata scan needs no key, while live checks and --set-default require OPENROUTER_API_KEY; a scan with probing writes to the config (directly replacing fallbacks)—add --no-probe if you only want to look.

Give a model an alias. After openclaw models aliases add Opus anthropic/claude-opus-5-5, /model Opus selects it in chat. Aliases are stored in agents.defaults.models.<key>.alias; a model has only one alias at a time, and adding a new one replaces the old.

Specify a model for a single run. If you don't want to change any configuration and just want a one-off run:

bash
openclaw agent --model deepseek/deepseek-v4-pro --message "..."

You can also manage models in the Control UI. The Gateway's Models page offers the same login flow as the CLI; Settings → Models → Set API key lets you swap the key directly, and once changed it clears that credential's cooldown and failure counters, so the next request can be attempted immediately.

Update the hosted model catalog. openclaw models refresh pulls the official hosted metadata catalog (new models enter the catalog through this); it requires the local Gateway to be stopped first (openclaw gateway stop), then restart it after the refresh.

Lesson Summary ​

✅ The three concepts of OpenClaw model configuration are clear: provider (plugin + credentials), provider/model references, default model and switching.

✅ The command chain of check → list → set → switch works: models status to see the current state, models list to see the catalog, models set to set the default, /model to switch in chat.

✅ The three steps for onboarding a new provider are settled: install the plugin (if needed) → openclaw onboard --auth-choice <id> to configure credentials → pick a model; official plugins don't require writing models.providers.

✅ Two behaviors to remember: in-session /model selection is a strict match with no fallback; in daemon mode the key must go into ~/.openclaw/.env.

Configuration field / commandForm / recommended valueDescription
agents.defaults.model.primary"provider/model"Default model; openclaw models set writes it here
agents.defaults.model.fallbacksModel reference listFallback chain, tried in order
agents.defaults.models.<key>.aliasAlias stringQuick entry for /model <别名>
models.providers.<id>Only write for custom endpointsNot needed for official plugins
~/.openclaw/.envPROVIDER_API_KEY=...Where the key lives in daemon mode
openclaw onboard --auth-choice <id>See each provider's dedicated page for valuesConfigure / replace provider credentials

See CLI Commands and Configuration Cheat Sheet for the complete command quick-reference list.

Next Lesson Preview ​

Now that the system is clear, starting from the next lesson we'll go hands-on with each provider — the first one is DeepSeek, the most widely used. Next lesson: Connecting to DeepSeek: V4 Series Model Configuration in Practice.

You will learn:

  • DeepSeek V4 series model catalog: deepseek-v4-pro / deepseek-v4-flash and how to choose
  • DEEPSEEK_API_KEY full configuration walkthrough: plugin installation, onboarding, and three ways to write the configuration file
  • Migration after the old IDs deepseek-chat / deepseek-reasoner are retired
  • DeepSeek-specific capabilities: thinking levels, DSML tool recovery, web_search

Related Tutorials ​

gaodong.aiAboutPrivacyTermsContact

Created and maintained by Haorui Li, co-author of the KiT candlestick foundation model.

Independent tutorials, not affiliated with any product mentioned. Product names and trademarks belong to their owners. Check official pages for prices and policies.