Command Overview
The openclaw models command manages all model configurations in OpenClaw, including viewing available models, testing performance, setting parameters, and choosing the default model.
View Model List
openclaw models list
Models:
Name Provider Model ID Status
──────────────────────────────────────────────────────────
main openai gpt-4o ✓ Active
fast openai gpt-4o-mini ✓ Active
local ollama llama3.1:8b ✓ Active
claude anthropic claude-sonnet-4-20250514 ✗ No API key
code openai gpt-4o ✓ Active
Default model: main
View Available Models
See all models offered by a provider:
# View a specific provider
openclaw models available --provider openai
# View all providers
openclaw models available --all
Available models from openai:
gpt-4o 128k context $5.00/$15.00 per 1M tokens
gpt-4o-mini 128k context $0.15/$0.60 per 1M tokens
gpt-4-turbo 128k context $10.00/$30.00 per 1M tokens
o1 200k context $15.00/$60.00 per 1M tokens
Add a Model Configuration
openclaw models add smart-model \
--provider openai \
--model gpt-4o \
--temperature 0.7 \
--max-tokens 4096
Update a Model Configuration
openclaw models update main --temperature 0.5
openclaw models update main --max-tokens 8192
openclaw models update main --model gpt-4o-mini
Set the Default Model
openclaw models default fast
Test a Model
# Quick test
openclaw models test main
# Detailed test
openclaw models test main --verbose
Testing model: main (openai/gpt-4o)
✓ Connection: successful
✓ Response time: 1.2s
✓ Output quality: verified
✓ Streaming: working
✓ Token counting: accurate
Test conversation:
User: Hello
AI: Hello! How can I help you today?
Stats:
Prompt tokens: 8
Completion tokens: 10
Latency: 1,200ms
Benchmark Testing
openclaw models benchmark main --rounds 10
Benchmark: main (openai/gpt-4o) - 10 rounds
Avg latency: 1,350ms
Min latency: 850ms
Max latency: 2,100ms
P95 latency: 1,900ms
Avg tokens/sec: 45
Success rate: 100%
Comparison Testing
openclaw models compare main fast --prompt "Explain relativity"
View Model Costs
openclaw models cost --period 7d
Model Cost Summary (last 7 days):
main (gpt-4o): $12.50 (250K tokens)
fast (gpt-4o-mini): $0.85 (180K tokens)
local (llama3.1): $0.00 (local)
──────────────────────────────────────
Total: $13.35
Failover Configuration
# Set a fallback model
openclaw models set-fallback main --fallback fast
openclaw models set-fallback fast --fallback local
View the failover chain:
openclaw models fallback-chain main
Fallback chain for 'main':
main (openai/gpt-4o)
→ fast (openai/gpt-4o-mini)
→ local (ollama/llama3.1)
Delete a Model Configuration
openclaw models remove old-model
Import and Export
openclaw models export models.json
openclaw models import models.json
Summary
openclaw models provides complete model lifecycle management. From discovering available models and configuring parameters to performance testing and cost monitoring, it helps you make the best choices in a multi-model environment.