AI & Technology

OpenClaw AI Providers: Claude, OpenAI, OpenRouter, and Ollama

Configure OpenClaw to use Anthropic Claude, OpenAI, OpenRouter, or local models via Ollama. One gateway, multiple AI backends.

Huzaifa Tahir
5 min read

OpenClaw AI Providers: Claude, OpenAI, OpenRouter, and Ollama


OpenClaw does not lock you into one AI. You can configure Anthropic (Claude), OpenAI, OpenRouter, or local models via Ollama and use them through the same gateway, Control UI, and channels.


Why Multiple Providers?


  • Use the best model for each task (e.g., Claude for long context, OpenAI for speed).
  • Fallback if one provider is down or rate-limited.
  • Use local models (Ollama) for privacy or cost.
  • OpenRouter gives access to many models through one API.

  • Configuring a Provider


    Run `openclaw config` (or edit your config file) and add the provider and API key. For example, for Anthropic you get an API key from console.anthropic.com and add it to OpenClaw. The exact steps are in the OpenClaw getting-started and config docs.


    Anthropic (Claude)


    Add your Anthropic API key so OpenClaw can call Claude. You can choose models (e.g., Claude 3.5 Sonnet) in config. Good for long conversations, analysis, and nuanced tasks.


    OpenAI


    Add your OpenAI API key to use GPT-4, GPT-3.5, or other OpenAI models. Useful for broad compatibility and many integrations.


    OpenRouter


    OpenRouter is a unified API for many models (Claude, GPT, Llama, etc.). Add your OpenRouter API key and select the model in config. Lets you switch models without changing provider-specific code.


    Ollama (Local)


    Ollama runs models locally (e.g., Llama, Mistral). Configure OpenClaw to use Ollama so no data leaves your machine. Ideal for sensitive data or offline use. Run Ollama on the same machine (or reachable server) and point OpenClaw at it.


    Switching and Defaults


    You can set a default provider/model in config. Depending on your setup, you may also be able to switch provider or model per session or per channel—check the OpenClaw docs for your version.


    Cost and Limits


    Each provider has its own pricing and rate limits. OpenAI and Anthropic are pay-per-use; OpenRouter aggregates pricing; Ollama is free but uses your hardware. Choose based on cost, latency, and privacy needs.

    Share this article

    Related Articles