Connect models to OpenClaw
Give OpenClaw an API key for a cloud provider and choose the default model, or point it at a local server such as LM Studio or vLLM.
Cloud providers are official provider plugins that read their keys from environment variables. About 30 more providers are supported beyond the ones named here.
Set a provider key
Export the key for your provider, then list the models OpenClaw can reach with it. The same pattern works for OPENAI_API_KEY, GEMINI_API_KEY, OPENROUTER_API_KEY, XAI_API_KEY, MISTRAL_API_KEY, GROQ_API_KEY and DEEPSEEK_API_KEY.
shell export ANTHROPIC_API_KEY=sk-ant-... openclaw models listChoose the default model
Copy a model id from the list, in provider/model form, and make it the default.
shell openclaw models set <provider/model>Use LM Studio locally
Start the LM Studio local server, then add it in openclaw.json under models.providers.<id> with this baseUrl and api set to openai-responses. A placeholder apiKey such as ollama-local is accepted.
Settings Base URL: http://127.0.0.1:1234/v1 API: openai-responsesUse vLLM, SGLang or MLX
These servers use port 8000 by default and need api set to openai-completions. Register them under models.providers.<id> in the same way. Ollama has its own provider, and llama.cpp comes as a plugin with a managed local server.
Settings Base URL: http://127.0.0.1:8000/v1 API: openai-completions
Local models need far more memory than the gateway. The smallest llama.cpp recipe alone needs about 8 GiB, so check the host before you switch away from a cloud API.