---
title: "Connect OpenClaw to cloud and local models · DotsAgent"
description: "Connect OpenClaw to OpenAI, Anthropic, Gemini or OpenRouter with an API key, set a default model, or run LM Studio on port 1234 or vLLM on port 8000 locally."
url: https://dotsagent.io/openclaw/models
---

OpenClaw guide · 4 steps

# 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.

1. 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 list`
2. Choose 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>`
3. 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-responses`
4. Use 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.

## More OpenClaw guides

[Install OpenClaw](https://dotsagent.io/openclaw/install)

[Run OpenClaw on a VPS](https://dotsagent.io/openclaw/vps)

[Run OpenClaw in Docker](https://dotsagent.io/openclaw/docker)

[Run OpenClaw on a Raspberry Pi](https://dotsagent.io/openclaw/raspberry-pi)

[Connect OpenClaw to Telegram](https://dotsagent.io/openclaw/telegram)

[Harden your OpenClaw gateway](https://dotsagent.io/openclaw/hardening)

[Remote access to OpenClaw](https://dotsagent.io/openclaw/remote-access)

## Sources

1. [docs.openclaw.ai](https://docs.openclaw.ai/concepts/model-providers/official-provider-plugins)/concepts/model-providers/official-provider-plugins
2. [docs.openclaw.ai](https://docs.openclaw.ai/gateway/local-models)/gateway/local-models

Independent reference for people who build AI agents. Not affiliated with any vendor named here.

© 2026 DotsAgent · Facts checked October 1, 2026
