Ollama Web Search Setup and Configuration Guide

Learn how to set up and configure Ollama Web Search in OpenClaw, including local and hosted options. This guide covers API keys, host configuration, and provider selection.

Read this when

  • You want to use Ollama for web_search
  • You want a key-free web_search provider
  • You want to use hosted Ollama Web Search with OLLAMA_API_KEY
  • You need Ollama Web Search setup guidance

OpenClaw includes Ollama Web Search as a bundled web_search provider. It returns titles, URLs, and snippets from Ollama's web-search API.

A local or self-hosted Ollama instance does not require an API key by default. You only need a reachable Ollama host and ollama signin. For direct hosted search (without a local Ollama), you need baseUrl: "https://ollama.com" and a valid OLLAMA_API_KEY.

Setup

Start Ollama

Confirm that Ollama is installed and running.

Sign in

ollama signin
openclaw configure --section web

Choose Ollama Web Search as the provider.

If you already use Ollama for models, Ollama Web Search uses the same configured host.

Note

OpenClaw never automatically selects Ollama Web Search over a higher-priority credentialed provider. You must select it explicitly with tools.web.search.provider: "ollama".

Config

{
  tools: {
    web: {
      search: {
        provider: "ollama",
      },
    },
  },
}

Optional host override, limited to web search only:

{
  plugins: {
    entries: {
      ollama: {
        config: {
          webSearch: {
            baseUrl: "http://ollama-host:11434",
          },
        },
      },
    },
  },
}

Or reuse the host already configured for the Ollama model provider:

{
  models: {
    providers: {
      ollama: {
        baseUrl: "http://ollama-host:11434",
      },
    },
  },
}

models.providers.ollama.baseUrl is the canonical key. The web-search provider also accepts baseURL there for compatibility with OpenAI SDK-style configuration examples. If nothing is set, OpenClaw defaults to http://127.0.0.1:11434.

Direct hosted Ollama Web Search (no local Ollama):

{
  models: {
    providers: {
      ollama: {
        baseUrl: "https://ollama.com",
        apiKey: "OLLAMA_API_KEY",
      },
    },
  },
  tools: {
    web: {
      search: {
        provider: "ollama",
      },
    },
  },
}

Auth and request routing

  • There is no web-search-specific API key field. The provider reuses models.providers.ollama.apiKey (or the matching env-backed provider auth) when the configured host requires authentication.
  • Host resolution order: plugins.entries.ollama.config.webSearch.baseUrl to models.providers.ollama.baseUrl (or baseURL) to http://127.0.0.1:11434.
  • If the resolved host is https://ollama.com, OpenClaw calls https://ollama.com/api/web_search directly with the API key as bearer auth.
  • Otherwise OpenClaw calls the local proxy endpoint /api/experimental/web_search first (which signs and forwards to Ollama Cloud), then falls back to /api/web_search on the same host. If both fail and OLLAMA_API_KEY is set, it retries once against https://ollama.com/api/web_search with that key, without sending it to the local host.
  • OpenClaw warns during setup if Ollama is unreachable or not signed in, but does not block selecting the provider.