Files
openclaw/docs/tools/gemini-search.md
Vincent Koc 78399c67e9 docs(tools): restructure web search into nested group with provider sub-pages
Restructure "Web and search" into a "Web Search" nested group
(matching Browser pattern) with provider sub-pages:

New pages:
- tools/gemini-search: Gemini with Google Search grounding setup
- tools/grok-search: Grok/xAI web-grounded search setup
- tools/kimi-search: Kimi/Moonshot web search setup

Existing pages (Brave, Firecrawl, Perplexity, Tavily) already exist.

Changes to tools/web.md (overview page):
- Simplify provider table with links to sub-pages
- Replace inline Gemini section with link to dedicated page
- Replace inline Brave/Perplexity setup with CardGroup linking all 7 providers
- Keep auto-detection, web_search, web_fetch reference sections

Navigation: "Web and search" -> "Web Search" with all 8 pages
(overview + 7 providers alphabetical)
2026-03-22 14:25:16 -07:00

2.5 KiB

summary, read_when, title
summary read_when title
Gemini web search with Google Search grounding
You want to use Gemini for web_search
You need a GEMINI_API_KEY
You want Google Search grounding
Gemini Search

Gemini Search

OpenClaw supports Gemini models with built-in Google Search grounding, which returns AI-synthesized answers backed by live Google Search results with citations.

Get an API key

Go to [Google AI Studio](https://aistudio.google.com/apikey) and create an API key. Set `GEMINI_API_KEY` in the Gateway environment, or configure via:
```bash
openclaw configure --section web
```

Config

{
  plugins: {
    entries: {
      google: {
        config: {
          webSearch: {
            apiKey: "AIza...", // optional if GEMINI_API_KEY is set
            model: "gemini-2.5-flash", // default
          },
        },
      },
    },
  },
  tools: {
    web: {
      search: {
        provider: "gemini",
      },
    },
  },
}

Environment alternative: set GEMINI_API_KEY in the Gateway environment. For a gateway install, put it in ~/.openclaw/.env.

How it works

Unlike traditional search providers that return a list of links and snippets, Gemini uses Google Search grounding to produce AI-synthesized answers with inline citations. The results include both the synthesized answer and the source URLs.

  • Citation URLs from Gemini grounding are automatically resolved from Google redirect URLs to direct URLs.
  • Redirect resolution uses the SSRF guard path (HEAD + redirect checks + http/https validation) before returning the final citation URL.
  • Redirect resolution uses strict SSRF defaults, so redirects to private/internal targets are blocked.

Supported parameters

Gemini search supports the standard query and count parameters. Provider-specific filters like country, language, freshness, and domain_filter are not supported.

Model selection

The default model is gemini-2.5-flash (fast and cost-effective). Any Gemini model that supports grounding can be used via plugins.entries.google.config.webSearch.model.