Ollama Web Search Integration Setup and Configuration

This page explains how to set up and configure Ollama Web Search as a built-in provider in OpenClaw. It covers local Ollama hosts, API key usage, and provider selection for users who need web search via Ollama.

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 built-in web_search provider, which retrieves titles, URLs, and snippets through Ollama's web-search API.

A locally hosted Ollama instance typically requires no API key; you just need a running Ollama host and ollama signin. To use the direct hosted search without a local Ollama, you must provide baseUrl: "https://ollama.com" and a valid OLLAMA_API_KEY.

Setup

Start Ollama

Verify that Ollama is installed and currently running.

Sign in

ollama signin
openclaw configure --section web

Choose Ollama Web Search as your provider.

If you already run Ollama for models, the web search provider will share the same host configuration automatically.

Note

OpenClaw never automatically prioritizes Ollama Web Search over a higher-ranked provider that uses credentials. You must manually select it with tools.web.search.provider: "ollama".

Config

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

Optionally override the host, applying only to web search:

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

Alternatively, reuse the host already set for the Ollama model provider:

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

The primary key is models.providers.ollama.baseUrl; for compatibility with OpenAI SDK style configuration examples, the web-search provider also accepts baseURL in that field. When nothing is specified, OpenClaw defaults to http://127.0.0.1:11434.

For direct hosted Ollama Web Search (without a 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 dedicated API key field for web search; the provider reuses models.providers.ollama.apiKey (or the corresponding environment-based provider authentication) when the configured host requires authentication.
  • Host resolution follows this order: plugins.entries.ollama.config.webSearch.baseUrlmodels.providers.ollama.baseUrl (or baseURL) → http://127.0.0.1:11434.
  • When the resolved host equals https://ollama.com, OpenClaw calls https://ollama.com/api/web_search directly, using the API key as bearer authentication.
  • Otherwise, OpenClaw first contacts the local proxy endpoint /api/experimental/web_search (which signs and forwards requests to Ollama Cloud), then falls back to /api/web_search on the same host. If both attempts fail and OLLAMA_API_KEY is configured, it retries once against https://ollama.com/api/web_search with that key, without sending the key to the local host.
  • During setup, OpenClaw issues a warning if Ollama is unreachable or not signed in, but it does not prevent selecting the provider.
  • Web Search overview -- covers all providers and automatic detection
  • Ollama -- setting up Ollama models in cloud and local modes
444 words · updated Jul 27, 2026