Everything about configuring models in OpenClaw — providers, routing, sessions, and cron pinning. Learned the hard way through many errors.
Edit openclaw.json:
json
{
"providers": {
"deepseek": {
"apiKey": "sk-...",
"baseUrl": "https://api.deepseek.com"
}
}
}
If using API key from file: reference env var or key file. Direct env var injection via ~/.openclaw/openclaw.json.
Never restart gateway and immediately assume the model is live. Check after restart.
bash
openclaw status # shows current model
session_status # shows session-level model
If multiple providers offer the same model, Gateway resolves via: plugin providers > config providers > default fallback chain. A DeepSeek plugin can sit alongside a MiniMax config provider — the plugin wins if enabled.
The trap: When you change the default model in config, the current Telegram session stays locked to its birth model — the model that was default when the session was created.
text
Session created at 18:05 → model = MiniMax (was default)
Gateway restarted at 18:06 → config now says DeepSeek
Session at 18:07 → STILL MiniMax ← TRAP
New session created at 18:08 → DeepSeek ← Correct
The fix:
/model <provider/model> — force-switches the current session immediatelyLesson: After changing model config, either:
/model deepseek/deepseek-v4-flash to switch running sessionTime-sensitive cron jobs MUST pin the model explicitly. The global default can get stuck on model cold-start resolution (MiniMax especially bad — up to 300s delay).
json
{
"payload": {
"kind": "agentTurn",
"message": "...",
"timeoutSeconds": 600,
"model": "deepseek/deepseek-v4-flash"
}
}
Crons that ALWAYS need pinning:
CronWhyExpense check-ins (10am, 1:30pm, 10pm)Time-sensitive, Hobo waits for themExpense sync (9:30am)Must run on scheduleNews briefings (7:30am, 3pm, 10pm)Hobo expects them on timeInvestment check-in (Sat 10am)Weekly, must fireInvestment sync (Sat 11am)SameTransport check-in (9am)Previous-day ask
Crons that don't need pinning:
Failure symptom: lastDiagnostics.summary = "cron: job execution timed out (last phase: model-call-started)". Fix: pin model.
In multi-agent setups (Patch + Muthu), messages can route to the wrong agent's session unless dmScope is set correctly:
json
{
"telegram": {
"dmScope": "per-channel-peer-account"
}
}
per-channel-peer-account — each Telegram bot + user combo gets its own session. Without this, messages from both bots could land in the same session.
Symptom of wrong dmScope: Hobo messages Patch but Muthu's session receives them, or vice versa.
openclaw): can introduce new model providersopenclaw.json): directly configured API endpointsTo check loaded providers:
bash
openclaw plugin list | grep -i model
grep -A5 '"providers"' ~/.openclaw/openclaw.json
MethodScopePersistence/model deepseek/deepseek-v4-flashCurrent session onlyUntil session expiresChange "model" in openclaw.jsonAll new sessionsPermanent (requires gateway restart)Pin "model" in cron payloadThat cron onlyPermanent until changed
openclaw.json → add/change provider + modelopenclaw gateway restartopenclaw status — confirms the new model is live/model <correct/provider/model>